Skip to content

Commit 2809240

Browse files
committed
fix: correct mock function name in path-resolve tests
The test was mocking `resolveBinPathSync` but the actual function is `resolveRealBinSync`. This caused tests to use the real implementation in CI, which resolved to the actual npm path on the runner.
1 parent 1e32839 commit 2809240

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/cli/test/unit/utils/fs/path-resolve.test.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const PACKAGE_JSON = 'package.json'
3939

4040
// Hoisted mocks for better CI reliability.
4141
const mockWhichRealSync = vi.hoisted(() => vi.fn())
42-
const mockResolveBinPathSync = vi.hoisted(() => vi.fn((p: string) => p))
42+
const mockResolveRealBinSync = vi.hoisted(() => vi.fn((p: string) => p))
4343

4444
// Mock dependencies for new tests.
4545
vi.mock('@socketsecurity/lib/bin', async () => {
@@ -48,7 +48,7 @@ vi.mock('@socketsecurity/lib/bin', async () => {
4848
>('@socketsecurity/lib/bin')
4949
return {
5050
...actual,
51-
resolveBinPathSync: mockResolveBinPathSync,
51+
resolveRealBinSync: mockResolveRealBinSync,
5252
whichRealSync: mockWhichRealSync,
5353
}
5454
})

0 commit comments

Comments
 (0)