From 353e565923c3819dbb9bef8025cc714c42075a8f Mon Sep 17 00:00:00 2001 From: Wojciech Maj Date: Sat, 6 Jan 2024 17:59:49 +0100 Subject: [PATCH] Replace vitest-canvas-mock with node-canvas --- packages/react-pdf/package.json | 4 +-- packages/react-pdf/vitest.config.ts | 5 ---- packages/react-pdf/vitest.setup.ts | 1 - yarn.lock | 41 ++--------------------------- 4 files changed, 4 insertions(+), 47 deletions(-) diff --git a/packages/react-pdf/package.json b/packages/react-pdf/package.json index 5f3593028..48d02bb7a 100644 --- a/packages/react-pdf/package.json +++ b/packages/react-pdf/package.json @@ -71,6 +71,7 @@ "@types/node": "*", "@types/react": "*", "@types/warning": "^3.0.0", + "canvas": "^2.11.2", "cpy-cli": "^5.0.0", "eslint": "^8.26.0", "eslint-config-wojtekmaj": "^0.9.0", @@ -81,8 +82,7 @@ "react-dom": "^18.2.0", "rimraf": "^3.0.0", "typescript": "^5.3.2", - "vitest": "^1.0.2", - "vitest-canvas-mock": "^0.2.2" + "vitest": "^1.0.2" }, "peerDependencies": { "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0", diff --git a/packages/react-pdf/vitest.config.ts b/packages/react-pdf/vitest.config.ts index c0a21535c..cfcdc7496 100644 --- a/packages/react-pdf/vitest.config.ts +++ b/packages/react-pdf/vitest.config.ts @@ -5,11 +5,6 @@ export default defineConfig({ environment: 'jsdom', exclude: [...configDefaults.exclude, 'src/index.test.ts'], pool: 'forks', - server: { - deps: { - inline: ['vitest-canvas-mock'], - }, - }, setupFiles: 'vitest.setup.ts', watch: false, }, diff --git a/packages/react-pdf/vitest.setup.ts b/packages/react-pdf/vitest.setup.ts index 471cc4aa8..5d0d42043 100644 --- a/packages/react-pdf/vitest.setup.ts +++ b/packages/react-pdf/vitest.setup.ts @@ -1,7 +1,6 @@ import { afterEach } from 'vitest'; import { cleanup } from '@testing-library/react'; import '@testing-library/jest-dom/vitest'; -import 'vitest-canvas-mock'; afterEach(() => { cleanup(); diff --git a/yarn.lock b/yarn.lock index 073b22f98..900c15b27 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1719,7 +1719,7 @@ __metadata: languageName: node linkType: hard -"color-name@npm:^1.1.4, color-name@npm:~1.1.4": +"color-name@npm:~1.1.4": version: 1.1.4 resolution: "color-name@npm:1.1.4" checksum: a1a3f914156960902f46f7f56bc62effc6c94e84b2cae157a526b1c1f74b677a47ec602bf68a61abfa2b42d15b7c5651c6dbe72a43af720bc588dff885b10f95 @@ -1836,13 +1836,6 @@ __metadata: languageName: node linkType: hard -"cssfontparser@npm:^1.2.1": - version: 1.2.1 - resolution: "cssfontparser@npm:1.2.1" - checksum: ceb9b2976d503dbff3ac2aff0229b263affb4fb221a6947b357682cd8a952f6995253646ca5f820020d2fe05b5e29b56dbdd2343388c32203e8dd0ed15bdc1ca - languageName: node - linkType: hard - "cssstyle@npm:^3.0.0": version: 3.0.0 resolution: "cssstyle@npm:3.0.0" @@ -3181,16 +3174,6 @@ __metadata: languageName: node linkType: hard -"jest-canvas-mock@npm:^2.4.0": - version: 2.5.0 - resolution: "jest-canvas-mock@npm:2.5.0" - dependencies: - cssfontparser: "npm:^1.2.1" - moo-color: "npm:^1.0.2" - checksum: db6cdda478c7cf9722c96fd1be37ed7f6a19c7db8a62a874693ca71a3eb61dcbb633cedead4a2deebd4d733a79c78a59c3bfb73ad410c13aa2fc74cbba317652 - languageName: node - linkType: hard - "js-sdsl@npm:^4.1.4": version: 4.4.0 resolution: "js-sdsl@npm:4.4.0" @@ -3808,15 +3791,6 @@ __metadata: languageName: node linkType: hard -"moo-color@npm:^1.0.2": - version: 1.0.3 - resolution: "moo-color@npm:1.0.3" - dependencies: - color-name: "npm:^1.1.4" - checksum: 778c82f67f638c03a1d0fa78dcd6ea376a9f17b5e78e349c7e34a290b496dbdb43fd0b1c38070e2062d5e784bcf08e57f499015fcbcf52b3a1887d7825ebb80d - languageName: node - linkType: hard - "ms@npm:2.1.2": version: 2.1.2 resolution: "ms@npm:2.1.2" @@ -4551,6 +4525,7 @@ __metadata: "@types/node": "npm:*" "@types/react": "npm:*" "@types/warning": "npm:^3.0.0" + canvas: "npm:^2.11.2" clsx: "npm:^2.0.0" cpy-cli: "npm:^5.0.0" eslint: "npm:^8.26.0" @@ -4569,7 +4544,6 @@ __metadata: tiny-invariant: "npm:^1.0.0" typescript: "npm:^5.3.2" vitest: "npm:^1.0.2" - vitest-canvas-mock: "npm:^0.2.2" warning: "npm:^4.0.0" peerDependencies: "@types/react": ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -5610,17 +5584,6 @@ __metadata: languageName: node linkType: hard -"vitest-canvas-mock@npm:^0.2.2": - version: 0.2.2 - resolution: "vitest-canvas-mock@npm:0.2.2" - dependencies: - jest-canvas-mock: "npm:^2.4.0" - peerDependencies: - vitest: "*" - checksum: f8b77ed9216f749f6768a9c1190fd999ce3d70b7afc5c615b180971fcdc3353779cb249cdf2c40f75bb15c031795ad5f76b3f27783bce54cd6547e16e91f18eb - languageName: node - linkType: hard - "vitest@npm:^1.0.2": version: 1.0.2 resolution: "vitest@npm:1.0.2"