3 ms·
I'm somewhat new to Node, but why do they have you run the test suite like this: npm test as mentioned here https://github.com/cloudkick/whiskey https://git
by tlack 15y ago
I'm somewhat new to Node, but why do they have you run the test suite like this:
npm test
as mentioned here https://github.com/cloudkick/whiskey https://github.com/cloudkick/whiskey ? Shouldn't that just be 'node whiskey test' or similar?
- benatkin 15y agonpm test runs whatever shell command is in package.json under scripts/test.
- _harry 15y agonpm provides a common interface for running package scripts: http://npmjs.org/doc/scripts.html http://npmjs.org/doc/scripts.html So if you open the package.json (https://github.com/cloudkick/whiskey/blob/master/package.json https://github.com/cloudkick/whiskey/blob/master/package.jso...) you'll see that `test` runs `make test`. Check out the Makefile (https://github.com/cloudkick/whiskey/blob/master/Makefile https://github.com/cloudkick/whiskey/blob/master/Makefile) to see what `npm test` is doing. This abstracts out the test command, because you could be running `cake test`, `make test`, `node whiskey test`, etc. and if you're just using the node package, you probably don't care what the command is, you just want to run the tests. `npm test` is the way to do it.