P5.js unit testing with Jest

I used global.color = require('color'); to get rid of some of the errors.
image

If you have found any other solution for this problem, also let me know. I am able to get rid of these errors for color but createDiv is giving me errors.