thlorenz / proxyquireify

browserify >= v2 version of proxyquire. Mocks out browserify's require to allow stubbing out dependencies while testing.
MIT License
152 stars 24 forks source link

Referring to globals causes a TypeError #8

Closed jmerrifield closed 10 years ago

jmerrifield commented 10 years ago

This seems similar to #6 but I don't think it's the same thing.

When I refer to the global object in a file, browserify seems to wrap that module in another function to pass in global. This means that when I load the proxyquireified bundle, I get an undefined is not a function error because require is undefined.

To reproduce, simply add global.a = 'a' to test.js in the example.

thlorenz commented 10 years ago

Could you please try to see if that is fixed in the latest version (some major changes, so hopefully they addressed your changes).