eslint-rule-benchmark
Version:
Benchmark ESLint rules with detailed performance metrics for CI and plugin development
31 lines (30 loc) • 1.4 kB
TypeScript
import { ReporterOptions, TestSpecResult } from '../types/benchmark-config'
import { UserBenchmarkConfig } from '../types/user-benchmark-config'
/**
* Executes the appropriate reporters based on the provided options and
* benchmark results.
*
* This function iterates through the reporter options. For each option, it
* generates a report using `createReporter` with all test specification results
* and then either prints it to the console or saves it to a file, based on the
* reporter's configuration.
*
* Additionally, when running in a GitHub Actions pull request context, this
* function automatically generates a markdown report and publishes it as a
* comment to the pull request, independent of the configured reporter options.
* This GitHub integration works seamlessly without requiring additional
* configuration from the user.
*
* @param allTestSpecResults - An array containing the results for all test
* specifications.
* @param userConfig - The user's benchmark configuration, used for global
* settings.
* @param reporterOptionsFromCli - An array of reporter options specifying
* format and output.
* @returns A promise that resolves when all reports have been processed.
*/
export declare function runReporters(
allTestSpecResults: TestSpecResult[],
userConfig: UserBenchmarkConfig,
reporterOptionsFromCli: ReporterOptions[],
): Promise<void>