Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Node version support in README and docs #5622

Merged
merged 1 commit into from
Feb 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* `[jest-runtime]` Provide `require.main` property set to module with test suite
([#5618](https://github.com/facebook/jest/pull/5618))
* `[docs]` Add note about Node version support ([#5622](https://github.com/facebook/jest/pull/5622))

## 22.4.0

Expand Down
22 changes: 10 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ Or via [`yarn`](https://yarnpkg.com/en/package/jest):
yarn add --dev jest
```

The minimum supported Node version is `v6.0.0` by default. If you need to
support Node 4, refer to the
[Compatibility issues](https://facebook.github.io/jest/docs/en/troubleshooting.html#compatibility-issues)
section.

Let's get started by writing a test for a hypothetical function that adds two
numbers. First, create a `sum.js` file:

Expand Down Expand Up @@ -96,23 +101,16 @@ page.

### Using Babel

To use [Babel](http://babeljs.io/), install the `babel-jest` and
`regenerator-runtime` packages:
[Babel](http://babeljs.io/) is automatically handled by Jest using `babel-jest`.
You don't need install anything extra for using Babel.

```bash
npm install --save-dev babel-jest babel-core regenerator-runtime
```

> Note: If you are using a babel version 7 then you need to install `babel-jest`
> with the following command:
> Note: If you are using a babel version 7 then you need to install
> `babel-core@^7.0.0-0` and `@babel/core` with the following command:
>
> ```bash
> npm install --save-dev babel-jest 'babel-core@^7.0.0-0' @babel/core regenerator-runtime
> npm install --save-dev 'babel-core@^7.0.0-0' @babel/core
> ```

_Note: Explicitly installing `regenerator-runtime` is not needed if you use
`npm` 3 or 4 or Yarn_

Don't forget to add a [`.babelrc`](https://babeljs.io/docs/usage/babelrc/) file
in your project's root folder. For example, if you are using ES6 and
[React.js](https://facebook.github.io/react/) with the
Expand Down
7 changes: 6 additions & 1 deletion docs/Troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,12 @@ option to `jasmine1` or pass `--testRunner=jasmine1` as a command line option.

Jest takes advantage of new features added to Node 6. We recommend that you
upgrade to the latest stable release of Node. The minimum supported version is
`v6.0.0`. Versions `0.x.x` and `4.x.x` are not supported.
`v6.0.0`. Versions `0.x.x` and `4.x.x` are not supported because the `jsdom`
version used in Jest doesn't support Node 4. However, if you need to run Jest on
Node 4, you can use the `testEnvironment` config to use a
[custom environment](https://facebook.github.io/jest/docs/en/configuration.html#testenvironment-string)
that supports Node 4, such as
[`jest-environment-node`](https://www.npmjs.com/package/jest-environment-node).

### `coveragePathIgnorePatterns` seems to not have any effect.

Expand Down