-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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 Breaks Libraries Using process for environment detection. #770
Comments
hmm yeah that sort of thing gets messy, we should be able to pretty easily avoid that if we do our own checking |
Does that mean the browser doesn't use these lines of code: https://github.com/visionmedia/mocha/blob/master/mocha.js#L5229-L5290 Also thanks for your quick response. M |
actually maybe what we can do is just wrap those in the anonymous closure there so that we're not leaking |
I think its in a closure, what we really need is a |
Just want to let you guys know that this change breaks mocha-phantomjs nathanboktae/mocha-phantomjs#58, which need to override some methods in I guess one way to fix this is to expose Not sure what @visionmedia and @metaskills think about this. |
Agreed, something should happen. Even when PhantomJS 1.9.1 comes out with proper std{out,error} support, see my issue 50, we will see need to capture Mocha's |
hmmm tricky.. if we get too cute there it's going to be one huge PITA to maintain, |
+1, had to revert to Mocha 1.9.0 to use it with PhantomJS and |
I'll close this one since it has been merged, but we'll need to tweak for the phantom stuff |
The grunt-mocha-phantom was built on top of a hack. My vote is we expose using Mocha.process. |
even having Mocha.process is pretty hacky too :( necessary I suppose, maybe we can formalize a nicer api for intercepting that data |
Would love anything formalized. Either way, thanks everyone! |
Is there a new issue that is tracking that? |
+1 for Mocha.process as well, I would really like to be able to upgrade to newer versions of mocha with mocha-phantomjs. :) |
+1, would also like to be able to upgrade to newer versions of mocha with mocha-phantomjs. |
👍 |
1 similar comment
👍 |
Please, I do not want this to be an up vote thread. @visionmedia Is there another issue that has opened up for this or is this something you are not working on? If so, can you give anyone feedback on what would be OK by you for someone to work on and create a new pull request. |
I put in this pull request just now #916 It exposes the shim process that Mocha uses as Mocha.process. |
Please see an example repository at https://github.com/iammerrick/mocha-rjs-fail.
The Problem
Mocha.js installs a global called
process
see here. A comment says it is only to allow mocha.js to run untouched, not to allow running node code in the browser, however this has some unfortunate side effects for some libraries that useprocess
for environment detection.r.js is one of those libraries that uses
process
for environment detection see here.The text was updated successfully, but these errors were encountered: