Jest import statement: 'TypeError: Cannot set property 'fillStyle' of null'

半世苍凉 提交于 2021-02-11 15:20:47

问题


I type:

npm test

and I get:

It's interesting to note that the import statement works inside the BootScene.test.js file but it doesn't work in the imported file.

I focused on the import statement not working under JEst. So I thought maybe it has something to do with Ecma Script version jest uses. So I tried this solution but the error persists.

This is the repo/branch of this question.

When I type npm start. Everything flows swiftly and with no errors.


回答1:


I solved it by following this instructions.

Thanks CherryDt.



来源:https://stackoverflow.com/questions/63219552/jest-import-statement-typeerror-cannot-set-property-fillstyle-of-null

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!