Skip to content

Commit

Permalink
docs(upgrading): detail changes to NodeEnvironment export (#12812)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicojs committed May 6, 2022
1 parent 3390ec4 commit 8433c5c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/UpgradingToJest28.md
Expand Up @@ -140,6 +140,16 @@ The constructor of [test environment](Configuration.md#testenvironment-string) c
+ const config = projectConfig;
```

In addition, test environments are now exported with the name `TestEnvironment`, instead of simply exporting the class directly:

```diff
- const TestEnvironment = require('jest-environment-node');
+ const {TestEnvironment} = require('jest-environment-node');

- const TestEnvironment = require('jest-environment-jsdom');
+ const {TestEnvironment} = require('jest-environment-jsdom');
```

### `jsdom`

If you are using JSDOM [test environment](Configuration.md#testenvironment-string), `jest-environment-jsdom` package now must be installed separately:
Expand Down
10 changes: 10 additions & 0 deletions website/versioned_docs/version-28.0/UpgradingToJest28.md
Expand Up @@ -140,6 +140,16 @@ The constructor of [test environment](Configuration.md#testenvironment-string) c
+ const config = projectConfig;
```

In addition, test environments are now exported with the name `TestEnvironment`, instead of simply exporting the class directly:

```diff
- const TestEnvironment = require('jest-environment-node');
+ const {TestEnvironment} = require('jest-environment-node');

- const TestEnvironment = require('jest-environment-jsdom');
+ const {TestEnvironment} = require('jest-environment-jsdom');
```

### `jsdom`

If you are using JSDOM [test environment](Configuration.md#testenvironment-string), `jest-environment-jsdom` package now must be installed separately:
Expand Down

0 comments on commit 8433c5c

Please sign in to comment.