Closed mr-e- closed 8 years ago
I see now I am actually supposed to run npm tests (sorry new to this and have only called mocha directly on test files previously) but I am still receiving an error:
D:\Projects\marketcap.io>npm test
mean@0.5.23 test D:\Projects\marketcap.io npm run mocha && NODE_ENV=test npm run start & sleep 20 && npm run karma
mean@0.5.23 mocha D:\Projects\marketcap.io node node_modules/.bin/mocha packages//server/tests//*.js -R spec -r tools/test/mocha-req.js
D:\Projects\marketcap.io\node_modules.bin\mocha:2
basedir=dirname "$0"
^
SyntaxError: Unexpected token ILLEGAL
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "node" "D:\Projects\marketcap.io\node_modules\npm\bin\npm-cli.js" "run" "mocha"
npm ERR! node v0.12.4
npm ERR! npm v2.11.2
npm ERR! code ELIFECYCLE
npm ERR! mean@0.5.23 mocha: node node_modules/.bin/mocha packages/**/server/tests/**/*.js -R spec -r tools/test/mocha-req.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mean@0.5.23 mocha script 'node nodemodules/.bin/mocha packages//server/tests//.js -R spec -r tools/test/mocha-req.js'.
npm ERR! This is most likely a problem with the mean package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node nodemodules/.bin/mocha packages//server/tests//.js -R spec -r tools/test/mocha-req.js
npm ERR! You can get their info via:
npm ERR! npm owner ls mean
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request: npm ERR! D:\Projects\marketcap.io\npm-debug.log 'sleep' is not recognized as an internal or external command, operable program or batch file. npm ERR! Test failed. See above for more details.
@mr-e- If this is still an issue for you, please reopen.
I am trying to run the unit tests listed under users/server/tests/users.js but I receive an immediate error:
D:\Projects\marketcap.io\node_modules\mongoose\lib\index.js:329 throw new mongoose.Error.MissingSchemaError(name); ^ MissingSchemaError: Schema hasn't been registered for model "User". Use mongoose.model(name, schema) at Mongoose.model (D:\Projects\marketcap.io\node_modules\mongoose\lib\index.js:329:13)