Skip to content

Commit 2a4c39a

Browse files
committed
Add shim for canvas context
1 parent 2eccea9 commit 2a4c39a

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

package-lock.json

Lines changed: 15 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"babel-core": "^7.0.0-bridge.0",
3636
"babel-eslint": "^10.0.1",
3737
"babel-jest": "^23.6.0",
38-
"canvas-prebuilt": "^1.6.11",
38+
"canvas-prebuilt": "^2.0.0-alpha.14",
3939
"enzyme": "^3.6.0",
4040
"enzyme-adapter-react-16": "^1.5.0",
4141
"eslint": "^5.6.1",

src/__tests__/shim.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
11
global.requestAnimationFrame = callback => setTimeout(callback, 0);
2+
3+
HTMLCanvasElement.prototype.getContext = () => ({
4+
clearRect: () => {},
5+
fillRect: () => {}
6+
});

0 commit comments

Comments
 (0)