Skip to content

Commit

Permalink
fix test?
Browse files Browse the repository at this point in the history
  • Loading branch information
lforst committed Jan 12, 2023
1 parent c31d07f commit 760df35
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/node/test/handlers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import * as http from 'http';

import { NodeClient } from '../src/client';
import { errorHandler, requestHandler, tracingHandler } from '../src/handlers';
import * as SDK from '../src/sdk';
import { getDefaultNodeClientOptions } from './helper/node-client-options';

describe('requestHandler', () => {
Expand Down Expand Up @@ -111,7 +110,7 @@ describe('requestHandler', () => {
});

it('patches `res.end` when `flushTimeout` is specified', done => {
const flush = jest.spyOn(SDK, 'flush').mockResolvedValue(true);
const flush = jest.spyOn(sentryCore, 'flush').mockResolvedValue(true);

const sentryRequestMiddleware = requestHandler({ flushTimeout: 1337 });
sentryRequestMiddleware(req, res, next);
Expand All @@ -125,7 +124,7 @@ describe('requestHandler', () => {
});

it('prevents errors thrown during `flush` from breaking the response', done => {
jest.spyOn(SDK, 'flush').mockRejectedValue(new SentryError('HTTP Error (429)'));
jest.spyOn(sentryCore, 'flush').mockRejectedValue(new SentryError('HTTP Error (429)'));

const sentryRequestMiddleware = requestHandler({ flushTimeout: 1337 });
sentryRequestMiddleware(req, res, next);
Expand Down

0 comments on commit 760df35

Please sign in to comment.