Question

I have created from scratch scaffolded compoundjs app using:

compound init test_app && cd test_app

Than

compound g crud user id name password created:date

Than

npm test

which runs: ./node_modules/.bin/mocha --include test/init.js test//.test.js

However, I only get the following output errors:

> 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
Était-ce utile?

La solution

Using mocha fixed the issue:

mocha test/*
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top