Skip to content

Commit 4f12372

Browse files
committed
fix non-unix chmod
1 parent cc03ad8 commit 4f12372

File tree

1 file changed

+5
-1
lines changed
  • tests/rspack-test/configCases/rslib/hashbang-and-chmod

1 file changed

+5
-1
lines changed

tests/rspack-test/configCases/rslib/hashbang-and-chmod/test.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ testCases.forEach(({ name, file }) => {
1515
expect(content.startsWith('#!/usr/bin/env node\n')).toBe(true);
1616
});
1717

18-
it (`should set executable permissions (0o755) for files with hashbang (${name})`, () => {
18+
// File permissions (chmod) are only supported on Unix-like systems (Linux, macOS, BSD, etc.).
19+
// Skip on Windows and WASM environments where Unix permissions are not supported.
20+
const itOnUnixOnly = (process.platform !== 'win32' && !process.env.WASM) ? it : it.skip;
21+
22+
itOnUnixOnly(`should set executable permissions (0o755) for files with hashbang (${name})`, () => {
1923
const filePath = path.resolve(__dirname, file);
2024
const stats = fs.statSync(filePath);
2125
const permissions = stats.mode & 0o777;

0 commit comments

Comments
 (0)