Skip to content

Test UI: Provide a mechanism to control sort order other than by label #130882

@smcenlly

Description

@smcenlly

The Test Explorer Sort By Location uses the test label as the sort key when a uri and range is not provided. Depending on the test runner, intermediary nodes in the Test Explorer may be show (for example, for describe blocks).

For example, you may have a test file with a structure as shown below:

- src/components/feature/app.spec.ts
    - describe block Z
            - test 1 (Line 100)
    - describe block A
            - test 2 (Line 200)

In this case, the range and uri exist only for the test 1 and test 2 nodes. This results in the order of the nodes being ordered as shown below (line 200 is before line 100):

- src/components/feature/app.spec.ts
    - describe block A
            - test 2 (Line 200)
    - describe block Z
            - test 1 (Line 100)

As an extension developer, it would be nice to be able to control the sort order in this case. I guess it's possible for the sort order of leaf nodes to ripple up to the parents and you wouldn't have this problem.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions