Skip to content

Commit 69c96fc

Browse files
committed
fix(test): update flaky test for vi.mock hoisting behavior
1 parent 6ec58d5 commit 69c96fc

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

packages/core/test/lib/integrations/express/patch-layer.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ import { type Span } from '../../../../src/types-hoist/span';
1111
import { EventEmitter } from 'node:events';
1212
import { getOriginalFunction, markFunctionWrapped } from '../../../../src';
1313

14-
let DEBUG_BUILD = false;
14+
// must be var to hoist above vi.mock
15+
var DEBUG_BUILD = true;
1516
beforeEach(() => (DEBUG_BUILD = true));
1617
vi.mock('../../../../src/debug-build', () => ({
1718
get DEBUG_BUILD() {
18-
return DEBUG_BUILD;
19+
return DEBUG_BUILD ?? true;
1920
},
2021
}));
2122

0 commit comments

Comments
 (0)