Tuesday 23 May 2017

setting up a task in package.json

I am trying to setup a task in package.json

"scripts": {
    "unit-test": "mocha './test/unit/**/*.spec.js'",
 }

However when I run

npm run unit-test

the following errors are thrown in the console at the end of the run :

npm ERR! Darwin 16.6.0
npm ERR! argv "/Users/shreya.vakil/.nvm/v6.9.5/bin/node" "/Users/d.bubble/.nvm/v6.9.5/bin/npm" "run" "unit-test"
npm ERR! node v6.9.5
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! myapp@0.0.1-SNAPSHOT unit-test: `mocha './test/unit/**/*.spec.js'`
npm ERR! Exit status 1

However if I change the command to

"scripts" : {
 "unit-test": "mocha './test/unit/**/*.spec.js'; exit 0",
}

this error is not throw. However I am not sure if this is the right approach. Pls advice.



via Bubble Trouble

No comments:

Post a Comment