Closed maniax89 closed 6 years ago
Hey @maniax89 with the current approach, is the problem that beforeEach failures are not showing up? Asking because I would have thought that 'test end' would encompass that.
@esalman-sfdc ^ exactly, the test never runs because the beforeEach
fails, thus 'test end' is never invoked
this seems to highlight the issue at least for afterEach
hooks -> https://github.com/mochajs/mocha/issues/1860#issuecomment-139072862
Good find @maniax89 and thanks for the pull request. We'll try reviewing/merging soon.
PR accepted. Next package release will have the changes.
According to https://github.com/mochajs/mocha/blob/master/lib/runner.js#L42-L54 there are a few events that can happen.
Currently, the mocha suite test reporter (https://github.com/forcedotcom/LightningTestingService/blob/master/lightning-component-tests/test/default/staticresources/lts_testutil.resource#L193-L212) uses the following event:
unfortunately, this does not include hook failures in the report.
My proposal would be to switch out the logic to something more like:
this captures both test failures and beforeEach failures
I can try to get a PR up sometime if others think this is useful