开玩笑的导入语句:'TypeError:无法将属性'fillStyle'设置为null' [英] Jest import statement: 'TypeError: Cannot set property 'fillStyle' of null'

查看:75
本文介绍了开玩笑的导入语句:'TypeError:无法将属性'fillStyle'设置为null'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我键入:

npm test

我得到:

有趣的是,import语句可以在BootScene.test.js文件中使用,但不能在导入的文件中使用.

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.

我重点介绍了在JEst下不起作用的导入声明.因此,我认为这可能与Ecma Script版本的笑话使用有关.因此,我尝试了解决方案,但错误仍然存​​在.

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.

当我键入npm start时.一切迅速进行,没有错误.

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

推荐答案

我通过遵循

感谢CherryDt.

Thanks CherryDt.

这篇关于开玩笑的导入语句:'TypeError:无法将属性'fillStyle'设置为null'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