Skip to content

Commit 1e056e6

Browse files
committed
fix(tests): use .cmd extension for Windows batch scripts
Windows cannot execute batch script files without a .cmd or .bat extension. The cache invalidation test was creating a shell script without the proper extension, causing test failures on Windows CI.
1 parent 5a27122 commit 1e056e6

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

test/unit/bin.test.mts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1436,7 +1436,10 @@ echo "test"
14361436
it('should invalidate cache when binary no longer exists', async () => {
14371437
await runWithTempDir(async tmpDir => {
14381438
// Create a temporary "binary" script
1439-
const binPath = path.join(tmpDir, 'test-bin')
1439+
// Windows requires .cmd extension to execute batch scripts
1440+
const binName =
1441+
process.platform === 'win32' ? 'test-bin.cmd' : 'test-bin'
1442+
const binPath = path.join(tmpDir, binName)
14401443
const binScript =
14411444
process.platform === 'win32'
14421445
? '@echo off\necho test'

0 commit comments

Comments
 (0)