Skip to content

Instantly share code, notes, and snippets.

@davidbanham
Created March 25, 2014 09:14
Show Gist options
  • Save davidbanham/9757890 to your computer and use it in GitHub Desktop.
Save davidbanham/9757890 to your computer and use it in GitHub Desktop.
Test scripts
A common way to write your test script in a package.json is:
"scripts": {
"test": "mocha"
},
But that expects the user to have mocha (or karma, etc) installed globally. A more portable way to do it is call the locally installed runner directly:
"scripts": {
"test": "./node_modules/.bin/mocha"
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment