Ben Schmidt

Results 5 comments of Ben Schmidt

It turns out this is an issue with Browserify, which is used to package Mocha for the browser. Mocha simply assigns `global.mocha = ...` and Browserify injects the first defined...

I'm experiencing this problem trying to use Mocha with Karma in NW.js. I like @Zarel's solution above (https://github.com/substack/insert-module-globals/pull/48#issuecomment-241844732) as it is targetted specifically to the breaking case and is unlikely...

@jmm's proposal (https://github.com/substack/insert-module-globals/pull/48#issuecomment-142763478) also seems pretty appropriate to me.

Regarding some of @hgwood's comments: > `window` has all the properties of `global` I do not believe this is the case since NW.js 0.13: http://docs.nwjs.io/en/latest/For%20Users/Advanced/JavaScript%20Contexts%20in%20NW.js/#access-nodejs-and-nwjs-api-in-browser-context > `global.window === window` holds...

Sorry for so many comments. I've done some further testing. In NW.js < 0.13 (I think; only tested 0.12.3): - `window.window === window` - `global.window === window` (strange but true)...