Asked By: Anonymous
When I run unit tests via Ospec for Mithril, I can see if tests fail locally in the console.
What I’m looking for is a solution that will not allow a following Node.js build script to execute if one or more of the tests fail.
I don’t want code to be pushed up to another environment/lane if the unit tests aren’t passing.
I don’t see how to accomplish this in the docs.
In Node, I’m running
ospec && someBuildProcess.
The answer might be a Node.js thing, but I’m at a loss for what to look for now.
Answered By: Anonymous
process.exit(1) if any tests fail, and the command string you posted should work. I just verified it locally with the following setup:
ospec runs, fails, and the
echo command never gets called.
Can you post some more details about your setup?