fix(test): gate POSIX-only fixtures off Windows

windows-free-tests: the gstack-render CLI tests drive a shebang fake browse
that CreateProcess cannot exec, and two NEEDS_BUILD cases assert an execute
bit and a bare-name miss that MSYS bash does not have (test -x ignores mode
bits and resolves design -> design.exe). Those describes and cases now
self-skip on win32; argument guards, --help, the no-browser case, and every
other rebuild-check case still run there.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-09-06 14:37:38 +00:00
co-authored by Claude Fable 5.1
parent 2649a3b6de
commit 287b976d9f
2 changed files with 14 additions and 5 deletions
+6 -2
View File
@@ -155,7 +155,9 @@ describe('setup: NEEDS_BUILD decision executes', () => {
expect(decide(dir)).toBe(1);
});
test('a binary that exists but is not executable counts as missing → 1', () => {
// MSYS bash has no execute bit: `[ -x file ]` is true for any regular file, so
// this case is POSIX-only.
test.skipIf(process.platform === 'win32')('a binary that exists but is not executable counts as missing → 1', () => {
const dir = makeTree();
fs.chmodSync(path.join(dir, 'design/dist/design'), 0o644);
expect(decide(dir)).toBe(1);
@@ -221,7 +223,9 @@ describe('setup: NEEDS_BUILD decision executes', () => {
expect(decide(dir, { isWindows: '1' })).toBe(1);
});
test('IS_WINDOWS=0: only the .exe names present → 1 (no suffix on Unix)', () => {
// MSYS bash resolves `[ -x design ]` to design.exe on its own, so the "no
// suffix on Unix" contrast can only be asserted on a POSIX host.
test.skipIf(process.platform === 'win32')('IS_WINDOWS=0: only the .exe names present → 1 (no suffix on Unix)', () => {
const dir = makeTree({ exe: '.exe' });
expect(decide(dir, { isWindows: '0' })).toBe(1);
});