Skip to content

Commit 033e58f

Browse files
committed
Add documentation for environment variable exclusion
1 parent 8df1735 commit 033e58f

3 files changed

Lines changed: 23 additions & 0 deletions

File tree

‎src/content/docs/reference/endform-config-ts.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,18 @@ By default the following environment variables are automatically transferred:
8585
- Environment variables that start with `E2E_`
8686
- All environment variables that are set in your `playwright.config.ts`
8787

88+
#### Excluding environment variables
89+
90+
Prefix a pattern with `!` to exclude matching environment variables, including ones that would be transferred automatically:
91+
92+
```ts
93+
import { defineEndformConfig } from "endform";
94+
95+
export default defineEndformConfig({
96+
environmentVariables: ["!^PLAYWRIGHT_BDD_CONFIGS$"],
97+
});
98+
```
99+
88100
### `extraHttpHeaders`
89101

90102
Set extra HTTP headers that will be applied to the Playwright browser contexts when tests run on remote runners. The value is an object mapping header names to string values.

‎src/content/docs/reference/endform-config.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,16 @@ By default the following environment variables are automatically transferred:
8484
- Environment variables that start with `E2E_`
8585
- All environment variables that are set in your `playwright.config.ts`
8686

87+
#### Excluding environment variables
88+
89+
Prefix a pattern with `!` to exclude matching environment variables, including ones that would be transferred automatically:
90+
91+
```json
92+
{
93+
"environmentVariables": ["!^PLAYWRIGHT_BDD_CONFIGS$"]
94+
}
95+
```
96+
8797
### `extraHttpHeaders`
8898

8999
Set extra HTTP headers that will be applied to the Playwright browser contexts when tests run on remote runners. The value is a JSON object mapping header names to string values.

‎src/content/docs/reference/environment-variables.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ At a high level:
1414
- `E2E_*` variables are transferred automatically.
1515
- Variables referenced from tests via `process.env` are transferred automatically.
1616
- You can explicitly include additional variables with `environmentVariables`.
17+
- You can exclude variables with `!`-prefixed patterns in `environmentVariables`, for example `"!^PLAYWRIGHT_BDD_CONFIGS$"`. Exclusions take precedence over everything above.
1718

1819
## Runtime marker: `ENDFORM=true`
1920

0 commit comments

Comments
 (0)