-
Robert Knight authored
This provides an alternative way to mock a module's dependencies that fixes several issues with proxyquire and proxyquireify [1]. In particular we have had issues in the past with: - Third party modules that have global state (eg. angular) causing hard-to-debug errors when mocking - An initial attempt to convert Common JS imports to ES 6 imports ran into problems with the transformed code breaking proxyquire This also provides future-proofing as well in that it enables us to change the module bundler or test runner without changing how mocking works. It should also be much more efficient if we make more extensive use of import mocking as AngularJS is gradually removed from the codebase. [1] https://github.com/robertknight/babel-plugin-mockable-imports#how-does-this-plugin-differ-from-alternative-approaches
70edade4
Analyzing file…