medusa-test-utils 1.1.45-snapshot-20240531102054 → 1.1.45-snapshot-20240701122250

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,168 +1,62 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- var __values = (this && this.__values) || function(o) {
39
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
40
- if (m) return m.call(o);
41
- if (o && typeof o.length === "number") return {
42
- next: function () {
43
- if (o && i >= o.length) o = void 0;
44
- return { value: o && o[i++], done: !o };
45
- }
46
- };
47
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
48
- };
49
2
  Object.defineProperty(exports, "__esModule", { value: true });
50
3
  exports.medusaIntegrationTestRunner = void 0;
51
- var utils_1 = require("@medusajs/utils");
52
- var pg_god_1 = require("pg-god");
53
- var database_1 = require("./database");
54
- var bootstrap_app_1 = require("./medusa-test-runner-utils/bootstrap-app");
55
- var use_db_1 = require("./medusa-test-runner-utils/use-db");
56
- var axios = require("axios").default;
57
- var DB_HOST = process.env.DB_HOST;
58
- var DB_USERNAME = process.env.DB_USERNAME;
59
- var DB_PASSWORD = process.env.DB_PASSWORD;
60
- var pgGodCredentials = {
4
+ const utils_1 = require("@medusajs/utils");
5
+ const pg_god_1 = require("pg-god");
6
+ const database_1 = require("./database");
7
+ const bootstrap_app_1 = require("./medusa-test-runner-utils/bootstrap-app");
8
+ const use_db_1 = require("./medusa-test-runner-utils/use-db");
9
+ const axios = require("axios").default;
10
+ const DB_HOST = process.env.DB_HOST;
11
+ const DB_USERNAME = process.env.DB_USERNAME;
12
+ const DB_PASSWORD = process.env.DB_PASSWORD;
13
+ const pgGodCredentials = {
61
14
  user: DB_USERNAME,
62
15
  password: DB_PASSWORD,
63
16
  host: DB_HOST,
64
17
  };
65
- var dbTestUtilFactory = function () { return ({
18
+ const dbTestUtilFactory = () => ({
66
19
  pgConnection_: null,
67
- create: function (dbName) {
68
- return __awaiter(this, void 0, void 0, function () {
69
- return __generator(this, function (_a) {
70
- switch (_a.label) {
71
- case 0: return [4 /*yield*/, (0, pg_god_1.createDatabase)({ databaseName: dbName }, pgGodCredentials)];
72
- case 1:
73
- _a.sent();
74
- return [2 /*return*/];
75
- }
76
- });
77
- });
20
+ create: async function (dbName) {
21
+ await (0, pg_god_1.createDatabase)({ databaseName: dbName }, pgGodCredentials);
78
22
  },
79
- teardown: function () {
80
- return __awaiter(this, arguments, void 0, function (_a) {
81
- var runRawQuery, tableNames, tableNames_1, tableNames_1_1, table_name, e_1_1;
82
- var e_1, _b;
83
- var _c = _a === void 0 ? {} : _a, schema = _c.schema;
84
- return __generator(this, function (_d) {
85
- switch (_d.label) {
86
- case 0:
87
- if (!this.pgConnection_) {
88
- return [2 /*return*/];
89
- }
90
- runRawQuery = this.pgConnection_.raw.bind(this.pgConnection_);
91
- schema !== null && schema !== void 0 ? schema : (schema = "public");
92
- return [4 /*yield*/, runRawQuery("SET session_replication_role = 'replica';")];
93
- case 1:
94
- _d.sent();
95
- return [4 /*yield*/, runRawQuery("SELECT table_name\n FROM information_schema.tables\n WHERE table_schema = '".concat(schema, "';"))];
96
- case 2:
97
- tableNames = (_d.sent()).rows;
98
- _d.label = 3;
99
- case 3:
100
- _d.trys.push([3, 8, 9, 10]);
101
- tableNames_1 = __values(tableNames), tableNames_1_1 = tableNames_1.next();
102
- _d.label = 4;
103
- case 4:
104
- if (!!tableNames_1_1.done) return [3 /*break*/, 7];
105
- table_name = tableNames_1_1.value.table_name;
106
- return [4 /*yield*/, runRawQuery("DELETE\n FROM ".concat(schema, ".\"").concat(table_name, "\";"))];
107
- case 5:
108
- _d.sent();
109
- _d.label = 6;
110
- case 6:
111
- tableNames_1_1 = tableNames_1.next();
112
- return [3 /*break*/, 4];
113
- case 7: return [3 /*break*/, 10];
114
- case 8:
115
- e_1_1 = _d.sent();
116
- e_1 = { error: e_1_1 };
117
- return [3 /*break*/, 10];
118
- case 9:
119
- try {
120
- if (tableNames_1_1 && !tableNames_1_1.done && (_b = tableNames_1.return)) _b.call(tableNames_1);
121
- }
122
- finally { if (e_1) throw e_1.error; }
123
- return [7 /*endfinally*/];
124
- case 10: return [4 /*yield*/, runRawQuery("SET session_replication_role = 'origin';")];
125
- case 11:
126
- _d.sent();
127
- return [2 /*return*/];
128
- }
129
- });
130
- });
23
+ teardown: async function ({ schema } = {}) {
24
+ if (!this.pgConnection_) {
25
+ return;
26
+ }
27
+ const runRawQuery = this.pgConnection_.raw.bind(this.pgConnection_);
28
+ schema ??= "public";
29
+ await runRawQuery(`SET session_replication_role = 'replica';`);
30
+ const { rows: tableNames } = await runRawQuery(`SELECT table_name
31
+ FROM information_schema.tables
32
+ WHERE table_schema = '${schema}';`);
33
+ for (const { table_name } of tableNames) {
34
+ await runRawQuery(`DELETE
35
+ FROM ${schema}."${table_name}";`);
36
+ }
37
+ await runRawQuery(`SET session_replication_role = 'origin';`);
131
38
  },
132
- shutdown: function (dbName) {
133
- return __awaiter(this, void 0, void 0, function () {
134
- var _a, _b, _c;
135
- return __generator(this, function (_d) {
136
- switch (_d.label) {
137
- case 0: return [4 /*yield*/, ((_b = (_a = this.pgConnection_) === null || _a === void 0 ? void 0 : _a.context) === null || _b === void 0 ? void 0 : _b.destroy())];
138
- case 1:
139
- _d.sent();
140
- return [4 /*yield*/, ((_c = this.pgConnection_) === null || _c === void 0 ? void 0 : _c.destroy())];
141
- case 2:
142
- _d.sent();
143
- return [4 /*yield*/, (0, pg_god_1.dropDatabase)({ databaseName: dbName, errorIfNonExist: false }, pgGodCredentials)];
144
- case 3: return [2 /*return*/, _d.sent()];
145
- }
146
- });
147
- });
39
+ shutdown: async function (dbName) {
40
+ await this.pgConnection_?.context?.destroy();
41
+ await this.pgConnection_?.destroy();
42
+ return await (0, pg_god_1.dropDatabase)({ databaseName: dbName, errorIfNonExist: false }, pgGodCredentials);
148
43
  },
149
- }); };
150
- function medusaIntegrationTestRunner(_a) {
151
- var _this = this;
152
- var moduleName = _a.moduleName, dbName = _a.dbName, _b = _a.schema, schema = _b === void 0 ? "public" : _b, _c = _a.env, env = _c === void 0 ? {} : _c, _d = _a.debug, debug = _d === void 0 ? false : _d, testSuite = _a.testSuite;
153
- var tempName = parseInt(process.env.JEST_WORKER_ID || "1");
154
- moduleName = moduleName !== null && moduleName !== void 0 ? moduleName : Math.random().toString(36).substring(7);
155
- dbName !== null && dbName !== void 0 ? dbName : (dbName = "medusa-".concat(moduleName.toLowerCase(), "-integration-").concat(tempName));
156
- var dbConfig = {
157
- dbName: dbName,
44
+ });
45
+ function medusaIntegrationTestRunner({ moduleName, dbName, schema = "public", env = {}, debug = false, testSuite, }) {
46
+ const tempName = parseInt(process.env.JEST_WORKER_ID || "1");
47
+ moduleName = moduleName ?? Math.random().toString(36).substring(7);
48
+ dbName ??= `medusa-${moduleName.toLowerCase()}-integration-${tempName}`;
49
+ let dbConfig = {
50
+ dbName,
158
51
  clientUrl: (0, database_1.getDatabaseURL)(dbName),
159
- schema: schema,
160
- debug: debug,
52
+ schema,
53
+ debug,
161
54
  };
162
- var originalConfigLoader = require("@medusajs/medusa/dist/loaders/config").default;
163
- require("@medusajs/medusa/dist/loaders/config").default = function (rootDirectory) {
164
- var config = originalConfigLoader(rootDirectory);
55
+ const originalConfigLoader = require("@medusajs/medusa/dist/loaders/config").default;
56
+ require("@medusajs/medusa/dist/loaders/config").default = (rootDirectory) => {
57
+ const config = originalConfigLoader(rootDirectory);
165
58
  config.projectConfig.databaseUrl = dbConfig.clientUrl;
59
+ config.projectConfig.databaseLogging = !!dbConfig.debug;
166
60
  config.projectConfig.databaseDriverOptions = dbConfig.clientUrl.includes("localhost")
167
61
  ? {}
168
62
  : {
@@ -173,159 +67,108 @@ function medusaIntegrationTestRunner(_a) {
173
67
  };
174
68
  return config;
175
69
  };
176
- var cwd = process.cwd();
177
- var shutdown = function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
178
- return [2 /*return*/, void 0];
179
- }); }); };
180
- var dbUtils = dbTestUtilFactory();
181
- var container;
182
- var apiUtils;
183
- var options = {
70
+ const cwd = process.cwd();
71
+ let shutdown = async () => void 0;
72
+ const dbUtils = dbTestUtilFactory();
73
+ let container;
74
+ let apiUtils;
75
+ let options = {
184
76
  api: new Proxy({}, {
185
- get: function (target, prop) {
77
+ get: (target, prop) => {
186
78
  return apiUtils[prop];
187
79
  },
188
80
  }),
189
81
  dbConnection: new Proxy({}, {
190
- get: function (target, prop) {
82
+ get: (target, prop) => {
191
83
  return dbUtils.pgConnection_[prop];
192
84
  },
193
85
  }),
194
- getContainer: function () { return container; },
86
+ getContainer: () => container,
195
87
  dbConfig: {
196
- dbName: dbName,
197
- schema: schema,
88
+ dbName,
89
+ schema,
198
90
  clientUrl: dbConfig.clientUrl,
199
91
  },
92
+ dbUtils,
200
93
  };
201
- var isFirstTime = true;
202
- var beforeAll_ = function () { return __awaiter(_this, void 0, void 0, function () {
203
- var _a, error_1, containerRes, serverShutdownRes, portRes, _b, _c, shutdown_1, container_1, port, error_2, cancelTokenSource;
204
- var _this = this;
205
- return __generator(this, function (_d) {
206
- switch (_d.label) {
207
- case 0: return [4 /*yield*/, dbUtils.create(dbName)];
208
- case 1:
209
- _d.sent();
210
- _d.label = 2;
211
- case 2:
212
- _d.trys.push([2, 4, , 5]);
213
- _a = dbUtils;
214
- return [4 /*yield*/, (0, use_db_1.initDb)({
215
- cwd: cwd,
216
- env: env,
217
- })];
218
- case 3:
219
- _a.pgConnection_ = _d.sent();
220
- return [3 /*break*/, 5];
221
- case 4:
222
- error_1 = _d.sent();
223
- console.error("Error initializing database", error_1 === null || error_1 === void 0 ? void 0 : error_1.message);
224
- throw error_1;
225
- case 5:
226
- _d.trys.push([5, 7, , 8]);
227
- return [4 /*yield*/, (0, bootstrap_app_1.startApp)({
228
- cwd: cwd,
229
- env: env,
230
- })];
231
- case 6:
232
- _b = _d.sent(), _c = _b.shutdown, shutdown_1 = _c === void 0 ? function () { return void 0; } : _c, container_1 = _b.container, port = _b.port;
233
- containerRes = container_1;
234
- serverShutdownRes = shutdown_1;
235
- portRes = port;
236
- return [3 /*break*/, 8];
237
- case 7:
238
- error_2 = _d.sent();
239
- console.error("Error starting the app", error_2 === null || error_2 === void 0 ? void 0 : error_2.message);
240
- throw error_2;
241
- case 8:
242
- cancelTokenSource = axios.CancelToken.source();
243
- container = containerRes;
244
- shutdown = function () { return __awaiter(_this, void 0, void 0, function () {
245
- return __generator(this, function (_a) {
246
- switch (_a.label) {
247
- case 0: return [4 /*yield*/, serverShutdownRes()];
248
- case 1:
249
- _a.sent();
250
- cancelTokenSource.cancel("Request canceled by shutdown");
251
- return [2 /*return*/];
252
- }
253
- });
254
- }); };
255
- apiUtils = axios.create({
256
- baseURL: "http://localhost:".concat(portRes),
257
- cancelToken: cancelTokenSource.token,
258
- });
259
- return [2 /*return*/];
260
- }
261
- });
262
- }); };
263
- var beforeEach_ = function () { return __awaiter(_this, void 0, void 0, function () {
264
- var container, copiedContainer, medusaAppLoaderRunner, error_3;
265
- return __generator(this, function (_a) {
266
- switch (_a.label) {
267
- case 0:
268
- // The beforeAll already run everything, so lets not re run the loaders for the first iteration
269
- if (isFirstTime) {
270
- isFirstTime = false;
271
- return [2 /*return*/];
272
- }
273
- container = options.getContainer();
274
- copiedContainer = (0, utils_1.createMedusaContainer)({}, container);
275
- _a.label = 1;
276
- case 1:
277
- _a.trys.push([1, 3, , 4]);
278
- medusaAppLoaderRunner = require("@medusajs/medusa/dist/loaders/medusa-app").runModulesLoader;
279
- return [4 /*yield*/, medusaAppLoaderRunner({
280
- container: copiedContainer,
281
- configModule: container.resolve(utils_1.ContainerRegistrationKeys.CONFIG_MODULE),
282
- })];
283
- case 2:
284
- _a.sent();
285
- return [3 /*break*/, 4];
286
- case 3:
287
- error_3 = _a.sent();
288
- console.error("Error runner modules loaders", error_3 === null || error_3 === void 0 ? void 0 : error_3.message);
289
- throw error_3;
290
- case 4: return [2 /*return*/];
291
- }
292
- });
293
- }); };
294
- var afterEach_ = function () { return __awaiter(_this, void 0, void 0, function () {
295
- var error_4;
296
- return __generator(this, function (_a) {
297
- switch (_a.label) {
298
- case 0:
299
- _a.trys.push([0, 2, , 3]);
300
- return [4 /*yield*/, dbUtils.teardown({ schema: schema })];
301
- case 1:
302
- _a.sent();
303
- return [3 /*break*/, 3];
304
- case 2:
305
- error_4 = _a.sent();
306
- console.error("Error tearing down database:", error_4 === null || error_4 === void 0 ? void 0 : error_4.message);
307
- throw error_4;
308
- case 3: return [2 /*return*/];
309
- }
94
+ let isFirstTime = true;
95
+ const beforeAll_ = async () => {
96
+ console.log(`Creating database ${dbName}`);
97
+ await dbUtils.create(dbName);
98
+ try {
99
+ dbUtils.pgConnection_ = await (0, use_db_1.initDb)({
100
+ cwd,
101
+ env,
102
+ });
103
+ }
104
+ catch (error) {
105
+ console.error("Error initializing database", error?.message);
106
+ throw error;
107
+ }
108
+ let containerRes;
109
+ let serverShutdownRes;
110
+ let portRes;
111
+ try {
112
+ const { shutdown = () => void 0, container, port, } = await (0, bootstrap_app_1.startApp)({
113
+ cwd,
114
+ env,
115
+ });
116
+ containerRes = container;
117
+ serverShutdownRes = shutdown;
118
+ portRes = port;
119
+ }
120
+ catch (error) {
121
+ console.error("Error starting the app", error?.message);
122
+ throw error;
123
+ }
124
+ const cancelTokenSource = axios.CancelToken.source();
125
+ container = containerRes;
126
+ shutdown = async () => {
127
+ await serverShutdownRes();
128
+ cancelTokenSource.cancel("Request canceled by shutdown");
129
+ };
130
+ apiUtils = axios.create({
131
+ baseURL: `http://localhost:${portRes}`,
132
+ cancelToken: cancelTokenSource.token,
310
133
  });
311
- }); };
312
- return describe("", function () {
134
+ };
135
+ const beforeEach_ = async () => {
136
+ // The beforeAll already run everything, so lets not re run the loaders for the first iteration
137
+ if (isFirstTime) {
138
+ isFirstTime = false;
139
+ return;
140
+ }
141
+ const container = options.getContainer();
142
+ const copiedContainer = (0, utils_1.createMedusaContainer)({}, container);
143
+ try {
144
+ const medusaAppLoaderRunner = require("@medusajs/medusa/dist/loaders/medusa-app").runModulesLoader;
145
+ await medusaAppLoaderRunner({
146
+ container: copiedContainer,
147
+ configModule: container.resolve(utils_1.ContainerRegistrationKeys.CONFIG_MODULE),
148
+ });
149
+ }
150
+ catch (error) {
151
+ console.error("Error runner modules loaders", error?.message);
152
+ throw error;
153
+ }
154
+ };
155
+ const afterEach_ = async () => {
156
+ try {
157
+ await dbUtils.teardown({ schema });
158
+ }
159
+ catch (error) {
160
+ console.error("Error tearing down database:", error?.message);
161
+ throw error;
162
+ }
163
+ };
164
+ return describe("", () => {
313
165
  beforeAll(beforeAll_);
314
166
  beforeEach(beforeEach_);
315
167
  afterEach(afterEach_);
316
- afterAll(function () { return __awaiter(_this, void 0, void 0, function () {
317
- return __generator(this, function (_a) {
318
- switch (_a.label) {
319
- case 0: return [4 /*yield*/, dbUtils.shutdown(dbName)];
320
- case 1:
321
- _a.sent();
322
- return [4 /*yield*/, shutdown()];
323
- case 2:
324
- _a.sent();
325
- return [2 /*return*/];
326
- }
327
- });
328
- }); });
168
+ afterAll(async () => {
169
+ await dbUtils.shutdown(dbName);
170
+ await shutdown();
171
+ });
329
172
  testSuite(options);
330
173
  });
331
174
  }
@@ -1 +1 @@
1
- {"version":3,"file":"medusa-test-runner.js","sourceRoot":"","sources":["../src/medusa-test-runner.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAGwB;AACxB,iCAAqD;AACrD,uCAA2C;AAC3C,0EAAmE;AACnE,4DAA0D;AAE1D,IAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,CAAA;AAEtC,IAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAA;AACnC,IAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,CAAA;AAC3C,IAAM,WAAW,GAAG,OAAO,CA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,EAAE,CAAA;QAClB,CAAC,CAAC,CAAA;QAEF,SAAS,CAAC,OAAQ,CAAC,CAAA;IACrB,CAAC,CAAC,CAAA;AACJ,CAAC;AAjLD,kEAiLC"}
@@ -1,8 +1,8 @@
1
- import { EmitData, EventBusTypes, IEventBusModuleService, Message, Subscriber } from "@medusajs/types";
1
+ import { EventBusTypes, IEventBusModuleService, Message, Subscriber } from "@medusajs/types";
2
2
  export default class EventBusService implements IEventBusModuleService {
3
- emit<T>(eventName: string, data: T, options?: Record<string, unknown>): Promise<void>;
4
- emit<T>(data: EmitData<T>[]): Promise<void>;
5
- emit<T>(data: Message<T>[]): Promise<void>;
3
+ emit<T>(data: Message<T> | Message<T>[], options: Record<string, unknown>): Promise<void>;
6
4
  subscribe(event: string | symbol, subscriber: Subscriber): this;
7
5
  unsubscribe(event: string | symbol, subscriber: Subscriber, context?: EventBusTypes.SubscriberContext): this;
6
+ releaseGroupedEvents(eventGroupId: string): Promise<void>;
7
+ clearGroupedEvents(eventGroupId: string): Promise<void>;
8
8
  }
@@ -1,59 +1,19 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
2
  Object.defineProperty(exports, "__esModule", { value: true });
39
- var EventBusService = /** @class */ (function () {
40
- function EventBusService() {
41
- }
42
- EventBusService.prototype.emit = function (eventOrData_1, data_1) {
43
- return __awaiter(this, arguments, void 0, function (eventOrData, data, options) {
44
- if (options === void 0) { options = {}; }
45
- return __generator(this, function (_a) {
46
- return [2 /*return*/];
47
- });
48
- });
49
- };
50
- EventBusService.prototype.subscribe = function (event, subscriber) {
3
+ class EventBusService {
4
+ async emit(data, options) { }
5
+ subscribe(event, subscriber) {
51
6
  return this;
52
- };
53
- EventBusService.prototype.unsubscribe = function (event, subscriber, context) {
7
+ }
8
+ unsubscribe(event, subscriber, context) {
54
9
  return this;
55
- };
56
- return EventBusService;
57
- }());
10
+ }
11
+ releaseGroupedEvents(eventGroupId) {
12
+ return Promise.resolve();
13
+ }
14
+ clearGroupedEvents(eventGroupId) {
15
+ return Promise.resolve();
16
+ }
17
+ }
58
18
  exports.default = EventBusService;
59
19
  //# sourceMappingURL=mock-event-bus-service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mock-event-bus-service.js","sourceRoot":"","sources":["../src/mock-event-bus-service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA;IAAA;IAgCA,CAAC;IAvBO,8BAAI,GAAV;4DAOE,WAAmB,EACnB,IAAQ,EACR,OAAqC;YAArC,wBAAA,EAAA,YAAqC;;;;;KACpB;IAEnB,mCAAS,GAAT,UAAU,KAAsB,EAAE,UAAsB;QACtD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,qCAAW,GAAX,UACE,KAAsB,EACtB,UAAsB,EACtB,OAAyC;QAEzC,OAAO,IAAI,CAAA;IACb,CAAC;IACH,sBAAC;AAAD,CAAC,AAhCD,IAgCC"}
1
+ {"version":3,"file":"mock-event-bus-service.js","sourceRoot":"","sources":["../src/mock-event-bus-service.ts"],"names":[],"mappings":";;AAOA,MAAqB,eAAe;IAClC,KAAK,CAAC,IAAI,CACR,IAA+B,EAC/B,OAAgC,IAChB,CAAC;IAEnB,SAAS,CAAC,KAAsB,EAAE,UAAsB;QACtD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,WAAW,CACT,KAAsB,EACtB,UAAsB,EACtB,OAAyC;QAEzC,OAAO,IAAI,CAAA;IACb,CAAC;IAED,oBAAoB,CAAC,YAAoB;QACvC,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;IAC1B,CAAC;IAED,kBAAkB,CAAC,YAAoB;QACrC,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;IAC1B,CAAC;CACF;AAzBD,kCAyBC"}
@@ -8,7 +8,7 @@ export interface SuiteOptions<TService = unknown> {
8
8
  clientUrl: string;
9
9
  };
10
10
  }
11
- export declare function moduleIntegrationTestRunner({ moduleName, moduleModels, moduleOptions, joinerConfig, schema, debug, testSuite, resolve, injectedDependencies, }: {
11
+ export declare function moduleIntegrationTestRunner<TService = any>({ moduleName, moduleModels, moduleOptions, joinerConfig, schema, debug, testSuite, resolve, injectedDependencies, }: {
12
12
  moduleName: string;
13
13
  moduleModels?: any[];
14
14
  moduleOptions?: Record<string, any>;
@@ -18,5 +18,5 @@ export declare function moduleIntegrationTestRunner({ moduleName, moduleModels,
18
18
  injectedDependencies?: Record<string, any>;
19
19
  resolve?: string;
20
20
  debug?: boolean;
21
- testSuite: <TService = unknown>(options: SuiteOptions<TService>) => void;
21
+ testSuite: (options: SuiteOptions<TService>) => void;
22
22
  }): void;