IF Commons GitHub

logical/evaluate

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0003-grc-logical FR-003

Judging what a runner observed against what a check expects, and joining statuses (0003-grc-logical FR-001, FR-003): pure functions over JSON data.

import { evaluate, join } from "./evaluate.ts";
evaluate({ kind: "empty" }, []); // { status: "pass", reason: "no rows, as expected" }
join("fail", "pass"); // "fail"

Source: commons/grc/src/logical/evaluate.ts

3 of 8 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.Judgementtypeno test imports it
type Judgement = { readonly status: "pass" | "fail" | "error"; readonly reason: string };

What an expectation says of an observation.

logical.joinfunctionno test imports it
function join(a: "accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn", b: "accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn"): "accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn"

The more serious of two statuses: associative, commutative and idempotent, with not-applicable its identity.

logical.joinAllfunctionno test imports it
function joinAll(statuses: readonly ("accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn")[]): "accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn"

The join of statuses; not-applicable for none.

logical.evaluatefunctionno test imports it
function evaluate(expect: import("/home/runner/work/.github/.github/commons/core/src/decode").ObjectOf<{ kind: import("/… (1776 characters)
function evaluate(expect: import("/home/runner/work/.github/.github/commons/core/src/decode").ObjectOf<{ kind: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<"empty">; }, Record<never, never>> | import("/home/runner/work/.github/.github/commons/core/src/decode").ObjectOf<{ kind: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<"non-empty">; }, Record<never, never>> | import("/home/runner/work/.github/.github/commons/core/src/decode").ObjectOf<{ kind: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<"equals">; value: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<import("/home/runner/work/.github/.github/commons/grc/src/governance/kinds").Json>; }, Record<never, never>> | import("/home/runner/work/.github/.github/commons/core/src/decode").ObjectOf<{ kind: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<"count">; }, { min: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<number>; max: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<number>; }> | import("/home/runner/work/.github/.github/commons/core/src/decode").ObjectOf<{ kind: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<"every">; field: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<string>; op: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<"eq" | "ge" | "gt" | "in" | "le" | "lt" | "matches" | "ne">; value: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<import("/home/runner/work/.github/.github/commons/grc/src/governance/kinds").Json>; }, Record<never, never>>, observed: Json): Judgement

The judgement of an observed value against an expectation: error where the observation is not the shape the expectation needs.

Judgementtypeno test imports it
type Judgement = { readonly status: "pass" | "fail" | "error"; readonly reason: string };

What an expectation says of an observation.

joinfunction
function join(a: "accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn", b: "accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn"): "accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn"

The more serious of two statuses: associative, commutative and idempotent, with not-applicable its identity.

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

joinAllfunction
function joinAll(statuses: readonly ("accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn")[]): "accepted" | "error" | "fail" | "gap" | "not-applicable" | "pass" | "pending" | "warn"

The join of statuses; not-applicable for none.

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

evaluatefunction
function evaluate(expect: import("/home/runner/work/.github/.github/commons/core/src/decode").ObjectOf<{ kind: import("/… (1776 characters)
function evaluate(expect: import("/home/runner/work/.github/.github/commons/core/src/decode").ObjectOf<{ kind: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<"empty">; }, Record<never, never>> | import("/home/runner/work/.github/.github/commons/core/src/decode").ObjectOf<{ kind: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<"non-empty">; }, Record<never, never>> | import("/home/runner/work/.github/.github/commons/core/src/decode").ObjectOf<{ kind: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<"equals">; value: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<import("/home/runner/work/.github/.github/commons/grc/src/governance/kinds").Json>; }, Record<never, never>> | import("/home/runner/work/.github/.github/commons/core/src/decode").ObjectOf<{ kind: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<"count">; }, { min: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<number>; max: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<number>; }> | import("/home/runner/work/.github/.github/commons/core/src/decode").ObjectOf<{ kind: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<"every">; field: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<string>; op: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<"eq" | "ge" | "gt" | "in" | "le" | "lt" | "matches" | "ne">; value: import("/home/runner/work/.github/.github/commons/core/src/decode").Decoder<import("/home/runner/work/.github/.github/commons/grc/src/governance/kinds").Json>; }, Record<never, never>>, observed: Json): Judgement

The judgement of an observed value against an expectation: error where the observation is not the shape the expectation needs.

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

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