i-like-robots / rewireify

Rewireify is a port of Rewire for Browserify that adds setter and getter methods to each module so that their behaviour can be modified for better unit testing.
https://www.npmjs.com/package/rewireify
Other
59 stars 10 forks source link

0.2.3 - methods aren't injected if typeof module.exports is 'function' #16

Closed tran2 closed 9 years ago

tran2 commented 9 years ago

In 0.2.3, there's a check if typeof module.exports === 'object' before injecting. In some of my codes, typeof module === 'object' but typeof module.exports === 'function' so __get__ and __set__ never gets injected

loudwinston commented 9 years ago

I've also encountered this issue. This changes breaks rewireify for anyone exporting a React component in a module, since React.createClass returns a function.

My team has reverted to 0.2.2 for now until this issue is resolved.

i-like-robots commented 9 years ago

Thanks for reporting this, a fix is imminent

i-like-robots commented 9 years ago

Fixed in 059be2bc4ddcac4f69394ccca3b2c4985966c37d