Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在用 :
{ "webpack": "^5.11.1", "mocha-webpack": "^2.0.0-beta.0", "nyc": "^15.1.0", }
我通常有 0% 的覆盖率,当我试图覆盖我用 express 制作的其余 API 时出现这个错误
注意:
终端截图
useColors在 Mocha 8 中已弃用。我认为该color方法应该替换它。
useColors
color
资料来源:PR删除useColorsmochajs/mocha
mochajs/mocha
为了"mocha": "^8.4.0"
"mocha": "^8.4.0"
虽然它在使用时有效mocha.color(true),但打字稿会抱怨:error TS2339: Property 'color' does not exist on type 'Mocha'..
mocha.color(true)
error TS2339: Property 'color' does not exist on type 'Mocha'.
相反,这很好用:mocha.options.color = true;
mocha.options.color = true;