What's the difference between a testResultsProcessor and a reporter? #158
-
What's different when I use jest-junit as a reporter v.s. a testResultsProcessor? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 3 replies
-
Very little. But the subtle difference is that a testResultsProcessor only receives details about test runs after all tests are finished. Whereas a reporter has the ability to receive test results after individual tests and/or test suites are finished. testResultsProcessor remains in jest because Facebook needs it internally (or so I've been told). |
Beta Was this translation helpful? Give feedback.
-
So if I just want to generate a JUnit style report after all tests are finished (in my case for GitLab CI integration), it's merely no difference to use jest-junit as a testResultsProcessor or as a reporter.
And when I need it to report dynamically after each test case (e.g. IDE integrations), I should only use it as a reporter.
Am I getting it correct?
At 2021-02-22 17:55:30, "Jason Palmer" <[email protected]> wrote:
Very little. But the subtle difference is that a testResultsProcessor only receives details about test runs after all tests are finished.
Whereas a reporter has the ability to receive test results after individual tests and/or test suites are finished.
testResultsProcessor remains in jest because Facebook needs it internally (or so I've been told).
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Beta Was this translation helpful? Give feedback.
-
You should use it as a reporter. testResultsProcessor support is only there for legacy reasons but it could be removed in the future. jest-junit only writes junit files at the end of a test run anyway. |
Beta Was this translation helpful? Give feedback.
-
Using it as a reporter allows you a lot more flexibility in the future should you decide to use some of jest-junit's configuration options |
Beta Was this translation helpful? Give feedback.
-
Back to the original question:
As per Jest API |
Beta Was this translation helpful? Give feedback.
Very little. But the subtle difference is that a testResultsProcessor only receives details about test runs after all tests are finished.
Whereas a reporter has the ability to receive test results after individual tests and/or test suites are finished.
testResultsProcessor remains in jest because Facebook needs it internally (or so I've been told).