Skip to content

Commit 6685e71

Browse files
committed
test: fix import paths and improve skip explanation for path-resolve tests
Fix incorrect import paths (../constants.mts -> ../../constants.mts) and provide clearer explanation of why tests are skipped: mock-fs completely replaces the filesystem, preventing access to real dependencies needed by the tested code.
1 parent a54c259 commit 6685e71

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,9 @@ const sortedPromise =
146146
}
147147
const sortedGetPackageFilesFullScans = sortedPromise(getPackageFilesForScan)
148148

149-
// Skipped: Tests use mock-fs which conflicts with loading socket-registry files,
150-
// and have import path issues that need fixing.
149+
// Skipped: mock-fs completely replaces the filesystem, preventing the tested code
150+
// from accessing real dependencies in @socketsecurity/lib and node_modules.
151+
// Would need to switch to memfs or real temp directories to fix.
151152
describe.skip('Path Resolve', () => {
152153
afterEach(() => {
153154
mockFs.restore()
@@ -396,7 +397,7 @@ describe.skip('Path Resolve', () => {
396397
})
397398

398399
it('handles shadowed bin paths', async () => {
399-
const constants = await import('../constants.mts')
400+
const constants = await import('../../constants.mts')
400401
const shadowBinPath = constants.default.shadowBinPath
401402
const { whichBinSync } = vi.mocked(
402403
await import('@socketsecurity/lib/bin'),
@@ -461,7 +462,7 @@ describe.skip('Path Resolve', () => {
461462
})
462463

463464
it('handles only shadow bin in path', async () => {
464-
const constants = await import('../constants.mts')
465+
const constants = await import('../../constants.mts')
465466
const shadowBinPath = constants.default.shadowBinPath
466467
const { whichBinSync } = vi.mocked(
467468
await import('@socketsecurity/lib/bin'),

0 commit comments

Comments
 (0)