diff --git a/packages/astro/test/server/middleware.test.ts b/packages/astro/test/server/middleware.test.ts index 093b2fad2d6b..bc15a7433374 100644 --- a/packages/astro/test/server/middleware.test.ts +++ b/packages/astro/test/server/middleware.test.ts @@ -142,7 +142,7 @@ describe('sentryMiddleware', () => { }); // @ts-expect-error, a partial ctx object is fine here - await expect(async () => middleware(ctx, next)).rejects.toThrowError(); + await expect(async () => middleware(ctx, next)).rejects.toThrow(); expect(captureExceptionSpy).toHaveBeenCalledWith(error, { mechanism: { handled: false, type: 'astro', data: { function: 'astroMiddleware' } }, diff --git a/packages/cloudflare/test/transport.test.ts b/packages/cloudflare/test/transport.test.ts index 788785de8216..048251f6f9c0 100644 --- a/packages/cloudflare/test/transport.test.ts +++ b/packages/cloudflare/test/transport.test.ts @@ -140,7 +140,7 @@ describe('IsolatedPromiseBuffer', () => { await ipb.add(task2); await ipb.add(task3); - await expect(ipb.add(task4)).rejects.toThrowError('Not adding Promise because buffer limit was reached.'); + await expect(ipb.add(task4)).rejects.toThrow('Not adding Promise because buffer limit was reached.'); }); it('should not throw when one of the tasks throws when drained', async () => { diff --git a/packages/google-cloud-serverless/test/gcpfunction/cloud_event.test.ts b/packages/google-cloud-serverless/test/gcpfunction/cloud_event.test.ts index c80df4d66a2f..ca5fe5ae8d90 100644 --- a/packages/google-cloud-serverless/test/gcpfunction/cloud_event.test.ts +++ b/packages/google-cloud-serverless/test/gcpfunction/cloud_event.test.ts @@ -119,7 +119,7 @@ describe('wrapCloudEventFunction', () => { }); const wrappedHandler = wrapCloudEventFunction(handler); - await expect(handleCloudEvent(wrappedHandler)).rejects.toThrowError(error); + await expect(handleCloudEvent(wrappedHandler)).rejects.toThrow(error); const fakeTransactionContext = { name: 'event.type', @@ -143,7 +143,7 @@ describe('wrapCloudEventFunction', () => { throw error; }; const wrappedHandler = wrapCloudEventFunction(handler); - await expect(handleCloudEvent(wrappedHandler)).rejects.toThrowError(error); + await expect(handleCloudEvent(wrappedHandler)).rejects.toThrow(error); const fakeTransactionContext = { name: 'event.type', @@ -189,7 +189,7 @@ describe('wrapCloudEventFunction', () => { cb(error); }; const wrappedHandler = wrapCloudEventFunction(handler); - await expect(handleCloudEvent(wrappedHandler)).rejects.toThrowError(error); + await expect(handleCloudEvent(wrappedHandler)).rejects.toThrow(error); const fakeTransactionContext = { name: 'event.type', @@ -212,7 +212,7 @@ describe('wrapCloudEventFunction', () => { throw error; }; const wrappedHandler = wrapCloudEventFunction(handler); - await expect(handleCloudEvent(wrappedHandler)).rejects.toThrowError(error); + await expect(handleCloudEvent(wrappedHandler)).rejects.toThrow(error); const fakeTransactionContext = { name: 'event.type', diff --git a/packages/google-cloud-serverless/test/gcpfunction/events.test.ts b/packages/google-cloud-serverless/test/gcpfunction/events.test.ts index 409b8982081b..e4139d430f99 100644 --- a/packages/google-cloud-serverless/test/gcpfunction/events.test.ts +++ b/packages/google-cloud-serverless/test/gcpfunction/events.test.ts @@ -92,7 +92,7 @@ describe('wrapEventFunction', () => { throw error; }; const wrappedHandler = wrapEventFunction(handler); - await expect(handleEvent(wrappedHandler)).rejects.toThrowError(error); + await expect(handleEvent(wrappedHandler)).rejects.toThrow(error); const fakeTransactionContext = { name: 'event.type', @@ -145,7 +145,7 @@ describe('wrapEventFunction', () => { }); const wrappedHandler = wrapEventFunction(handler); - await expect(handleEvent(wrappedHandler)).rejects.toThrowError(error); + await expect(handleEvent(wrappedHandler)).rejects.toThrow(error); const fakeTransactionContext = { name: 'event.type', @@ -191,7 +191,7 @@ describe('wrapEventFunction', () => { cb(error); }; const wrappedHandler = wrapEventFunction(handler); - await expect(handleEvent(wrappedHandler)).rejects.toThrowError(error); + await expect(handleEvent(wrappedHandler)).rejects.toThrow(error); const fakeTransactionContext = { name: 'event.type', @@ -214,7 +214,7 @@ describe('wrapEventFunction', () => { throw error; }; const wrappedHandler = wrapEventFunction(handler); - await expect(handleEvent(wrappedHandler)).rejects.toThrowError(error); + await expect(handleEvent(wrappedHandler)).rejects.toThrow(error); const fakeTransactionContext = { name: 'event.type', @@ -236,7 +236,7 @@ describe('wrapEventFunction', () => { throw error; }; const wrappedHandler = wrapEventFunction(handler); - await expect(handleEvent(wrappedHandler)).rejects.toThrowError(error); + await expect(handleEvent(wrappedHandler)).rejects.toThrow(error); expect(mockCaptureException).toHaveBeenCalledWith(error, expect.any(Function)); diff --git a/packages/node/test/cron.test.ts b/packages/node/test/cron.test.ts index d068280a41e0..db2315edbd35 100644 --- a/packages/node/test/cron.test.ts +++ b/packages/node/test/cron.test.ts @@ -103,7 +103,7 @@ describe('cron check-ins', () => { // }, }); - }).toThrowError("A job named 'my-cron-job' has already been scheduled"); + }).toThrow("A job named 'my-cron-job' has already been scheduled"); }); }); @@ -149,7 +149,7 @@ describe('cron check-ins', () => { cronWithCheckIn.schedule('* * * * *', () => { // }); - }).toThrowError('Missing "name" for scheduled job. A name is required for Sentry check-in monitoring.'); + }).toThrow('Missing "name" for scheduled job. A name is required for Sentry check-in monitoring.'); }); }); @@ -194,7 +194,7 @@ describe('cron check-ins', () => { scheduleWithCheckIn.scheduleJob('my-cron-job', new Date(), () => { // }); - }).toThrowError( + }).toThrow( "Automatic instrumentation of 'node-schedule' requires the first parameter of 'scheduleJob' to be a job name string and the second parameter to be a crontab string", ); }); @@ -212,7 +212,7 @@ describe('cron check-ins', () => { scheduleWithCheckIn.scheduleJob('* * * * *', () => { // }); - }).toThrowError( + }).toThrow( "Automatic instrumentation of 'node-schedule' requires the first parameter of 'scheduleJob' to be a job name string and the second parameter to be a crontab string", ); }); diff --git a/packages/replay-internal/test/unit/eventBuffer/EventBufferArray.test.ts b/packages/replay-internal/test/unit/eventBuffer/EventBufferArray.test.ts index 05055fe62763..9b5c278b0596 100644 --- a/packages/replay-internal/test/unit/eventBuffer/EventBufferArray.test.ts +++ b/packages/replay-internal/test/unit/eventBuffer/EventBufferArray.test.ts @@ -63,7 +63,7 @@ describe('Unit | eventBuffer | EventBufferArray', () => { await buffer.addEvent(largeEvent); // Now it should error - await expect(() => buffer.addEvent(largeEvent)).rejects.toThrowError(EventBufferSizeExceededError); + await expect(() => buffer.addEvent(largeEvent)).rejects.toThrow(EventBufferSizeExceededError); }); it('resets size limit on clear', async function () { diff --git a/packages/replay-internal/test/unit/eventBuffer/EventBufferCompressionWorker.test.ts b/packages/replay-internal/test/unit/eventBuffer/EventBufferCompressionWorker.test.ts index 4369a8b930c8..257178e009de 100644 --- a/packages/replay-internal/test/unit/eventBuffer/EventBufferCompressionWorker.test.ts +++ b/packages/replay-internal/test/unit/eventBuffer/EventBufferCompressionWorker.test.ts @@ -172,7 +172,7 @@ describe('Unit | eventBuffer | EventBufferCompressionWorker', () => { await buffer.addEvent(largeEvent); // Now it should error - await expect(() => buffer.addEvent(largeEvent)).rejects.toThrowError(EventBufferSizeExceededError); + await expect(() => buffer.addEvent(largeEvent)).rejects.toThrow(EventBufferSizeExceededError); }); it('resets size limit on clear', async function () { diff --git a/packages/sveltekit/test/server/serverRoute.test.ts b/packages/sveltekit/test/server/serverRoute.test.ts index de99db5a548e..20506198a1f8 100644 --- a/packages/sveltekit/test/server/serverRoute.test.ts +++ b/packages/sveltekit/test/server/serverRoute.test.ts @@ -82,7 +82,7 @@ describe('wrapServerRouteWithSentry', () => { await expect(async () => { await wrappedRouteHandler(getRequestEventMock() as RequestEvent); - }).rejects.toThrowError('Server Route Error'); + }).rejects.toThrow('Server Route Error'); expect(captureExceptionSpy).toHaveBeenCalledWith(error, { mechanism: { type: 'sveltekit', handled: false, data: { function: 'serverRoute' } }, diff --git a/packages/utils/test/promisebuffer.test.ts b/packages/utils/test/promisebuffer.test.ts index 1dc2e1f993e8..0739c6ad040a 100644 --- a/packages/utils/test/promisebuffer.test.ts +++ b/packages/utils/test/promisebuffer.test.ts @@ -19,7 +19,7 @@ describe('PromiseBuffer', () => { }); const producer2 = jest.fn(() => new SyncPromise(resolve => setTimeout(resolve))); expect(buffer.add(producer1)).toEqual(task1); - void expect(buffer.add(producer2)).rejects.toThrowError(); + void expect(buffer.add(producer2)).rejects.toThrow(); expect(buffer.$.length).toEqual(1); expect(producer1).toHaveBeenCalled(); expect(producer2).not.toHaveBeenCalled(); diff --git a/packages/vercel-edge/test/transports/index.test.ts b/packages/vercel-edge/test/transports/index.test.ts index c2ead21998be..dfa524b942f0 100644 --- a/packages/vercel-edge/test/transports/index.test.ts +++ b/packages/vercel-edge/test/transports/index.test.ts @@ -139,7 +139,7 @@ describe('IsolatedPromiseBuffer', () => { await ipb.add(task2); await ipb.add(task3); - await expect(ipb.add(task4)).rejects.toThrowError('Not adding Promise because buffer limit was reached.'); + await expect(ipb.add(task4)).rejects.toThrow('Not adding Promise because buffer limit was reached.'); }); it('should not throw when one of the tasks throws when drained', async () => {