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

Dependency detection fails with previously declared var #25

Closed bendrucker closed 9 years ago

bendrucker commented 9 years ago

Currently you can't do:

var p;
p = require('proxyquireify')(require)

Aside from being perfectly valid JS, this is the output derived from compiling CoffeeScript

alanrubin commented 9 years ago

+1 for this one. That will make sure CoffeeScript can use proxyquireify.

The question is should we support this case as well ?

var p;
p = require('proxyquireify')

The inline assignment is currently being tested in code so I assume we should test this form as well.

bendrucker commented 9 years ago

Yes, see #27. Feel free to pick up where I left off and open a new PR.