vitest.config.ts 822 B

1234567891011121314151617181920212223242526272829303132
  1. /**
  2. * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
  3. * SPDX-License-Identifier: MIT
  4. */
  5. const path = require('path');
  6. import { defineConfig } from 'vitest/config';
  7. export default defineConfig({
  8. build: {
  9. commonjsOptions: {
  10. transformMixedEsModules: true,
  11. },
  12. },
  13. test: {
  14. testTimeout: 30000,
  15. globals: true,
  16. mockReset: false,
  17. environment: 'jsdom',
  18. setupFiles: [path.resolve(__dirname, './vitest.setup.ts')],
  19. include: ['**/?(*.){test,spec}.?(c|m)[jt]s?(x)'],
  20. exclude: [
  21. '**/__mocks__**',
  22. '**/node_modules/**',
  23. '**/dist/**',
  24. '**/lib/**', // lib 编译结果忽略掉
  25. '**/cypress/**',
  26. '**/.{idea,git,cache,output,temp}/**',
  27. '**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*',
  28. ],
  29. },
  30. });