Skip to content
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

rename browser require() implementation #1193

Closed
jonathanong opened this issue Apr 17, 2014 · 5 comments · Fixed by gluckgames/pixi-packer#17
Closed

rename browser require() implementation #1193

jonathanong opened this issue Apr 17, 2014 · 5 comments · Fixed by gluckgames/pixi-packer#17

Comments

@jonathanong
Copy link
Contributor

to something like __require__ so stuff like https://github.com/visionmedia/node-requires and browserify don't try to parse it. wuttaya think

@tj
Copy link
Contributor

tj commented Apr 17, 2014

ideally we'd use component or browserify for mocha :( component didn't exist at the time and browserify was in a weird place but it would be killer to get that out of the way, so many hacks in here for that

@jamesmortensen
Copy link

If this helps, the problem with require colliding with other implementations started at version 1.12.0. For version 1.11.0, I can reassign the require at the global scope and the CommonJS implementation you're using inside Mocha doesn't get affected.

Did you by chance, sometime between 1.11 and 1.12, do something that leaked the CommonJS require (the one you defined in mocha.js) in the global scope?

I'm using node-webkit. If you checkout their tests, you'll see they're still using Mocha 1.7.4, and if you try to update to the latest version, you see problems. Most of them can be worked around, but I'm afraid the require issue is one that will need to be solved in Mocha itself...

One suggestion, since it's an internal function, is to rename it as suggested by @jonathanong. Hope this helps, and thanks again for putting this great testing toolset together!

@domenic
Copy link
Contributor

domenic commented Aug 15, 2014

A rename would definitely help; right now we're very close to being able to use Mocha with browserify but I think this is the only thing standing in our way.

@JamesMessinger
Copy link

Any update on this issue? I'd really love to be able to use Mocha with Browserify. Do you have an ETA for when this will be supported? Or maybe a workaround for the time being?

@dasilvacontin
Copy link
Contributor

I'll try looking into it soon if it's still open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants