-
Robert Knight authored
We have an idiom in many tests where we import the "default export" from a module and then access the `$imports` property on that function/class/object in order to mock or unmock imports. For example: ``` const Widget = require('../widget'); beforeEach(() => { Widget.$imports.$mock(...); }); afterEach(() => { Widget.$imports.$restore(); }); ``` This won't work when the module under test is converted to an ES module because the `$imports` object will become a separate export from the module rather than a property of the default export.
426d2670
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
modules | ||
test | ||
create-store.js | ||
debug-middleware.js | ||
index.js | ||
use-store.js | ||
util.js |