practicalmeteor / meteor-mocha

Depreciated - Write meteor package tests with mocha and run them in the browser or from the command line with spacejam.
https://atmospherejs.com/practicalmeteor/mocha
Other
41 stars 13 forks source link

Conflict with dispatch:mocha-phantomjs in firefox #55

Closed teeks99 closed 8 years ago

teeks99 commented 8 years ago

So this seems like to be a leftover issue after #23 was closed (which is why I'm putting it in this repo @aldeed). Now the practicalmeteor:mocha results render correctly, in chrome and IE, but not in firefox. Not sure about others.

This can be reproduced by having a running practicalmeteor:mocha page running correctly and showing in firefox, then adding the dispatch:mocha-phantomjs package to the project, then the page doesn't show in firefox.

There are errors in the javascript console:

dispatch_mocha-phantomjs.js:262:13
Exception from Tracker recompute function: 
TypeError: mocha is undefined 
require<.node_modules.meteor["practicalmeteor:mocha"].meteor.src.lib["MochaRunner.coffee.js"]</MochaRunner</MochaRunner.prototype.onServerRunSubscriptionReady/</<@http://abe:8082/packages/practicalmeteor_mocha.js?hash=48311d8d578694d27de704142d6093ebe2dc3fbe:366:13
Tracker.Computation.prototype._compute@http://abe:8082/packages/tracker.js?hash=b605200c15f3a57abb701c7cbc58ca5b0f2802d7:351:5
Tracker.Computation.prototype._recompute@http://abe:8082/packages/tracker.js?hash=b605200c15f3a57abb701c7cbc58ca5b0f2802d7:370:9
Tracker._runFlush@http://abe:8082/packages/tracker.js?hash=b605200c15f3a57abb701c7cbc58ca5b0f2802d7:535:9
onGlobalMessage@http://abe:8082/packages/meteor.js?hash=ae8b8affa9680bf9720bd8f7fa112f13a62f71c3:401:11
jsep commented 8 years ago

Hello @teeks99, thanks for reporting, I have some questions

Are you using the latest packages versions? Which OS? Which meteor version? Can you provide a demo repo?

Thanks

teeks99 commented 8 years ago

Are you using the latest packages versions?

Yes, installed in the demo today:

practicalmeteor:chai@2.1.0_1 practicalmeteor:loglevel@1.2.0_2 practicalmeteor:mocha@2.4.5_4 practicalmeteor:mocha-core@1.0.0 practicalmeteor:sinon@1.14.1_2

dispatch:mocha-phantomjs@0.1.6 dispatch:phantomjs-tests@0.0.5

Which OS?

Tried it on Linux (Ubuntu 16.04), I think another person on my team saw it on windows.

Which meteor version?

$ meteor --version Meteor 1.3.4.1

Can you provide a demo repo?

https://github.com/teeks99/mocha-conflict-bug

On the first commit, it all runs fine. You can execute meteor to see the default app. You can execute meteor npm run test-watch and view the practicalmeteor:mocha results on port 8082.

On the second commit (which does meteor add dispatch:mocha-phantomjs), the app still runs, but the results of meteor npm run test-watch are the blank screen and console error in firefox (runs fine in chrome).

rbabayoff commented 8 years ago

@aldeed, any clues? It works for us without the dispatch:mocha-phantomjs package

teeks99 commented 8 years ago

Verified the same issue occurs for meteor running on windows. (in reference to the previous OS question)

aldeed commented 8 years ago

This is fixed by dispatch:mocha-phantomjs@0.1.7. Some bad shimming that applied only to mozilla. The shimming was for slimerjs only apparently so isn't needed. I removed it and things seem to work now. @rbabayoff you can close this

teeks99 commented 8 years ago

Verified that this fixes it :-)

jsep commented 8 years ago

Thanks @aldeed !