问题:
Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package)
解决方案:
yarn add jest-canvas-mock
然后在相应的单元测试中 加上 import 'jest-canvas-mock';
来源:oschina
链接:https://my.oschina.net/u/2263272/blog/4468786