I have a code where certain tests will always fail in CI environment. I would like to disable them based on an environment condition.
How to programmatically skip a test in mocha during the runtime execution?
I have a code where certain tests will always fail in CI environment. I would like to disable them based on an environment condition.
How to programmatically skip a test in mocha during the runtime execution?
As @danielstjules answered here there is a way to skip test. @author of this topic has copied answer from github.com mochajs discussion, but there is no info in what version of mocha it available.
I'm using grunt-mocha-test module for integrating mocha test functionality in my project. Jumping to last (for now) version - 0.12.7 bring me mocha version 2.4.5 with implementation of this.skip().
So, in my package.json
And then
And it make me happy with this hook:
There is an undocumented way of programmatically skipping tests:
This is discussed in https://github.com/mochajs/mocha/issues/1901.