From 70f9655034bab4a8fb3fdba6e8678fb4eab7dfdb Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 14 Feb 2022 20:53:52 +0100 Subject: [PATCH] docs: add suggestion to disable full test runs in Jest editor integration Signed-off-by: Patrik Oldsberg --- docs/local-dev/cli-build-system.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/local-dev/cli-build-system.md b/docs/local-dev/cli-build-system.md index 5df9b751c5..c4a08afc56 100644 --- a/docs/local-dev/cli-build-system.md +++ b/docs/local-dev/cli-build-system.md @@ -465,11 +465,18 @@ 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 something like this: -```json +```jsonc { - "jest.jestCommandLine": "node_modules/.bin/jest --config node_modules/@backstage/cli/config/jest.js" + "jest.jestCommandLine": "node_modules/.bin/jest --config node_modules/@backstage/cli/config/jest.js", + // In a large repo like the Backstage main repo you likely want to disable + // watch mode and the initial test run too, leaving just manual and perhaps + // on-save test runs in place. + "jest.autoRun": { + "watch": false, + "onSave": "test-src-file" + } } ```