medusa-test-utils 1.1.45-snapshot-20240524111804 → 1.1.45-snapshot-20240527135519

Sign up to get free protection for your applications and to get access to all the features.
package/dist/id-map.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export default instance;
2
- declare const instance: IdMap;
3
1
  declare class IdMap {
4
2
  ids: {};
5
3
  getId(key: any, prefix?: string, length?: number): any;
6
4
  }
5
+ declare const instance: IdMap;
6
+ export default instance;
@@ -1 +1 @@
1
- {"version":3,"file":"id-map.js","sourceRoot":"","sources":["../src/id-map.js"],"names":[],"mappings":";;;;;AAAA,0DAAkC;AAElC;IAAA;QACE,QAAG,GAAG,EAAE,CAAA;IAYV,CAAC;IAVC,qBAAK,GAAL,UAAM,GAAG,EAAE,MAAW,EAAE,MAAW;QAAxB,uBAAA,EAAA,WAAW;QAAE,uBAAA,EAAA,WAAW;QACjC,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YAClB,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACtB,CAAC;QAED,IAAM,EAAE,GAAG,UAAG,MAAM,IAAI,MAAM,GAAG,GAAG,SAAG,IAAA,oBAAS,EAAC,KAAK,EAAE,MAAM,CAAC,CAAE,CAAA;QACjE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAA;QAElB,OAAO,EAAE,CAAA;IACX,CAAC;IACH,YAAC;AAAD,CAAC,AAbD,IAaC;AAED,IAAM,QAAQ,GAAG,IAAI,KAAK,EAAE,CAAA;AAC5B,kBAAe,QAAQ,CAAA"}
1
+ {"version":3,"file":"id-map.js","sourceRoot":"","sources":["../src/id-map.ts"],"names":[],"mappings":";;;;;AAAA,0DAAkC;AAElC;IAAA;QACE,QAAG,GAAG,EAAE,CAAA;IAYV,CAAC;IAVC,qBAAK,GAAL,UAAM,GAAG,EAAE,MAAW,EAAE,MAAW;QAAxB,uBAAA,EAAA,WAAW;QAAE,uBAAA,EAAA,WAAW;QACjC,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YAClB,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACtB,CAAC;QAED,IAAM,EAAE,GAAG,UAAG,MAAM,IAAI,MAAM,GAAG,GAAG,SAAG,IAAA,oBAAS,EAAC,KAAK,EAAE,MAAM,CAAC,CAAE,CAAA;QACjE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAA;QAElB,OAAO,EAAE,CAAA;IACX,CAAC;IACH,YAAC;AAAD,CAAC,AAbD,IAaC;AAED,IAAM,QAAQ,GAAG,IAAI,KAAK,EAAE,CAAA;AAC5B,kBAAe,QAAQ,CAAA"}
package/dist/index.d.ts CHANGED
@@ -2,8 +2,6 @@ export * as TestDatabaseUtils from "./database";
2
2
  export * as TestEventUtils from "./events";
3
3
  export * as JestUtils from "./jest";
4
4
  export { default as IdMap } from "./id-map";
5
- export { default as MockManager } from "./mock-manager";
6
- export { default as MockRepository } from "./mock-repository";
7
5
  export * from "./init-modules";
8
6
  export { default as MockEventBusService } from "./mock-event-bus-service";
9
7
  export * from "./module-test-runner";
package/dist/index.js CHANGED
@@ -29,16 +29,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
29
29
  return (mod && mod.__esModule) ? mod : { "default": mod };
30
30
  };
31
31
  Object.defineProperty(exports, "__esModule", { value: true });
32
- exports.MockEventBusService = exports.MockRepository = exports.MockManager = exports.IdMap = exports.JestUtils = exports.TestEventUtils = exports.TestDatabaseUtils = void 0;
32
+ exports.MockEventBusService = exports.IdMap = exports.JestUtils = exports.TestEventUtils = exports.TestDatabaseUtils = void 0;
33
33
  exports.TestDatabaseUtils = __importStar(require("./database"));
34
34
  exports.TestEventUtils = __importStar(require("./events"));
35
35
  exports.JestUtils = __importStar(require("./jest"));
36
36
  var id_map_1 = require("./id-map");
37
37
  Object.defineProperty(exports, "IdMap", { enumerable: true, get: function () { return __importDefault(id_map_1).default; } });
38
- var mock_manager_1 = require("./mock-manager");
39
- Object.defineProperty(exports, "MockManager", { enumerable: true, get: function () { return __importDefault(mock_manager_1).default; } });
40
- var mock_repository_1 = require("./mock-repository");
41
- Object.defineProperty(exports, "MockRepository", { enumerable: true, get: function () { return __importDefault(mock_repository_1).default; } });
42
38
  __exportStar(require("./init-modules"), exports);
43
39
  var mock_event_bus_service_1 = require("./mock-event-bus-service");
