CodeVetter · Repo Unpack · System map
avajs/ava
AVA separates CLI orchestration from per-file test execution. The parent process discovers files, prepares providers, schedules workers, and aggregates events; workers own declarations, assertions, hooks, and snapshot state. Persistent artifacts are filesystem snapshots and local scheduling caches. Distribution is an npm package with a manually dispatched release workflow.
- package.json exposes the ava executable through entrypoints/cli.js, declares ESM, and supports Node ^22.20, ^24.12, or >=26.
- The public test entrypoint exports lib/worker/main.js, which checks runnerChain, marks loadedMain, and returns the worker's declaration chain.
- loadCli() loads configuration, normalizes providers and selection options, constructs Api, and chooses a reporter before entering one-shot or watch execution.
- Api.run() discovers tests, applies selection and CI partitioning, compiles providers, and schedules selected files with pMap.
- loadFork() creates either a Worker with workerData or a childProcess.fork with advanced serialization; both forward stdout, stderr, and AVA state messages.
- Runner owns per-file task queues and active runnables; Test owns each runnable's assertions, completion, and teardown.
- Snapshot Manager persists binary snapshots and Markdown reports; scheduler separately stores failing-tests.json in the AVA cache outside CI.
- npm test invokes lint, TypeScript checking, both test suites, and c8 reporting; release.yml validates a supplied ref, publishes npm provenance, and creates a draft GitHub release.