Skip to content

Commit f267988

Browse files
committed
Merge branch 'main' into clarasb/xxx-prepare_release_0.2.0
2 parents f6839ea + 779985a commit f267988

4 files changed

Lines changed: 41 additions & 27 deletions

File tree

chartlets.js/CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
- `vite: ^7.1.11`
99
- `vitest: ^3.2.4`
1010

11+
* Removed `canvas` from the test setup. `vitest.setup.ts` now
12+
uses `vitest-canvas-mock` instead. (#143)
13+
1114
* Added icon support for `Button`, `IconButton` and `Tabs` components.
1215
(#124).
1316

chartlets.js/package-lock.json

Lines changed: 35 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chartlets.js/packages/lib/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@
9696
"@typescript-eslint/parser": "^8.46.4",
9797
"@vitejs/plugin-react-swc": "^3.7.0",
9898
"@vitest/coverage-istanbul": "^3.2.4",
99-
"canvas": "^3.2.0",
10099
"eslint": "^9.39.1",
101100
"eslint-plugin-react-hooks": "^7.0.1",
102101
"eslint-plugin-react-refresh": "^0.4.24",
@@ -107,6 +106,7 @@
107106
"typescript": "^5.6.2",
108107
"vite": "^7.1.11",
109108
"vite-plugin-dts": "^4.2.4",
110-
"vitest": "^3.2.4"
109+
"vitest": "^3.2.4",
110+
"vitest-canvas-mock": "^1.1.3"
111111
}
112112
}

chartlets.js/packages/lib/vitest.setup.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,4 @@
55
*/
66

77
import "@testing-library/jest-dom";
8-
import { vi } from "vitest";
9-
import { createCanvas } from "canvas";
10-
11-
// Mock getContext for HTMLCanvasElement
12-
HTMLCanvasElement.prototype.getContext = vi.fn().mockImplementation((type) => {
13-
const canvas = createCanvas(100, 100);
14-
return canvas.getContext(type);
15-
});
8+
import "vitest-canvas-mock";

0 commit comments

Comments
 (0)