-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mocha in browser #8
Comments
I found the underlying issue with the interfaces registration and I'm working on a browserify branch to build a browser-friendly distribution. I have the interface registration working well using browserify-shim to expose At this point, mocha-gwt is being registered correctly and the page loads without errors. However, none of the tests are being recognized by mocha (they are not being saved into the mocha suites/tests arrays so |
I actually have very little insight in how mocha works and I have never used it in the browser. This interface was written mostly by working my way through trial and error to its current state. If you look at the code for mocha-gwt you'll see that it listens to hoooks. All tests are registerd pre-require and they are added to mocha post-require by doing I don't know about the browser but "require" seems quite nodish. Perhaps those hooks are not fired in the browser environment? |
pre-require is triggered but post-require isn't. (mocha-given and the I attempted simply emitting post-require at the end of pre-require, which On Fri, Sep 25, 2015 at 4:46 PM, Ludwig Magnusson [email protected]
|
I did a very quick search through the mocha code and if this is where mocha emits events in the browser then it seems that mocha-gwt is incompatible with mocha in the browser. I don't know if the implementation is a mistake or if it needs to be that way. Only the pre-hook is emitted and the file is not included. |
Right. And the loadFiles implementation (in node) simply emits the three I should also point out that I set the On Fri, Sep 25, 2015 at 4:54 PM, Ludwig Magnusson [email protected]
|
Yes, but in mocha-gwt the file parameter is used. |
I have a proof of concept working and have opened #9 as the results of my work. (partially dependent on mochajs/mocha#1905) |
Does anyone have experience using custom interfaces in the browser? We're getting errors when mocha-gwt is loaded at
mocha-gwt/lib/mocha-gwt.coffee
Line 118 in de04ed1
interfaces
doesn't exist on that Mocha object.And then when we attempt to configure mocha to use mocha-gwt, it throws an error about an unknown UI (since mocha-gwt failed to register itself as a UI).
The text was updated successfully, but these errors were encountered: