test(cursor-hook): accept either quote style in the -s KILL assertions

CI runs prettier before vitest, which normalizes the wrapped spawnSync
arguments to single quotes; the double-quoted substring assertions then
fail on all platforms. Match both quote styles instead.
This commit is contained in:
luyua9 2026-09-15 19:50:04 +08:00
parent ea9d097be5
commit 190ab0d4f6

View file

@ -470,8 +470,8 @@ describe('Cursor hook npx fallback host budget', () => {
expect(fnBody).toContain('timeout: npxTimeout');
expect(fnBody).not.toMatch(/timeout:\s*timeout\s*\+\s*5000/);
// npx grandchild is killed outright so it cannot keep the DB lock
expect(fnBody).toContain('"-s"');
expect(fnBody).toContain('KILL');
expect(fnBody).toMatch(/['"]-s['"]/);
expect(fnBody).toMatch(/['"]KILL['"]/);
});
it('reads the shipped timeout value, not a detached literal', () => {