diff --git a/.circleci/config.yml b/.circleci/config.yml index 9c2ed2bf9a6b..a29f7e918b73 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -49,7 +49,7 @@ jobs: steps: - checkout - node/install: - lts: true + node-version: '14' install-npm: false - node/install-packages: *install - run: @@ -70,5 +70,5 @@ workflows: partial: true matrix: parameters: - node-version: ['10', '12', '15', '16'] + node-version: ['10', '12', '15', '16', '17'] - test-jest-jasmine diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index cfcbc9a1d0ab..a37e014a732d 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -69,7 +69,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: [10.x, 12.x, 14.x, 15.x, 16.x] + node-version: [10.x, 12.x, 14.x, 15.x, 16.x, 17.x] os: [ubuntu-latest, macOS-latest, windows-latest] runs-on: ${{ matrix.os }} needs: prepare-yarn-cache diff --git a/CHANGELOG.md b/CHANGELOG.md index c37f53b3699e..3ca7f7a06dde 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,33 @@ ### Performance +## 27.4.0 + +### Features + +- `[expect]` Enhancing the `toHaveProperty` matcher to support array selection ([#12092](https://github.com/facebook/jest/pull/12092)) +- `[jest-core]` Add support for `testResultsProcessor` written in ESM ([#12006](https://github.com/facebook/jest/pull/12006)) +- `[jest-diff, pretty-format]` Add `compareKeys` option for custom sorting of object keys ([#11992](https://github.com/facebook/jest/pull/11992)) +- `[jest-mock]` Add `ts-jest` mock util functions ([#12089](https://github.com/facebook/jest/pull/12089)) + +### Fixes + +- `[expect]` Allow again `expect.Matchers` generic with single value ([#11986](https://github.com/facebook/jest/pull/11986)) +- `[jest-circus, jest-jasmine2]` Avoid false concurrent test failures due to unhandled promise rejections ([#11987](https://github.com/facebook/jest/pull/11987)) +- `[jest-config]` Add missing `slash` dependency to `package.json` ([#12080](https://github.com/facebook/jest/pull/12080)) +- `[jest-core]` Incorrect detection of open ZLIB handles ([#12022](https://github.com/facebook/jest/pull/12022)) +- `[jest-diff]` Break dependency cycle ([#10818](https://github.com/facebook/jest/pull/10818)) +- `[jest-environment-jsdom]` Add `@types/jsdom` dependency ([#11999](https://github.com/facebook/jest/pull/11999)) +- `[jest-environment-jsdom]` Do not reset the global.document too early on teardown ([#11871](https://github.com/facebook/jest/pull/11871)) +- `[jest-transform]` Improve error and warning messages ([#11998](https://github.com/facebook/jest/pull/11998)) + +### Chore & Maintenance + +- `[docs]` CLI options alphabetized ([#11586](https://github.com/facebook/jest/pull/11586)) +- `[jest-runner]` Add info regarding timers to forcedExit message([#12083](https://github.com/facebook/jest/pull/12083)) +- `[*]` Replaced `substr` method with `substring` ([#12066](https://github.com/facebook/jest/pull/12066)) +- `[*]` Add `types` entry to all export maps ([#12073](https://github.com/facebook/jest/pull/12073)) + ## 27.3.1 ### Fixes diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 08bae3d7ba7c..a276b16e449f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,7 +42,7 @@ _Before_ submitting a pull request, please make sure the following is done… python --version ``` -1. Make sure you have a compatible version of `node` installed (As of April 14th 2021, `v14.x` is recommended). +1. Make sure you have a compatible version of `node` installed (As of October 29th 2021, `v16.x` is recommended). ```sh node -v diff --git a/README.md b/README.md index 0a30e3fdb221..c93a0ff72e72 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@
-
+
@@ -176,7 +176,7 @@ Jest can be used in projects that use [webpack](https://webpack.js.org/) to mana
### Using parcel
-Jest can be used in projects that use [parcel-bundler](https://parceljs.org/) to manage assets, styles, and compilation similar to webpack. Parcel requires zero configuration. Refer to the official [docs](https://parceljs.org/getting_started.html) to get started.
+Jest can be used in projects that use [parcel-bundler](https://parceljs.org/) to manage assets, styles, and compilation similar to webpack. Parcel requires zero configuration. Refer to the official [docs](https://parceljs.org/docs/) to get started.
### Using TypeScript
diff --git a/docs/BypassingModuleMocks.md b/docs/BypassingModuleMocks.md
index 5e48a05b9fb4..96dfa7462016 100644
--- a/docs/BypassingModuleMocks.md
+++ b/docs/BypassingModuleMocks.md
@@ -7,8 +7,7 @@ Jest allows you to mock out whole modules in your tests, which can be useful for
Consider writing a test case for this `createUser` function:
-```javascript
-// createUser.js
+```javascript title="createUser.js"
import fetch from 'node-fetch';
export const createUser = async () => {
diff --git a/docs/CLI.md b/docs/CLI.md
index e22c5df733e8..4d9af6aceb25 100644
--- a/docs/CLI.md
+++ b/docs/CLI.md
@@ -138,6 +138,10 @@ When this option is provided, Jest will assume it is running in a CI environment
Deletes the Jest cache directory and then exits without running tests. Will delete `cacheDirectory` if the option is passed, or Jest's default cache directory. The default cache directory can be found by calling `jest --showConfig`. _Note: clearing the cache will reduce performance._
+### `--clearMocks`
+
+Automatically clear mock calls, instances and results before every test. Equivalent to calling [`jest.clearAllMocks()`](JestObjectAPI.md#jestclearallmocks) before each test. This does not remove any mock implementation that may have been provided.
+
### `--collectCoverageFrom=