调试/执行 单元测试报错的问题解决方案 #53
cuixiaorui
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
问题
当执行vue3源码的单元测试时,你会发现一个报错

解决
这时候你在点击单元测试的 Run / Debug 按钮就可以成功执行单测了
why
这是一个 jest 的问题,当通过点击 Run/Debug 按钮执行单测的时候
实际上执行的文件是 node_modules/.bin/jest 文件, 而报错就是由这个文件引起的
但是执行 node_modules/jest/bin/jest.js 文件的话 就不会出错
所以直接修改 jestrunner 的 jestPath 让插件执行 "node_modules/jest/bin/jest.js"
目前这个 issue 还是 open 的状态 issue 传送门
Beta Was this translation helpful? Give feedback.
All reactions