vscode-jest-runner icon indicating copy to clipboard operation
vscode-jest-runner copied to clipboard

create jestrunner.configPath mapping

Open oitan opened this issue 2 years ago • 3 comments
trafficstars

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.

oitan avatar Apr 18 '23 11:04 oitan

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

mattcasey avatar Jul 24 '23 19:07 mattcasey

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

domsleee avatar Oct 15 '23 04:10 domsleee