We have a bunch of tests that we only run optionally based on the environment, we use various ways to do if (build time flags, just putting tests inside an if), but the best place for us to do it would be inside beforeEach, it would be nice if there was a way to provide something to done that indicated the test should be skipped
Can try coming up with a patch if that seems like something likely to be merged?
I would also like to know how to do this. I played with it. If I throw an error, it stops all test execution. If I set the this.currentTest.pending flag to true, it still executes the test.
For anyone finding this issue: this little snippet of code should help you work around the issue:
beforeEach(function()
{
if (YOUR_CONDITION_HERE) this.currentTest.fn = function() { this.skip(); }
});
you can also just use this.skip ie
beforeEach(function() {
if (FAILED_TESTS[this.currentTest.file]) {
this.skip();
}
});
Most helpful comment
For anyone finding this issue: this little snippet of code should help you work around the issue: