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
This answer does work for ES6.
Instead of:
describe('your describe block', () => {
You want:
(condition ? describe : describe.skip)('your describe block', () => {
This conditionally skips all tests in the describe block IF the condition is false.
Or, instead of:
it('your it block', () => {
You want:
(condition ? it : it.skip)('your it block', () => {
This conditionally skips one test IF the condition is false.