itereshchenkov / jest-teamcity

Jest Teamcity Reporter
MIT License
31 stars 13 forks source link

Handle jest suites that failed to run #16

Closed yurynix closed 3 years ago

yurynix commented 3 years ago

Hello 👋

If jest fails to run a spec file, it will populate testExecError and testResults will be an empty array. Currently jest-teamcity doesn't handle that, so TC's overview will not report anything regarding the failure, just exit code 1

See buildFailureTestResult: https://github.com/facebook/jest/blob/93cde55bf1d770bf2f4e386024032298535a65ea/packages/jest-test-result/src/helpers.ts#L76-L78

Unfortunately, it seems that TeamCtiy doesn't support "failing" on a test suite level: https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000531484-Fail-TestSuite-without-failing-TestCase

So, in this PR, I push a "fake" test result that will bring the error message to the TC overview tab.

yurynix commented 3 years ago

@itereshchenkov Not to rush you or anything, when you're planning to release a new version to npm? 🙂

itereshchenkov commented 3 years ago

@itereshchenkov Not to rush you or anything, when you're planning to release a new version to npm? 🙂

I will try to do it today

itereshchenkov commented 3 years ago

@itereshchenkov Not to rush you or anything, when you're planning to release a new version to npm? 🙂

The new version was published. Please feel free to update it

yurynix commented 3 years ago

Thank you @itereshchenkov ! 🙇

scinos commented 3 years ago

This is still broken, as it won't report suites as failed if an after hook failed. I raised #24 to fix it.