fix: hide the osascript raise spawn too; exclude comments from the spawn invariant

This commit is contained in:
Matt Van Horn 2026-06-04 07:36:13 -07:00
parent 4d30746a1b
commit 77ebc1489e
No known key found for this signature in database
2 changed files with 5 additions and 1 deletions

View File

@ -288,6 +288,7 @@ function raiseHeadedWindowMacOS(): void {
nodeSpawn('osascript', ['-e', 'tell application "Google Chrome for Testing" to activate'], {
stdio: 'ignore',
detached: true,
windowsHide: true,
}).unref();
} catch {
// osascript missing or app not present — non-fatal

View File

@ -74,7 +74,10 @@ describe('detached server spawns carry windowsHide (#1863 fold-in)', () => {
});
test('every detached spawn site in cli.ts carries windowsHide:true', () => {
const body = read(CLI);
const body = read(CLI)
.split('\n')
.filter((line) => !line.trim().startsWith('//') && !line.trim().startsWith('*'))
.join('\n');
const detachedSpawns = body.match(/detached:\s*true/g)?.length ?? 0;
const windowsHideFlags = body.match(/windowsHide:\s*true/g)?.length ?? 0;
expect(windowsHideFlags).toBeGreaterThanOrEqual(detachedSpawns);