In a test file, I've added several unit tests using the Tape test harness. What I'd like to do now is ensure that, if at least one of my unit tests fails (screenshot), some custom JS code is executed. How would I approach that?
In this case, the custom code I'd like to carry out will play a sound (which I plan to do using the sound-play Node package.
If it matters, I'm running the unit tests in VSCode, and the Tape output is currently printed to VSCode's output panel.
Thanks.
I figured out that Tape has an onFailure method, which fires a callback whenever at least one test fails. This was exactly what I needed.