test-config.ts 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import 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. emailTemplatePath: __dirname,
  42. transport: {
  43. type: 'none',
  44. },
  45. },
  46. importExportOptions: {
  47. importAssetsDir: path.join(__dirname, '..', 'fixtures/assets'),
  48. },
  49. assetOptions: {
  50. assetNamingStrategy: new DefaultAssetNamingStrategy(),
  51. assetStorageStrategy: new TestingAssetStorageStrategy(),
  52. assetPreviewStrategy: new TestingAssetPreviewStrategy(),
  53. },
  54. };