开玩笑的导入语句:'TypeError:无法将属性'fillStyle'设置为null'

时间:2020-08-02 18:16:56

标签: javascript jestjs babeljs phaser-framework

我键入:

npm test

我得到:

enter image description here

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

我专注于在JEst下不起作用的导入声明。因此,我认为这可能与Ecma Script版本开玩笑有关。所以我尝试了this解决方案,但错误仍然存​​在。

This是此问题的回购/分支。

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

1 个答案:

答案 0 :(得分:1)

我按照this的说明进行了解决。

enter image description here

感谢CherryDt。