You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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]>
Copy file name to clipboardExpand all lines: docs/guides/testing-single-file-components-with-jest.md
+2
Original file line number
Diff line number
Diff line change
@@ -55,6 +55,8 @@ Next, create a `jest` block in `package.json`:
55
55
56
56
> **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).
57
57
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
+
58
60
### Handling webpack Aliases
59
61
60
62
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