test: declare `canvas` so the jsdom tests get a real 2D context

captureDisplay.test.ts runs under @vitest-environment jsdom and says in its own
header that "jsdom + the `canvas` package give a real 2D context here" — but
canvas was never a direct devDependency. jsdom lists it as optional, so npm
skipped it, getContext('2d') returned null, and five tests died on
`ctx.fillStyle` with a TypeError. That aborted the pre-deploy test gate.

Declaring it directly makes the install deterministic; the lockfile already
carried the entry. All six tests pass with it present.
This commit is contained in:
David Montero Crespo 2026-08-18 02:05:01 +02:00
parent 20fc27e680
commit a0aeb101cd
1 changed files with 1 additions and 0 deletions

View File

@ -69,6 +69,7 @@
"@vitejs/plugin-react": "^5.1.1",
"@vitest/coverage-v8": "^4.0.18",
"@vitest/ui": "^4.0.18",
"canvas": "^3.2.3",
"eslint": "^9.39.1",
"eslint-config-prettier": "10.1.8",
"eslint-plugin-react-hooks": "^7.0.1",