For AI agents: the complete documentation index is available at https://scriptedalchemy.github.io/agent-bundle/zh/llms.txt, the full documentation bundle is available at https://scriptedalchemy.github.io/agent-bundle/zh/llms-full.txt, and this page is available as Markdown at https://scriptedalchemy.github.io/agent-bundle/zh/api/interfaces/test.DocumentAssertions.md.
  • 简体中文
  • 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

    readonly toContainAudio: (expected?) => DocumentAssertions

    Asserts an audio node matches every supplied media field.

    Parameters

    expected?

    MediaNodeExpectation

    Returns

    DocumentAssertions


    toContainContext

    readonly toContainContext: (text) => DocumentAssertions

    Asserts a context node contains text — the additional context an event route returns to its host.

    Parameters

    text

    string

    Returns

    DocumentAssertions


    toContainImage

    readonly toContainImage: (expected?) => DocumentAssertions

    Asserts an image node matches every supplied media field.

    Parameters

    expected?

    MediaNodeExpectation

    Returns

    DocumentAssertions


    toContainMarkdown

    readonly toContainMarkdown: (text) => DocumentAssertions

    Asserts a Markdown node contains text.

    Parameters

    text

    string

    Returns

    DocumentAssertions


    toContainResource

    readonly toContainResource: (expected?) => DocumentAssertions

    Asserts a resource node matches every supplied link field.

    Parameters

    expected?

    ResourceNodeExpectation

    Returns

    DocumentAssertions


    toContainText

    readonly toContainText: (text) => DocumentAssertions

    Asserts a text node contains text.

    Parameters

    text

    string

    Returns

    DocumentAssertions


    toHaveError

    readonly toHaveError: (code?) => DocumentAssertions

    Asserts the document represents an error node, optionally with code.

    Parameters

    code?

    string

    Returns

    DocumentAssertions


    toHaveNodeKinds

    readonly toHaveNodeKinds: (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

    readonly toHaveStatus: (status) => DocumentAssertions

    Parameters

    status

    AgentDocumentStatus

    Returns

    DocumentAssertions


    toHaveValue

    readonly toHaveValue: (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