我有这个./package.json
:
"scripts": {
"test": "nodeunit test"
}
和这个文件./test/log.coffee
module.exports =
'Test logging': (test) ->
test.expect(1)
console.log("yeah")
test.ok(true)
test.done()
当我执行时,npm test
我得到这个:OK: 0 assertions (1ms)
但是,当我尝试这些时它运行良好:
- 直接执行
nodeunit test
。 - 转换
./test/log.coffee
为 Javascript./test/log.js
并执行npm test
我该怎么做才能让我npm test
拿起咖啡脚本测试文件?