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

Mocking `external` modules from another browserify bundle #51

Closed zdychacek closed 8 years ago

zdychacek commented 8 years ago

Hi,

I have a question about mocking modules which are required as external modules from another browserify bundle.

Basically, I have one browserify bundle with my app code which exposes app modules to the second browserify bundle which contains tests. This second bundle is created by karma-browserify.

When I try to mock any app's external module from within the test bundle, I always get original non-mocked module.

Do you have any ideas what to do with this issue?

Thanks in advance.

O.

bendrucker commented 8 years ago

Unfortunately I doubt proxyquireify is compatible with browserify externals. Why are you using externals for tests? Never heard of anyone doing that.