karma-runner / karma-mocha

A Karma plugin. Adapter for Mocha testing framework.
MIT License
379 stars 95 forks source link

Report fails without emit 'test end' event #223

Closed gdmfilippov closed 4 years ago

gdmfilippov commented 4 years ago

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.

gdmfilippov commented 4 years ago

Thanks! Please add a test for this change.

Done

karmarunnerbot commented 4 years ago

:tada: This PR is included in version 2.0.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: