A TestRun represents an in-progress or completed test run and provides methods to report the state of individual tests in the run.

Implements

Constructors

Properties

changeBatcher: ChangeBatcher = ...
controller: TestControllerImpl
ended: boolean
id: string
isPersisted: boolean

Whether the test run will be persisted across reloads by the editor.

name: string

The human-readable name of the run. This can be used to disambiguate multiple sets of results in a test run. It is useful if tests are run across multiple platforms, for example.

onDidDispose: Event<void> = ...

An event fired when the editor is no longer interested in data associated with the test run.

onDidDisposeEmitter: Emitter<void> = ...
onDidEnd: Event<void> = ...
onDidEndEmitter: Emitter<void> = ...
onWillFlush: Event<void> = ...
onWillFlushEmitter: Emitter<void> = ...
testOutputDeltas: TestOutputDTO[] = []
testStateDeltas: Map<TestItem, TestStateChangeDTO> = ...
tokenSource: CancellationTokenSource

Accessors

Methods

  • Appends raw output from the test runner. On the user's request, the output will be displayed in a terminal. ANSI escape sequences, such as colors and text styles, are supported. New lines must be given as CRLF (\r\n) rather than LF (\n).

    Parameters

    • output: string

      Output text to append.

    • Optional location: Location

      Indicate that the output was logged at the given location.

    • Optional test: TestItem

      Test item to associate the output with.

    Returns void

  • Indicates a test has errored. You should pass one or more TestMessages to describe the failure. This differs from the "failed" state in that it indicates a test that couldn't be executed at all, from a compilation error for example.

    Parameters

    • test: TestItem

      Test item to update.

    • message: TestMessage | readonly TestMessage[]

      Messages associated with the test failure.

    • Optional duration: number

      How long the test took to execute, in milliseconds.

    Returns void