wobsoriano / vitest-canvas-mock

🌗 A module used to mock canvas in Vitest.
MIT License
53 stars 8 forks source link

0.3.0 update failing with Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package) #7

Closed gdams closed 1 year ago

gdams commented 1 year ago

The update to 0.3.0 is now causing the following error:

Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package)
    at module.exports (/Users/gadams/adoptium.net/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17)
    at HTMLCanvasElementImpl.getContext (/Users/gadams/adoptium.net/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5)
    at HTMLCanvasElement.getContext (/Users/gadams/adoptium.net/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:131:58)
    at /Users/gadams/adoptium.net/node_modules/axe-core/axe.js:11337:49
    at Object.get (/Users/gadams/adoptium.net/node_modules/axe-core/axe.js:5922:23)
    at isIconLigature (/Users/gadams/adoptium.net/node_modules/axe-core/axe.js:11336:41)
    at /Users/gadams/adoptium.net/node_modules/axe-core/axe.js:21266:54
    at Array.some (<anonymous>)
    at hasRealTextChildren (/Users/gadams/adoptium.net/node_modules/axe-core/axe.js:21265:35)
    at Rule.colorContrastMatches [as matches] (/Users/gadams/adoptium.net/node_modules/axe-core/axe.js:21235:12) undefined
gdams commented 1 year ago

@wobsoriano any update here?

wobsoriano commented 1 year ago

Reverted back to jest-canvas-mock 2.4.0. Can you check?

jonathanawesome commented 1 year ago

Thank you for the revert, this is working again for us now!

gdams commented 1 year ago

Reverted back to jest-canvas-mock 2.4.0. Can you check?

yup, that's working now! thank you

marklai1998 commented 7 months ago

@gdams why closing this? I'm using 0.3.3 and it still has this issue