Skip to content

This site describes solve-engine as it is on main: 2.43.0, which npm does not have yet. npm installs 2.40.0, so a page may show an answer that version does not give yet.

DocumentAssertion

Defined in: packages/engine/src/testing/index.ts:533

Assertions about a whole evaluated document, returned by expectDocument. Each line is read with the same matchers expectExpression returns.

new DocumentAssertion(lines): DocumentAssertion;

Defined in: packages/engine/src/testing/index.ts:537

ParameterTypeDescription
linesreadonly ParsedLine[]Every line of the settled document, in order.

DocumentAssertion

readonly lines: readonly ParsedLine[];

Defined in: packages/engine/src/testing/index.ts:537

Every line of the settled document, in order.

line(lineNumber): ExpressionAssertion;

Defined in: packages/engine/src/testing/index.ts:547

The matchers for line lineNumber (one-based), reading the answer the document gave it: a line reference, a tag or a goal seek on it resolves as it does in an editor. A line with nothing to evaluate (prose, a heading, a blank) fails every matcher but ExpressionAssertion.toBeError.

ParameterType
lineNumbernumber

ExpressionAssertion

ExpectationError EXPECTED_LINE for a line number the document does not have.