test: increase coverage and add codecov integration

This commit is contained in:
Justineo
2025-09-20 22:47:33 +08:00
committed by GU Yiling
parent e0cf2a4e7e
commit 373fe19d59
31 changed files with 2813 additions and 169 deletions

14
tests/setup.ts Normal file
View File

@ -0,0 +1,14 @@
import { afterEach, vi } from "vitest";
import { cleanup } from "vitest-browser-vue/pure";
import { createEChartsModule } from "./helpers/mock";
import { resetDocumentBody } from "./helpers/dom";
// Mock echarts/core globally for browser tests
vi.mock("echarts/core", () => createEChartsModule());
// Centralized cleanup for all browser tests
afterEach(() => {
cleanup();
resetDocumentBody();
});