Created
January 7, 2015 06:14
-
-
Save nkbt/94fa5e77739ecfdf4a61 to your computer and use it in GitHub Desktop.
Simple way to load legacy dependency with Webpack for tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Example of legacy lib | |
./legacy_lib.js | |
*/ | |
App = App || {}; | |
App.Tool = function () { | |
}; | |
/* | |
./legacy_lib_spec.js | |
*/ | |
// ... | |
var AppMock = {}; | |
var Tool = require('inject!' + | |
'imports?App=AppMock!' + | |
'exports?App.Tool!' + | |
'./legacy_lib' | |
)({'AppMock': AppMock}); | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment