Skip to content

Commit b957494

Browse files
committed
Remove redundant tests
1 parent 7c99b5b commit b957494

3 files changed

Lines changed: 0 additions & 73 deletions

File tree

test/react-router/codemods/server-entry.test.ts

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
instrumentServerEntry,
1111
instrumentHandleRequest,
1212
instrumentHandleError,
13-
instrumentUnstableInstrumentations,
1413
} from '../../../src/react-router/codemods/server-entry';
1514

1615
// @ts-expect-error - magicast is ESM and TS complains about that. It works though
@@ -668,63 +667,3 @@ export const unstable_instrumentations = [Sentry.createSentryServerInstrumentati
668667
expect(count).toBe(1);
669668
});
670669
});
671-
672-
describe('instrumentUnstableInstrumentations', () => {
673-
let tmpDir: string;
674-
675-
beforeEach(() => {
676-
tmpDir = path.join(
677-
__dirname,
678-
'fixtures',
679-
'tmp',
680-
`unstable-instrumentations-${Date.now()}-${Math.random()
681-
.toString(36)
682-
.substring(2, 11)}`,
683-
);
684-
fs.mkdirSync(tmpDir, { recursive: true });
685-
});
686-
687-
afterEach(() => {
688-
if (fs.existsSync(tmpDir)) {
689-
fs.rmSync(tmpDir, { recursive: true });
690-
}
691-
});
692-
693-
it('should add unstable_instrumentations export to the end of the file', async () => {
694-
const content = `
695-
import { ServerRouter } from 'react-router';
696-
import * as Sentry from '@sentry/react-router';
697-
698-
export default function handleRequest() {}
699-
`;
700-
const tempFile = path.join(tmpDir, 'entry.server.tsx');
701-
fs.writeFileSync(tempFile, content);
702-
703-
const mod = await loadFile(tempFile);
704-
instrumentUnstableInstrumentations(mod);
705-
706-
const modifiedCode = generateCode(mod.$ast).code;
707-
708-
expect(modifiedCode).toContain(
709-
'export const unstable_instrumentations = [Sentry.createSentryServerInstrumentation()];',
710-
);
711-
});
712-
713-
it('should not add unstable_instrumentations if already present', async () => {
714-
const content = `
715-
import * as Sentry from '@sentry/react-router';
716-
717-
export default function handleRequest() {}
718-
export const unstable_instrumentations = [Sentry.createSentryServerInstrumentation()];
719-
`;
720-
const tempFile = path.join(tmpDir, 'entry.server.tsx');
721-
fs.writeFileSync(tempFile, content);
722-
723-
const mod = await loadFile(tempFile);
724-
const originalBodyLength = (mod.$ast as any).body.length;
725-
726-
instrumentUnstableInstrumentations(mod);
727-
728-
expect((mod.$ast as any).body.length).toBe(originalBodyLength);
729-
});
730-
});

test/react-router/sdk-setup.test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,6 @@ describe('React Router SDK Setup', () => {
262262
});
263263

264264
it('should handle semver range specifiers correctly', () => {
265-
expect(
266-
supportsInstrumentationAPI({
267-
dependencies: { '@react-router/dev': '^7.9.5' },
268-
}),
269-
).toBe(true);
270265
expect(
271266
supportsInstrumentationAPI({
272267
dependencies: { '@react-router/dev': '~7.9.5' },

test/react-router/templates.test.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -295,13 +295,6 @@ describe('React Router Templates', () => {
295295
expect(result).not.toContain('unstable_instrumentations');
296296
expect(result).not.toContain('createSentryServerInstrumentation');
297297
});
298-
299-
it('should default to no instrumentation API when parameter is omitted', () => {
300-
const result = getManualServerEntryContent();
301-
302-
expect(result).not.toContain('unstable_instrumentations');
303-
expect(result).not.toContain('createSentryServerInstrumentation');
304-
});
305298
});
306299
});
307300

0 commit comments

Comments
 (0)