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

View file

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