src/content/docs/linter/rules/use-playwright-valid-describe-callback.mdx
import { Tabs, TabItem } from '@astrojs/starlight/components';
<Tabs> <TabItem label="JavaScript (and super languages)" icon="seti:javascript"> :::caution This rule is part of the [nursery](/linter/#nursery) group. This means that it is experimental and the behavior can change at any time. ::: ## Summary - Rule available since: `v2.4.2` - Diagnostic Category: [`lint/nursery/usePlaywrightValidDescribeCallback`](/reference/diagnostics#diagnostic-category) - This rule doesn't have a fix. - The default severity of this rule is [**information**](/reference/diagnostics#information). - This rule belongs to the following domains: - [`playwright`](/linter/domains#playwright) - Sources: - Same as [`playwright/valid-describe-callback`](https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/valid-describe-callback.md){
"linter": {
"rules": {
"nursery": {
"usePlaywrightValidDescribeCallback": "error"
}
}
}
}
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.
test.describe('suite', async () => {
test('one', async ({ page }) => {});
});
test.describe('suite', (done) => {
test('one', async ({ page }) => {});
});
test.describe('suite', () => {
test('one', async ({ page }) => {});
test('two', async ({ page }) => {});
});
describe('suite', function() {
test('one', async ({ page }) => {});
});