Skip to content
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 @@ -14,6 +14,7 @@
### Chore & Maintenance

- `[docs]` Fix babel-core installation instructions ([#6745](https://github.com/facebook/jest/pull/6745))
- `[examples]` add example using Babel 7 ([#6983](https://github.com/facebook/jest/pull/6983))

### Chore & Maintenance

Expand Down
4 changes: 4 additions & 0 deletions docs/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ yarn add --dev babel-jest babel-core regenerator-runtime
> ```bash
> yarn add --dev babel-jest babel-core@^7.0.0-bridge.0 @babel/core regenerator-runtime
> ```
>
> You will need to use `babel.config.js` in order to transpile `node_modules`. See https://babeljs.io/docs/en/next/config-files for more information.
>
> You can also see the example in the Jest repository: https://github.com/facebook/jest/tree/master/examples/babel-7

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

Expand Down
9 changes: 9 additions & 0 deletions examples/babel-7/__tests__/index.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright 2004-present Facebook. All Rights Reserved.

'use strict';

import {double} from '../index';

it('works with `import`', () => {
expect(double(5)).toBe(10);
});
5 changes: 5 additions & 0 deletions examples/babel-7/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

module.exports = {
presets: ['@babel/preset-env'],
};
5 changes: 5 additions & 0 deletions examples/babel-7/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2004-present Facebook. All Rights Reserved.

export function double(input) {
return input * 2;
}
15 changes: 15 additions & 0 deletions examples/babel-7/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"private": true,
"version": "0.0.0",
"name": "example-babel-7",
"devDependencies": {
"@babel/core": "*",
"@babel/preset-env": "*",
"babel-core": "7.0.0-bridge.0",
"babel-jest": "*",
"jest": "*"
},
"scripts": {
"test": "jest"
}
}
4 changes: 4 additions & 0 deletions website/versioned_docs/version-22.0/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ npm install --save-dev babel-jest babel-core regenerator-runtime
> ```bash
> npm install --save-dev babel-jest babel-core@^7.0.0-bridge.0 @babel/core regenerator-runtime
> ```
>
> You will need to use `babel.config.js` in order to transpile `node_modules`. See https://babeljs.io/docs/en/next/config-files for more information.
>
> You can also see the example in the Jest repository: https://github.com/facebook/jest/tree/master/examples/babel-7

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

Expand Down
4 changes: 4 additions & 0 deletions website/versioned_docs/version-22.1/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ npm install --save-dev babel-jest babel-core regenerator-runtime
> ```bash
> npm install --save-dev babel-jest babel-core@^7.0.0-bridge.0 @babel/core regenerator-runtime
> ```
>
> You will need to use `babel.config.js` in order to transpile `node_modules`. See https://babeljs.io/docs/en/next/config-files for more information.
>
> You can also see the example in the Jest repository: https://github.com/facebook/jest/tree/master/examples/babel-7

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

Expand Down
4 changes: 4 additions & 0 deletions website/versioned_docs/version-22.2/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ npm install --save-dev babel-jest babel-core regenerator-runtime
> ```bash
> npm install --save-dev babel-jest babel-core@^7.0.0-bridge.0 @babel/core regenerator-runtime
> ```
>
> You will need to use `babel.config.js` in order to transpile `node_modules`. See https://babeljs.io/docs/en/next/config-files for more information.
>
> You can also see the example in the Jest repository: https://github.com/facebook/jest/tree/master/examples/babel-7

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

Expand Down
4 changes: 4 additions & 0 deletions website/versioned_docs/version-22.3/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ npm install --save-dev babel-jest babel-core regenerator-runtime
> ```bash
> npm install --save-dev babel-jest babel-core@^7.0.0-bridge.0 @babel/core regenerator-runtime
> ```
>
> You will need to use `babel.config.js` in order to transpile `node_modules`. See https://babeljs.io/docs/en/next/config-files for more information.
>
> You can also see the example in the Jest repository: https://github.com/facebook/jest/tree/master/examples/babel-7

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

Expand Down
4 changes: 4 additions & 0 deletions website/versioned_docs/version-22.4/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ yarn add --dev babel-jest babel-core regenerator-runtime
> ```bash
> yarn add --dev babel-jest babel-core@^7.0.0-bridge.0 @babel/core regenerator-runtime
> ```
>
> You will need to use `babel.config.js` in order to transpile `node_modules`. See https://babeljs.io/docs/en/next/config-files for more information.
>
> You can also see the example in the Jest repository: https://github.com/facebook/jest/tree/master/examples/babel-7

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

Expand Down
4 changes: 4 additions & 0 deletions website/versioned_docs/version-23.2/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ yarn add --dev babel-jest babel-core regenerator-runtime
> ```bash
> yarn add --dev babel-jest babel-core@^7.0.0-bridge.0 @babel/core regenerator-runtime
> ```
>
> You will need to use `babel.config.js` in order to transpile `node_modules`. See https://babeljs.io/docs/en/next/config-files for more information.
>
> You can also see the example in the Jest repository: https://github.com/facebook/jest/tree/master/examples/babel-7

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

Expand Down
Loading