test-config.ts 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import * as path from 'path';
  2. import { API_PATH } from '../../../shared/shared-constants';
  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. apiPath: API_PATH,
  20. cors: true,
  21. defaultChannelToken: 'e2e-default-channel',
  22. authOptions: {
  23. sessionSecret: 'some-secret',
  24. tokenMethod: 'bearer',
  25. requireVerification: true,
  26. },
  27. dbConnectionOptions: {
  28. type: 'sqljs',
  29. database: new Uint8Array([]),
  30. location: '',
  31. autoSave: false,
  32. logging: false,
  33. },
  34. promotionOptions: {},
  35. customFields: {},
  36. entityIdStrategy: new TestingEntityIdStrategy(),
  37. paymentOptions: {
  38. paymentMethodHandlers: [],
  39. },
  40. emailOptions: {
  41. transport: {
  42. type: 'none',
  43. },
  44. },
  45. importExportOptions: {
  46. importAssetsDir: path.join(__dirname, '..', 'fixtures'),
  47. },
  48. assetOptions: {
  49. assetNamingStrategy: new DefaultAssetNamingStrategy(),
  50. assetStorageStrategy: new TestingAssetStorageStrategy(),
  51. assetPreviewStrategy: new TestingAssetPreviewStrategy(),
  52. },
  53. };