Open khylias opened 6 years ago
Hi,
When looking into the code WindowMock
is exported as exports.default = WindowMock;
.
In ES6 it is interpreted as a named export, so in order to access the default export you need to:
const WindowMock = require('window-mock').default;
Hope it helps.
@khylias sorry I completely missed this issue. And thanks to @teef for clarification!
Hi @sbstnmsch,
I search a lib to mock window and document object into a Webpack config file and I found your lib. My webpack file is write into Javascript ES5, like below :
I set my constant fakeWindow as your example into README :
var windowMock = new WindowMock();
but I keep a error on build:TypeError: WindowMock is not a constructor
Environments :