CodeVetter · Repo Unpack · Data flow
stryker-mutator/stryker-js
Configuration and filesystem selection establish the project model before source transformation begins. Instrumentation produces modified files and mutant metadata, while the baseline test runner supplies test results, coverage, and timing. The planner converts these inputs into early results or executable run options, and the executor streams outcomes into reporting. Reports preserve original source and test relationships, and incremental mode feeds that persisted information into later planning.
- ConfigReader loads a discovered or explicit JSON/JavaScript configuration, deep-merges CLI options with precedence, and validates it; preparation adds plugin schemas, validates again, then deep-freezes options.
- ProjectReader crawls from process.cwd(), applies ordered ignore rules, resolves mutation/test descriptions, reads an optional incremental report, and constructs Project.
- ProjectFile.toInstrumenterFile supplies name, mutation scope, and current text; Instrumenter parses each file, transforms its AST, prints instrumented text, and returns files plus API mutants.
- MutantInstrumenterExecutor stores generated text in ProjectFile, runs preprocessors, initializes the checker pool, then initializes Sandbox; unchanged sandbox files are copied while changed text is written.
- DryRunExecutor passes sandbox mutation/test paths, coverage mode, bail preference, and timeout to dryRun; it remaps returned test filenames and derives net time and nonnegative overhead.
- MutantTestPlanner produces covered-test filters or full-test plans; timeout equals timeoutFactor × netTime + timeoutMS + overhead, hitLimit is 100 × baseline hits, and hot swapping requires a filter and nonstatic coverage.
- Mutation execution separates early results, checker failures, empty-filter NoCoverage results, and test-runner outcomes, merges them into an array, and calls reportAll before reporter.wrapUp.
- Report assembly remaps test IDs, includes original mutation/test sources, config, cwd, thresholds, and framework metadata; incremental loading converts report positions back to zero-based internal coordinates before diffing.