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.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new DocumentAssertion(lines): DocumentAssertion;Defined in: packages/engine/src/testing/index.ts:537
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
lines | readonly ParsedLine[] | Every line of the settled document, in order. |
Returns
Section titled “Returns”DocumentAssertion
Properties
Section titled “Properties”readonly lines: readonly ParsedLine[];Defined in: packages/engine/src/testing/index.ts:537
Every line of the settled document, in order.
Methods
Section titled “Methods”line()
Section titled “line()”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
lineNumber | number |
Returns
Section titled “Returns”Throws
Section titled “Throws”ExpectationError EXPECTED_LINE for a line number the document does not have.