从npm脚本运行伊斯坦布尔将错过测试
如果直接从终端运行以下命令,我会看到有233个测试正在运行从npm脚本运行伊斯坦布尔将错过测试,npm,istanbul,Npm,Istanbul,如果直接从终端运行以下命令,我会看到有233个测试正在运行 /node\u modules/.bin/伊斯坦布尔cover./node\u modules/.bin/\u mocha--compilers咖啡:咖啡脚本/注册--require./coffee-coverage-loader.js--require lib/bootstrap.coffee测试/lib/***.coffee 但是,如果我在我的package.json中将其设置为脚本,则如下所示: “coverage”:“/node
/node\u modules/.bin/伊斯坦布尔cover./node\u modules/.bin/\u mocha--compilers咖啡:咖啡脚本/注册--require./coffee-coverage-loader.js--require lib/bootstrap.coffee测试/lib/***.coffee
但是,如果我在我的package.json
中将其设置为脚本,则如下所示:
“coverage”:“/node\u modules/.bin/伊斯坦布尔cover./node\u modules/.bin/\u mocha----编译器咖啡:咖啡脚本/寄存器--require./coffee-coverage-loader.js--require lib/bootstrap.coffee test/lib/***.coffee”
运行npm运行覆盖率
我只看到74个测试已经运行
我的测试在test/lib/***.coffee
中
为什么通过npm
运行命令会导致它运行更少的测试
我注意到没有运行的测试在
test/lib/*/*/*/*。coffee
通过在npm
脚本中的glob模式周围添加引号来修复:
“coverage”:“/node\u modules/.bin/伊斯坦布尔cover./node\u modules/.bin/\u mocha--compilers coffee:coffee script/register--require./coffee-coffee-coverage-loader.js--require lib/bootstrap.coffee./test/lib/***.coffee”
我不知道为什么我必须将
/test/lib/***.coffee
放在引号中才能使其工作。通过在npm
脚本中的glob模式周围添加引号来修复:
“coverage”:“/node\u modules/.bin/伊斯坦布尔cover./node\u modules/.bin/\u mocha--compilers coffee:coffee script/register--require./coffee-coffee-coverage-loader.js--require lib/bootstrap.coffee./test/lib/***.coffee”
我不知道为什么我必须把/test/lib/***.coffee
放在引号里才能让它工作