diff --git a/CHANGELOG.md b/CHANGELOG.md index aa6b581532d6..4c8dad693ee8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,6 @@ ### Features -- `[docs]` Add step for fetching `backers.json` file in website setup docs ([#10631](https://github.com/facebook/jest/pull/10631)) - `[jest-cli, jest-config]` Add support for the `jest.config.ts` configuration file ([#10564](https://github.com/facebook/jest/pull/10564)) ### Fixes @@ -11,6 +10,9 @@ ### Chore & Maintenance +- `[docs]` Add step for fetching `backers.json` file in website setup docs ([#10631](https://github.com/facebook/jest/pull/10631)) +- `[docs]` Add page detailing environment variables set by Jest ([#10630](https://github.com/facebook/jest/pull/10630)) + ### Performance ## 26.5.3 diff --git a/docs/EnvironmentVariables.md b/docs/EnvironmentVariables.md new file mode 100644 index 000000000000..fb50c3e72d08 --- /dev/null +++ b/docs/EnvironmentVariables.md @@ -0,0 +1,14 @@ +--- +id: environment-variables +title: Environment Variables +--- + +Jest sets the following environment variables: + +### `NODE_ENV` + +Set to `'test'` if it's not already set to something else. + +### `JEST_WORKER_ID` + +Each worker process is assigned a unique id (index-based that starts with `1`). This is set to `1` for all tests when [`runInBand`](CLI.md#--runinband) is set to true. diff --git a/website/sidebars.json b/website/sidebars.json index 3c4cc29d4399..1cb762c601d6 100644 --- a/website/sidebars.json +++ b/website/sidebars.json @@ -39,7 +39,8 @@ "mock-function-api", "jest-object", "configuration", - "cli" + "cli", + "environment-variables" ] } } diff --git a/website/versioned_docs/version-22.x/EnvironmentVariables.md b/website/versioned_docs/version-22.x/EnvironmentVariables.md new file mode 100644 index 000000000000..87ba1381f2e8 --- /dev/null +++ b/website/versioned_docs/version-22.x/EnvironmentVariables.md @@ -0,0 +1,15 @@ +--- +id: version-22.x-environment-variables +title: Environment Variables +original_id: environment-variables +--- + +Jest sets the following environment variables: + +### `NODE_ENV` + +Set to `'test'` if it's not already set to something else. + +### `JEST_WORKER_ID` + +Each worker process is assigned a unique id (index-based that starts with `1`). This is set to `1` for all tests when [`runInBand`](CLI.md#--runinband) is set to true. diff --git a/website/versioned_sidebars/version-22.x-sidebars.json b/website/versioned_sidebars/version-22.x-sidebars.json index 5519b94c5267..630569168d5f 100644 --- a/website/versioned_sidebars/version-22.x-sidebars.json +++ b/website/versioned_sidebars/version-22.x-sidebars.json @@ -33,7 +33,8 @@ "version-22.x-mock-function-api", "version-22.x-jest-object", "version-22.x-configuration", - "version-22.x-cli" + "version-22.x-cli", + "version-22.x-environment-variables" ] } } diff --git a/website/versioned_sidebars/version-23.x-sidebars.json b/website/versioned_sidebars/version-23.x-sidebars.json index c681767309d2..de96dc37c761 100644 --- a/website/versioned_sidebars/version-23.x-sidebars.json +++ b/website/versioned_sidebars/version-23.x-sidebars.json @@ -36,7 +36,8 @@ "version-23.x-mock-function-api", "version-23.x-jest-object", "version-23.x-configuration", - "version-23.x-cli" + "version-23.x-cli", + "version-23.x-environment-variables" ] } } diff --git a/website/versioned_sidebars/version-24.x-sidebars.json b/website/versioned_sidebars/version-24.x-sidebars.json index b9317eec8d8d..70a7968ade02 100644 --- a/website/versioned_sidebars/version-24.x-sidebars.json +++ b/website/versioned_sidebars/version-24.x-sidebars.json @@ -38,7 +38,8 @@ "version-24.x-mock-function-api", "version-24.x-jest-object", "version-24.x-configuration", - "version-24.x-cli" + "version-24.x-cli", + "version-24.x-environment-variables" ] } } diff --git a/website/versioned_sidebars/version-26.0-sidebars.json b/website/versioned_sidebars/version-26.0-sidebars.json index c69d3ac005d8..d791b145a933 100644 --- a/website/versioned_sidebars/version-26.0-sidebars.json +++ b/website/versioned_sidebars/version-26.0-sidebars.json @@ -39,7 +39,8 @@ "version-26.0-mock-function-api", "version-26.0-jest-object", "version-26.0-configuration", - "version-26.0-cli" + "version-26.0-cli", + "version-26.0-environment-variables" ] } }