【Vue Test Utils】Failed at the frontend@0.1.0 test:unit script.

 寫測試寫到一半,出現這個 bug

Failed at the frontend@0.1.0 test:unit script.


查了很多原因,普遍建議是刪掉 package-lock.json 再 npm install


但我做了之後卻沒有用


後來照這個方式修好了。如解說,是 snapshot 的問題,已更新 snapshot 的方式來解決

不過我是使用 vue-jest,具體下的command 是  npm run test:unit -- -u

留言