fix(testing): close cypress web server correctly on windows (#22125)

This commit is contained in:
Leosvel Pérez Espinosa 2024-03-04 19:11:01 +01:00 committed by GitHub
parent 6957937ec4
commit 2d9ecfd1fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -75,9 +75,13 @@ function startWebServer(webServerCommand: string) {
}); });
return () => { return () => {
// child.kill() does not work on linux if (process.platform === 'win32') {
// process.kill will kill the whole process group on unix serverProcess.kill();
process.kill(-serverProcess.pid, 'SIGKILL'); } else {
// child.kill() does not work on linux
// process.kill will kill the whole process group on unix
process.kill(-serverProcess.pid, 'SIGKILL');
}
}; };
} }