Expand description
Assertions coverage: which executed statements a test would catch breaking.
A statement counts as asserted when changing it makes at least one passing
test that executes it fail. The change follows the statement: an if has its
condition inverted (each direction), return x returns undefined, a
declaration’s value becomes undefined, an expression point evaluates to
undefined, and any other statement is skipped. Imports, declarations without
a value, and function, class and type declarations are not assessed.
Supercov does not decide this itself. For each test it renders what the test ran (its code, its helpers, and the source it executed) and asks Jev, one yes/no question per statement, whether the test would fail. This module owns the population, the change rules and the rendering; the CLI owns the requests, the answer cache and the output. What Jev sees for one statement and one test is also the cache key, so an answer is reused only when the question would be asked with exactly the same text.
Structs§
Enums§
Constants§
- FIRST_
TESTS - Tests asked about a statement before it may be called unchecked, then the wider set asked before it is (measured: more tests remove false “unchecked” flags, and 25 tests was no better than 15).
- INSTRUCTIONS
- MAX_
QUESTIONS - MODEL
- MORE_
TESTS - THRESHOLD
- A statement is asserted when some test’s answer is at least this.
Functions§
- load_
snapshot - Read files written by
save_snapshot. - population
- The executed statements of a run and the tests that ran them.
sourcesare the run’s source files, verified against the run. - save_
snapshot - Write files’ text, compressed, to
path.