44
40
  Object.defineProperty(exports, "MockEventBusService", { enumerable: true, get: function () { return __importDefault(mock_event_bus_service_1).default; } });
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gEAA+C;AAC/C,2DAA0C;AAC1C,oDAAmC;AACnC,mCAA2C;AAAlC,gHAAA,OAAO,OAAS;AACzB,+CAAuD;AAA9C,4HAAA,OAAO,OAAe;AAC/B,qDAA6D;AAApD,kIAAA,OAAO,OAAkB;AAClC,iDAA8B;AAC9B,mEAAyE;AAAhE,8IAAA,OAAO,OAAuB;AACvC,uDAAoC;AACpC,uDAAoC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gEAA+C;AAC/C,2DAA0C;AAC1C,oDAAmC;AACnC,mCAA2C;AAAlC,gHAAA,OAAO,OAAS;AACzB,iDAA8B;AAC9B,mEAAyE;AAAhE,8IAAA,OAAO,OAAuB;AACvC,uDAAoC;AACpC,uDAAoC"}
@@ -46,21 +46,24 @@ function initModules(_a) {
46
46
  return __generator(this, function (_b) {
47
47
  switch (_b.label) {
48
48
  case 0:
49
- if (!shouldDestroyConnectionAutomatically) return [3 /*break*/, 2];
49
+ if (!shouldDestroyConnectionAutomatically) return [3 /*break*/, 3];
50
+ return [4 /*yield*/, medusaApp.onApplicationPrepareShutdown()];
51
+ case 1:
52
+ _b.sent();
50
53
  return [4 /*yield*/, (0, utils_1.promiseAll)([
51
54
  (_a = sharedPgConnection.context) === null || _a === void 0 ? void 0 : _a.destroy(),
52
55
  sharedPgConnection.destroy(),
53
56
  medusaApp.onApplicationShutdown(),
54
57
  ])];
55
- case 1:
56
- _b.sent();
57
- return [3 /*break*/, 3];
58
58
  case 2:
59
+ _b.sent();
60
+ return [3 /*break*/, 4];
61
+ case 3:
59
62
  if (!preventConnectionDestroyWarning) {
60
63
  console.info("You are using a custom shared connection. The connection won't be destroyed automatically.");
61
64
  }
62
- _b.label = 3;
63
- case 3:
65
+ _b.label = 4;
66
+ case 4:
64
67
  moduleSdkImports.MedusaModule.clearInstances();
65
68
  return [2 /*return*/];
66
69
  }
@@ -1 +1 @@
1
- {"version":3,"file":"init-modules.js","sourceRoot":"","sources":["../src/init-modules.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,yCAIwB;AAkBxB,SAAsB,WAAW;wDAAC,EAMb;QAyBnB,SAAe,QAAQ;;;;;;iCACjB,oCAAoC,EAApC,wBAAoC;4BACtC,qBAAM,IAAA,kBAAU,EAAC;oCACf,MAAC,kBAA0B,CAAC,OAAO,0CAAE,OAAO,EAAE;oCAC7C,kBAA0B,CAAC,OAAO,EAAE;oCACrC,SAAS,CAAC,qBAAqB,EAAE;iCAClC,CAAC,EAAA;;4BAJF,SAIE,CAAA;;;4BAEF,IAAI,CAAC,+BAA+B,EAAE,CAAC;gCACrC,OAAO,CAAC,IAAI,CACV,4FAA4F,CAC7F,CAAA;4BACH,CAAC;;;4BAEH,gBAAgB,CAAC,YAAY,CAAC,cAAc,EAAE,CAAA;;;;;SAC/C;;YA7CD,oBAAoB,0BAAA,EACpB,cAAc,oBAAA,EACd,aAAa,mBAAA,EACb,YAAY,kBAAA,EACZ,uCAAuC,EAAvC,+BAA+B,mBAAG,KAAK,KAAA;;;;oBAEjC,gBAAgB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAA;oBAE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I,CAAC,+BAA+B,EAAE,CAAC;gCACrC,OAAO,CAAC,IAAI,CACV,4FAA4F,CAC7F,CAAA;4BACH,CAAC;;;4BAEH,gBAAgB,CAAC,YAAY,CAAC,cAAc,EAAE,CAAA;;;;;SAC/C;;YA/CD,oBAAoB,0BAAA,EACpB,cAAc,oBAAA,EACd,aAAa,mBAAA,EACb,YAAY,kBAAA,EACZ,uCAAuC,EAAvC,+BAA+B,mBAAG,KAAK,KAAA;;;;oBAEjC,gBAAgB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAA;oBAEzD,oBAAoB,aAApB,oBAAoB,cAApB,oBAAoB,IAApB,oBAAoB,GAAK,EAAE,EAAA;oBAEvB,kBAAkB,GACpB,oBAAoB,aAApB,oBAAoB,uBAApB,oBAAoB,CAAG,iCAAyB,CAAC,aAAa,CAAC,CAAA;oBAE7D,oCAAoC,GAAG,CAAC,kBAAkB,CAAA;oBAC9D,IAAI,CAAC,kBAAkB,EAAE,CAAC;wBACxB,kBAAkB,GAAG,uBAAe,CAAC,kBAAkB,CAAC;4BACtD,SAAS,EAAE,cAAc,CAAC,SAAS;4BACnC,MAAM,EAAE,cAAc,CAAC,MAAM;yBAC9B,CAAC,CAAA;wBAEF,oBAAoB,CAAC,iCAAyB,CAAC,aAAa,CAAC;4BAC3D,kBAAkB,CAAA;oBACtB,CAAC;oBAEiB,qBAAM,gBAAgB,CAAC,SAAS,CAAC;4BACjD,aAAa,eAAA;4BACb,cAAc,EAAE,YAAY;4BAC5B,oBAAoB,sBAAA;yBACrB,CAAC,EAAA;;oBAJI,SAAS,GAAG,SAIhB;oBAqBF,sBAAO;4BACL,SAAS,WAAA;4BACT,QAAQ,UAAA;yBACT,EAAA;;;;CACF;AAtDD,kCAsDC"}
@@ -1,5 +1,9 @@
1
- export function startBootstrapApp({ cwd, env, skipExpressListen, }?: {
2
- cwd: any;
3
- env?: {} | undefined;
4
- skipExpressListen?: boolean | undefined;
5
- }): Promise<any>;
1
+ import { MedusaContainer } from "@medusajs/types";
2
+ export declare function startApp({ cwd, env, }?: {
3
+ cwd?: string;
4
+ env?: Record<any, any>;
5
+ }): Promise<{
6
+ shutdown: () => Promise<void>;
7
+ container: MedusaContainer;
8
+ port: number;
9
+ }>;
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -50,21 +51,15 @@ var __read = (this && this.__read) || function (o, n) {
50
51
  }
51
52
  return ar;
52
53
  };
53
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
54
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
55
- if (ar || !(i in from)) {
56
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
57
- ar[i] = from[i];
58
- }
59
- }
60
- return to.concat(ar || Array.prototype.slice.call(from));
54
+ var __importDefault = (this && this.__importDefault) || function (mod) {
55
+ return (mod && mod.__esModule) ? mod : { "default": mod };
61
56
  };
62
- var _this = this;
63
- var path = require("path");
64
- var express = require("express");
65
- var getPort = require("get-port");
66
- var _a = require("@medusajs/utils"), isObject = _a.isObject, promiseAll = _a.promiseAll;
67
- var GracefulShutdownServer = require("medusa-core-utils").GracefulShutdownServer;
57
+ Object.defineProperty(exports, "__esModule", { value: true });
58
+ exports.startApp = void 0;
59
+ var express_1 = __importDefault(require("express"));
60
+ var get_port_1 = __importDefault(require("get-port"));
61
+ var path_1 = require("path");
62
+ var utils_1 = require("@medusajs/utils");
68
63
  function bootstrapApp() {
69
64
  return __awaiter(this, arguments, void 0, function (_a) {
70
65
  var app, loaders, _b, container, shutdown, PORT;
@@ -72,8 +67,8 @@ function bootstrapApp() {
72
67
  return __generator(this, function (_e) {
73
68
  switch (_e.label) {
74
69
  case 0:
75
- app = express();
76
- if (isObject(env)) {
70
+ app = (0, express_1.default)();
71
+ if ((0, utils_1.isObject)(env)) {
77
72
  Object.entries(env).forEach(function (_a) {
78
73
  var _b = __read(_a, 2), k = _b[0], v = _b[1];
79
74
  return (process.env[k] = v);
@@ -81,13 +76,12 @@ function bootstrapApp() {
81
76
  }
82
77
  loaders = require("@medusajs/medusa/dist/loaders").default;
83
78
  return [4 /*yield*/, loaders({
84
- directory: path.resolve(cwd || process.cwd()),
79
+ directory: (0, path_1.resolve)(cwd || process.cwd()),
85
80
  expressApp: app,
86
- isTest: false,
87
81
  })];
88
82
  case 1:
89
83
  _b = _e.sent(), container = _b.container, shutdown = _b.shutdown;
90
- return [4 /*yield*/, getPort()];
84
+ return [4 /*yield*/, (0, get_port_1.default)()];
91
85
  case 2:
92
86
  PORT = _e.sent();
93
87
  return [2 /*return*/, {
@@ -100,67 +94,62 @@ function bootstrapApp() {
100
94
  });
101
95
  });
102
96
  }
103
- module.exports = {
104
- startBootstrapApp: function () {
105
- var args_1 = [];
106
- for (var _i = 0; _i < arguments.length; _i++) {
107
- args_1[_i] = arguments[_i];
108
- }
109
- return __awaiter(_this, __spreadArray([], __read(args_1), false), void 0, function (_a) {
110
- var _b, app, port, container, medusaShutdown, expressServer, shutdown;
111
- var _this = this;
112
- var _c = _a === void 0 ? {} : _a, cwd = _c.cwd, _d = _c.env, env = _d === void 0 ? {} : _d, _e = _c.skipExpressListen, skipExpressListen = _e === void 0 ? false : _e;
113
- return __generator(this, function (_f) {
114
- switch (_f.label) {
115
- case 0: return [4 /*yield*/, bootstrapApp({
116
- cwd: cwd,
117
- env: env,
118
- })];
119
- case 1:
120
- _b = _f.sent(), app = _b.app, port = _b.port, container = _b.container, medusaShutdown = _b.shutdown;
121
- if (skipExpressListen) {
122
- return [2 /*return*/];
123
- }
124
- shutdown = function () { return __awaiter(_this, void 0, void 0, function () {
125
- return __generator(this, function (_a) {
126
- switch (_a.label) {
127
- case 0: return [4 /*yield*/, promiseAll([expressServer.shutdown(), medusaShutdown()])];
128
- case 1:
129
- _a.sent();
130
- if (typeof global !== "undefined" && (global === null || global === void 0 ? void 0 : global.gc)) {
131
- global.gc();
132
- }
133
- return [2 /*return*/];
134
- }
97
+ function startApp() {
98
+ return __awaiter(this, arguments, void 0, function (_a) {
99
+ var _b, app, port, container, medusaShutdown, expressServer, shutdown;
100
+ var _this = this;
101
+ var _c = _a === void 0 ? {} : _a, cwd = _c.cwd, _d = _c.env, env = _d === void 0 ? {} : _d;
102
+ return __generator(this, function (_e) {
103
+ switch (_e.label) {
104
+ case 0: return [4 /*yield*/, bootstrapApp({
105
+ cwd: cwd,
106
+ env: env,
107
+ })];
108
+ case 1:
109
+ _b = _e.sent(), app = _b.app, port = _b.port, container = _b.container, medusaShutdown = _b.shutdown;
110
+ shutdown = function () { return __awaiter(_this, void 0, void 0, function () {
111
+ return __generator(this, function (_a) {
112
+ switch (_a.label) {
113
+ case 0: return [4 /*yield*/, (0, utils_1.promiseAll)([expressServer.shutdown(), medusaShutdown()])];
114
+ case 1:
115
+ _a.sent();
116
+ if (typeof global !== "undefined" && (global === null || global === void 0 ? void 0 : global.gc)) {
117
+ global.gc();
118
+ }
119
+ return [2 /*return*/];
120
+ }
121
+ });
122
+ }); };
123
+ return [4 /*yield*/, new Promise(function (resolve, reject) {
124
+ var server = app
125
+ .listen(port)
126
+ .on("error", function (err) { return __awaiter(_this, void 0, void 0, function () {
127
+ return __generator(this, function (_a) {
128
+ switch (_a.label) {
129
+ case 0: return [4 /*yield*/, shutdown()];
130
+ case 1:
131
+ _a.sent();
132
+ return [2 /*return*/, reject(err)];
133
+ }
134
+ });
135
+ }); })
136
+ .on("listening", function () {
137
+ var _a;
138
+ (_a = process.send) === null || _a === void 0 ? void 0 : _a.call(process, port);
139
+ resolve({
140
+ shutdown: shutdown,
141
+ container: container,
142
+ port: port,
143
+ });
135
144
  });
136
- }); };
137
- return [4 /*yield*/, new Promise(function (resolve, reject) {
138
- var server = app.listen(port, function (err) { return __awaiter(_this, void 0, void 0, function () {
139
- return __generator(this, function (_a) {
140
- switch (_a.label) {
141
- case 0:
142
- if (!err) return [3 /*break*/, 2];
143
- return [4 /*yield*/, shutdown()];
144
- case 1:
145
- _a.sent();
146
- return [2 /*return*/, reject(err)];
147
- case 2:
148
- process.send(port);
149
- resolve({
150
- shutdown: shutdown,
151
- container: container,
152
- port: port,
153
- });
154
- return [2 /*return*/];
155
- }
156
- });
157
- }); });
158
- expressServer = GracefulShutdownServer.create(server);
159
- })];
160
- case 2: return [2 /*return*/, _f.sent()];
161
- }
162
- });
145
+ // TODO: fix that once we find the appropriate place to put this util
146
+ var GracefulShutdownServer = require("@medusajs/medusa/dist/utils/graceful-shutdown-server").GracefulShutdownServer;
147
+ expressServer = GracefulShutdownServer.create(server);
148
+ })];
149
+ case 2: return [2 /*return*/, _e.sent()];
150
+ }
163
151
  });
164
- },
165
- };
152
+ });
153
+ }
154
+ exports.startApp = startApp;
166
155
  //# sourceMappingURL=bootstrap-app.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap-app.js","sourceRoot":"","sources":["../../src/medusa-test-runner-utils/bootstrap-app.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iBA+EA;AA/EA,IAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAC5B,IAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA;AAClC,IAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;AAC7B,IAAA,KAA2B,OAAO,CAAC,iBAAiB,CAAC,EAAnD,QAAQ,cAAA,EAAE,UAAU,gBAA+B,CAAA;AACnD,IAAA,sBAAsB,GAAK,OAAO,CAAC,mBAAmB,CAAC,uBAAjC,CAAiC;AAE/D,SAAe,YAAY;wDAAC,EAAsB;;YAAtB,qBAAoB,EAAE,KAAA,EAApB,GAAG,SAAA,EAAE,WAAQ,EAAR,GAAG,mBAAG,EAAE,KAAA;;;;oBACnC,GAAG,GAA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oCAA9D,SAA8D,CAAA;oCAE9D,IAAI,OAAO,MAAM,KAAK,WAAW,KAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,EAAE,CAAA,EAAE,CAAC;wCAChD,MAAM,CAAC,EAAE,EAAE,CAAA;oCACb,CAAC;;;;yBACF,CAAA;oBAEM,qBAAM,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;4BACvC,IAAM,MAAM,GAAG,GAAG;iCACf,MAAM,CAAC,IAAI,CAAC;iCACZ,EAAE,CAAC,OAAO,EAAE,UAAO,GAAG;;;gDACrB,qBAAM,QAAQ,EAAE,EAAA;;4CAAhB,SAAgB,CAAA;4CAChB,sBAAO,MAAM,CAAC,GAAG,CAAC,EAAA;;;iCACnB,CAAC;iCACD,EAAE,CAAC,WAAW,EAAE;;gCACf,MAAA,OAAO,CAAC,IAAI,wDAAG,IAAI,CAAC,CAAA;gCAEpB,OAAO,CAAC;oCACN,QAAQ,UAAA;oCACR,SAAS,WAAA;oCACT,IAAI,MAAA;iCACL,CAAC,CAAA;4BACJ,CAAC,CAAC,CAAA;4BAEJ,qEAAqE;4BAEnE,IAAA,sBAAsB,GACpB,OAAO,CAAC,sDAAsD,CAAC,uBAD3C,CAC2C;4BAEnE,aAAa,GAAG,sBAAsB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;wBACvD,CAAC,CAAC,EAAA;wBAvBF,sBAAO,SAuBL,EAAA;;;;CACH;AApDD,4BAoDC"}
@@ -1,12 +1,4 @@
1
- import { DataSource } from "typeorm";
2
- export function initDb({ cwd, database_extra, env, force_modules_migration, dbUrl, dbSchema, }: {
3
- cwd: any;
4
- database_extra: any;
5
- env: any;
6
- force_modules_migration: any;
7
- dbUrl?: string | undefined;
8
- dbSchema?: string | undefined;
9
- }): Promise<{
10
- dbDataSource: DataSource;
11
- pgConnection: any;
12
- }>;
1
+ export declare function initDb({ cwd, env, }: {
2
+ cwd: string;
3
+ env?: Record<any, any>;
4
+ }): Promise<any>;
@@ -1,14 +1,4 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
1
+ "use strict";
12
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -61,80 +51,57 @@ var __read = (this && this.__read) || function (o, n) {
61
51
  }
62
52
  return ar;
63
53
  };
64
- var path = require("path");
65
- var asValue = require("awilix").asValue;
66
- var _a = require("@medusajs/utils"), isObject = _a.isObject, createMedusaContainer = _a.createMedusaContainer, MedusaV2Flag = _a.MedusaV2Flag;
67
- var DataSource = require("typeorm").DataSource;
68
- var ContainerRegistrationKeys = require("@medusajs/utils").ContainerRegistrationKeys;
69
- var logger = require("@medusajs/medusa-cli/dist/reporter").logger;
70
- module.exports = {
71
- initDb: function (_a) {
72
- return __awaiter(this, arguments, void 0, function (_b) {
73
- var configModuleLoader, configModule, featureFlagsLoader, featureFlagRouter, getModuleSharedResources, _c, moduleMigrations, moduleModels, dbDataSource, pgConnectionLoader, featureFlagLoader, container, featureFlagRouter_1, pgConnection, migrateMedusaApp;
74
- var _d;
75
- var cwd = _b.cwd,
76
- // use for v1 datasource only
77
- database_extra = _b.database_extra, env = _b.env, force_modules_migration = _b.force_modules_migration, _e = _b.dbUrl, dbUrl = _e === void 0 ? "" : _e, _f = _b.dbSchema, dbSchema = _f === void 0 ? "public" : _f;
78
- return __generator(this, function (_g) {
79
- switch (_g.label) {
80
- case 0:
81
- if (isObject(env)) {
82
- Object.entries(env).forEach(function (_a) {
83
- var _b = __read(_a, 2), k = _b[0], v = _b[1];
84
- return (process.env[k] = v);
85
- });
86
- }
87
- configModuleLoader = require("@medusajs/medusa/dist/loaders/config").default;
88
- configModule = configModuleLoader(cwd);
89
- featureFlagsLoader = require("@medusajs/medusa/dist/loaders/feature-flags").default;
90
- featureFlagRouter = featureFlagsLoader(configModule);
91
- getModuleSharedResources = require("@medusajs/medusa/dist/commands/utils/get-migrations").getModuleSharedResources;
92
- _c = getModuleSharedResources(configModule, featureFlagRouter), moduleMigrations = _c.migrations, moduleModels = _c.models;
93
- dbDataSource = new DataSource({
94
- type: "postgres",
95
- url: dbUrl || configModule.projectConfig.database_url,
96
- entities: moduleModels,
97
- migrations: moduleMigrations,
98
- extra: database_extra !== null && database_extra !== void 0 ? database_extra : {},
99
- //name: "integration-tests",
100
- schema: dbSchema,
54
+ Object.defineProperty(exports, "__esModule", { value: true });
55
+ exports.initDb = void 0;
56
+ var utils_1 = require("@medusajs/utils");
57
+ var awilix_1 = require("awilix");
58
+ function initDb(_a) {
59
+ return __awaiter(this, arguments, void 0, function (_b) {
60
+ var container, configModule, pgConnection, featureFlagRouter, migrateMedusaApp, err_1;
61
+ var _c;
62
+ var cwd = _b.cwd, _d = _b.env, env = _d === void 0 ? {} : _d;
63
+ return __generator(this, function (_e) {
64
+ switch (_e.label) {
65
+ case 0:
66
+ if ((0, utils_1.isObject)(env)) {
67
+ Object.entries(env).forEach(function (_a) {
68
+ var _b = __read(_a, 2), k = _b[0], v = _b[1];
69
+ return (process.env[k] = v);
101
70
  });
102
- return [4 /*yield*/, dbDataSource.initialize()];
103
- case 1:
104
- _g.sent();
105
- return [4 /*yield*/, dbDataSource.runMigrations()];
106
- case 2:
107
- _g.sent();
108
- if (!(force_modules_migration ||
109
- featureFlagRouter.isFeatureEnabled(MedusaV2Flag.key))) return [3 /*break*/, 6];
110
- pgConnectionLoader = require("@medusajs/medusa/dist/loaders/pg-connection").default;
111
- featureFlagLoader = require("@medusajs/medusa/dist/loaders/feature-flags").default;
112
- container = createMedusaContainer();
113
- return [4 /*yield*/, featureFlagLoader(configModule)];
114
- case 3:
115
- featureFlagRouter_1 = _g.sent();
116
- return [4 /*yield*/, pgConnectionLoader({
117
- configModule: __assign(__assign({}, configModule), { projectConfig: __assign(__assign({}, configModule.projectConfig), { database_url: dbUrl || configModule.projectConfig.database_url }) }),
118
- container: container,
119
- })];
120
- case 4:
121
- pgConnection = _g.sent();
122
- container.register((_d = {},
123
- _d[ContainerRegistrationKeys.CONFIG_MODULE] = asValue(configModule),
124
- _d[ContainerRegistrationKeys.LOGGER] = asValue(logger),
125
- _d[ContainerRegistrationKeys.MANAGER] = asValue(dbDataSource.manager),
126
- _d[ContainerRegistrationKeys.PG_CONNECTION] = asValue(pgConnection),
127
- _d.featureFlagRouter = asValue(featureFlagRouter_1),
128
- _d));
129
- migrateMedusaApp = require("@medusajs/medusa/dist/loaders/medusa-app").migrateMedusaApp;
130
- return [4 /*yield*/, migrateMedusaApp({ configModule: configModule, container: container }, { registerInContainer: false })];
131
- case 5:
132
- _g.sent();
133
- _g.label = 6;
134
- case 6: return [2 /*return*/, { dbDataSource: dbDataSource, pgConnection: pgConnection }];
135
- }
136
- });
71
+ }
72
+ container = (0, utils_1.createMedusaContainer)();
73
+ return [4 /*yield*/, require("@medusajs/medusa/dist/loaders/config").default(cwd)];
74
+ case 1:
75
+ configModule = _e.sent();
76
+ return [4 /*yield*/, require("@medusajs/medusa/dist/loaders/pg-connection").default({
77
+ configModule: configModule,
78
+ container: container,
79
+ })];
80
+ case 2:
81
+ pgConnection = _e.sent();
82
+ featureFlagRouter = require("@medusajs/medusa/dist/loaders/feature-flags").default(configModule);
83
+ container.register((_c = {},
84
+ _c[utils_1.ContainerRegistrationKeys.CONFIG_MODULE] = (0, awilix_1.asValue)(configModule),
85
+ _c[utils_1.ContainerRegistrationKeys.LOGGER] = (0, awilix_1.asValue)(console),
86
+ _c[utils_1.ContainerRegistrationKeys.PG_CONNECTION] = (0, awilix_1.asValue)(pgConnection),
87
+ _c[utils_1.ContainerRegistrationKeys.FEATURE_FLAG_ROUTER] = (0, awilix_1.asValue)(featureFlagRouter),
88
+ _c));
89
+ _e.label = 3;
90
+ case 3:
91
+ _e.trys.push([3, 5, , 6]);
92
+ migrateMedusaApp = require("@medusajs/medusa/dist/loaders/medusa-app").migrateMedusaApp;
93
+ return [4 /*yield*/, migrateMedusaApp({ configModule: configModule, container: container })];
94
+ case 4:
95
+ _e.sent();
96
+ return [3 /*break*/, 6];
97
+ case 5:
98
+ err_1 = _e.sent();
99
+ console.error("Something went wrong while running the migrations");
100
+ throw err_1;
101
+ case 6: return [2 /*return*/, pgConnection];
102
+ }
137
103
  });
138
- },
139
- };
104
+ });
105
+ }
106
+ exports.initDb = initDb;
140
107
  //# sourceMappingURL=use-db.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-db.js","sourceRoot":"","sources":["../../src/medusa-test-runner-utils/use-db.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAEpB,IAAA,OAAO,GAAK,OAAO,CAAC,QAAQ,CAAC,QAAtB,CAAsB;AAC/B,IAAA,KAIF,OAAO,CAAC,iBAAiB,CAAC,EAH5B,QAAQ,cAAA,EACR,qBAAqB,2BAAA,EACrB,YAAY,kBACgB,CAAA;AACtB,IAAA,UAAU,GAAK,OAAO,CAAC,SAAS,CAAC,WAAvB,CAAuB;AACjC,IAAA,yBAAyB,GAAK,OAAO,CAAC,iBAAiB,CAAC,0BAA/B,CAA+B;AACxD,IAAA,MAAM,GAAK,OAAO,CAAC,oCAAoC,CAAC,OAAlD,CAAkD;AAEhE,MAAM,CAAC,OAAO,GAAG;IACf,MAAM,EAAE;4DAAgB,EAQvB;;;gBAPC,GAAG,SAAA;YACH,6BAA6B;YAC7B,cAAc,oBAAA,EACd,GAAG,SAAA,EACH,uBAAuB,6BAAA,EACvB,aAAU,EAAV,KAAK,mBAAG,EAAE,KAAA,EACV,gBA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IE,gBAAgB,GACd,OAAO,CAAC,0CAA0C,CAAC,iBADrC,CACqC;oBACvD,qBAAM,gBAAgB,CAAC,EAAE,YAAY,cAAA,EAAE,SAAS,WAAA,EAAE,CAAC,EAAA;;oBAAnD,SAAmD,CAAA;;;;oBAEnD,OAAO,CAAC,KAAK,CAAC,mDAAmD,CAAC,CAAA;oBAClE,MAAM,KAAG,CAAA;wBAGX,sBAAO,YAAY,EAAA;;;;CACpB;AA3CD,wBA2CC"}
@@ -1,6 +1,5 @@
1
1
  import { MedusaContainer } from "@medusajs/types";
2
2
  export interface MedusaSuiteOptions<TService = unknown> {
3
- dbUtils: any;
4
3
  dbConnection: any;
5
4
  getContainer: () => MedusaContainer;
6
5
  api: any;
@@ -10,12 +9,11 @@ export interface MedusaSuiteOptions<TService = unknown> {
10
9
  clientUrl: string;
11
10
  };
12
11
  }
13
- export declare function medusaIntegrationTestRunner({ moduleName, dbName, schema, env, force_modules_migration, debug, testSuite, }: {
12
+ export declare function medusaIntegrationTestRunner({ moduleName, dbName, schema, env, debug, testSuite, }: {
14
13
  moduleName?: string;
15
14
  env?: Record<string, any>;
16
15
  dbName?: string;
17
16
  schema?: string;
18
17
  debug?: boolean;
19
- force_modules_migration?: boolean;
20
18
  testSuite: <TService = unknown>(options: MedusaSuiteOptions<TService>) => void;
21
19
  }): void;
@@ -63,17 +63,7 @@ var pgGodCredentials = {
63
63
  host: DB_HOST,
64
64
  };
65
65
  var dbTestUtilFactory = function () { return ({
66
- db_: null,
67
66
  pgConnection_: null,
68
- clear: function () {
69
- return __awaiter(this, void 0, void 0, function () {
70
- var _a;
71
- return __generator(this, function (_b) {
72
- (_a = this.db_) === null || _a === void 0 ? void 0 : _a.synchronize(true);
73
- return [2 /*return*/];
74
- });
75
- });
76
- },
77
67
  create: function (dbName) {
78
68
  return __awaiter(this, void 0, void 0, function () {
79
69
  return __generator(this, function (_a) {
@@ -88,24 +78,23 @@ var dbTestUtilFactory = function () { return ({
88
78
  },
89
79
  teardown: function () {
90
80
  return __awaiter(this, arguments, void 0, function (_a) {
91
- var manager, tableNames, tableNames_1, tableNames_1_1, table_name, e_1_1;
81
+ var runRawQuery, tableNames, tableNames_1, tableNames_1_1, table_name, e_1_1;
92
82
  var e_1, _b;
93
- var _c = _a === void 0 ? {} : _a, forceDelete = _c.forceDelete, schema = _c.schema;
83
+ var _c = _a === void 0 ? {} : _a, schema = _c.schema;
94
84
  return __generator(this, function (_d) {
95
85
  switch (_d.label) {
96
86
  case 0:
97
- forceDelete !== null && forceDelete !== void 0 ? forceDelete : (forceDelete = []);
98
- if (!this.db_) {
87
+ if (!this.pgConnection_) {
99
88
  return [2 /*return*/];
100
89
  }
101
- manager = this.db_.manager;
90
+ runRawQuery = this.pgConnection_.raw.bind(this.pgConnection_);
102
91
  schema !== null && schema !== void 0 ? schema : (schema = "public");
103
- return [4 /*yield*/, manager.query("SET session_replication_role = 'replica';")];
92
+ return [4 /*yield*/, runRawQuery("SET session_replication_role = 'replica';")];
104
93
  case 1:
105
94
  _d.sent();
106
- return [4 /*yield*/, manager.query("SELECT table_name\n FROM information_schema.tables\n WHERE table_schema = '".concat(schema, "';"))];
95
+ return [4 /*yield*/, runRawQuery("SELECT table_name\n FROM information_schema.tables\n WHERE table_schema = '".concat(schema, "';"))];
107
96
  case 2:
108
- tableNames = _d.sent();
97
+ tableNames = (_d.sent()).rows;
109
98
  _d.label = 3;
110
99
  case 3:
111
100
  _d.trys.push([3, 8, 9, 10]);
@@ -114,7 +103,7 @@ var dbTestUtilFactory = function () { return ({
114
103
  case 4:
115
104
  if (!!tableNames_1_1.done) return [3 /*break*/, 7];
116
105
  table_name = tableNames_1_1.value.table_name;
117
- return [4 /*yield*/, manager.query("DELETE\n FROM ".concat(schema, ".\"").concat(table_name, "\";"))];
106
+ return [4 /*yield*/, runRawQuery("DELETE\n FROM ".concat(schema, ".\"").concat(table_name, "\";"))];
118
107
  case 5:
119
108
  _d.sent();
120
109
  _d.label = 6;
@@ -132,7 +121,7 @@ var dbTestUtilFactory = function () { return ({
132
121
  }
133
122
  finally { if (e_1) throw e_1.error; }
134
123
  return [7 /*endfinally*/];
135
- case 10: return [4 /*yield*/, manager.query("SET session_replication_role = 'origin';")];
124
+ case 10: return [4 /*yield*/, runRawQuery("SET session_replication_role = 'origin';")];
136
125
  case 11:
137
126
  _d.sent();
138
127
  return [2 /*return*/];
@@ -142,20 +131,17 @@ var dbTestUtilFactory = function () { return ({
142
131
  },
143
132
  shutdown: function (dbName) {
144
133
  return __awaiter(this, void 0, void 0, function () {
145
- var _a, _b, _c, _d;
146
- return __generator(this, function (_e) {
147
- switch (_e.label) {
148
- case 0: return [4 /*yield*/, ((_a = this.db_) === null || _a === void 0 ? void 0 : _a.destroy())];
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())];
149
138
  case 1:
150
- _e.sent();
151
- return [4 /*yield*/, ((_c = (_b = this.pgConnection_) === null || _b === void 0 ? void 0 : _b.context) === null || _c === void 0 ? void 0 : _c.destroy())];
139
+ _d.sent();
140
+ return [4 /*yield*/, ((_c = this.pgConnection_) === null || _c === void 0 ? void 0 : _c.destroy())];
152
141
  case 2:
153
- _e.sent();
154
- return [4 /*yield*/, ((_d = this.pgConnection_) === null || _d === void 0 ? void 0 : _d.destroy())];
155
- case 3:
156
- _e.sent();
142
+ _d.sent();
157
143
  return [4 /*yield*/, (0, pg_god_1.dropDatabase)({ databaseName: dbName, errorIfNonExist: false }, pgGodCredentials)];
158
- case 4: return [2 /*return*/, _e.sent()];
144
+ case 3: return [2 /*return*/, _d.sent()];
159
145
  }
160
146
  });
161
147
  });
@@ -163,7 +149,7 @@ var dbTestUtilFactory = function () { return ({
163
149
  }); };
164
150
  function medusaIntegrationTestRunner(_a) {
165
151
  var _this = this;
166
- 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.force_modules_migration, force_modules_migration = _d === void 0 ? false : _d, _e = _a.debug, debug = _e === void 0 ? false : _e, testSuite = _a.testSuite;
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;
167
153
  var tempName = parseInt(process.env.JEST_WORKER_ID || "1");
168
154
  moduleName = moduleName !== null && moduleName !== void 0 ? moduleName : Math.random().toString(36).substring(7);
169
155
  dbName !== null && dbName !== void 0 ? dbName : (dbName = "medusa-".concat(moduleName.toLowerCase(), "-integration-").concat(tempName));
@@ -195,7 +181,6 @@ function medusaIntegrationTestRunner(_a) {
195
181
  var container;
196
182
  var apiUtils;
197
183
  var options = {
198
- dbUtils: dbUtils,
199
184
  api: new Proxy({}, {
200
185
  get: function (target, prop) {
201
186
  return apiUtils[prop];
@@ -203,14 +188,19 @@ function medusaIntegrationTestRunner(_a) {
203
188
  }),
204
189
  dbConnection: new Proxy({}, {
205
190
  get: function (target, prop) {
206
- return dbUtils.db_[prop];
191
+ return dbUtils.pgConnection_[prop];
207
192
  },
208
193
  }),
209
194
  getContainer: function () { return container; },
195
+ dbConfig: {
196
+ dbName: dbName,
197
+ schema: schema,
198
+ clientUrl: dbConfig.clientUrl,
199
+ },
210
200
  };
211
201
  var isFirstTime = true;
212
202
  var beforeAll_ = function () { return __awaiter(_this, void 0, void 0, function () {
213
- var dataSourceRes, pgConnectionRes, _a, dbDataSource, pgConnection, error_1, containerRes, serverShutdownRes, portRes, _b, _c, shutdown_1, container_1, port, error_2, cancelTokenSource;
203
+ var _a, error_1, containerRes, serverShutdownRes, portRes, _b, _c, shutdown_1, container_1, port, error_2, cancelTokenSource;
214
204
  var _this = this;
215
205
  return __generator(this, function (_d) {
216
206
  switch (_d.label) {
@@ -220,44 +210,35 @@ function medusaIntegrationTestRunner(_a) {
220
210
  _d.label = 2;
221
211
  case 2:
222
212
  _d.trys.push([2, 4, , 5]);
213
+ _a = dbUtils;
223
214
  return [4 /*yield*/, (0, use_db_1.initDb)({
224
215
  cwd: cwd,
225
216
  env: env,
226
- force_modules_migration: force_modules_migration,
227
- database_extra: {},
228
- dbUrl: dbConfig.clientUrl,
229
- dbSchema: dbConfig.schema,
230
217
  })];
231
218
  case 3:
232
- _a = _d.sent(), dbDataSource = _a.dbDataSource, pgConnection = _a.pgConnection;
233
- dataSourceRes = dbDataSource;
234
- pgConnectionRes = pgConnection;
219
+ _a.pgConnection_ = _d.sent();
235
220
  return [3 /*break*/, 5];
236
221
  case 4:
237
222
  error_1 = _d.sent();
238
223
  console.error("Error initializing database", error_1 === null || error_1 === void 0 ? void 0 : error_1.message);
239
224
  throw error_1;
240
225
  case 5:
241
- dbUtils.db_ = dataSourceRes;
242
- dbUtils.pgConnection_ = pgConnectionRes;
243
- _d.label = 6;
244
- case 6:
245
- _d.trys.push([6, 8, , 9]);
246
- return [4 /*yield*/, (0, bootstrap_app_1.startBootstrapApp)({
226
+ _d.trys.push([5, 7, , 8]);
227
+ return [4 /*yield*/, (0, bootstrap_app_1.startApp)({
247
228
  cwd: cwd,
248
229
  env: env,
249
230
  })];
250
- case 7:
231
+ case 6:
251
232
  _b = _d.sent(), _c = _b.shutdown, shutdown_1 = _c === void 0 ? function () { return void 0; } : _c, container_1 = _b.container, port = _b.port;
252
233
  containerRes = container_1;
253
234
  serverShutdownRes = shutdown_1;
254
235
  portRes = port;
255
- return [3 /*break*/, 9];
256
- case 8:
236
+ return [3 /*break*/, 8];
237
+ case 7:
257
238
  error_2 = _d.sent();
258
239
  console.error("Error starting the app", error_2 === null || error_2 === void 0 ? void 0 : error_2.message);
259
240
  throw error_2;
260
- case 9:
241
+ case 8:
261
242
  cancelTokenSource = axios.CancelToken.source();
262
243
  container = containerRes;
263
244
  shutdown = function () { return __awaiter(_this, void 0, void 0, function () {
@@ -297,7 +278,7 @@ function medusaIntegrationTestRunner(_a) {
297
278
  medusaAppLoaderRunner = require("@medusajs/medusa/dist/loaders/medusa-app").runModulesLoader;
298
279
  return [4 /*yield*/, medusaAppLoaderRunner({
299
280
  container: copiedContainer,
300
- configModule: container.resolve("configModule"),
281
+ configModule: container.resolve(utils_1.ContainerRegistrationKeys.CONFIG_MODULE),
301
282
  })];
302
283
  case 2:
303
284
  _a.sent();
@@ -1 +1 @@
1
- {"version":3,"file":"medusa-test-runner.js","sourceRoot":"","sources":["../src/medusa-test-runner.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAAuD;AACvD,iCAAqD;AACrD,uCAA2C;AAC3C,0EAA4E;AAC5E,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,CAAC,GAAG,CAAC,WAAW,CAAA;AAE3C,IAAM,gBAAgB,GAAG;IACvB,IAAI,EAAE,WAAW;IACjB,QAAQ,EAAE,WAAW;IACrB,IAAI,EAAE,OAAO;CACd,CAAA;AAED,IAAM,iBAAiB,GAAG,cAAW,OAAA,CAAC;IACpC,GAAG,EAAE,IAAI;IACT,aAAa,EAAE,IAAI;IAEnB,KAAK,EAAE;;;;gBACL,MAAA,IAAI,CAAC,GAAG,0CAAE,WAAW,CAAC,IAAI,CAAC,CAAA;;;;KAC5B;IAED,MAAM,EAAE,UAAgB,MAAc;;;;4BACpC,qBAAM,IAAA,uBAAc,EAAC,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,gBAAgB,CAAC,EAAA;;wBAAhE,SAAgE,CAAA;;;;;KACjE;IAED,QAAQ,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E,OAAO,CAAC,CAAA;oBAC7D,MAAM,OAAK,CAAA;;;;SAEd,CAAA;IAED,OAAO,QAAQ,CAAC,EAAE,EAAE;QAClB,SAAS,CAAC,UAAU,CAAC,CAAA;QACrB,UAAU,CAAC,WAAW,CAAC,CAAA;QACvB,SAAS,CAAC,UAAU,CAAC,CAAA;QACrB,QAAQ,CAAC;;;4BACP,qBAAM,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAA;;wBAA9B,SAA8B,CAAA;wBAC9B,qBAAM,QAAQ,EAAE,EAAA;;wBAAhB,SAAgB,CAAA;;;;aACjB,CAAC,CAAA;QAEF,SAAS,CAAC,OAAQ,CAAC,CAAA;IACrB,CAAC,CAAC,CAAA;AACJ,CAAC;AA9KD,kEA8KC"}
@@ -78,9 +78,7 @@ function moduleIntegrationTestRunner(_a) {
78
78
  _b[moduleName] = {
79
79
  definition: moduleSdkImports.ModulesDefinition[moduleName],
80
80
  resolve: resolve,
81
- options: __assign({ defaultAdapterOptions: {
82
- database: dbConfig,
83
- }, database: dbConfig }, moduleOptions),
81
+ options: __assign({ database: dbConfig }, moduleOptions),
84
82
  },
85
83
  _b);
86
84
  var moduleOptions_ = {
@@ -105,6 +103,10 @@ function moduleIntegrationTestRunner(_a) {
105
103
  return moduleService[prop];
106
104
  },
107
105
  }),
106
+ dbConfig: {
107
+ schema: schema,
108
+ clientUrl: dbConfig.clientUrl,
109
+ },
108
110
  };
109
111
  var beforeEach_ = function () { return __awaiter(_this, void 0, void 0, function () {
110
112
  var output;
@@ -1 +1 @@
1
- {"version":3,"file":"module-test-runner.js","sourceRoot":"","sources":["../src/module-test-runner.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAgE;AAChE,uCAA6E;AAE7E,sBAAuC;AACvC,yCAA4E;AAY5E,SAAgB,2BAA2B,CAAC,EAqB3C;;IArBD,iBA2HC;QA1HC,UAAU,gBAAA,EACV,YA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M,CAAA,MAAC,UAAkB,CAAC,OAAO,0CAAE,OAAO,EAAE,CAAA,EAAA;;wBAA5C,SAA4C,CAAA;wBAC5C,qBAAO,UAAkB,CAAC,OAAO,EAAE,EAAA;;wBAAnC,SAAmC,CAAA;;;;aACpC,CAAC,CAAA;QAEF,SAAS,CAAC,OAAO,CAAC,CAAA;IACpB,CAAC,CAAC,CAAA;AACJ,CAAC;AA5HD,kEA4HC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "medusa-test-utils",
3
- "version": "1.1.45-snapshot-20240524111804",
3
+ "version": "1.1.45-snapshot-20240527135519",
4
4
  "description": "Test utils for Medusa",
5
5
  "main": "dist/index.js",
6
6
  "repository": {
@@ -24,20 +24,19 @@
24
24
  "author": "Sebastian Rindom",
25
25
  "license": "MIT",
26
26
  "devDependencies": {
27
- "@medusajs/types": "1.12.0-snapshot-20240524111804",
27
+ "@medusajs/types": "1.12.0-snapshot-20240527135519",
28
28
  "cross-env": "^5.2.1",
29
29
  "jest": "^25.5.4",
30
30
  "rimraf": "^3.0.2",
31
31
  "typescript": "^5.1.6"
32
32
  },
33
33
  "peerDependencies": {
34
- "@medusajs/medusa": "1.20.6-snapshot-20240524111804",
35
- "@medusajs/modules-sdk": "1.13.0-snapshot-20240524111804",
34
+ "@medusajs/medusa": "1.20.6-snapshot-20240527135519",
35
+ "@medusajs/modules-sdk": "1.13.0-snapshot-20240527135519",
36
36
  "axios": "^0.28.0",
37
37
  "express": "^4.18.3",
38
38
  "get-port": "^5.1.0",
39
- "pg-god": "^1.0.12",
40
- "typeorm": "^0.2.43"
39
+ "pg-god": "^1.0.12"
41
40
  },
42
41
  "peerDependenciesMeta": {
43
42
  "@medusajs/medusa": {
@@ -54,16 +53,12 @@
54
53
  },
55
54
  "pg-god": {
56
55
  "optional": true
57
- },
58
- "typeorm": {
59
- "optional": true
60
56
  }
61
57
  },
62
58
  "dependencies": {
63
- "@medusajs/utils": "1.12.0-snapshot-20240524111804",
59
+ "@medusajs/utils": "1.12.0-snapshot-20240527135519",
64
60
  "@mikro-orm/migrations": "5.9.7",
65
61
  "@mikro-orm/postgresql": "5.9.7",
66
- "medusa-core-utils": "1.2.3-snapshot-20240524111804",
67
62
  "randomatic": "^3.1.1"
68
63
  },
69
64
  "gitHead": "81a7ff73d012fda722f6e9ef0bd9ba0232d37808"
@@ -1,9 +0,0 @@
1
- declare namespace _default {
2
- namespace connection {
3
- function getMetadata(target: any): any;
4
- }
5
- function getRepository(repo: any): any;
6
- function withRepository(repo: any): any;
7
- function transaction(isolationOrCb: any, cb: any): any;
8
- }
9
- export default _default;
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = {
4
- connection: {
5
- getMetadata: function (target) {
6
- var _a;
7
- return ((_a = target["metadata"]) !== null && _a !== void 0 ? _a : {
8
- columns: [],
9
- });
10
- },
11
- },
12
- getRepository: function (repo) {
13
- return repo;
14
- },
15
- withRepository: function (repo) {
16
- if (repo) {
17
- return Object.assign(repo, { manager: this });
18
- }
19
- return repo;
20
- },
21
- transaction: function (isolationOrCb, cb) {
22
- if (typeof isolationOrCb === "string") {
23
- return cb(this);
24
- }
25
- else {
26
- return isolationOrCb(this);
27
- }
28
- },
29
- };
30
- //# sourceMappingURL=mock-manager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mock-manager.js","sourceRoot":"","sources":["../src/mock-manager.js"],"names":[],"mappings":";;AAAA,kBAAe;IACb,UAAU,EAAE;QACV,WAAW,EAAE,UAAC,MAAM;;YAClB,OAAO,CACL,MAAA,MAAM,CAAC,UAAU,CAAC,mCAAI;gBACpB,OAAO,EAAE,EAAE;aACZ,CACF,CAAA;QACH,CAAC;KACF;IAED,aAAa,EAAE,UAAU,IAAI;QAC3B,OAAO,IAAI,CAAA;IACb,CAAC;IAED,cAAc,EAAE,UAAU,IAAI;QAC5B,IAAI,IAAI,EAAE,CAAC;YACT,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAA;QAC/C,CAAC;QAED,OAAO,IAAI,CAAA;IACb,CAAC;IAED,WAAW,EAAE,UAAU,aAAa,EAAE,EAAE;QACtC,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE,CAAC;YACtC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAA;QACjB,CAAC;aAAM,CAAC;YACN,OAAO,aAAa,CAAC,IAAI,CAAC,CAAA;QAC5B,CAAC;IACH,CAAC;CACF,CAAA"}
@@ -1,51 +0,0 @@
1
- declare function _default(methods?: {}): MockRepo;
2
- export default _default;
3
- declare class MockRepo {
4
- constructor({ create, update, remove, softRemove, find, findDescendantsTree, findOne, findOneWithRelations, findOneOrFail, save, findAndCount, del, count, insertBulk, metadata, }: {
5
- create: any;
6
- update: any;
7
- remove: any;
8
- softRemove: any;
9
- find: any;
10
- findDescendantsTree: any;
11
- findOne: any;
12
- findOneWithRelations: any;
13
- findOneOrFail: any;
14
- save: any;
15
- findAndCount: any;
16
- del: any;
17
- count: any;
18
- insertBulk: any;
19
- metadata: any;
20
- });
21
- create_: any;
22
- update_: any;
23
- remove_: any;
24
- delete_: any;
25
- softRemove_: any;
26
- find_: any;
27
- findDescendantsTree_: any;
28
- findOne_: any;
29
- findOneOrFail_: any;
30
- save_: any;
31
- findAndCount_: any;
32
- findOneWithRelations_: any;
33
- insertBulk_: any;
34
- count_: any;
35
- metadata: any;
36
- setFindOne(fn: any): void;
37
- insertBulk: jest.Mock<any, any>;
38
- create: jest.Mock<any, any>;
39
- softRemove: jest.Mock<any, any>;
40
- remove: jest.Mock<any, any>;
41
- update: jest.Mock<any, any>;
42
- findOneOrFail: jest.Mock<any, any>;
43
- findOneWithRelations: jest.Mock<any, any>;
44
- findOne: jest.Mock<any, any>;
45
- findDescendantsTree: jest.Mock<any, any>;
46
- find: jest.Mock<any, any>;
47
- save: jest.Mock<any, any>;
48
- findAndCount: jest.Mock<any, any>;
49
- count: jest.Mock<any, any>;
50
- delete: jest.Mock<any, any>;
51
- }
@@ -1,193 +0,0 @@
1
- "use strict";
2
- var __read = (this && this.__read) || function (o, n) {
3
- var m = typeof Symbol === "function" && o[Symbol.iterator];
4
- if (!m) return o;
5
- var i = m.call(o), r, ar = [], e;
6
- try {
7
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
8
- }
9
- catch (error) { e = { error: error }; }
10
- finally {
11
- try {
12
- if (r && !r.done && (m = i["return"])) m.call(i);
13
- }
14
- finally { if (e) throw e.error; }
15
- }
16
- return ar;
17
- };
18
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
19
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
20
- if (ar || !(i in from)) {
21
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
22
- ar[i] = from[i];
23
- }
24
- }
25
- return to.concat(ar || Array.prototype.slice.call(from));
26
- };
27
- Object.defineProperty(exports, "__esModule", { value: true });
28
- var MockRepo = /** @class */ (function () {
29
- function MockRepo(_a) {
30
- var create = _a.create, update = _a.update, remove = _a.remove, softRemove = _a.softRemove, find = _a.find, findDescendantsTree = _a.findDescendantsTree, findOne = _a.findOne, findOneWithRelations = _a.findOneWithRelations, findOneOrFail = _a.findOneOrFail, save = _a.save, findAndCount = _a.findAndCount, del = _a.del, count = _a.count, insertBulk = _a.insertBulk, metadata = _a.metadata;
31
- var _this = this;
32
- this.insertBulk = jest.fn().mockImplementation(function () {
33
- var args = [];
34
- for (var _i = 0; _i < arguments.length; _i++) {
35
- args[_i] = arguments[_i];
36
- }
37
- if (_this.insertBulk_) {
38
- return _this.insertBulk_.apply(_this, __spreadArray([], __read(args), false));
39
- }
40
- return {};
41
- });
42
- this.create = jest.fn().mockImplementation(function () {
43
- var args = [];
44
- for (var _i = 0; _i < arguments.length; _i++) {
45
- args[_i] = arguments[_i];
46
- }
47
- if (_this.create_) {
48
- return _this.create_.apply(_this, __spreadArray([], __read(args), false));
49
- }
50
- return {};
51
- });
52
- this.softRemove = jest.fn().mockImplementation(function () {
53
- var args = [];
54
- for (var _i = 0; _i < arguments.length; _i++) {
55
- args[_i] = arguments[_i];
56
- }
57
- if (_this.softRemove_) {
58
- return _this.softRemove_.apply(_this, __spreadArray([], __read(args), false));
59
- }
60
- return {};
61
- });
62
- this.remove = jest.fn().mockImplementation(function () {
63
- var args = [];
64
- for (var _i = 0; _i < arguments.length; _i++) {
65
- args[_i] = arguments[_i];
66
- }
67
- if (_this.remove_) {
68
- return _this.remove_.apply(_this, __spreadArray([], __read(args), false));
69
- }
70
- return {};
71
- });
72
- this.update = jest.fn().mockImplementation(function () {
73
- var args = [];
74
- for (var _i = 0; _i < arguments.length; _i++) {
75
- args[_i] = arguments[_i];
76
- }
77
- if (_this.update_) {
78
- return _this.update_.apply(_this, __spreadArray([], __read(args), false));
79
- }
80
- });
81
- this.findOneOrFail = jest.fn().mockImplementation(function () {
82
- var args = [];
83
- for (var _i = 0; _i < arguments.length; _i++) {
84
- args[_i] = arguments[_i];
85
- }
86
- if (_this.findOneOrFail_) {
87
- return _this.findOneOrFail_.apply(_this, __spreadArray([], __read(args), false));
88
- }
89
- });
90
- this.findOneWithRelations = jest.fn().mockImplementation(function () {
91
- var args = [];
92
- for (var _i = 0; _i < arguments.length; _i++) {
93
- args[_i] = arguments[_i];
94
- }
95
- if (_this.findOneWithRelations_) {
96
- return _this.findOneWithRelations_.apply(_this, __spreadArray([], __read(args), false));
97
- }
98
- });
99
- this.findOne = jest.fn().mockImplementation(function () {
100
- var args = [];
101
- for (var _i = 0; _i < arguments.length; _i++) {
102
- args[_i] = arguments[_i];
103
- }
104
- if (_this.findOne_) {
105
- return _this.findOne_.apply(_this, __spreadArray([], __read(args), false));
106
- }
107
- });
108
- this.findDescendantsTree = jest.fn().mockImplementation(function () {
109
- var args = [];
110
- for (var _i = 0; _i < arguments.length; _i++) {
111
- args[_i] = arguments[_i];
112
- }
113
- if (_this.findDescendantsTree_) {
114
- return _this.findDescendantsTree_.apply(_this, __spreadArray([], __read(args), false));
115
- }
116
- });
117
- this.find = jest.fn().mockImplementation(function () {
118
- var args = [];
119
- for (var _i = 0; _i < arguments.length; _i++) {
120
- args[_i] = arguments[_i];
121
- }
122
- if (_this.find_) {
123
- return _this.find_.apply(_this, __spreadArray([], __read(args), false));
124
- }
125
- });
126
- this.save = jest.fn().mockImplementation(function () {
127
- var args = [];
128
- for (var _i = 0; _i < arguments.length; _i++) {
129
- args[_i] = arguments[_i];
130
- }
131
- if (_this.save_) {
132
- return _this.save_.apply(_this, __spreadArray([], __read(args), false));
133
- }
134
- return Promise.resolve.apply(Promise, __spreadArray([], __read(args), false));
135
- });
136
- this.findAndCount = jest.fn().mockImplementation(function () {
137
- var args = [];
138
- for (var _i = 0; _i < arguments.length; _i++) {
139
- args[_i] = arguments[_i];
140
- }
141
- if (_this.findAndCount_) {
142
- return _this.findAndCount_.apply(_this, __spreadArray([], __read(args), false));
143
- }
144
- return {};
145
- });
146
- this.count = jest.fn().mockImplementation(function () {
147
- var args = [];
148
- for (var _i = 0; _i < arguments.length; _i++) {
149
- args[_i] = arguments[_i];
150
- }
151
- if (_this.count_) {
152
- return _this.count_.apply(_this, __spreadArray([], __read(args), false));
153
- }
154
- return {};
155
- });
156
- this.delete = jest.fn().mockImplementation(function () {
157
- var args = [];
158
- for (var _i = 0; _i < arguments.length; _i++) {
159
- args[_i] = arguments[_i];
160
- }
161
- if (_this.delete_) {
162
- return _this.delete_.apply(_this, __spreadArray([], __read(args), false));
163
- }
164
- return {};
165
- });
166
- this.create_ = create;
167
- this.update_ = update;
168
- this.remove_ = remove;
169
- this.delete_ = del;
170
- this.softRemove_ = softRemove;
171
- this.find_ = find;
172
- this.findDescendantsTree_ = findDescendantsTree;
173
- this.findOne_ = findOne;
174
- this.findOneOrFail_ = findOneOrFail;
175
- this.save_ = save;
176
- this.findAndCount_ = findAndCount;
177
- this.findOneWithRelations_ = findOneWithRelations;
178
- this.insertBulk_ = insertBulk;
179
- this.count_ = count;
180
- this.metadata = metadata !== null && metadata !== void 0 ? metadata : {
181
- columns: [],
182
- };
183
- }
184
- MockRepo.prototype.setFindOne = function (fn) {
185
- this.findOne_ = fn;
186
- };
187
- return MockRepo;
188
- }());
189
- exports.default = (function (methods) {
190
- if (methods === void 0) { methods = {}; }
191
- return new MockRepo(methods);
192
- });
193
- //# sourceMappingURL=mock-repository.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mock-repository.js","sourceRoot":"","sources":["../src/mock-repository.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;IACE,kBAAY,EAgBX;YAfC,MAAM,YAAA,EACN,MAAM,YAAA,EACN,MAAM,YAAA,EACN,UAAU,gBAAA,EACV,IAAI,UAAA,EACJ,mBAAmB,yBAAA,EACnB,OAAO,aAAA,EACP,oBAAoB,0BAAA,EACpB,aAAa,mBAAA,EACb,IAAI,UAAA,EACJ,YAAY,kBAAA,EACZ,GAAG,SAAA,EACH,KAAK,WAAA,EACL,UAAU,gBAAA,EACV,QAAQ,cAAA;QAfV,iBAmCC;QAMD,eAAU,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC;YAAC,cAAO;iBAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;gBAAP,yBAAO;;YAChD,IAAI,KAAI,CAAC,WAAW,EAAE,CAAC;gBACrB,OAAO,KAAI,CAAC,WAAW,OAAhB,KAAI,2BAAgB,IAAI,WAAC;YAClC,CAAC;YACD,OAAO,EAAE,CAAA;QACX,CAAC,CAAC,CAAA;QACF,WAAM,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC;YAAC,cAAO;iBAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;gBAAP,yBAAO;;YAC5C,IAAI,KAAI,CAAC,OAAO,EAAE,CAAC;gBACjB,OAAO,KAAI,CAAC,OAAO,OAAZ,KAAI,2BAAY,IAAI,WAAC;YAC9B,CAAC;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