rogeliog / jest-runner-mocha

A Mocha runner for Jest
70 stars 12 forks source link

Handle when an error occurs in a beforeEach block of a mocha test. #9

Closed hswolff closed 6 years ago

hswolff commented 6 years ago

Hello, it's me again! Apologies for the PR's without issues!

This adds support to surface when an error occurs in a beforeEach block, before any individual tests run.

Without this change this is what is shown:

image

With this change we show:

image

rogeliog commented 6 years ago

Thanks for reporting and sorry for the late response, I was sick

hswolff commented 6 years ago

No worries about being sick! Appreciate the update!

Just pushed change to using Set, let me know if that's what you had in mind otherwise I'm happy to update it to your liking.

hswolff commented 6 years ago

Reverted the change to Sets for node compatibility.

I also included another small change that hopefully is ok to include in this PR. I noticed (when trying to use https://github.com/palmerj3/jest-junit) that the type of failureMessages wasn't what that library was expected.

I did some looking and the type object that is defined in Jest also expects the property to be an Array. So I fixed that here too.

rogeliog commented 6 years ago

Thanks a lot!