-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
What needs testing
While running the test suite (npm test), I observed repeated warnings in the console: Not implemented: HTMLCanvasElement.prototype.getContext
The tests pass successfully, but this warning appears multiple times during execution.
This seems to occur because jsdom does not implement canvas rendering APIs by default, and HTMLCanvasElement.getContext is not globally mocked in the Jest environment.
Current coverage
All existing test suites pass (120/120), and coverage is being collected correctly.
However, the test environment logs repeated jsdom warnings related to canvas rendering, which results in noisy output and may affect CI clarity.
Proposed approach
Add a global Jest setup file to mock:
HTMLCanvasElement.prototype.getContextI am willing to contribute to this approach if it gets approved.
Checklist
- I have read and followed the project's code of conduct.
- I have checked that no existing tests cover this area.
- I have checked that there is no open PR for the tests I am submitting.
- I have reviewed docs/TESTING.md for testing patterns.
π See Testing Guide for how to write block tests.
ππΎππΌ Questions: Community Matrix Server.