usePlaywrightValidDescribeCallback
Цей контент ще не доступний вашою мовою.
Summary
Section titled “Summary”- Rule available since:
v2.4.2 - Diagnostic Category:
lint/nursery/usePlaywrightValidDescribeCallback - This rule doesn’t have a fix.
- The default severity of this rule is information.
- This rule belongs to the following domains:
- Sources:
How to configure
Section titled “How to configure”{ "linter": { "rules": { "nursery": { "usePlaywrightValidDescribeCallback": "error" } } }}Description
Section titled “Description”Enforce valid describe() callback.
Using an improper describe() callback function can lead to unexpected test errors.
This rule validates that describe callbacks are proper synchronous functions without parameters.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”test.describe('suite', async () => { test('one', async ({ page }) => {});});code-block.js:1:1 lint/nursery/usePlaywrightValidDescribeCallback ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ Describe callback should not be async.
> 1 │ test.describe(‘suite’, async () => {
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 2 │ test(‘one’, async ({ page }) => {});
> 3 │ });
│ ^^
4 │
ℹ Describe blocks are meant to organize tests, not contain asynchronous logic. Async operations should be placed within individual test callbacks.
ℹ Remove the async keyword from the describe callback.
ℹ This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.
test.describe('suite', (done) => { test('one', async ({ page }) => {});});code-block.js:1:1 lint/nursery/usePlaywrightValidDescribeCallback ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ Describe callback should not have parameters.
> 1 │ test.describe(‘suite’, (done) => {
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 2 │ test(‘one’, async ({ page }) => {});
> 3 │ });
│ ^^
4 │
ℹ Describe callbacks are invoked without arguments by the test framework.
ℹ Remove parameters from the describe callback.
ℹ This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.
test.describe('suite', () => { test('one', async ({ page }) => {}); test('two', async ({ page }) => {});});describe('suite', function() { test('one', async ({ page }) => {});});Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.