Files
Notes/vitest.config.js
2026-09-12 14:15:26 +08:00

19 lines
734 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// Vitest 配置Stage 7
//
// 设计:
// - 测试目录tests/unit/** 按模块名就近放stats / editor-theme / modal / ...
// - 默认环境node最快config-store / stats / editor-theme 这些纯函数)
// - 标记 // @vitest-environment jsdom 的文件用 jsdommodal / 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,
},
});