vitest.config.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. import path from 'path';
  2. import swc from 'unplugin-swc';
  3. import { defineConfig } from 'vitest/config';
  4. export default defineConfig({
  5. test: {
  6. include: '**/*.e2e-spec.ts',
  7. /**
  8. * For local debugging of the e2e tests, we set a very long timeout value otherwise tests will
  9. * automatically fail for going over the 5 second default timeout.
  10. */
  11. testTimeout: process.env.E2E_DEBUG ? 1800 * 1000 : process.env.CI ? 30 * 1000 : 15 * 1000,
  12. // threads: false,
  13. // singleThread: true,
  14. // reporters: ['verbose'],
  15. typecheck: {
  16. tsconfig: path.join(__dirname, 'tsconfig.e2e.json'),
  17. },
  18. },
  19. plugins: [
  20. // SWC required to support decorators used in test plugins
  21. // See https://github.com/vitest-dev/vitest/issues/708#issuecomment-1118628479
  22. // Vite plugin
  23. swc.vite({
  24. jsc: {
  25. transform: {
  26. // See https://github.com/vendure-ecommerce/vendure/issues/2099
  27. useDefineForClassFields: false,
  28. },
  29. },
  30. }),
  31. ],
  32. });