Skip to content
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

fix to exit correctly when using bail flag #3346

Merged
merged 1 commit into from
Apr 27, 2018

Conversation

outsideris
Copy link
Contributor

Description of the Change

The bail flag fixed in #3278, but it doesn't exit correctly when before hook throw an error.
This PR fix to exit correctly whenever test or hook failed.

Alternate Designs

I don't have any idea.

Why should this be in core?

Now, when before hook failed, mocha doesn't exit correctly. It makes bail flag useless.

Benefits

Users believe the result of mocha with bail flag.

Possible Drawbacks

I'm not sure.

Applicable issues

Fix #3303

@outsideris outsideris added type: bug a defect, confirmed by a maintainer semver-patch implementation requires increase of "patch" version number; "bug fixes" labels Apr 22, 2018
@coveralls
Copy link

coveralls commented Apr 22, 2018

Coverage Status

Coverage increased (+0.05%) to 90.054% when pulling b1ba3df on outsideris:issue-3303 into 5fc5845 on mochajs:master.

Copy link

@marcusmotill marcusmotill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests prove your fix is valid. Thank you

Copy link
Contributor

@boneskull boneskull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@boneskull boneskull added this to the next milestone Apr 27, 2018
@boneskull boneskull merged commit 99c2f8a into mochajs:master Apr 27, 2018
@medikoo
Copy link

medikoo commented May 9, 2018

When can we expect the fix to be published?

@medikoo
Copy link

medikoo commented May 10, 2018

On our side it hidden failed builds for weeks, so bug seems critical (for now we reverted to 5.0.4)

@marcusmotill
Copy link

yes please release this

@spalger
Copy link

spalger commented May 18, 2018

sorry for the unnecessary ping, but also anxious for this fix

@boneskull
Copy link
Contributor

published as v5.2.0

wopian referenced this pull request in wopian/agc-assembly May 20, 2018
This Pull Request updates dependency [mocha](https://github.com/mochajs/mocha) from `~5.1.0` to `~5.2.0`



<details>
<summary>Release Notes</summary>

### [`v5.2.0`](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md#&#8203;520--2018-05-18)
[Compare Source](mochajs/mocha@v5.1.1...v5.2.0)
#### 🎉 Enhancements

- [#&#8203;3375]: Add support for comments in `mocha.opts` ([@&#8203;plroebuck])
#### 🐛 Fixes

- [#&#8203;3346]: Exit correctly from `before` hooks when using `--bail` ([@&#8203;outsideris])
#### 📖 Documentation

- [#&#8203;3328]: Mocha-flavored [API docs](https://mochajs.org/api/)! ([@&#8203;Munter])
#### 🔩 Other

- [#&#8203;3330]: Use `Buffer.from()` ([@&#8203;harrysarson])
- [#&#8203;3295]: Remove redundant folder ([@&#8203;DavNej])
- [#&#8203;3356](`https://github.com/mochajs/mocha/pull/3356`): Refactoring ([@&#8203;plroebuck])

[#&#8203;3375]: `https://github.com/mochajs/mocha/pull/3375`
[#&#8203;3346]: `https://github.com/mochajs/mocha/pull/3346`
[#&#8203;3328]: `https://github.com/mochajs/mocha/pull/3328`
[#&#8203;3330]: `https://github.com/mochajs/mocha/pull/3330`
[#&#8203;3295]: `https://github.com/mochajs/mocha/pull/3295`

[@&#8203;plroebuck]: https://github.com/plroebuck
[@&#8203;harrysarson]: https://github.com/harrysarson
[@&#8203;outsideris]: https://github.com/outsideris
[@&#8203;Munter]: https://github.com/Munter

---

</details>




---

This PR has been generated by [Renovate Bot](https://renovatebot.com).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-patch implementation requires increase of "patch" version number; "bug fixes" type: bug a defect, confirmed by a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When using bail flag, before hook failures do not exit as failed
6 participants