Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从npm脚本运行伊斯坦布尔将错过测试_Npm_Istanbul - Fatal编程技术网

从npm脚本运行伊斯坦布尔将错过测试

从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

如果直接从终端运行以下命令,我会看到有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\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
放在引号里才能让它工作