test-config.ts 1.9 KB

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