Skip to content

Commit

Permalink
Fix broken unit tests by installing canvas
Browse files Browse the repository at this point in the history
The unit test associated with the app banner was failing with the following error: "TypeError: Cannot set property 'fillStyle' of null"

As lottie-web uses canvas and jest doesn't handle canvas by default, it's necessary to install canvas as a dependency to prevent broken unit tests.
  • Loading branch information
Siobhan committed Aug 30, 2022
1 parent 0242520 commit 6c7a31f
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@
"@wordpress/eslint-plugin": "^12.3.0",
"babel-loader": "^8.2.3",
"bunyan": "^1.8.15",
"canvas": "^2.9.3",
"capture-website": "^1.0.0",
"chalk": "^4.1.2",
"check-node-version": "^4.0.2",
Expand Down
41 changes: 40 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4368,6 +4368,25 @@ __metadata:
languageName: node
linkType: hard

"@mapbox/node-pre-gyp@npm:^1.0.0":
version: 1.0.9
resolution: "@mapbox/node-pre-gyp@npm:1.0.9"
dependencies:
detect-libc: ^2.0.0
https-proxy-agent: ^5.0.0
make-dir: ^3.1.0
node-fetch: ^2.6.7
nopt: ^5.0.0
npmlog: ^5.0.1
rimraf: ^3.0.2
semver: ^7.3.5
tar: ^6.1.11
bin:
node-pre-gyp: bin/node-pre-gyp
checksum: 5b32a2c3bf44e0340a29cc82cbb726bc8f49aa721388fa741afb790035975299a114b907018fc35832896cde7fa11ba2c703e2ccfd1f5a99ffe1c57814f58571
languageName: node
linkType: hard

"@mdx-js/mdx@npm:^1.6.22":
version: 1.6.22
resolution: "@mdx-js/mdx@npm:1.6.22"
Expand Down Expand Up @@ -12820,6 +12839,18 @@ __metadata:
languageName: node
linkType: hard

"canvas@npm:^2.9.3":
version: 2.9.3
resolution: "canvas@npm:2.9.3"
dependencies:
"@mapbox/node-pre-gyp": ^1.0.0
nan: ^2.15.0
node-gyp: latest
simple-get: ^3.0.3
checksum: b11ab744d2905dd1c463707cfdd42ce80dffeeb927db1e7d43f750e739c88b736af4de8117e1b2e1ff8b25c60ad46cf7f659d35478ffb77185bbcee0474e7529
languageName: node
linkType: hard

"capture-exit@npm:^2.0.0":
version: 2.0.0
resolution: "capture-exit@npm:2.0.0"
Expand Down Expand Up @@ -15323,6 +15354,13 @@ __metadata:
languageName: node
linkType: hard

"detect-libc@npm:^2.0.0":
version: 2.0.1
resolution: "detect-libc@npm:2.0.1"
checksum: 153009d0ce4073ea885a97641aa1cc0327ff168b971fa3c770958345ad3ead4618f3747334435dc8edff32c0f56d8ba16dcf5271543c99b24af532b1cf84a61d
languageName: node
linkType: hard

"detect-newline@npm:^3.0.0":
version: 3.1.0
resolution: "detect-newline@npm:3.1.0"
Expand Down Expand Up @@ -25109,7 +25147,7 @@ __metadata:
languageName: node
linkType: hard

"nan@npm:^2.12.1, nan@npm:^2.14.0, nan@npm:^2.16.0":
"nan@npm:^2.12.1, nan@npm:^2.14.0, nan@npm:^2.15.0, nan@npm:^2.16.0":
version: 2.16.0
resolution: "nan@npm:2.16.0"
dependencies:
Expand Down Expand Up @@ -35946,6 +35984,7 @@ [email protected]:
bunyan: ^1.8.15
calypso: "workspace:^"
calypso-codemods: "workspace:^"
canvas: ^2.9.3
capture-website: ^1.0.0
chalk: ^4.1.2
check-node-version: ^4.0.2
Expand Down

0 comments on commit 6c7a31f

Please sign in to comment.