Options
All
  • Public
  • Public/Protected
  • All
Menu

An item shown in the "test explorer" view.

A TestItem can represent either a test suite or a test itself, since they both have similar capabilities.

层级

  • TestItem

索引

Properties(10)

Readonly id

id: string

Identifier for the TestItem. This is used to correlate test results and tests in the document with those in the workspace (test explorer). This cannot change for the lifetime of the TestItem, and must be unique among its parent's direct children.

Optional Readonly uri

uri: Uri

URI this TestItem is associated with. May be a file or directory.

Readonly children

The children of this test item. For a test suite, this may contain the individual test cases or nested suites.

Optional Readonly parent

parent: TestItem

The parent of this item. It's set automatically, and is undefined top-level items in the TestController.items and for items that aren't yet included in another item's children.

canResolveChildren

canResolveChildren: boolean

Indicates whether this test item may have children discovered by resolving.

If true, this item is shown as expandable in the Test Explorer view and expanding the item will cause TestController.resolveHandler to be invoked with the item.

Default to false.

busy

busy: boolean

Controls whether the item is shown as "busy" in the Test Explorer view. This is useful for showing status while discovering children.

Defaults to false.

label

label: string

Display name describing the test case.

Optional description

description: string

Optional description that appears next to the label.

Optional range

range: Range

Location of the test item in its uri.

This is only meaningful if the uri points to a file.

Optional error

error: string | MarkdownString

Optional error encountered while loading the test.

Note that this is not a test result and should only be used to represent errors in test discovery, such as syntax errors.

友链:VS Code 中文文档 | VS Code 官网文档 | VS Code 扩展市场

Generated by TypeDoc. Maintained by 洛竹