Skip to content

Commit f4848b8

Browse files
author
John Doe
committed
refactor: fix unit-test in CI
1 parent 26a851a commit f4848b8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

testing/test-setup/src/lib/process.setup-file.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import process from 'node:process';
2-
import { threadId } from 'node:worker_threads';
2+
import workerThreadsModule from 'node:worker_threads';
33
import { afterEach, beforeEach, vi } from 'vitest';
44

55
export const MOCK_PID = 10_001;
@@ -8,7 +8,7 @@ export const MOCK_TID = 1;
88
// Mock immediately when the setup file loads for default exports using process.pid or threadId
99
const processMock = vi.spyOn(process, 'pid', 'get').mockReturnValue(MOCK_PID);
1010
const threadIdMock = vi
11-
.spyOn({ threadId }, 'threadId', 'get')
11+
.spyOn(workerThreadsModule, 'threadId', 'get')
1212
.mockReturnValue(MOCK_TID);
1313

1414
beforeEach(() => {

0 commit comments

Comments
 (0)