vscode-jest-runner
vscode-jest-runner copied to clipboard
Supporting multiple config paths depending on the test file extension
Current state
I have multiple jest test suite types, each requiring different configuration files. Each suite type has a distinct file extension. For example:
- integration tests - files ending with
.int.test.ts- required-cconfiguration./jest.config.int.js - end to end tests - files ending with
.e2e.test.ts- required-cconfiguration./jest.config.e2e.js - unit tests - files ending with
.unit.test.ts- required-cconfiguration./jest.config.jsetc.
Unfortunately, vscode-jest-runner does not allow setting varying configuration files depending on file mask. I've also been using https://github.com/formulahendry/vscode-code-runner extension and I am able to have distinct configurations set there using the executorMapByGlob setting, i.e.
"code-runner.executorMapByGlob": {
"*.e2e.test.ts": "npx jest --config jest.config.e2e.js",
"*.e2e.test.js": "npx jest --config jest.config.e2e.js",
"*.int.test.ts": "npx jest --config jest.config.int.js",
"*.int.test.js": "npx jest --config jest.config.int.js",
"*.unit.test.ts": "npx jest",
"*.unit.test.js": "npx jest",
...
},
Expected state
It would be very helpful if one could designate multiple jest config files depending on the extension of the test file being executed.
Is it the same feature as #309?