plasticine / inject-loader

💉📦 A Webpack loader for injecting code into modules via their dependencies.
https://www.npmjs.com/package/inject-loader
MIT License
482 stars 47 forks source link

Any chance of transitive dependencies ? #44

Closed DrGor closed 6 years ago

DrGor commented 7 years ago

Thanks for this nice library. Is there any chance of adding support for injecting transitive dependencies ?

Module A ----imports ----> Module B ----imports ----> Module C I want to be able to mock Module C when testing Module A.

morfj commented 6 years ago

Strictly speaking, you are not testing ModuleA in that case, you are testing ModuleA & ModuleB collaboration.

plasticine commented 6 years ago

@DrGor Yep, @morfj is correct. Implementing this is not really something that I’m interested in supporting, as I feel it’s a pretty unusual use-case. Feel free to re-open or submit a PR if you don’t agree though.