You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From the debugging I did, this.skip() is causing dirty global state in a handful of test suites, which could explain a chunk of the seemingly arbitrary failures we've been seeing.
Sadly, I don't think there's a good workaround at the mocha level to get past this. We're going to have to come up with a way to not call this.skip() if a test must be skipped, but instead make the test return without doing anything.
According to https://mochajs.org/#inclusive-tests, use of this.skip() is okay in before(), since none of the beforeEach() setup is done at that point. The problem only occurs when this.skip() is called in beforeEach(), because by then, the global beforeEach() will have been run, but the global afterEach() will be bypassed.
I think we can work with this limitation.
In addition, there's a workaround for using this.skip() in a nested describe block that we should put in place: mochajs/mocha#2683 (comment)
Using
this.skip()
within tests can causeafterEach()
to be skipped. mochajs/mocha#2148In addition,
this.skip()
doesn't work from within a nesteddescribe
block. mochajs/mocha#2683Figure out how to get past these two issues while still allowing tests to dynamically skip themselves.
The text was updated successfully, but these errors were encountered: