New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
this.skip() is also skipping teardown()/afterEach() #2148
Comments
Confirmed as an issue. Likely extends to the bdd and other UIs as well. suite('suite', function() {
suiteSetup(function() {
console.log('SUITE SETUP');
});
setup(function() {
console.log('SETUP');
});
test('spec2', function() {
console.log('SKIPPED SPEC');
this.skip();
});
teardown(function() {
console.log('TEADOWN');
});
suiteTeardown(function() {
console.log('SUITE TEARDOWN');
});
});
// =>
SUITE SETUP
SETUP
SKIPPED SPEC
SUITE TEARDOWN |
Note that the behavior is correct when using It's only when dynamically skipping the spec that this occurs. In that case, the test is pending, however the setup/beforeEach has already ran. |
@megagon @danielstjules 8a37e01 was merged. Is this still an issue? |
@boneskull: yes it is, I'm able to repro using the testcase from the original issue report that uses latest |
I copied this down locally and tried it with a rebuilt browser mocha.js file and confirmed the issue is still present. In the process I also noticed how this is different from #2286/#2287: that was |
@ScottFreeCode: oh, thanks! Did you ever try #2168? |
If I take the change from #2168 and rebuild mocha.js, it does seem to fix this issue. It could use some updates to the tests though. |
dupe of #2286 for all intents and purposes |
See PR #2571 |
Hey now, mine came first so strictly speaking #2286 is a dupe of this one 😜 |
With Mocha v2.4.5: http://jsbin.com/bijuru/edit?html,output
With latest
master
branch: http://jsbin.com/dajugel/edit?html,outputObserved:
Temporary stuff
is leftover from test setupExpected:
Temporary stuff
should've been cleared by test teardownThe text was updated successfully, but these errors were encountered: