vitest.config.ts 328 B

123456789101112
  1. import { defineConfig } from "vitest/config";
  2. /**
  3. * 组件级(DOM)测试:只跑 `src` 下的 `*.test.tsx`,与既有纯逻辑测试
  4. * (`tests/*.test.mjs`,node --test,无 DOM)互不影响。
  5. */
  6. export default defineConfig({
  7. test: {
  8. environment: "jsdom",
  9. include: ["src/**/*.test.{ts,tsx}"],
  10. },
  11. });