Skip to content

Commit 8027a30

Browse files
committed
test(crypto-js): Remove dependency to canvas.
1 parent 1d9ac6e commit 8027a30

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

bindings/matrix-sdk-crypto-js/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"pkg/matrix_sdk_crypto.d.ts"
2727
],
2828
"devDependencies": {
29-
"canvas": "^2.10.1",
3029
"cross-env": "^7.0.3",
3130
"fake-indexeddb": "^4.0",
3231
"jest": "^28.1.0",

bindings/matrix-sdk-crypto-js/tests/device.test.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,9 @@ describe('Key Verification', () => {
749749

750750
expect(qrCode).toBeInstanceOf(QrCode);
751751

752-
let canvasBuffer;
752+
// Want to get `canvasBuffer` to render the QR code? Install `npm install canvas` and uncomment the following blocks.
753+
754+
//let canvasBuffer;
753755

754756
{
755757
const buffer = qrCode.renderIntoBuffer();
@@ -760,6 +762,7 @@ describe('Key Verification', () => {
760762
// 0 for a white pixel, 1 for a black pixel.
761763
expect(buffer.every(p => p == 0 || p == 1)).toStrictEqual(true);
762764

765+
/*
763766
const { Canvas } = require('canvas');
764767
const canvas = new Canvas(55, 55);
765768
@@ -792,6 +795,7 @@ describe('Key Verification', () => {
792795
793796
context.putImageData(imageData, 5, 5);
794797
canvasBuffer = canvas.toBuffer('image/png');
798+
*/
795799
}
796800

797801
// Want to see the QR code? Uncomment the following block.

0 commit comments

Comments
 (0)