Events: QUnit logging system uses EventEmitter#644
Conversation
|
Shoot, I apparently need to rebase this. Hold tight. |
|
Rebased. |
|
@jzaefferer @Krinkle @leobalter @scottgonzalez: Reviews, please? |
|
I think this needs to wait until we get some feedback from other frameworks on the shared reporter. I just commented on the discussion issue, hopefully we get some participation there. |
There was a problem hiding this comment.
Can't this just be if ( !config.callbacks[ type ] )?
There was a problem hiding this comment.
Yes, it was just copied from the old code.
|
Updated per @scottgonzalez's comments (+1 more guard for undefined |
|
Fine by me. I just repurposed what was already there for the old logging callback system.
That's the idea, yes. I think it's just easier to leave all of the logs tests in place for now and axe them completely in |
|
Eliminated |
There was a problem hiding this comment.
What's the usecase of removing event listeners?
There was a problem hiding this comment.
- Standard EventEmitter behavior/API.
- Thinking ahead to Reporters, e.g. if Reporters become an event-driven interface, then we would need to remove event listeners if the Reporters (especially the default reporter) can be removed/disabled.
|
Exporting Otherwise, see my inline comments. |
Agreed... hopefully. 🙏 |
|
I should also add a test to verify the prevention of duplicate listeners. |
|
I'm be much more comfortable landing this with just |
|
Can do. We will definitely need QUnit.addReporter = function( reporter ) {
var emitter = {
on: QUnit.on,
emit: emit,
off: off
};
reporter.register( emitter );
}; |
|
That sounds good to me. Either way, we can add that later without hassle, and will have much less docs (=XML!) to write to release this. And if we're wrong about a lot of this stuff, there's less mess to fix. |
|
Updates:
|
|
Rebased from latest |
faf5e97 to
150ecaf
Compare
There was a problem hiding this comment.
Shouldn't runStart replace begin? This looks like it was missed when rebasing.
|
Apart from the one issue above, this looks good. I still don't think we should land this until there's some more consensus on the js-reporter end. Changing these names along with a new method for binding the callbacks is fine, but once we release this, I don't want us changing those names again. |
|
FYI, my git history got very messed up while trying to rebase this branch so I unfortunately felt the need to squash it to clean things up. |
|
I doesn't look we're gonna have progress fast enough on js-reporters to wait to land this one. I believe it's good to rebase and be ready to land this to advance on 2.0 |
|
@JamesMGreene, do you want to work on this? If you're busy I'll continue the work on the top of your commit (keeping the authorship credits). |
|
I'm closing this as the discussion should be followed at #882 |
Fixes #422.
Even though this is earmarked for
v2.0, it is 100% backward compatible.Critique away. 😉🍷