connor4312 / nodejs-testing

VS Code integration for node:test native tests
MIT License
43 stars 6 forks source link

Multi-Root Workspace Test Discovery not Working #15

Closed NoelAbrahams closed 10 months ago

NoelAbrahams commented 10 months ago

Hi

Given a set up like the following:

Workspace Settings JSON

    "folders": [
        {
            "path": "aaa"
        },
        {
            "path": "bbb"
        },
        {
            "path": "ccc"
             // This contains hello.test.js
        },
  ]

We want to limit test discovery to folder 'ccc'. A setting like the following

"nodejs-testing.include": ["ccc"]

does not discover hello.test.js. Changing to "nodejs-testing.include": ["./"] does work, but that's not what we want.

connor4312 commented 10 months ago

In the latest release, I've added support for the ${workspaceFolder:name} variable. Relative patterns are applied to all workspaces, but you can use absolute paths in specific workspace folders. For example:

"nodejs-testing.include": [
    // includes myTests in workspace folderA
    "${workspaceFolder:folderA}/myTests",
    // includes allTests in all workspace folders
    "allTests"
]
NoelAbrahams commented 10 months ago

It's working as expected after the update. Thanks.