Vue-cli3 jest unit test error reporting solution (does not support ES6)

Time:2020-5-25

When using the company project to try unit testing, the company usesjest, found and prompted ES6 related syntax error prompt, there are many online Baidu, various attempts still failed to solve

The final solution:

Using vue-cli3, we recreated a project with unit test, and found that it ran successfully. Then we copied the dependent version of unit test of the project to the company project, and the company project ran successfully, ✌️

And it turns out that you just need tobabel-jestThe version can be downgraded,
Vue-cli3 jest unit test error reporting solution (does not support ES6)

"babel-jest": "^23.6.0",

If it doesn’t work, remember to package.lock File deleted

Recommended Today

Analysis of super comprehensive MySQL statement locking (Part 1)

A series of articles: Analysis of super comprehensive MySQL statement locking (Part 1) Analysis of super comprehensive MySQL statement locking (Part 2) Analysis of super comprehensive MySQL statement locking (Part 2) Preparation in advance Build a system to store heroes of the Three KingdomsheroTable: CREATE TABLE hero ( number INT, name VARCHAR(100), country varchar(100), PRIMARY […]