fix(test runner): add an overload for test.skip(title, fn) (#8454)

We shipped this feature, but forgot to add the right overload to d.ts.
This commit is contained in:
Dmitry Gozman 2021-08-25 14:36:36 -07:00 committed by GitHub
parent 204b6321b4
commit a479cb6f52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 0 deletions

View File

@ -179,6 +179,10 @@ test('test modifiers should check types', async ({runTSC}) => {
// @ts-expect-error
test.skip(42);
});
test.skip('skipped', async ({}) => {
});
// @ts-expect-error
test.skip('skipped', 'skipped');
`,
});
expect(result.exitCode).toBe(0);

1
types/test.d.ts vendored
View File

@ -1626,6 +1626,7 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
* skipped when the condition is `true`.
* @param testFunctionOrDescription When used with `test.skip('test', () => {})` notation, second argument is a test function. Otherwise it is an optional description that will be reflected in a test report.
*/
skip(title: string, testFunction: (args: TestArgs, testInfo: TestInfo) => Promise<void> | void): void;
skip(): void;
skip(condition: boolean): void;
skip(condition: boolean, description: string): void;

View File

@ -227,6 +227,7 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
only: SuiteFunction;
};
};
skip(title: string, testFunction: (args: TestArgs, testInfo: TestInfo) => Promise<void> | void): void;
skip(): void;
skip(condition: boolean): void;
skip(condition: boolean, description: string): void;