/** * One place to say what this run records, instead of two that have to agree. * * The recording fixtures and the reporter read the same values — the root, * the cache, the coverage index, the probe recipe — and a configuration that spells them twice is a * configuration where they can differ. A mismatch is not an error anybody * sees: the workers stage crossings recorded against one root and the fold * resolves them against another, and the result is a record written under * paths no later run will ask about. * * ```ts * // playwright.config.ts * import { withTestSelection } from '@variance-authority/playwright-test'; * * export default defineConfig(withTestSelection({ * projects: [{ name: 'chromium', use: devices['Desktop Chrome'] }], * }, { preconditions: ['playwright/fixtures.ts'] })); * ``` * * Every project is given the recording, because a project is a second run of * the same specs and a project the wrapper skipped would drive the page * without draining it. The reporter is the run's rather than a project's — * Playwright folds once — so it is added once, at the top. */ import type { ExecutionRecording } from './execution.js'; import { type PlaywrightShard } from './whole-file-shard.js'; /** The reporter entry, by the specifier a configuration names it with. */ export declare const SELECTION_REPORTER = "@variance-authority/playwright-test/reporter"; /** The subset of a Playwright configuration this reads and rewrites. */ export interface PlaywrightSelectionConfig { readonly use?: object; readonly reporter?: string | ReadonlyArray; readonly projects?: ReadonlyArray<{ readonly name?: string; readonly use?: object; }>; readonly shard?: PlaywrightShard | null; readonly build?: { readonly external?: readonly string[]; }; readonly '@playwright/test'?: { readonly babelPlugins?: readonly unknown[]; }; } /** * Turn recording on for every project in a Playwright configuration, and add * the reporter that folds what the workers staged. * * Everything the configuration already had stays, its own reporters included * and in their order; a configuration with none keeps Playwright's default by * naming it, because a `reporter` array of one entry replaces the default * rather than adding to it. Its own `babelPlugins` stay too, and the plugin * that cuts each spec statement by statement goes after them, unless * `cadence` is `false`. * * The suite still has to be built with `testSelectionProbes()` from * `@variance-authority/sense/journal` — this wires the runner, not the page — * and a run whose application has no collector says so on stderr and records * nothing. * * A run that asks for a shard, by `--shard` or the configuration's `shard`, is * refused here, before anything starts, when the project's Playwright is older * than 1.62 and would split it test by test, or when a `--reporter` on the * command line replaces the reporter that places it by whole files. */ export declare function withTestSelection(config?: Config & PlaywrightSelectionConfig, recording?: ExecutionRecording): Config; //# sourceMappingURL=with-test-selection.d.ts.map