chore: fix codegen SIGINT test

This commit is contained in:
Adam Gastineau 2025-01-24 11:08:49 -08:00
parent bbd55587e4
commit 003cb4ae58

View file

@ -459,8 +459,13 @@ await page1.GotoAsync("about:blank?foo");`);
const cli = runCLI([`--save-storage=${storageFileName}`, `--save-har=${harFileName}`]);
await cli.waitFor(`import { test, expect } from '@playwright/test'`);
await cli.process.kill('SIGINT');
const { exitCode } = await cli.process.exited;
expect(exitCode).toBe(130);
const { exitCode, signal } = await cli.process.exited;
if (exitCode !== null) {
expect(exitCode).toBe(130);
} else {
// If the runner is slow enough, the process will be forcibly terminated by the signal
expect(signal).toBe('SIGINT');
}
expect(fs.existsSync(storageFileName)).toBeTruthy();
expect(fs.existsSync(harFileName)).toBeTruthy();
});