Is there a way to run npm posttest when the test failed? If package.json contains
"scripts": { "pretest": "echo pretest", "test": "some_failed_test_or_error", "posttest": "echo posttest" }
$ npm test will echo the "prefix", but not the "posttest".
I get the same behavior if I use mocha and the test fails even if mocha does not raise any exceptions (just a simple assert(true==false) failure assert(true==false) ).
I run the resource on pre-testing, and I would like to kill the resource in posttest, regardless of whether the test passes or fails.
MacOS OS X 10.9.4, npm version 1.4.21, node v0.10.30.
source share