Support mocha reporters #5

Open
wants to merge 4 commits into
from

Projects

None yet

3 participants

@ForbesLindesay

This pull request changes the API significantly. Instead of handling events on the client and saving info into mochaResults, we serialize all the event information and send it to the reporter as JSON. By using jssn it can send circular references fine and also re-construct the prototype chains properly on arrival.

The upshot of the API change is that you can use any of the standard mocha reporters. Here is a demo of browser side tests running with the spec reporter:

Imgur

Note that the timing at the end is sadly completely erroneous, but could be fixed if the timing was done in the runner and not in the reporter.

@loopj
loopj commented Feb 9, 2013

Ok this is pretty badass, looking forward to seeing this merged in

@SlexAxton

This may work with component.js - but seems to fail without it. Perhaps it's just older, but it just seems like there are raw require statements in client.js that can't be run in a normal environment.

@ForbesLindesay

Yes, but all that's then needed is a compiled version. Component can generate standalone builds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment