Coffeescript 运行覆盖毯的摩卡咖啡会导致测试无法运行

Coffeescript 运行覆盖毯的摩卡咖啡会导致测试无法运行,coffeescript,mocha.js,blanket.js,Coffeescript,Mocha.js,Blanket.js,在我的package.json中,我有: "scripts": { "test": "mocha --require blanket -R html-cov > test/coverage.html --compilers coffee:'./node_modules/coffee-script/lib/coffee-script/register'" }, 因此,如果我运行npm测试,我会得到: npm test > my-site@1.0.0 test /U

在我的
package.json
中,我有:

  "scripts": {
    "test": "mocha --require blanket -R html-cov > test/coverage.html --compilers coffee:'./node_modules/coffee-script/lib/coffee-script/register'"
  },
因此,如果我运行
npm测试
,我会得到:

 npm test

> my-site@1.0.0 test /Users/me/Sites/my-site
> mocha --require blanket -R html-cov > test/coverage.html --compilers coffee:'./node_modules/coffee-script/lib/coffee-script/register'
如果我拿出
毯子
东西(
“测试”:“mocha--compilers coffee:”./node_modules/coffee script/lib/coffee script/register“
),那么我的测试运行正常

我正在使用
CoffeeScript
,如果这很重要的话。我做错了什么?

根据毛毯:

如果您的测试运行程序测试用coffee脚本编写的源文件, 毯子还盖着你。使用自定义加载程序coffeescript 对文件进行编译、检测和测试

咖啡脚本位于。
您需要将以下内容添加到
包.json

"config": {
    "blanket:" {
        "pattern" : "src", // use the correct pattern for your project
        "loader": "./node-loaders/coffee-script"
    }
}
例如,请参见总括项目文件

此外,用于测试的命令行不正确。它缺少测试文件的路径,输出重定向应该在末尾。您应该使用以下内容:

mocha --require blanket -R html-cov --recursive --compilers coffee:./node_modules/coffee-script/lib/coffee-script/register src > test/coverage.html

您正在使用coffeescript加载程序吗?这意味着什么?我将如何做?我有:`“配置”:{“毯子”:{“模式”:“src”,“加载程序”:“/node loaders/coffeescript”}`否dice@Shamoon请参见我的回答中的补充内容。正如注释所示,输出重定向不必位于末尾,几乎所有的贝壳。您甚至可以将重定向置于命令之前。如果您不相信我,请尝试在类似UNIX的系统上运行