Is it possible to inject "global" / "window" objects?
Janekk opened this issue · comments
I'd like to inject some parts of the DOM API to my jsdom instance, like jsdom-global does, so that my jsdom test environement reflects the real broser better. Is it possible with karma-jsdom-launcher? Or do I have to switch to mocha in this case?
Yes, try providing the beforeParse
config to jsdomLauncher.
https://github.com/tmpvar/jsdom#intervening-before-parsing
config.set({
jsdomLauncher: {
jsdom: {
beforeParse: function(window) { ... }
}
}
});
Closed due to answered.