Interface: DocumentAssertions
Fluent assertions over one final Agent Document. Every failure names the
route, its module, and the proof level that produced the document; passing
the whole renderRoute result (rather than just .document) is what makes
that provenance available.
Properties
toContainAudio
readonlytoContainAudio: (expected?) =>DocumentAssertions
Asserts an audio node matches every supplied media field.
Parameters
expected?
Returns
DocumentAssertions
toContainContext
readonlytoContainContext: (text) =>DocumentAssertions
Asserts a context node contains text — the additional context an event route returns to its host.
Parameters
text
string
Returns
DocumentAssertions
toContainImage
readonlytoContainImage: (expected?) =>DocumentAssertions
Asserts an image node matches every supplied media field.
Parameters
expected?
Returns
DocumentAssertions
toContainMarkdown
readonlytoContainMarkdown: (text) =>DocumentAssertions
Asserts a Markdown node contains text.
Parameters
text
string
Returns
DocumentAssertions
toContainResource
readonlytoContainResource: (expected?) =>DocumentAssertions
Asserts a resource node matches every supplied link field.
Parameters
expected?
Returns
DocumentAssertions
toContainText
readonlytoContainText: (text) =>DocumentAssertions
Asserts a text node contains text.
Parameters
text
string
Returns
DocumentAssertions
toHaveError
readonlytoHaveError: (code?) =>DocumentAssertions
Asserts the document represents an error node, optionally with code.
Parameters
code?
string
Returns
DocumentAssertions
toHaveNodeKinds
readonlytoHaveNodeKinds: (kinds) =>DocumentAssertions
Asserts the document's node kinds in document order.
Parameters
kinds
readonly ("error" | "resource" | "result" | "json" | "text" | "markdown" | "context" | "image" | "audio" | "progress")[]
Returns
DocumentAssertions
toHaveStatus
readonlytoHaveStatus: (status) =>DocumentAssertions
Parameters
status
AgentDocumentStatus
Returns
DocumentAssertions
toHaveValue
readonlytoHaveValue: (value) =>DocumentAssertions
Asserts the document's structured value equals value (JSON structural
equality). undefined asserts the document emitted no value at all, which
null does not satisfy.
Parameters
value
unknown
Returns
DocumentAssertions