cli,docs: update jest transform to only include source maps when requested

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-02-12 16:47:41 +01:00
parent f1a9349446
commit 86ab640b20
4 changed files with 91 additions and 53 deletions
+25 -1
View File
@@ -465,7 +465,7 @@ The overrides in a single `package.json` may for example look like this:
},
```
If you want to configure editor integration for tests we recommend executing the bundled configuration directly with Jest, rather than running through the Yarn test script. For example, with the Jest extension for VS Code, the configuration would look like this:
If you want to configure editor integration for tests we recommend executing the bundled configuration directly with Jest, rather than running through the Yarn test script. For example, with the Jest extension for VS Code the configuration would look like this:
```json
{
@@ -473,6 +473,30 @@ If you want to configure editor integration for tests we recommend executing the
}
```
If you also want to enable source maps when debugging tests, you can do so by setting the `ENABLE_SOURCE_MAPS` environment variable. For example, a complete launch configuration for VS Code debugging may look like this:
```json
{
"type": "node",
"name": "vscode-jest-tests",
"request": "launch",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"program": "${workspaceFolder}/node_modules/.bin/jest",
"cwd": "${workspaceFolder}",
"env": {
"ENABLE_SOURCE_MAPS": "true"
},
"args": [
"--config",
"node_modules/@backstage/cli/config/jest.js",
"--runInBand",
"--watchAll=false"
]
}
```
## Publishing
Package publishing is an optional part of the Backstage build system and not