/** * `peaks test ` — slice 2.5.0 sub-fix B (Prob 2). * * Wraps the consumer project's test framework (jest / vitest / mocha) * with a per-test fingerprint cache. The wrapper: * * 1. Auto-detects the framework from package.json (devDependencies + * dependencies) via detectTestFramework(). * 2. Spawns the framework's CLI with --cache enabled (overriding any * --no-cache in the consumer's `test` script). The user can * opt back into no-cache via `peaks test --no-cache` or * `peaks test --passthrough`. * 3. Skips tests where (fileMtime, fileSha256) is unchanged AND the * previous run status was 'passed' (per-test fingerprint cache at * `/.peaks/_runtime/test-cache/.json`). * 4. Exits 0 on all-pass / all-skip; exits 1 on any failure. * * The CLI is invoked by USER (not just by skill) per slice 2.5.0 * sub-fix B (G16) — a documented exception to the * dev-preference red-line "no new top-level peaks ". * * Sub-commands: * peaks test — run tests matching the pattern * peaks test --all — run the full suite * peaks test --changed — only files changed since HEAD * peaks test --clear-cache — empty the fingerprint cache * peaks test --no-cache-result — bypass the fingerprint cache * peaks test --no-cache — pass --no-cache to the framework * peaks test --passthrough — do NOT override the consumer's argv * peaks test --framework — force a specific framework */ import type { Command } from 'commander'; import { type ProgramIO } from '../cli-helpers.js'; import { type TestFramework } from '../../services/test-cache/test-cache-service.js'; /** * Build the argv for the underlying test runner. This is the SINGLE * source of truth for "peaks test drops --no-cache from the * consumer's script" (G7 / NG7). `--cache` is always passed * unless the user explicitly opts in to `--no-cache` or `--passthrough`. */ export declare function buildRunnerArgv(framework: TestFramework, patterns: string[], options: { all?: boolean; changed?: boolean; cache?: boolean; passthrough?: boolean; }): string[]; export declare function registerTestCommands(program: Command, _io: ProgramIO): void;