test-config.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import { API_PATH } from 'shared/shared-constants';
  2. import { DefaultAssetNamingStrategy } from '../../src/config/asset-naming-strategy/default-asset-naming-strategy';
  3. import { VendureConfig } from '../../src/config/vendure-config';
  4. import { TestingAssetPreviewStrategy } from './testing-asset-preview-strategy';
  5. import { TestingAssetStorageStrategy } from './testing-asset-storage-strategy';
  6. import { TestingEntityIdStrategy } from './testing-entity-id-strategy';
  7. /**
  8. * We use a relatively long timeout on the initial beforeAll() function of the
  9. * e2e tests because on the first run (and always in CI) the sqlite databases
  10. * need to be generated, which can take a while.
  11. */
  12. export const TEST_SETUP_TIMEOUT_MS = 120000;
  13. /**
  14. * Config settings used for e2e tests
  15. */
  16. export const testConfig: VendureConfig = {
  17. port: 3050,
  18. apiPath: API_PATH,
  19. cors: true,
  20. defaultChannelToken: 'e2e-default-channel',
  21. authOptions: {
  22. sessionSecret: 'some-secret',
  23. tokenMethod: 'bearer',
  24. },
  25. dbConnectionOptions: {
  26. type: 'sqljs',
  27. database: new Uint8Array([]),
  28. location: '',
  29. autoSave: false,
  30. logging: false,
  31. },
  32. promotionOptions: {},
  33. customFields: {},
  34. entityIdStrategy: new TestingEntityIdStrategy(),
  35. paymentOptions: {
  36. paymentMethodHandlers: [],
  37. },
  38. assetOptions: {
  39. assetNamingStrategy: new DefaultAssetNamingStrategy(),
  40. assetStorageStrategy: new TestingAssetStorageStrategy(),
  41. assetPreviewStrategy: new TestingAssetPreviewStrategy(),
  42. },
  43. };