Skip to content

Commit dca80fa

Browse files
authored
fix tests
1 parent 8c7102a commit dca80fa

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

packages/node/test/handlers.test.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -283,18 +283,6 @@ describe('requestHandler', () => {
283283
done();
284284
});
285285
});
286-
287-
it('patches `res.end`', () => {
288-
const flush = jest.spyOn(SDK, 'flush').mockResolvedValue(true);
289-
290-
sentryRequestMiddleware(req, res, next);
291-
res.end('ok');
292-
293-
setImmediate(() => {
294-
expect(flush).toHaveBeenCalled();
295-
expect(res.finished).toBe(true);
296-
});
297-
});
298286

299287
it('patches `res.end` when `flushTimeout` is specified', () => {
300288
const flush = jest.spyOn(SDK, 'flush').mockResolvedValue(true);
@@ -312,6 +300,7 @@ describe('requestHandler', () => {
312300
it('prevents errors thrown during `flush` from breaking the response', async () => {
313301
jest.spyOn(SDK, 'flush').mockRejectedValue(new SentryError('HTTP Error (429)'));
314302

303+
const sentryRequestMiddleware = requestHandler({ flushTimeout: 1337 });
315304
sentryRequestMiddleware(req, res, next);
316305
res.end('ok');
317306

0 commit comments

Comments
 (0)