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.