This commit is contained in:
2026-09-12 14:15:26 +08:00
commit 9c06d3f4be
99 changed files with 41853 additions and 0 deletions

19
vitest.config.js Normal file
View File

@@ -0,0 +1,19 @@
// Vitest 配置(Stage 7)
//
// 设计:
// - 测试目录:tests/unit/** (按模块名就近放:stats / editor-theme / modal / ...)
// - 默认环境:node(最快;config-store / stats / editor-theme 这些纯函数)
// - 标记 // @vitest-environment jsdom 的文件用 jsdom(modal / file-ops 涉及 DOM)
// - 不跑 tests/_fixtures/ 之类的辅助文件 —— glob 只覆盖 *.test.js
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
include: ['tests/unit/**/*.test.js'],
// 默认 node 环境;需要 DOM 的文件用 /* @vitest-environment jsdom */ 标记
environment: 'node',
// 测试结束清掉临时文件
clearMocks: true,
},
});