CodeVetter · Repo Unpack · System map
jestjs/jest
The executable product is a collection of Node packages with a CLI and programmatic orchestration API. Configuration and file indexing establish project contexts before runners execute individual test files in configured environments. Persistence consists of filesystem caches, snapshots, and report artifacts. The documentation website has its own build and deployment boundary.
- The private root workspace includes packages, website, and examples, pins yarn@4.18.0, and declares Node support as ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0.
- The jest-cli package exposes the jest executable and CJS/ESM package exports; bin/jest.js delegates to import-local before invoking run().
- runCLI is the orchestration boundary: it loads configurations, selects projects, builds Haste contexts, and branches into watch or one-shot execution.
- TestScheduler loads configured runners, partitions tests by runner path and runnerOptions, and determines serial execution using shouldRunInBand or runner.isSerial.
- jest-runner executes files directly in serial mode or through a jest-worker pool with optional worker threads, serialized resolver maps, piped output, and explicit worker cleanup.
- Runtime composes ModuleRegistries, Resolution, MockState, TransformCache, JestGlobals, EsmLoader, ModuleExecutor, and CjsLoader for each test-file execution.
- The build script bundles packages with Webpack and generates .mjs wrappers from CJS exports; yarn build additionally builds and bundles declarations, while Lerna tracks package version 30.5.2.
- The website uses Docusaurus and React, reads documentation from ../docs, fetches Open Collective supporter data, and publishes website/build through Netlify production or preview commands.