Debian Codegraph @

tests/js/setupFile.js

raw
1 // jsdom does not support HTML5 canvas, so we need to mock out this function
2 HTMLCanvasElement.prototype.getContext = () => {
3 return {
4 scale: () => { },
5 fillRect: () => { },
6 strokeRect: () => { },
7 fillText: () => { },
8 beginPath: () => { },
9 moveTo: () => { },
10 lineTo: () => { },
11 stroke: () => { },
12 };
13 };
14
15 // Polyfill DragEvent
16 Object.defineProperty(window, 'DragEvent', {
17 value: class DragEvent {}
18 });