Przeglądaj źródła

test(email-plugin): Attempt to speed up tests

Michael Bromley 6 lat temu
rodzic
commit
23b8659731

+ 1 - 1
package.json

@@ -24,7 +24,7 @@
     "test:all": "cd admin-ui && yarn test --watch=false --browsers=ChromeHeadlessCI --progress=false && cd ../ && yarn test:common && yarn test:core && yarn test:email-plugin && yarn test:elasticsearch-plugin && yarn test:e2e",
     "test:common": "jest --config packages/common/jest.config.js",
     "test:core": "jest --config packages/core/jest.config.js",
-    "test:email-plugin": "jest --config packages/email-plugin/jest.config.js",
+    "test:email-plugin": "jest --config packages/email-plugin/jest.config.js --maxWorkers=1",
     "test:elasticsearch-plugin": "jest --config packages/elasticsearch-plugin/jest.config.js",
     "test:e2e": "jest --config packages/core/e2e/config/jest-e2e.json --runInBand",
     "test:admin-ui": "cd admin-ui && yarn test --watch=false --browsers=ChromeHeadlessCI --progress=false",

+ 1 - 0
packages/email-plugin/jest.config.js

@@ -15,6 +15,7 @@ module.exports = {
     },
     globals: {
         'ts-jest': {
+            isolatedModules: false,
             tsConfig: {
                 allowJs: true,
                 skipLibCheck: true,

+ 6 - 3
packages/email-plugin/src/plugin.spec.ts

@@ -1,9 +1,12 @@
 /* tslint:disable:no-non-null-assertion */
 import path from 'path';
 
-import { LanguageCode } from '../../common/src/generated-types';
-import { DEFAULT_CHANNEL_CODE } from '../../common/src/shared-constants';
-import { EventBus, Order, OrderStateTransitionEvent, VendureEvent } from '../../core';
+import { LanguageCode } from '../../common/lib/generated-types';
+import { DEFAULT_CHANNEL_CODE } from '../../common/lib/shared-constants';
+import { Order } from '../../core/dist/entity/order/order.entity';
+import { EventBus } from '../../core/dist/event-bus/event-bus';
+import { OrderStateTransitionEvent } from '../../core/dist/event-bus/events/order-state-transition-event';
+import { VendureEvent } from '../../core/dist/event-bus/vendure-event';
 
 import { orderConfirmationHandler } from './default-email-handlers';
 import { EmailEventHandler, EmailEventListener } from './event-listener';