Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TestMessage

Message associated with the test state. Can be linked to a specific source range -- useful for assertion failures, for example.

Hierarchy

  • TestMessage

Index

Methods(1)

Constructors(1)

Properties(5)

Methods(1)

Static diff

  • Creates a new TestMessage that will present as a diff in the editor.

    Parameters

    • message: string | MarkdownString

      Message to display to the user.

    • expected: string

      Expected output.

    • actual: string

      Actual output.

    Returns TestMessage

Constructors(1)

constructor

Properties(5)

message

message: string | MarkdownString

Human-readable message text to display.

Optional expectedOutput

expectedOutput: string

Expected test output. If given with actualOutput, a diff view will be shown.

Optional actualOutput

actualOutput: string

Actual test output. If given with expectedOutput, a diff view will be shown.

Optional location

location: Location

Associated file location.

Optional contextValue

contextValue: string

Context value of the test item. This can be used to contribute message- specific actions to the test peek view. The value set here can be found in the testMessage property of the following menus contribution points:

  • testing/message/context - context menu for the message in the results tree
  • testing/message/content - a prominent button overlaying editor content where the message is displayed.

For example:

"contributes": {
  "menus": {
    "testing/message/content": [
      {
        "command": "extension.deleteCommentThread",
        "when": "testMessage == canApplyRichDiff"
      }
    ]
  }
}

The command will be called with an object containing:

Generated by TypeDoc. Maintained by 洛竹