IF Commons GitHub

logical/step

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0003-repoctl-sync FR-002

How a step of a configuration is run (commons repoctl 0003-repoctl-sync FR-002; 0009-repoctl-config FR-003): a program goes through the port that runs programs, from the repository's root; a typed function is called with the root. A function that throws is a run that could not be made (status 2 with the message), never a throw of the verb.

import { runStep } from "./step.ts";
const world = { repo: "/r", process: { run: () => Promise.resolve({ code: 0, stdout: "", stderr: "" }) } };
const r = await runStep(world, { kind: "function", label: "f", call: () => Promise.resolve({ code: 1, stdout: "", stderr: "x" }) });
r.code; // 1

Source: commons/repoctl/src/logical/step.ts

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

logical.runStepfunctionno test imports it
function runStep(w: Pick<World, "process" | "repo">, step: Step): Promise<Run>

Runs a step in the world: the program from the repository's root, or the function with it.

runStepfunctionno test imports it
function runStep(w: Pick<World, "process" | "repo">, step: Step): Promise<Run>

Runs a step in the world: the program from the repository's root, or the function with it.

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