Skip to content

Commit f9783fd

Browse files
thedamonlmiller1990
andcommitted
docs: note babel-bridge in Jest SFC instructions (#1268)
* note babel-bridge in Jest SFC instructions Because of vue-jest's dependency on babel-core (babel 6), if you're using babel 7 your tests will fail. * fix: lint Co-authored-by: Lachlan <[email protected]>
1 parent 1630799 commit f9783fd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: docs/guides/testing-single-file-components-with-jest.md

+2
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ Next, create a `jest` block in `package.json`:
5555

5656
> **Note:** `vue-jest` currently does not support all the features of `vue-loader`, for example custom block support and style loading. In addition, some webpack-specific features such as code-splitting are not supported either. To use these unsupported features, you need to use Mocha instead of Jest to run your tests, and webpack to compile your components. To get started, read the guide on [testing SFCs with Mocha + webpack](./testing-single-file-components-with-mocha-webpack.md).
5757
58+
> **Note:** If you are using Babel 7 or higher, you will need to add [babel-bridge](https://github.com/babel/babel-bridge) to your devDependencies (`$ npm install --save-dev babel-core@^7.0.0-bridge.0`).
59+
5860
### Handling webpack Aliases
5961

6062
If you use a resolve alias in the webpack config, e.g. aliasing `@` to `/src`, you need to add a matching config for Jest as well, using the `moduleNameMapper` option:

0 commit comments

Comments
 (0)