A TestRunProfile describes one way to execute tests in a TestController.

Implements

Constructors

Properties

_isDefault: boolean
configureHandler: (() => undefined | void)

If this method is present, a configuration gear will be present in the UI, and this method will be invoked when it's clicked. When called, you can take other editor actions, such as showing a quick pick or opening a configuration file.

Type declaration

    • (): undefined | void
    • Returns undefined | void

controllerId: string

Configures what kind of execution this profile controls. If there are no profiles for a kind, it will not be available in the UI.

label: string

Label shown to the user in the UI.

Note that the label has some significance if the user requests that tests be re-run in a certain way. For example, if tests were run normally and the user requests to re-run them in debug mode, the editor will attempt use a configuration with the same label of the Debug kind. If there is no such configuration, the default will be used.

onDidChangeDefault: Event<boolean> = ...

Fired when a user has changed whether this is a default profile. The event contains the new value of isDefault

onDidChangeDefaultEmitter: Emitter<boolean> = ...
profileId: string
runHandler: ((request, token) => void | Thenable<void>)

Handler called to start a test run. When invoked, the function should call TestController.createTestRun at least once, and all test runs associated with the request should be created before the function returns or the returned promise is resolved.

If supportsContinuousRun is set, then TestRunRequest.continuous may be true. In this case, the profile should observe changes to source code and create new test runs by calling TestController.createTestRun, until the cancellation is requested on the token.

Type declaration

supportsContinuousRun: boolean = false

Whether this profile supports continuous running of requests. If so, then TestRunRequest.continuous may be set to true. Defaults to false.

tag: undefined | TestTag

Associated tag for the profile. If this is set, only TestItem instances with the same tag will be eligible to execute in this profile.

Accessors

  • get isDefault(): boolean
  • Controls whether this profile is the default action that will be taken when its kind is actioned. For example, if the user clicks the generic "run all" button, then the default profile for TestRunProfileKind.Run will be executed, although the user can configure this.

    Changes the user makes in their default profiles will be reflected in this property after a onDidChangeDefault event.

    Returns boolean

  • set isDefault(isDefault): void
  • Controls whether this profile is the default action that will be taken when its kind is actioned. For example, if the user clicks the generic "run all" button, then the default profile for TestRunProfileKind.Run will be executed, although the user can configure this.

    Changes the user makes in their default profiles will be reflected in this property after a onDidChangeDefault event.

    Parameters

    • isDefault: boolean

    Returns void

Methods