Message associated with the test state. Can be linked to a specific source range -- useful for assertion failures, for example.
Static methods
staticdiff(message:EitherType<String, MarkdownString>, expected:String, actual:String):TestMessage
Creates a new TestMessage that will present as a diff in the editor.
Parameters:
message | Message to display to the user. |
|---|---|
expected | Expected output. |
actual | Actual output. |
Constructor
new(message:EitherType<String, MarkdownString>)
Creates a new TestMessage instance.
Parameters:
message | The message to show to the user. |
|---|
Variables
actualOutput:Null<String>
Actual test output. If given with {@link TestMessage.expectedOutput expectedOutput }, a diff view will be shown.
contextValue:Null<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 treetesting/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:
- test: the {@link TestItem} the message is associated with, if it
is still present in the {@link TestController.items} collection.
- message: the {@link TestMessage} instance.
expectedOutput:Null<String>
Expected test output. If given with {@link TestMessage.actualOutput actualOutput }, a diff view will be shown.
stackTrace:Null<Array<TestMessageStackFrame>>
The stack trace associated with the message or failure.