1
0

vitest.config.mts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  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. // In jobs-queue.e2e-spec.ts, we use `it.only()` for sqljs, so we need this
  19. // set to true to avoid failures in CI.
  20. allowOnly: true,
  21. },
  22. plugins: [
  23. // SWC required to support decorators used in test plugins
  24. // See https://github.com/vitest-dev/vitest/issues/708#issuecomment-1118628479
  25. // Vite plugin
  26. swc.vite({
  27. jsc: {
  28. transform: {
  29. // See https://github.com/vendurehq/vendure/issues/2099
  30. useDefineForClassFields: false,
  31. },
  32. },
  33. }),
  34. ],
  35. });