Skip to content

Commit 4da6193

Browse files
committed
only set up spies once
1 parent 461fc3c commit 4da6193

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

packages/tracing/test/hub.test.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,17 @@ addExtensionMethods();
1616

1717
const mathRandom = jest.spyOn(Math, 'random');
1818
jest.spyOn(Transaction.prototype, 'setMetadata');
19+
jest.spyOn(logger, 'warn');
20+
jest.spyOn(logger, 'log');
21+
jest.spyOn(utilsModule, 'isNodeEnv');
1922

2023
// we have to add things into the real global object (rather than mocking the return value of getGlobalObject) because
2124
// there are modules which call getGlobalObject as they load, which is seemingly too early for jest to intervene
2225
addDOMPropertiesToGlobal(['XMLHttpRequest', 'Event', 'location', 'document']);
2326

2427
describe('Hub', () => {
25-
beforeEach(() => {
26-
jest.spyOn(logger, 'warn');
27-
jest.spyOn(logger, 'log');
28-
jest.spyOn(utilsModule, 'isNodeEnv');
29-
});
30-
3128
afterEach(() => {
3229
jest.clearAllMocks();
33-
jest.useRealTimers();
3430
});
3531

3632
describe('getTransaction()', () => {

0 commit comments

Comments
 (0)