Skip to content

Commit 0ba634a

Browse files
committed
fix circular package dependency
1 parent 5ebe8a2 commit 0ba634a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

packages/tracing/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
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",

packages/tracing/test/hub.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { BrowserClient } from '@sentry/browser';
22
import * as hubModuleRaw from '@sentry/hub'; // for mocking
33
import { getMainCarrier, Hub } from '@sentry/hub';
4-
import { NodeClient } from '@sentry/node';
54
import * as utilsModule from '@sentry/utils'; // for mocking
65
import { getGlobalObject, isNodeEnv, logger } from '@sentry/utils';
76
import * 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

0 commit comments

Comments
 (0)