tcmts.cli.suites.test

SOURCE "export const double = (n: number) => n * 2;\nexport const table = [1, 2, 3].map(double);\nexport c…
coveredRun (source: string) => { cb: Codebase; def: (name: string) => DefRecord; run: (...ran: [definition: st…
Definitions analyzed from `source` as a codebase holding only them, each named by its own name; and what a run of them executed, given the functions that ran (by name: a function's own, or a function in a constant's value), as V8 coverage of every module loaded would have it: `run`, the names; `executedBy`, the names and their code, given the names as the run started (or undefined: what ran isn't known), loaded from the codebase's cache or `cache`.
testComputedConstantChangingStateCountsWhenTheStateDoes () => void
What computing a constant could change is part of what ran when what ran refers to it: `registered` pushes to `registry`, which `main` reads, so it counts though nothing refers to it (as `unused` doesn't); `configured` changes `options`, and counts only when what ran reads that.
testComputedConstantCountsWhenAFunctionInItRan () => void
A computed constant counts when a function in its value ran (coverage has it in the constant's module), with its own code.
testComputedConstantsCountWhenRead () => void
A constant whose value is computed doing nothing else counts only when what ran refers to it: `table`, which `main` reads, and not `unused`, which nothing that ran does; one whose computation does something (reads the clock) counts on load. What a computed value only holds isn't run by loading it: `tools` holds a function reading the clock and is computed quietly.
testUnnamedCodeCountsThroughWhatRefersToIt () => void
What ran that no name follows counts through what refers to it, by hash: `double`, unnamed, is in the code of `table`, which reads it; a change to it re-hashes `table`, and so changes that code.
testUnnamedCodeOfATestsOwnCodebaseIsntThisOnes () => void
Code no name follows that ran only from another codebase's cache (one a test made, holding code this codebase once had: `tcm init`'s) is that codebase's, not this one's: it doesn't stop the run being kept.
testWhatASaveReplacedDuringARunStillCounts () => void
A definition a save replaced while the run went on (no name points at it once it ends) still counts, by the name it had when the run started; without those names, nothing follows it, and what the run executed isn't known.