From af170edbe225ad146c9d1e5940cbc089ef8d2925 Mon Sep 17 00:00:00 2001 From: Mathias Leppich Date: Fri, 11 Oct 2024 09:52:06 +0200 Subject: [PATCH] chore: lint code example 2nd try --- docs/src/test-api/class-testconfig.md | 12 ++++++++++-- packages/playwright/types/test.d.ts | 16 ++++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/docs/src/test-api/class-testconfig.md b/docs/src/test-api/class-testconfig.md index 8503c212f5..39830f6945 100644 --- a/docs/src/test-api/class-testconfig.md +++ b/docs/src/test-api/class-testconfig.md @@ -173,9 +173,17 @@ import { defineConfig } from '@playwright/test'; export default defineConfig({ filter: test => test.title === 'some test', - // or +}); +``` +Or... +```js +export default defineConfig({ filter: { filterTests: tests => tests.filter((test, index) => index % 2 === 0) }, - // or +}); +``` +Or... +```js +export default defineConfig({ filter: { filterTestGroups: testgroups => testgroups.filter((testgroups, index) => index % 2 === 0) }, }); ``` diff --git a/packages/playwright/types/test.d.ts b/packages/playwright/types/test.d.ts index 917a5e6fde..f53db33adc 100644 --- a/packages/playwright/types/test.d.ts +++ b/packages/playwright/types/test.d.ts @@ -1048,9 +1048,21 @@ interface TestConfig { * * export default defineConfig({ * filter: test => test.title === 'some test', - * // or + * }); + * ``` + * + * Or... + * + * ```js + * export default defineConfig({ * filter: { filterTests: tests => tests.filter((test, index) => index % 2 === 0) }, - * // or + * }); + * ``` + * + * Or... + * + * ```js + * export default defineConfig({ * filter: { filterTestGroups: testgroups => testgroups.filter((testgroups, index) => index % 2 === 0) }, * }); * ```