This commit is contained in:
Simon Knott 2024-11-07 12:07:17 +01:00
parent 14c8ec3a23
commit 4c881cf11c
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC
2 changed files with 5 additions and 5 deletions

View file

@ -30,7 +30,7 @@ export type WebServerPluginOptions = {
url?: string;
ignoreHTTPSErrors?: boolean;
timeout?: number;
kill?: { SIGINT: number }|{ SIGTERM: number };
kill?: { SIGINT?: number, SIGTERM?: number };
reuseExistingServer?: boolean;
cwd?: string;
env?: { [key: string]: string; };
@ -95,11 +95,11 @@ export class WebServerPlugin implements TestRunnerPlugin {
let signal: 'SIGINT' | 'SIGTERM' | undefined = undefined;
let timeout = 0;
if (this._options.kill) {
if ('SIGINT' in this._options.kill && typeof this._options.kill.SIGINT === 'number') {
if (typeof this._options.kill.SIGINT === 'number') {
signal = 'SIGINT';
timeout = this._options.kill.SIGINT;
}
if ('SIGTERM' in this._options.kill && typeof this._options.kill.SIGTERM === 'number') {
if (typeof this._options.kill.SIGTERM === 'number') {
if (signal)
throw new Error('Only one of SIGINT or SIGTERM can be specified in config.webServer.kill');
signal = 'SIGTERM';

View file

@ -9378,9 +9378,9 @@ interface TestConfigWebServer {
* and `SIGTERM` signals, so this option is ignored.
*/
kill?: {
SIGINT: number;
SIGINT?: number;
SIGTERM: number;
SIGTERM?: number;
};
/**