playwright-results-parser
Version:
Core building block for Playwright test analysis tools - provides foundational parsing, normalization, and transformation APIs that other packages can build upon.
40 lines • 1.41 kB
TypeScript
/**
* Aggregates sharded test results
*/
import type { NormalizedTestRun } from "../types/index.js";
/**
* Aggregates multiple sharded test runs into a single unified run.
* Combines tests from all shards and recalculates totals.
*
* @param runs - Array of test runs from different shards
* @returns Single aggregated test run with all tests
* @throws {Error} If no test runs are provided
*
* @example
* ```typescript
* const shard1 = await parsePlaywrightJson('./shard-1.json');
* const shard2 = await parsePlaywrightJson('./shard-2.json');
* const combined = aggregateShardedRuns([shard1, shard2]);
* console.log(`Total tests across shards: ${combined.totals.total}`);
* ```
*/
export declare function aggregateShardedRuns(runs: NormalizedTestRun[]): NormalizedTestRun;
/**
* Checks if test runs are from the same sharded execution.
* Validates that all runs have consistent shard configuration.
*
* @param runs - Array of test runs to validate
* @returns True if all runs are from the same sharded execution
*
* @example
* ```typescript
* const runs = [shard1, shard2, shard3];
* if (areRunsFromSameExecution(runs)) {
* const combined = aggregateShardedRuns(runs);
* } else {
* console.error('Runs are from different executions');
* }
* ```
*/
export declare function areRunsFromSameExecution(runs: NormalizedTestRun[]): boolean;
//# sourceMappingURL=shards.d.ts.map