From b2ec50d9199abdaf897ddeefb4a36e0381ef816d Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sat, 19 Oct 2024 11:17:28 +0200 Subject: [PATCH] docs/tooling: add doc for new rejectFrontendNetworkRequests option Signed-off-by: Patrik Oldsberg --- docs/tooling/cli/02-build-system.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/tooling/cli/02-build-system.md b/docs/tooling/cli/02-build-system.md index f1fb5f6c9e..468e848694 100644 --- a/docs/tooling/cli/02-build-system.md +++ b/docs/tooling/cli/02-build-system.md @@ -556,6 +556,22 @@ The overrides in a single `package.json` may for example look like this: }, ``` +### Additional Configuration Options + +When using the built-in `@backstage/cli/config/jest` configuration the following options are available in addition to the standard Jest options. + +#### `rejectFrontendNetworkRequests` **[boolean]** + +Default: `false` + +If set to `true`, any attempt to make a network request in frontend package tests will result in an error. This option can only be set in the root `package.json` and will apply to all frontend packages in the monorepo. + +```json title="Example - in your root package.json" + "jest": { + "rejectFrontendNetworkRequests": true + }, +``` + ## Caching Caching is used sparingly throughout the Backstage build system. It is always used as a way to squeeze out a little bit of extra performance, rather than requirement to keep things fast. The following is a list of places where optional caching is available: