test-config.ts 1.0 KB

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