Skip to content

Commit d077f2e

Browse files
authored
Add environment variables docs page (#10630)
1 parent e617969 commit d077f2e

8 files changed

Lines changed: 42 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
### Features
44

5-
- `[docs]` Add step for fetching `backers.json` file in website setup docs ([#10631](https://github.com/facebook/jest/pull/10631))
65
- `[jest-cli, jest-config]` Add support for the `jest.config.ts` configuration file ([#10564](https://github.com/facebook/jest/pull/10564))
76

87
### Fixes
@@ -11,6 +10,9 @@
1110

1211
### Chore & Maintenance
1312

13+
- `[docs]` Add step for fetching `backers.json` file in website setup docs ([#10631](https://github.com/facebook/jest/pull/10631))
14+
- `[docs]` Add page detailing environment variables set by Jest ([#10630](https://github.com/facebook/jest/pull/10630))
15+
1416
### Performance
1517

1618
## 26.5.3

docs/EnvironmentVariables.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
id: environment-variables
3+
title: Environment Variables
4+
---
5+
6+
Jest sets the following environment variables:
7+
8+
### `NODE_ENV`
9+
10+
Set to `'test'` if it's not already set to something else.
11+
12+
### `JEST_WORKER_ID`
13+
14+
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.

website/sidebars.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
"mock-function-api",
4040
"jest-object",
4141
"configuration",
42-
"cli"
42+
"cli",
43+
"environment-variables"
4344
]
4445
}
4546
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
id: version-22.x-environment-variables
3+
title: Environment Variables
4+
original_id: environment-variables
5+
---
6+
7+
Jest sets the following environment variables:
8+
9+
### `NODE_ENV`
10+
11+
Set to `'test'` if it's not already set to something else.
12+
13+
### `JEST_WORKER_ID`
14+
15+
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.

website/versioned_sidebars/version-22.x-sidebars.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
"version-22.x-mock-function-api",
3434
"version-22.x-jest-object",
3535
"version-22.x-configuration",
36-
"version-22.x-cli"
36+
"version-22.x-cli",
37+
"version-22.x-environment-variables"
3738
]
3839
}
3940
}

website/versioned_sidebars/version-23.x-sidebars.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
"version-23.x-mock-function-api",
3737
"version-23.x-jest-object",
3838
"version-23.x-configuration",
39-
"version-23.x-cli"
39+
"version-23.x-cli",
40+
"version-23.x-environment-variables"
4041
]
4142
}
4243
}

website/versioned_sidebars/version-24.x-sidebars.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
"version-24.x-mock-function-api",
3939
"version-24.x-jest-object",
4040
"version-24.x-configuration",
41-
"version-24.x-cli"
41+
"version-24.x-cli",
42+
"version-24.x-environment-variables"
4243
]
4344
}
4445
}

website/versioned_sidebars/version-26.0-sidebars.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
"version-26.0-mock-function-api",
4040
"version-26.0-jest-object",
4141
"version-26.0-configuration",
42-
"version-26.0-cli"
42+
"version-26.0-cli",
43+
"version-26.0-environment-variables"
4344
]
4445
}
4546
}

0 commit comments

Comments
 (0)