test-config.ts 1.8 KB

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