File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 2525 "devDependencies" : {
2626 "@sentry-internal/eslint-config-sdk" : " 5.21.4" ,
2727 "@sentry/browser" : " 5.21.4" ,
28- "@sentry/node" : " 5.21.4" ,
2928 "@types/express" : " ^4.17.1" ,
3029 "@types/jsdom" : " ^16.2.3" ,
3130 "eslint" : " 7.6.0" ,
Original file line number Diff line number Diff line change 11import { BrowserClient } from '@sentry/browser' ;
22import * as hubModuleRaw from '@sentry/hub' ; // for mocking
33import { getMainCarrier , Hub } from '@sentry/hub' ;
4- import { NodeClient } from '@sentry/node' ;
54import * as utilsModule from '@sentry/utils' ; // for mocking
65import { getGlobalObject , isNodeEnv , logger } from '@sentry/utils' ;
76import * as nodeHttpModule from 'http' ;
@@ -107,8 +106,12 @@ describe('Hub', () => {
107106 active : { members : [ mockRequestObject , mockResponseObject ] } ,
108107 } ;
109108
109+ // Ideally we'd use a NodeClient here, but @sentry/tracing can't depend on @sentry/node since the reverse is
110+ // already true (node's request handlers start their own transactions) - even as a dev dependency. Fortunately,
111+ // we're not relying on anything other than the client having a captureEvent method, which all clients do (it's
112+ // in the abstract base class), so a BrowserClient will do.
110113 const tracesSampler = jest . fn ( ) ;
111- const hub = new Hub ( new NodeClient ( { tracesSampler } ) ) ;
114+ const hub = new Hub ( new BrowserClient ( { tracesSampler } ) ) ;
112115 hub . startTransaction ( { name : 'dogpark' } ) ;
113116
114117 // post-normalization request object
You can’t perform that action at this time.
0 commit comments