Skip to navigation

assertion

An articulated assertion record produced by the runner for a step result. Each record names a single verification check, whether it passed, and the values it compared. The step’s result is the roll-up of its assertion results (FAIL > WARNING > all-SKIPPED > PASS). System-populated; appears in test results, not in authored specs.

Referenced In

Fields

FieldTypeDescriptionDefault
statementstringRequired. Human-readable articulation of the check, e.g. exitCode in [0].

Minimum length: 1. Pattern: \S
—
sourcestringRequired. Who defined the assertion: implicit (runner-defined) or custom (user-defined).

Accepted values: implicit, custom
—
resultstringRequired. Outcome of evaluating the assertion.

Accepted values: PASS, FAIL, WARNING, SKIPPED
—
expectedarray,boolean,integer,null,number,object,stringOptional. The value (or values) the assertion expected. Optional.—
actualarray,boolean,integer,null,number,object,stringOptional. The value actually observed. Optional.—
descriptionstringOptional. Human-readable explanation of the outcome. Optional.—

Examples

{
"statement": "exitCode in [0]",
"source": "implicit",
"result": "PASS",
"expected": [
0
],
"actual": 0,
"description": "Returned exit code 0."
}
{
"statement": "exitCode in [0]",
"source": "implicit",
"result": "FAIL",
"expected": [
0
],
"actual": 1,
"description": "Returned exit code 1. Expected one of [0]."
}
{
"statement": "saved-file variation <= 0.1",
"source": "implicit",
"result": "WARNING"
}
{
"statement": "$$outputs.exitCode == 0",
"source": "custom",
"result": "SKIPPED"
}