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 25
25
"devDependencies" : {
26
26
"@sentry-internal/eslint-config-sdk" : " 5.21.4" ,
27
27
"@sentry/browser" : " 5.21.4" ,
28
- "@sentry/node" : " 5.21.4" ,
29
28
"@types/express" : " ^4.17.1" ,
30
29
"@types/jsdom" : " ^16.2.3" ,
31
30
"eslint" : " 7.6.0" ,
Original file line number Diff line number Diff line change 1
1
import { BrowserClient } from '@sentry/browser' ;
2
2
import * as hubModuleRaw from '@sentry/hub' ; // for mocking
3
3
import { getMainCarrier , Hub } from '@sentry/hub' ;
4
- import { NodeClient } from '@sentry/node' ;
5
4
import * as utilsModule from '@sentry/utils' ; // for mocking
6
5
import { getGlobalObject , isNodeEnv , logger } from '@sentry/utils' ;
7
6
import * as nodeHttpModule from 'http' ;
@@ -107,8 +106,12 @@ describe('Hub', () => {
107
106
active : { members : [ mockRequestObject , mockResponseObject ] } ,
108
107
} ;
109
108
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.
110
113
const tracesSampler = jest . fn ( ) ;
111
- const hub = new Hub ( new NodeClient ( { tracesSampler } ) ) ;
114
+ const hub = new Hub ( new BrowserClient ( { tracesSampler } ) ) ;
112
115
hub . startTransaction ( { name : 'dogpark' } ) ;
113
116
114
117
// post-normalization request object
You can’t perform that action at this time.
0 commit comments