test-config.ts 1.0 KB

123456789101112131415161718192021222324252627282930
  1. import { mergeConfig } from '@vendure/core';
  2. import { testConfig as defaultTestConfig } from '@vendure/testing';
  3. import path from 'path';
  4. import { getPackageDir } from './get-package-dir';
  5. /**
  6. * We use a relatively long timeout on the initial beforeAll() function of the
  7. * e2e tests because on the first run (and always in CI) the sqlite databases
  8. * need to be generated, which can take a while.
  9. */
  10. export const TEST_SETUP_TIMEOUT_MS = process.env.E2E_DEBUG ? 1800 * 1000 : 120000;
  11. /**
  12. * For local debugging of the e2e tests, we set a very long timeout value otherwise tests will
  13. * automatically fail for going over the 5 second default timeout.
  14. */
  15. if (process.env.E2E_DEBUG) {
  16. // tslint:disable-next-line:no-console
  17. console.log('E2E_DEBUG', process.env.E2E_DEBUG, ' - setting long timeout');
  18. jest.setTimeout(1800 * 1000);
  19. }
  20. const packageDir = getPackageDir();
  21. export const testConfig = mergeConfig(defaultTestConfig, {
  22. importExportOptions: {
  23. importAssetsDir: path.join(packageDir, 'fixtures/assets'),
  24. },
  25. });