Skip to content

Commit 30ccaf0

Browse files
committed
fix(test): normalize projectRoot for cross-platform path comparison
The git-extended test was failing on Windows because projectRoot from process.cwd() used backslashes while getChangedFiles returns normalized paths with forward slashes. This caused toContain() comparison to fail. Solution: normalize projectRoot using normalizePath to ensure consistent forward slash usage across all platforms.
1 parent fce55dd commit 30ccaf0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/git-extended.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ import {
2020
isUnstaged,
2121
isUnstagedSync,
2222
} from '@socketsecurity/lib/git'
23+
import { normalizePath } from '@socketsecurity/lib/path'
2324
import { spawnSync } from '@socketsecurity/lib/spawn'
2425
import { describe, expect, it } from 'vitest'
2526
import { runWithTempDir } from './utils/temp-file-helper.mjs'
2627

2728
describe('git extended tests', () => {
28-
const projectRoot = process.cwd()
29+
const projectRoot = normalizePath(process.cwd())
2930

3031
describe('cache functionality', () => {
3132
it('should cache results by default', async () => {

0 commit comments

Comments
 (0)