Skip to content
This repository has been archived by the owner on Dec 28, 2023. It is now read-only.

Report fails without emit 'test end' event #223

Merged
merged 2 commits into from Apr 29, 2020

Conversation

gdmfilippov
Copy link
Contributor

The mocha listens for 'test end' event (it can restart test if it is
failed). If an exception is thrown from the setup/beforeEach, the
karma-mocha must not fire 'test end' event, because it leads to
exception inside mocha code (the mocha tries to get current test,
which is undefined).

With this, mocha adapter reports fail directly to karma instead of
raising an intermediate 'test end' event.

The mocha listens for 'test end' event (it can restart test if it is
failed). If an exception is thrown from the setup/beforeEach, the
karma-mocha must not fire 'test end' event, because it leads to
exception inside mocha code (the mocha tries to get current test,
which is undefined).

With this, mocha adapter reports fail directly to karma instead of
raising an intermediate 'test end' event.
Copy link
Contributor

@johnjbarton johnjbarton left a comment

Choose a reason for hiding this comment

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

Thanks! Please add a test for this change.

@gdmfilippov
Copy link
Contributor Author

Thanks! Please add a test for this change.

Done

Copy link
Contributor

@johnjbarton johnjbarton left a comment

Choose a reason for hiding this comment

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

Thanks!

@johnjbarton johnjbarton merged commit 1a8226c into karma-runner:master Apr 29, 2020
karmarunnerbot pushed a commit that referenced this pull request Apr 29, 2020
## [2.0.1](v2.0.0...v2.0.1) (2020-04-29)

### Bug Fixes

* **deps:** Report fails without emit 'test end' event ([#223](#223)) ([1a8226c](1a8226c))
@karmarunnerbot
Copy link
Member

🎉 This PR is included in version 2.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants