Fix jsdom canvas error on tests

This commit is contained in:
Alexander Zobnin
2020-05-12 19:28:57 +03:00
parent f3545f01e5
commit 00f6aa459e

View File

@@ -92,3 +92,7 @@ let dom = new JSDOM('<html><head><script></script></head><body></body></html>');
global.window = dom.window;
global.document = global.window.document;
global.Node = window.Node;
// Mock Canvas.getContext(), fixes
// Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package)
window.HTMLCanvasElement.prototype.getContext = () => {};