Skip to content

Commit 4481089

Browse files
committed
add test for removing sentry
1 parent 47c8dac commit 4481089

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/nextjs/test/config.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,15 @@ describe('withSentryConfig', () => {
281281

282282
expect(exportedNextConfigFunction).toHaveBeenCalledWith(runtimePhase, defaultsObject);
283283
});
284+
285+
it('removes `sentry` property', () => {
286+
// It's unclear why we need this cast -
287+
const finalConfig = materializeFinalNextConfig({ ...exportedNextConfig, sentry: {} });
288+
// const finalConfig = materializeFinalNextConfig({ ...exportedNextConfig, sentry: {} } as ExportedNextConfig);
289+
290+
// We have to check using `in` because TS knows it shouldn't be there and throws a type error if we try to access it
291+
// directly
292+
expect('sentry' in finalConfig).toBe(false);
284293
});
285294
});
286295

0 commit comments

Comments
 (0)