Jest import statement: 'TypeError: Cannot set property 'fillStyle' of null'
问题 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