Sometimes it might be necessary to provide cli options to jest that are decided at "runtime".
Example below of a debug configuration for running tests in vscode:
{
"configurations": [
{
"type": "node",
"name": "vscode-jest-tests.v2",
"request": "launch",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "ng",
"args": [
"test",
"etips-utils",
"--run-in-band",
"--watch-all=false",
"--test-name-pattern",
"${jest.testNamePattern}",
"--test-path-pattern",
"${jest.testFile}"
]
}
]
}
Command
test
Description
Sometimes it might be necessary to provide cli options to jest that are decided at "runtime".
Example below of a debug configuration for running tests in vscode:
Describe the solution you'd like
The project https://github.com/just-jeb/angular-builders implements an approach to allowing jest cli options.
https://github.com/just-jeb/angular-builders/blob/8f00fd9b324d0151f722a4e962fcbeab7891baae/packages/jest/src/index.ts#L37C11-L37C11
Describe alternatives you've considered
Alternative is to use https://github.com/just-jeb/angular-builders, but the build requires a lot more configuration to work with angular and esm.