Skip to content

Commit 5611d99

Browse files
committed
fix: Domain tests
1 parent fafa373 commit 5611d99

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

packages/node/test/domain.test.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@ import { getCurrentHub, Hub } from '@sentry/core';
22
import * as domain from 'domain';
33

44
describe('domains', () => {
5-
afterEach(() => {
6-
if (domain.active) {
7-
domain.active.exit();
8-
}
9-
jest.resetAllMocks();
10-
});
11-
125
test('without domain', () => {
136
expect(domain.active).toBeFalsy();
147
const hub = getCurrentHub();
@@ -33,6 +26,7 @@ describe('domains', () => {
3326
const d = domain.create();
3427
d.run(() => {
3528
expect(getCurrentHub()).toBe(getCurrentHub());
29+
d.exit();
3630
});
3731
});
3832

@@ -47,6 +41,7 @@ describe('domains', () => {
4741

4842
setTimeout(() => {
4943
expect(getCurrentHub().getStack()[1]).toEqual({ client: 'process' });
44+
d1.exit();
5045
}, 50);
5146
});
5247

@@ -57,6 +52,7 @@ describe('domains', () => {
5752

5853
setTimeout(() => {
5954
expect(getCurrentHub().getStack()[1]).toEqual({ client: 'local' });
55+
d2.exit();
6056
done();
6157
}, 100);
6258
});

0 commit comments

Comments
 (0)