qunitjs / js-reporters

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

Propose using js-reporters in Karma runner #98

Closed Krinkle closed 1 year ago

Krinkle commented 7 years ago

It would be nice if, for example, a plugin like karma-reporter-mocha could be used directly with qunit-cli.

If we establish a common API between QUnit and Karma for attaching reporters, this should be possible.

Karma already supports this in a way by abstracting the interfaces for testing libraries and reporters. In fact, you can already use karma-runner with karma-qunit and karma-reporter-mocha together to achieve this.

leobalter commented 7 years ago

That's a great a idea. Do we have someone from the JSF already connected w/ Karma? Or maybe someone we should ping to ask for support/help?

Krinkle commented 5 years ago

As of last year, I'm contributor on grunt-karma and karma-qunit.

Their Gitter room at https://gitter.im/karma-runner/karma is quite active for support. But, for this purpose we may want to use the issue tracker instead, which tends to get a quicker/better response for technical proposals.

Krinkle commented 4 years ago

Ref https://github.com/karma-runner/karma/issues/1183.

johnjbarton commented 4 years ago

Note that karma isn't a testing framework itself but rather hosts other frameworks. The karma reporter protocol is very narrow and I would push it to base it simply on the current 'info' API, making the karma part of this story be just a pipe between the client browser and server. On the client side, reporter calls would be converted to named json packets and reversed on the server side. Here is an example from karma-jasmine: https://github.com/karma-runner/karma-jasmine/commit/7b73ce0abec8da370986d10cbb040fe6e5ae1d22#diff-e52a9a67956bd51d044af4058fb939ceR202

The jasmine API is pretty complete and internally at my company we convert all reporters to jasmine API. Seems like a good starting point if the jasmine word is just dropped from the function names.

Krinkle commented 4 years ago

@johnjbarton Thanks. Karma's role would indeed be mainly on the consumer/reporting side.

I think we're seeing the same future, but let me reflect in my own words to see if we're thinking the same thing: