Skip to content

Commit 711eda5

Browse files
committed
oh, windows
1 parent 4e60c6a commit 711eda5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/integration/directive/index.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import fs from 'node:fs';
2+
import os from 'node:os';
23
import { join } from 'node:path';
34
import { buildAndGetResults, queryContent } from 'test-helper';
45
import { describe, expect, test } from 'vitest';
@@ -62,16 +63,19 @@ describe('shebang', async () => {
6263
});
6364

6465
describe('chmod', async () => {
66+
// Windows uses Access Control Lists (ACLs) for file permissions, which are represented differently from Linux modes.
67+
const mode = os.platform() === 'win32' ? 0o100644 : 0o100755;
68+
6569
test('shebang at the beginning', async () => {
6670
const filePath = entryFiles.esm0!;
6771
const fileStats = fs.statSync(filePath);
68-
expect(fileStats.mode).toBe(0o100755);
72+
expect(fileStats.mode).toBe(mode);
6973
});
7074

7175
test('shebang at the beginning even if minified', async () => {
7276
const filePath = entryFiles.esm1!;
7377
const fileStats = fs.statSync(filePath);
74-
expect(fileStats.mode).toBe(0o100755);
78+
expect(fileStats.mode).toBe(mode);
7579
});
7680
});
7781
});

0 commit comments

Comments
 (0)