fix type
This commit is contained in:
parent
14c8ec3a23
commit
4c881cf11c
|
|
@ -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';
|
||||||
|
|
|
||||||
4
packages/playwright/types/test.d.ts
vendored
4
packages/playwright/types/test.d.ts
vendored
|
|
@ -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;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue