From a479cb6f52d95a4825f74932f78a5a24f04c759a Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Wed, 25 Aug 2021 14:36:36 -0700 Subject: [PATCH] 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. --- tests/playwright-test/test-modifiers.spec.ts | 4 ++++ types/test.d.ts | 1 + utils/generate_types/overrides-test.d.ts | 1 + 3 files changed, 6 insertions(+) diff --git a/tests/playwright-test/test-modifiers.spec.ts b/tests/playwright-test/test-modifiers.spec.ts index 690f527fc6..5714cc75f1 100644 --- a/tests/playwright-test/test-modifiers.spec.ts +++ b/tests/playwright-test/test-modifiers.spec.ts @@ -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); diff --git a/types/test.d.ts b/types/test.d.ts index 4490d9938f..6abcc096bf 100644 --- a/types/test.d.ts +++ b/types/test.d.ts @@ -1626,6 +1626,7 @@ export interface TestType {})` 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; skip(): void; skip(condition: boolean): void; skip(condition: boolean, description: string): void; diff --git a/utils/generate_types/overrides-test.d.ts b/utils/generate_types/overrides-test.d.ts index 9cf4363f3f..db49461b58 100644 --- a/utils/generate_types/overrides-test.d.ts +++ b/utils/generate_types/overrides-test.d.ts @@ -227,6 +227,7 @@ export interface TestType Promise | void): void; skip(): void; skip(condition: boolean): void; skip(condition: boolean, description: string): void;