firsttris / vscode-jest-runner

Simple way to run or debug one or more tests from context menu, codelens or command plalette
https://marketplace.visualstudio.com/items?itemName=firsttris.vscode-jest-runner
MIT License
264 stars 124 forks source link

create jestrunner.configPath mapping #309

Open oitan opened 1 year ago

oitan commented 1 year ago

In my project I have multiple different jest config files to different filename endings. Like *.api-spec.ts files use jest-backend-api.json, *.unit-spec.ts files use jest-unit.json.

Is there a possibility to map those, so that I can run them by pressing the run button on each test, and it chooses the correct config file itself.

Currently I use jestrunner.configPath to map to one file. If multiple mapping is not possible, this can be a feature request. Something like:

{
  "jestrunner.configPath": {
    "*.api-spec.ts": "jest-backend-api.json",
    "*.unit-spec.ts": "jest-unit.json"
  }
}

I'm happy to contribute, so just let me know if this is something I can take or it already exists.

mattcasey commented 1 year ago

This would be amazing, we have 3 different configurations (browser, backend, and e2e), so I'd love to be able to segment by folder

domsleee commented 11 months ago

It's not possible at the moment (jestrunner.configPath only accepts a string), but I think it could be added around getJestConfigPath 👍