-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fixes #1093: missing hooks after failed test with bail #1409
fixes #1093: missing hooks after failed test with bail #1409
Conversation
please squash |
@travisjeffery Would you call this breaking? |
Soz, squashed. |
It's a bugfix that doesn't affect the API. People shouldn't be relying on I couldn't find any documentation regarding the behaviour of Waiting for @travisjeffery's opinion. |
ping @travisjeffery |
👍 it's awesome how the fix was just the omission of one line. |
fixes #1093: missing hooks after failed test with bail
i'd consider this a bugfix/patch. awesome, thanks homies! |
Cool! Glad to contribute :) @rstacruz Less code to maintain! |
Looks like those changes aren't in latest release yet. Can someone do |
ah yep will push a release tonight |
@runk, it shipped now with mocha v2.1.0 :) |
Awesome 👍 |
Issue #1093.
Line
247
inlib/runner.js
(which was causing the bug) is pointless:419
. After finishing the hooks for the current failed test and since no more tests will be executed, no more hooks will be executed in the suite.beforeAll
fails, the suite will be ended due to line521
.beforeEach
fails, runner will proceed withafterEach
due to447
. If the suite has bail, no more tests will be ran due to line419
and the suite will end.afterEach
fails and the suit has bail, the suite will end due to line419
.All tests pass after removing the line.
I've also added a test that checks that
afterEach
andafterAll
hooks are called after a failed test if the suite has bail. I wasn't sure where to add the test, though. Is it good there? Suggestions?