import { std } from "@winglang/sdk"; import { SnapshotMode, SnapshotResult } from "./snapshots"; import { CompileOptions } from "../compile"; /** * Options for the `test` command. */ export interface TestOptions extends CompileOptions { /** * Whether the output artifacts should be kept or cleaned up after the test run. */ readonly clean: boolean; /** * The name of the output file. */ readonly outputFile?: string; /** * String representing a regex pattern used to selectively filter which tests to run. */ readonly testFilter?: string; /** * How many times failed tests should be retried. default is one */ readonly retry?: number; /** * Whether to stream the logs of the test run. */ readonly stream?: boolean; /** * Determine snapshot behavior. */ readonly snapshots?: SnapshotMode; /** * Number of tests to be run in parallel. 0 or undefined will run all at once. */ readonly parallel?: number; } /** * Collects all the test files that should be run. * If no entrypoints are specified, all the entrypoint files in the current directory (recursive) are collected. * This excludes node_modules and target directories. * * If entrypoints are specified, only the files that contain the entrypoint string are collected. */ export declare function collectTestFiles(entrypoints?: string[]): Promise; export declare function test(entrypoints: string[], options: TestOptions): Promise; export type SingleTestResult = { readonly testName: string; readonly results: std.TestResult[]; readonly snapshot: SnapshotResult; }; /** * Render a test report for printing out to the console. */ export declare function renderTestReport(entrypoint: string, results: std.TestResult[], includeLogs?: boolean): Promise; export declare function filterTests(tests: Array, regexString?: string): Array;