We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 26a851a commit f4848b8Copy full SHA for f4848b8
testing/test-setup/src/lib/process.setup-file.ts
@@ -1,5 +1,5 @@
1
import process from 'node:process';
2
-import { threadId } from 'node:worker_threads';
+import workerThreadsModule from 'node:worker_threads';
3
import { afterEach, beforeEach, vi } from 'vitest';
4
5
export const MOCK_PID = 10_001;
@@ -8,7 +8,7 @@ export const MOCK_TID = 1;
8
// Mock immediately when the setup file loads for default exports using process.pid or threadId
9
const processMock = vi.spyOn(process, 'pid', 'get').mockReturnValue(MOCK_PID);
10
const threadIdMock = vi
11
- .spyOn({ threadId }, 'threadId', 'get')
+ .spyOn(workerThreadsModule, 'threadId', 'get')
12
.mockReturnValue(MOCK_TID);
13
14
beforeEach(() => {
0 commit comments