【发布时间】:2014-02-15 14:55:15
【问题描述】:
我有一个 node.js/express/mocha 项目。从我项目的根目录中,当我这样做时
./node_modules/.bin/mocha --compilers coffee:coffee-script-redux/register test/**/*.coffee --reporter list
1) UnitsController /units.json "before all" hook
․ CordBloodUnit should set attrs: 0ms
․ CordBloodUnit #getMatchCount should get the match count of alleles: 0ms
․ pg-adapter #runQuery should get results of the query: 7ms
․ pg-adapter #runQuery should get Cord Blood Units: 4ms
4 passing (2s)
1 failing
1) UnitsController /units.json "before all" hook:
Error: timeout of 2000ms exceeded
at Object.<anonymous> (/Users/pguruprasad/Projects/jeevan-js/node_modules/mocha/lib/runnable.js:175:14)
at Timer.list.ontimeout (timers.js:101:19)
我看到所有测试都在运行。但是当我想将长命令放入脚本中执行时,mocha 只运行两个测试并忽略其余测试。这里有什么问题?
➜ ~jjs git:(master) ✗ touch test1
➜ ~jjs git:(master) ✗ echo "./node_modules/.bin/mocha --compilers coffee:coffee-script-redux/register test/**/*.coffee --reporter list" >> test1
➜ ~jjs git:(master) ✗ cat test1
./node_modules/.bin/mocha --compilers coffee:coffee-script-redux/register test/**/*.coffee --reporter list
➜ ~jjs git:(master) ✗ chmod +x test1
➜ ~jjs git:(master) ✗ ./test1
․ CordBloodUnit should set attrs: 0ms
․ CordBloodUnit #getMatchCount should get the match count of alleles: 0ms
2 passing (2ms)
【问题讨论】:
-
您能添加
test/的树的样子吗?鉴于@dankohn 的回答不起作用?