chore: remove unused signature(fail.only)

This commit is contained in:
pengoosedev 2024-10-14 20:53:31 +09:00
parent ea033dbb3e
commit bd3f2d5cc5
2 changed files with 2 additions and 253 deletions

View file

@ -4019,10 +4019,6 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
* - `test.fail.only(title, body)`
* - `test.fail.only(title, details, body)`
*
* To conditionally focus a "failing" test:
* - `test.fail.only(condition, description)`
* - `test.fail.only(callback, description)`
*
* **Usage**
*
* You can declare a focused failing test, so that Playwright runs only this test and ensures it actually fails.
@ -4038,255 +4034,13 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
* });
* ```
*
* You can mark all tests within a file or
* [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group as
* focused "should fail" based on some condition with a single `test.fail.only(callback, description)` call.
*
* ```js
* import { test, expect } from '@playwright/test';
*
* test.fail.only(({ browserName }) => browserName === 'webkit', 'not implemented yet');
*
* test('fail in WebKit 1', async ({ page }) => {
* // This test will not run
* });
* test('fail in WebKit 2', async ({ page }) => {
* // This test will not run
* });
* ```
*
* @param title Test title.
* @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) for test
* details description.
* @param body Test body that takes one or two arguments: an object with fixtures and optional
* [TestInfo](https://playwright.dev/docs/api/class-testinfo).
* @param condition Test is marked as "should fail" and focused when the condition is `true`.
* @param callback A function that returns whether to mark as "should fail" and focused, based on test fixtures. Test or tests are
* marked as "should fail" and focused when the return value is `true`.
* @param description Optional description that will be reflected in a test report.
*/
only: {
/**
* You can use `test.fail.only` to focus on a specific test that is expected to fail. This is particularly useful when
* debugging a failing test or working on a specific issue.
*
* To declare a focused "failing" test:
* - `test.fail.only(title, body)`
* - `test.fail.only(title, details, body)`
*
* To conditionally focus a "failing" test:
* - `test.fail.only(condition, description)`
* - `test.fail.only(callback, description)`
*
* **Usage**
*
* You can declare a focused failing test, so that Playwright runs only this test and ensures it actually fails.
*
* ```js
* import { test, expect } from '@playwright/test';
*
* test.fail.only('focused failing test', async ({ page }) => {
* // This test is expected to fail
* });
* test('not in the focused group', async ({ page }) => {
* // This test will not run
* });
* ```
*
* You can mark all tests within a file or
* [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group as
* focused "should fail" based on some condition with a single `test.fail.only(callback, description)` call.
*
* ```js
* import { test, expect } from '@playwright/test';
*
* test.fail.only(({ browserName }) => browserName === 'webkit', 'not implemented yet');
*
* test('fail in WebKit 1', async ({ page }) => {
* // This test will not run
* });
* test('fail in WebKit 2', async ({ page }) => {
* // This test will not run
* });
* ```
*
* @param title Test title.
* @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) for test
* details description.
* @param body Test body that takes one or two arguments: an object with fixtures and optional
* [TestInfo](https://playwright.dev/docs/api/class-testinfo).
* @param condition Test is marked as "should fail" and focused when the condition is `true`.
* @param callback A function that returns whether to mark as "should fail" and focused, based on test fixtures. Test or tests are
* marked as "should fail" and focused when the return value is `true`.
* @param description Optional description that will be reflected in a test report.
*/
(title: string, body: (args: TestArgs & WorkerArgs, testInfo: TestInfo) => Promise<void> | void): void;
/**
* You can use `test.fail.only` to focus on a specific test that is expected to fail. This is particularly useful when
* debugging a failing test or working on a specific issue.
*
* To declare a focused "failing" test:
* - `test.fail.only(title, body)`
* - `test.fail.only(title, details, body)`
*
* To conditionally focus a "failing" test:
* - `test.fail.only(condition, description)`
* - `test.fail.only(callback, description)`
*
* **Usage**
*
* You can declare a focused failing test, so that Playwright runs only this test and ensures it actually fails.
*
* ```js
* import { test, expect } from '@playwright/test';
*
* test.fail.only('focused failing test', async ({ page }) => {
* // This test is expected to fail
* });
* test('not in the focused group', async ({ page }) => {
* // This test will not run
* });
* ```
*
* You can mark all tests within a file or
* [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group as
* focused "should fail" based on some condition with a single `test.fail.only(callback, description)` call.
*
* ```js
* import { test, expect } from '@playwright/test';
*
* test.fail.only(({ browserName }) => browserName === 'webkit', 'not implemented yet');
*
* test('fail in WebKit 1', async ({ page }) => {
* // This test will not run
* });
* test('fail in WebKit 2', async ({ page }) => {
* // This test will not run
* });
* ```
*
* @param title Test title.
* @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) for test
* details description.
* @param body Test body that takes one or two arguments: an object with fixtures and optional
* [TestInfo](https://playwright.dev/docs/api/class-testinfo).
* @param condition Test is marked as "should fail" and focused when the condition is `true`.
* @param callback A function that returns whether to mark as "should fail" and focused, based on test fixtures. Test or tests are
* marked as "should fail" and focused when the return value is `true`.
* @param description Optional description that will be reflected in a test report.
*/
(title: string, details: TestDetails, body: (args: TestArgs & WorkerArgs, testInfo: TestInfo) => Promise<void> | void): void;
/**
* You can use `test.fail.only` to focus on a specific test that is expected to fail. This is particularly useful when
* debugging a failing test or working on a specific issue.
*
* To declare a focused "failing" test:
* - `test.fail.only(title, body)`
* - `test.fail.only(title, details, body)`
*
* To conditionally focus a "failing" test:
* - `test.fail.only(condition, description)`
* - `test.fail.only(callback, description)`
*
* **Usage**
*
* You can declare a focused failing test, so that Playwright runs only this test and ensures it actually fails.
*
* ```js
* import { test, expect } from '@playwright/test';
*
* test.fail.only('focused failing test', async ({ page }) => {
* // This test is expected to fail
* });
* test('not in the focused group', async ({ page }) => {
* // This test will not run
* });
* ```
*
* You can mark all tests within a file or
* [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group as
* focused "should fail" based on some condition with a single `test.fail.only(callback, description)` call.
*
* ```js
* import { test, expect } from '@playwright/test';
*
* test.fail.only(({ browserName }) => browserName === 'webkit', 'not implemented yet');
*
* test('fail in WebKit 1', async ({ page }) => {
* // This test will not run
* });
* test('fail in WebKit 2', async ({ page }) => {
* // This test will not run
* });
* ```
*
* @param title Test title.
* @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) for test
* details description.
* @param body Test body that takes one or two arguments: an object with fixtures and optional
* [TestInfo](https://playwright.dev/docs/api/class-testinfo).
* @param condition Test is marked as "should fail" and focused when the condition is `true`.
* @param callback A function that returns whether to mark as "should fail" and focused, based on test fixtures. Test or tests are
* marked as "should fail" and focused when the return value is `true`.
* @param description Optional description that will be reflected in a test report.
*/
(condition: boolean, description?: string): void;
/**
* You can use `test.fail.only` to focus on a specific test that is expected to fail. This is particularly useful when
* debugging a failing test or working on a specific issue.
*
* To declare a focused "failing" test:
* - `test.fail.only(title, body)`
* - `test.fail.only(title, details, body)`
*
* To conditionally focus a "failing" test:
* - `test.fail.only(condition, description)`
* - `test.fail.only(callback, description)`
*
* **Usage**
*
* You can declare a focused failing test, so that Playwright runs only this test and ensures it actually fails.
*
* ```js
* import { test, expect } from '@playwright/test';
*
* test.fail.only('focused failing test', async ({ page }) => {
* // This test is expected to fail
* });
* test('not in the focused group', async ({ page }) => {
* // This test will not run
* });
* ```
*
* You can mark all tests within a file or
* [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) group as
* focused "should fail" based on some condition with a single `test.fail.only(callback, description)` call.
*
* ```js
* import { test, expect } from '@playwright/test';
*
* test.fail.only(({ browserName }) => browserName === 'webkit', 'not implemented yet');
*
* test('fail in WebKit 1', async ({ page }) => {
* // This test will not run
* });
* test('fail in WebKit 2', async ({ page }) => {
* // This test will not run
* });
* ```
*
* @param title Test title.
* @param details See [test.describe([title, details, callback])](https://playwright.dev/docs/api/class-test#test-describe) for test
* details description.
* @param body Test body that takes one or two arguments: an object with fixtures and optional
* [TestInfo](https://playwright.dev/docs/api/class-testinfo).
* @param condition Test is marked as "should fail" and focused when the condition is `true`.
* @param callback A function that returns whether to mark as "should fail" and focused, based on test fixtures. Test or tests are
* marked as "should fail" and focused when the return value is `true`.
* @param description Optional description that will be reflected in a test report.
*/
(callback: (args: TestArgs & WorkerArgs) => boolean, description?: string): void;
}
only: TestFunction<TestArgs & WorkerArgs>;
}
/**
* Marks a test as "slow". Slow test will be given triple the default timeout.

View file

@ -116,12 +116,7 @@ export interface TestType<TestArgs extends KeyValue, WorkerArgs extends KeyValue
(condition: boolean, description?: string): void;
(callback: (args: TestArgs & WorkerArgs) => boolean, description?: string): void;
(): void;
only: {
(title: string, body: (args: TestArgs & WorkerArgs, testInfo: TestInfo) => Promise<void> | void): void;
(title: string, details: TestDetails, body: (args: TestArgs & WorkerArgs, testInfo: TestInfo) => Promise<void> | void): void;
(condition: boolean, description?: string): void;
(callback: (args: TestArgs & WorkerArgs) => boolean, description?: string): void;
}
only: TestFunction<TestArgs & WorkerArgs>;
}
slow(): void;
slow(condition: boolean, description?: string): void;