IF Commons GitHub

trust/requirement-text

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

The text of a requirement as the specifications state it at a revision (commons 0001-quality-evidence FR-068): the Assessor and Internal pages show it beside a nonconformance, and the Public page never does. requirementTextOf is the pure lookup, made from the text of the specifications it is given; readRequirementTexts reads them from Git at the tested revision, so the page says what the requirement said when it was tested, not what it says now.

A requirement is named NNNN-slug FR-nnn: the folder of its specification and its number. A requirement is a bullet - **FR-nnn**: text, and the lines that continue it (indented) belong to it. Its text is returned as one line.

import { requirementTextOf } from "./requirement-text.ts";
const text = requirementTextOf(new Map([["0099-demo", "- **FR-052**: The first requirement.\n"]]));
text("0099-demo FR-001"); // "The first requirement."

Source: commons/quality/src/trust/requirement-text.ts

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

RequirementTexttypeno test imports it
type RequirementText = (requirement: string) => string | undefined;

A lookup of the text of a requirement by its name (NNNN-slug FR-nnn), or none where the specifications do not state it.

requirementTextOffunction
function requirementTextOf(specs: ReadonlyMap<string, string>): RequirementText

The lookup made from the text of specifications, by the name of the folder of each (0021-ifqs).

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

NO_REQUIREMENT_TEXTconst
const NO_REQUIREMENT_TEXT: RequirementText

The lookup that knows no requirement: the page of a harness that gives no specifications shows none.

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

readRequirementTextsfunction
function readRequirementTexts(repo: string, revision: string): Promise<Result<RequirementText, string>>

The text of the specifications of a revision of the repository, read with git, as a lookup (the revision is the tested one).

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

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