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

Update proxyquireify to work with latest browserify #4

Closed gsmaverick closed 10 years ago

gsmaverick commented 10 years ago

The current version of browser-pack/browserify uses a different path for loading the prelude causing proxyquirefy's hacked prelude to never be loaded.

thlorenz commented 10 years ago

I tried to pull this in, but couldn't get the tests to pass with the latest browserify.

node test/clientside/run.js

Do things work for you after your patch? I might pull this in anyways since this is kind of an emergency fix.

However in the long run we should adapt the prelude override to the latest browserify prelude. Additionally browser-pack now supports overriding the prelude without any hacks. Ideally we'd find a way to override the prelude this way, not sure how to pass it through via browserify, but possibly we can do a PR there if that is not supported yet.

Let me know if you want to help with that since that as it is essential to make proxyquireify work in the long run.

Thanks.

gsmaverick commented 10 years ago

Thanks for the quick turnaround time on this PR, much appreciated.

There seems to be some issue with the tape module I believe. I was playing around with it this morning and couldn't make any progress as I kept getting the "Call stack exceeded" error. It would be awesome if you could pull it in and update npm with a new version though.

I'll look into overriding the prelude the right way. I believe browserify exposes a pack option that could be given a browser-pack instance and that way the prelude could be overridden.

thlorenz commented 10 years ago

Ok, the hotfix is published as 0.3.0. However any help in implementing this more properly and getting client side tests to work again is greatly appreciated.

Thanks.