IF Commons GitHub

pure/chain-files

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0001-quality-evidence FR-030

The files of a requirement's trace chain (commons 0001-quality-evidence FR-030, 0020-ifccm FR-014): its specification, the code that cites it with a // Spec: line, the tests that prove it with proves, and the ontology files that define a term for it. A change to any of them after the revision of a run makes the proof stale; this file only says which they are. It reads text it is given and uses the readers of kernel/trace.ts, so that no stage needs an annotation of its own.

Also here: the tests a repository holds, by name (testsOf), which a CAPA names (FR-033), and the line of a requirement in its specification (requirementLine), so that a change to the requirement's own text is told from a change to its neighbours' (FR-030's "its text").

Source: commons/quality/src/pure/chain-files.ts

1 of 5 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

SourceTexttypeno test imports it
type SourceText = { readonly path: string; readonly text: string };

A file of the repository and its text.

requirementsOffunction
function requirementsOf(specs: readonly { readonly slug: string; readonly text: string; }[]): ReadonlyMap<string, readonly string[]>

The requirements, NNNN-slug FR-nnn, of each specification's text, by slug.

Imported by 8 tests of the run (8 passed, 0 failed): the library's results

chainFilesfunctionno test imports it
function chainFiles(requirements: readonly string[], sources: readonly SourceText[], specPaths: ReadonlyMap<string, string>): ReadonlyMap<string, readonly string[]>

For each requirement, the files of its chain (FR-030): the specification at specPaths, every file whose // Spec: line or proves call names it (alone or in a range), and every file that holds its identifier as text where it is an ontology file (mz:definedBy).

requirementLinefunctionno test imports it
function requirementLine(specText: string, fr: string): string | undefined

The line of a requirement in its specification's text (- **FR-nnn**: ...), trimmed; undefined where there is none.

testsOffunctionno test imports it
function testsOf(text: string): readonly KnownTest[]

The tests a text holds that name the requirements they prove: proves(["0001-quality-evidence FR-013"], "the name", ...).

Titles, headings, exports, tables, columns and requirements. Esc closes.