Skip to main content

Module from_tests

Module from_tests 

Source
Expand description

record --from-tests -- <test command>: runs the original’s own test suite and keeps every call it makes to the unit’s exported functions as recorded inputs, so the cases cover what the project’s authors thought worth testing, not only generated values.

TS/JS: test runners (Jest, Vitest, ts-jest) load sources through their own module systems, so no Node hook sees the calls. The unit’s files get a few lines appended for the run instead, wrapping each exported function declaration, and are restored from a backup afterwards (also at the start of the next run, if a run was killed). Python: an import hook on PYTHONPATH wraps the functions when their module loads; no file changes.

Structs§

Capture

Constants§

TEST_INPUTS

Functions§

capture
with_own_inputs
The inputs file record takes: the captured calls, after own inputs when there are some.