qunitjs / js-reporters

📋 Common Reporter Interface (CRI) for JavaScript testing frameworks.
MIT License
60 stars 18 forks source link

Does this work with jest? #112

Closed adamchenwei closed 4 years ago

trentmwillis commented 5 years ago

Unsure! It is designed to be test framework agnostic but I'm not familiar enough with jest's API to know how one would integrate it.

Krinkle commented 4 years ago

I believe the answer is yes. Jest has a reporter interface, similar to QUnit and Mocha:

https://jestjs.io/docs/en/configuration#reporters-arraymodulename--modulename-options

And the "test" and "suite"-related events it provides can presumably mapped to those of the JS Reporter spec.

https://github.com/facebook/jest/blob/v26.4.2/packages/jest-reporters/src/types.ts#L56-L82

I'm closing this for now, but feel free to ask further. It'd be great if e.g. Jest could directly provide spec-compliant EventEmitter that you can then attach js-reporters to.