Skip to main content

Module test_runner

Module test_runner 

Source
Expand description

bynk test’s shared command body (Wave 5 §5.4, findings #40/#72/#20/#21 remainder): compile the project’s test declarations, write them, and run them via tsc → node (falling back to tsx), folding the result into the pinned crate::test_json::TestRun document in --format json mode. Moved down from the old bynkc crate.

Runners are found with crate::probe::detect and crate::probe::DetectOpts::default() (no project-local search, no npx fallback), the one detection implementation both CLIs share for doctor/dev. #1758: each is spawned by the path detection resolved, not by its bare name, so a Windows npm shim (tsc.cmd) runs, and a runner that is found but won’t start is reported as such rather than as missing.

Structs§

TestArgs
The test subcommand’s flags — the one contract bynk test #[command(flatten)]s (review findings #40/#72/#20/#21 remainder), replacing independent hand-spellings in each CLI. Field docs here are the CLI help text for both commands’ flags.

Enums§

TestFormat
test --format selector, used by bynk test (review findings #40/#72): one enum both CLIs’ Test subcommand uses, instead of two structurally-identical copies that must be hand-kept in sync.

Functions§

discover_cases
Every (suite, case) the projects at members declare, by discovery, to judge a --suite/--case value against. None when any member does not compile or answers something else: the runs report that, and a value is not judged against a partial picture.
run_test
In --format json mode the deterministic surface is the document on stdout, so a <program> test: line on stderr is fine but must never reach stdout. program prefixes stderr messages ("bynk") so they read the same as before the move.