0

我使用以下方法从头开始创建了脚手架的 Compoundjs 应用程序:

compound init test_app && cd test_app

compound g crud user id name password created:date

npm test

运行: ./node_modules/.bin/mocha --include test/init.js test/ / .test.js

但是,我只收到以下输出错误:

> test_app@0.0.1 test /home/ubuntu/test_app

./node_modules/.bin/mocha --include test/init.js test/ / .test.js

✖ 1 of 10 tests failed:

1) UserController "before each" hook:
 ReferenceError: getApp is not defined
  at Context.<anonymous> (/home/ubuntu/test_app/test/controllers/users_controller.test.js:16:11)
  at Hook.Runnable.run (/home/ubuntu/test_app/node_modules/mocha/lib/runnable.js:196:15)
  at next (/home/ubuntu/test_app/node_modules/mocha/lib/runner.js:243:10)
  at Object._onImmediate (/home/ubuntu/test_app/node_modules/mocha/lib/runner.js:254:5)
  at processImmediate [as _immediateCallback] (timers.js:317:15)


npm ERR! Test failed.  See above for more details.
npm ERR! not ok code 0
4

1 回答 1

3

使用 mocha 解决了这个问题:

mocha test/*
于 2013-05-19T21:36:41.917 回答