Is there a way to trigger npm\'s posttest when test fails? If package.json contains
\"scripts\": { \"pretest\": \"echo pretest\", \"test\": \"some_failed_te
Worked it out. Not sure if the following will work in Windows. The bash || operator followed by an empty comment : changes the exit code.
||
:
For instance, using mocha:
"scripts": { "pretest": "echo pretest", "test": "mocha || :", "posttest": "echo posttest" }