mikemadest / jest-environment-linkedom

Trying to make linkedom works in a jest project
16 stars 1 forks source link

ReferenceError: HTMLCanvasElement is not defined #1

Open selfagency opened 2 years ago

selfagency commented 2 years ago

Following your example, all my tests are throwing errors like this:

 FAIL  components/auth/FirebaseAuth.test.tsx
  ● Test suite failed to run

    ReferenceError: HTMLCanvasElement is not defined

      at mockPrototype (../node_modules/jest-canvas-mock/lib/mock/prototype.js:42:28)
      at _default (../node_modules/jest-canvas-mock/lib/window.js:73:26)
      at Object.<anonymous> (../node_modules/jest-canvas-mock/lib/index.js:19:39)

  console.info
    Loaded env from /Users/daniel/code/ud/unstoppable-domains-website/client/.env

      at processEnv (../node_modules/@next/env/dist/index.js:1:2769)

Any suggestions?

sibelius commented 4 months ago

any way to fix it ?