@acmekit/test-utils 2.13.82 → 2.13.84

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/acmekit-test-runner-utils/bootstrap-app.d.ts +3 -1
  2. package/dist/acmekit-test-runner-utils/bootstrap-app.d.ts.map +1 -1
  3. package/dist/acmekit-test-runner-utils/bootstrap-app.js +6 -2
  4. package/dist/acmekit-test-runner-utils/bootstrap-app.js.map +1 -1
  5. package/dist/index.d.ts +1 -0
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +1 -0
  8. package/dist/index.js.map +1 -1
  9. package/dist/integration-test-runner.d.ts +54 -0
  10. package/dist/integration-test-runner.d.ts.map +1 -0
  11. package/dist/integration-test-runner.js +193 -0
  12. package/dist/integration-test-runner.js.map +1 -0
  13. package/dist/pipeline/errors.d.ts +13 -0
  14. package/dist/pipeline/errors.d.ts.map +1 -0
  15. package/dist/pipeline/errors.js +25 -0
  16. package/dist/pipeline/errors.js.map +1 -0
  17. package/dist/pipeline/pipeline.d.ts +31 -0
  18. package/dist/pipeline/pipeline.d.ts.map +1 -0
  19. package/dist/pipeline/pipeline.js +92 -0
  20. package/dist/pipeline/pipeline.js.map +1 -0
  21. package/dist/pipeline/stages/config.d.ts +23 -0
  22. package/dist/pipeline/stages/config.d.ts.map +1 -0
  23. package/dist/pipeline/stages/config.js +148 -0
  24. package/dist/pipeline/stages/config.js.map +1 -0
  25. package/dist/pipeline/stages/database.d.ts +28 -0
  26. package/dist/pipeline/stages/database.d.ts.map +1 -0
  27. package/dist/pipeline/stages/database.js +276 -0
  28. package/dist/pipeline/stages/database.js.map +1 -0
  29. package/dist/pipeline/stages/http.d.ts +18 -0
  30. package/dist/pipeline/stages/http.d.ts.map +1 -0
  31. package/dist/pipeline/stages/http.js +67 -0
  32. package/dist/pipeline/stages/http.js.map +1 -0
  33. package/dist/pipeline/stages/module.d.ts +20 -0
  34. package/dist/pipeline/stages/module.d.ts.map +1 -0
  35. package/dist/pipeline/stages/module.js +104 -0
  36. package/dist/pipeline/stages/module.js.map +1 -0
  37. package/dist/pipeline/stages/plugin-resources.d.ts +13 -0
  38. package/dist/pipeline/stages/plugin-resources.d.ts.map +1 -0
  39. package/dist/pipeline/stages/plugin-resources.js +94 -0
  40. package/dist/pipeline/stages/plugin-resources.js.map +1 -0
  41. package/dist/pipeline/stages/proxy.d.ts +23 -0
  42. package/dist/pipeline/stages/proxy.d.ts.map +1 -0
  43. package/dist/pipeline/stages/proxy.js +99 -0
  44. package/dist/pipeline/stages/proxy.js.map +1 -0
  45. package/dist/pipeline/types.d.ts +133 -0
  46. package/dist/pipeline/types.d.ts.map +1 -0
  47. package/dist/pipeline/types.js +29 -0
  48. package/dist/pipeline/types.js.map +1 -0
  49. package/dist/tsconfig.tsbuildinfo +1 -1
  50. package/package.json +6 -6
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ModuleStage = void 0;
4
+ const init_modules_1 = require("../../init-modules");
5
+ /**
6
+ * ModuleStage — initializes AcmeKit modules via initModules().
7
+ *
8
+ * Skipped when http: true in app mode (HttpStage handles module init
9
+ * via loaders()). Plugin non-http mode uses this for initModules.
10
+ *
11
+ * For plugin/module mode, reset() does a full shutdown + re-init cycle
12
+ * to match the existing runner behavior. This ensures modules get a
13
+ * clean state between tests.
14
+ */
15
+ class ModuleStage {
16
+ constructor() {
17
+ this.name = "ModuleStage";
18
+ }
19
+ async setup(ctx) {
20
+ // When http: true, HttpStage boots the full framework via startApp() → loaders()
21
+ // which handles module init — skip here
22
+ if (ctx.http) {
23
+ return;
24
+ }
25
+ await this.initializeModules(ctx);
26
+ }
27
+ async reset(ctx) {
28
+ // When http: true, the framework is running via HttpStage — only run
29
+ // scoped module loader for app mode (plugin HTTP mode skips entirely)
30
+ if (ctx.http && ctx.mode !== "app") {
31
+ return;
32
+ }
33
+ if (ctx.mode === "app") {
34
+ // App mode: re-run module loaders in scoped container
35
+ const container = ctx.container;
36
+ if (!container)
37
+ return;
38
+ const copiedContainer = container.createScope();
39
+ try {
40
+ const { AcmeKitAppLoader } = await import("@acmekit/framework");
41
+ const appLoader = new AcmeKitAppLoader({
42
+ container: copiedContainer,
43
+ acmekitConfigPath: ctx.cwd,
44
+ cwd: ctx.cwd,
45
+ });
46
+ await appLoader.runModulesLoader();
47
+ const { createDefaultsWorkflow } = await import("@acmekit/core-flows");
48
+ await createDefaultsWorkflow(copiedContainer).run();
49
+ }
50
+ catch (error) {
51
+ await copiedContainer.dispose?.();
52
+ throw error;
53
+ }
54
+ }
55
+ else {
56
+ // Plugin/Module mode (non-HTTP): full shutdown + re-init
57
+ await this.shutdownModules(ctx);
58
+ await this.initializeModules(ctx);
59
+ }
60
+ }
61
+ async destroy(ctx) {
62
+ // When http: true for plugin mode, HttpStage handles shutdown
63
+ if (ctx.http && ctx.mode !== "app") {
64
+ return;
65
+ }
66
+ await this.shutdownModules(ctx);
67
+ const { clearInstances } = await import("../../acmekit-test-runner-utils/clear-instances.js");
68
+ await clearInstances();
69
+ ctx.container = null;
70
+ ctx.acmekitApp = null;
71
+ ctx.moduleService = null;
72
+ }
73
+ // ── Private ──
74
+ async initializeModules(ctx) {
75
+ if (!ctx.moduleOptionsConfig) {
76
+ throw new Error("ModuleStage requires moduleOptionsConfig (set by ConfigStage)");
77
+ }
78
+ const output = await (0, init_modules_1.initModules)(ctx.moduleOptionsConfig);
79
+ ctx.shutdown.push(output.shutdown);
80
+ ctx.acmekitApp = output.acmekitApp;
81
+ if (ctx.mode === "module") {
82
+ ctx.container = output.acmekitApp.sharedContainer;
83
+ ctx.moduleService = output.acmekitApp.modules[ctx.moduleName];
84
+ }
85
+ else {
86
+ ctx.container = output.acmekitApp.sharedContainer;
87
+ }
88
+ }
89
+ async shutdownModules(ctx) {
90
+ for (const shutdownFn of ctx.shutdown) {
91
+ try {
92
+ await shutdownFn();
93
+ }
94
+ catch {
95
+ // Ignore shutdown errors
96
+ }
97
+ }
98
+ ctx.shutdown = [];
99
+ ctx.acmekitApp = null;
100
+ ctx.moduleService = null;
101
+ }
102
+ }
103
+ exports.ModuleStage = ModuleStage;
104
+ //# sourceMappingURL=module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.js","sourceRoot":"","sources":["../../../src/pipeline/stages/module.ts"],"names":[],"mappings":";;;AACA,qDAAgD;AAGhD;;;;;;;;;GASG;AACH,MAAa,WAAW;IAAxB;QACE,SAAI,GAAG,aAAa,CAAA;IAkGtB,CAAC;IAhGC,KAAK,CAAC,KAAK,CAAC,GAAoB;QAC9B,iFAAiF;QACjF,wCAAwC;QACxC,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;YACb,OAAM;QACR,CAAC;QAED,MAAM,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAA;IACnC,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,GAAoB;QAC9B,qEAAqE;QACrE,sEAAsE;QACtE,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;YACnC,OAAM;QACR,CAAC;QAED,IAAI,GAAG,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;YACvB,sDAAsD;YACtD,MAAM,SAAS,GAAG,GAAG,CAAC,SAA6B,CAAA;YACnD,IAAI,CAAC,SAAS;gBAAE,OAAM;YAEtB,MAAM,eAAe,GAAG,SAAS,CAAC,WAAW,EAAsB,CAAA;YACnE,IAAI,CAAC;gBACH,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAA;gBAC/D,MAAM,SAAS,GAAG,IAAI,gBAAgB,CAAC;oBACrC,SAAS,EAAE,eAAe;oBAC1B,iBAAiB,EAAE,GAAG,CAAC,GAAG;oBAC1B,GAAG,EAAE,GAAG,CAAC,GAAG;iBACb,CAAC,CAAA;gBACF,MAAM,SAAS,CAAC,gBAAgB,EAAE,CAAA;gBA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AAG,MAAM,CAAC,UAAU,CAAA;QAElC,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC1B,GAAG,CAAC,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,eAAe,CAAA;YACjD,GAAG,CAAC,aAAa,GAAG,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,UAAW,CAAC,CAAA;QAChE,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,eAAe,CAAA;QACnD,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,eAAe,CAAC,GAAoB;QAChD,KAAK,MAAM,UAAU,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC;YACtC,IAAI,CAAC;gBACH,MAAM,UAAU,EAAE,CAAA;YACpB,CAAC;YAAC,MAAM,CAAC;gBACP,yBAAyB;YAC3B,CAAC;QACH,CAAC;QACD,GAAG,CAAC,QAAQ,GAAG,EAAE,CAAA;QACjB,GAAG,CAAC,UAAU,GAAG,IAAI,CAAA;QACrB,GAAG,CAAC,aAAa,GAAG,IAAI,CAAA;IAC1B,CAAC;CACF;AAnGD,kCAmGC"}
@@ -0,0 +1,13 @@
1
+ import { BootstrapStage, PipelineContext } from "../types";
2
+ /**
3
+ * PluginResourceStage — loads plugin subscribers, workflows, and jobs.
4
+ * Only used in plugin mode.
5
+ */
6
+ export declare class PluginResourceStage implements BootstrapStage {
7
+ name: string;
8
+ setup(ctx: PipelineContext): Promise<void>;
9
+ reset(ctx: PipelineContext): Promise<void>;
10
+ destroy(_ctx: PipelineContext): Promise<void>;
11
+ private loadPluginResources;
12
+ }
13
+ //# sourceMappingURL=plugin-resources.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-resources.d.ts","sourceRoot":"","sources":["../../../src/pipeline/stages/plugin-resources.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE1D;;;GAGG;AACH,qBAAa,mBAAoB,YAAW,cAAc;IACxD,IAAI,SAAwB;IAEtB,KAAK,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAY1C,KAAK,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAK1C,OAAO,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;YAIrC,mBAAmB;CAwClC"}
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.PluginResourceStage = void 0;
37
+ const fs = __importStar(require("fs"));
38
+ const path_1 = require("path");
39
+ /**
40
+ * PluginResourceStage — loads plugin subscribers, workflows, and jobs.
41
+ * Only used in plugin mode.
42
+ */
43
+ class PluginResourceStage {
44
+ constructor() {
45
+ this.name = "PluginResourceStage";
46
+ }
47
+ async setup(ctx) {
48
+ // Set up no-op scheduler (same as plugin-test-runner.ts)
49
+ const { WorkflowScheduler } = require("@acmekit/orchestration");
50
+ WorkflowScheduler.setStorage({
51
+ async schedule() { },
52
+ async remove() { },
53
+ async removeAll() { },
54
+ });
55
+ await this.loadPluginResources(ctx);
56
+ }
57
+ async reset(ctx) {
58
+ // Re-load plugin resources after module reset
59
+ await this.loadPluginResources(ctx);
60
+ }
61
+ async destroy(_ctx) {
62
+ // No cleanup needed — resources are tied to the container
63
+ }
64
+ async loadPluginResources(ctx) {
65
+ if (!ctx.container)
66
+ return;
67
+ const { SubscriberLoader } = require("@acmekit/framework/subscribers");
68
+ const { WorkflowLoader } = require("@acmekit/framework/workflows");
69
+ const { JobLoader } = require("@acmekit/framework/jobs");
70
+ for (const plugin of ctx.plugins) {
71
+ const pluginResolve = plugin.resolve;
72
+ // Load subscribers
73
+ const subscriberDir = (0, path_1.join)(pluginResolve, "subscribers");
74
+ if (fs.existsSync(subscriberDir)) {
75
+ const loader = new SubscriberLoader([subscriberDir], plugin.options ?? {}, ctx.container);
76
+ await loader.load();
77
+ }
78
+ // Load workflows
79
+ const workflowDir = (0, path_1.join)(pluginResolve, "workflows");
80
+ if (fs.existsSync(workflowDir)) {
81
+ const loader = new WorkflowLoader([workflowDir], ctx.container);
82
+ await loader.load();
83
+ }
84
+ // Load jobs
85
+ const jobDir = (0, path_1.join)(pluginResolve, "jobs");
86
+ if (fs.existsSync(jobDir)) {
87
+ const loader = new JobLoader([jobDir], plugin.options ?? {}, ctx.container);
88
+ await loader.load();
89
+ }
90
+ }
91
+ }
92
+ }
93
+ exports.PluginResourceStage = PluginResourceStage;
94
+ //# sourceMappingURL=plugin-resources.js.map
@@ -0,0 +1 @@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IAAA,WAAI,EAAC,aAAa,EAAE,aAAa,CAAC,CAAA;YACxD,IAAI,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;gBACjC,MAAM,MAAM,GAAG,IAAI,gBAAgB,CACjC,CAAC,aAAa,CAAC,EACf,MAAM,CAAC,OAAO,IAAI,EAAE,EACpB,GAAG,CAAC,SAAS,CACd,CAAA;gBACD,MAAM,MAAM,CAAC,IAAI,EAAE,CAAA;YACrB,CAAC;YAED,iBAAiB;YACjB,MAAM,WAAW,GAAG,IAAA,WAAI,EAAC,aAAa,EAAE,WAAW,CAAC,CAAA;YACpD,IAAI,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;gBAC/B,MAAM,MAAM,GAAG,IAAI,cAAc,CAAC,CAAC,WAAW,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,CAAA;gBAC/D,MAAM,MAAM,CAAC,IAAI,EAAE,CAAA;YACrB,CAAC;YAED,YAAY;YACZ,MAAM,MAAM,GAAG,IAAA,WAAI,EAAC,aAAa,EAAE,MAAM,CAAC,CAAA;YAC1C,IAAI,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC1B,MAAM,MAAM,GAAG,IAAI,SAAS,CAC1B,CAAC,MAAM,CAAC,EACR,MAAM,CAAC,OAAO,IAAI,EAAE,EACpB,GAAG,CAAC,SAAS,CACd,CAAA;gBACD,MAAM,MAAM,CAAC,IAAI,EAAE,CAAA;YACrB,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAhED,kDAgEC"}
@@ -0,0 +1,23 @@
1
+ import { BootstrapStage, IntegrationTestOptions, PipelineContext } from "../types";
2
+ /**
3
+ * ProxyStage — creates deferred proxy objects for test fixtures.
4
+ * Proxies forward property access to the pipeline context's current state,
5
+ * allowing fixtures to reflect re-initialized state after each beforeEach.
6
+ *
7
+ * Options are built eagerly in the constructor (from context references),
8
+ * since testSuite() is called synchronously at describe time, before
9
+ * beforeAll runs setup(). The proxies lazily delegate to context state
10
+ * that gets populated during setup().
11
+ */
12
+ export declare class ProxyStage implements BootstrapStage {
13
+ name: string;
14
+ private options;
15
+ constructor(ctx: PipelineContext);
16
+ setup(_ctx: PipelineContext): Promise<void>;
17
+ reset(_ctx: PipelineContext): Promise<void>;
18
+ destroy(_ctx: PipelineContext): Promise<void>;
19
+ getOptions(): IntegrationTestOptions;
20
+ private buildOptions;
21
+ private createProxy;
22
+ }
23
+ //# sourceMappingURL=proxy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../../../src/pipeline/stages/proxy.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAElF;;;;;;;;;GASG;AACH,qBAAa,UAAW,YAAW,cAAc;IAC/C,IAAI,SAAe;IAEnB,OAAO,CAAC,OAAO,CAAwB;gBAE3B,GAAG,EAAE,eAAe;IAI1B,KAAK,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3C,KAAK,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3C,OAAO,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAInD,UAAU,IAAI,sBAAsB;IAIpC,OAAO,CAAC,YAAY;IAmCpB,OAAO,CAAC,WAAW;CAqCpB"}
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProxyStage = void 0;
4
+ const wait_workflow_executions_1 = require("../../acmekit-test-runner-utils/wait-workflow-executions");
5
+ /**
6
+ * ProxyStage — creates deferred proxy objects for test fixtures.
7
+ * Proxies forward property access to the pipeline context's current state,
8
+ * allowing fixtures to reflect re-initialized state after each beforeEach.
9
+ *
10
+ * Options are built eagerly in the constructor (from context references),
11
+ * since testSuite() is called synchronously at describe time, before
12
+ * beforeAll runs setup(). The proxies lazily delegate to context state
13
+ * that gets populated during setup().
14
+ */
15
+ class ProxyStage {
16
+ constructor(ctx) {
17
+ this.name = "ProxyStage";
18
+ this.options = this.buildOptions(ctx);
19
+ }
20
+ async setup(_ctx) {
21
+ // Options already built in constructor via lazy proxies
22
+ }
23
+ async reset(_ctx) {
24
+ // Proxies automatically reflect updated ctx state
25
+ }
26
+ async destroy(_ctx) {
27
+ // Proxies will return undefined once ctx is cleared
28
+ }
29
+ getOptions() {
30
+ return this.options;
31
+ }
32
+ buildOptions(ctx) {
33
+ const options = {
34
+ container: this.createProxy(() => ctx.container),
35
+ acmekitApp: this.createProxy(() => ctx.acmekitApp),
36
+ dbConfig: ctx.dbConfig,
37
+ MikroOrmWrapper: this.createProxy(() => ctx.MikroOrmWrapper),
38
+ };
39
+ // HTTP fixture (app + plugin HTTP modes)
40
+ if (ctx.http) {
41
+ options.api = this.createProxy(() => ctx.apiUtils);
42
+ }
43
+ // Module-specific fixture
44
+ if (ctx.mode === "module") {
45
+ options.service = this.createProxy(() => ctx.moduleService);
46
+ }
47
+ // App-specific fixtures
48
+ if (ctx.mode === "app") {
49
+ options.dbConnection = this.createProxy(() => ctx.dbUtils?.pgConnection_);
50
+ options.dbUtils = this.createProxy(() => ctx.dbUtils);
51
+ options.getContainer = () => ctx.container;
52
+ options.getAcmeKitApp = () => ctx.loadedApplication;
53
+ options.utils = {
54
+ waitWorkflowExecutions: () => (0, wait_workflow_executions_1.waitWorkflowExecutions)(ctx.container),
55
+ };
56
+ }
57
+ return options;
58
+ }
59
+ createProxy(getter) {
60
+ return new Proxy({}, {
61
+ get(_target, prop) {
62
+ const target = getter();
63
+ if (target == null)
64
+ return undefined;
65
+ const value = target[prop];
66
+ // Bind functions so they retain correct `this` context
67
+ return typeof value === "function" ? value.bind(target) : value;
68
+ },
69
+ has(_target, prop) {
70
+ const target = getter();
71
+ if (target == null)
72
+ return false;
73
+ // Check via `in` first. If the target is itself a Proxy (e.g.,
74
+ // awilix containers), `in` may miss properties that `get` would
75
+ // find, so fall back to a property access check.
76
+ try {
77
+ return prop in target || target[prop] !== undefined;
78
+ }
79
+ catch {
80
+ return false;
81
+ }
82
+ },
83
+ ownKeys() {
84
+ return Reflect.ownKeys(getter() ?? {});
85
+ },
86
+ getOwnPropertyDescriptor(_target, prop) {
87
+ const target = getter();
88
+ if (target == null)
89
+ return undefined;
90
+ return Object.getOwnPropertyDescriptor(target, prop);
91
+ },
92
+ getPrototypeOf() {
93
+ return Object.getPrototypeOf(getter() ?? {});
94
+ },
95
+ });
96
+ }
97
+ }
98
+ exports.ProxyStage = ProxyStage;
99
+ //# sourceMappingURL=proxy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proxy.js","sourceRoot":"","sources":["../../../src/pipeline/stages/proxy.ts"],"names":[],"mappings":";;;AACA,uGAAiG;AAGjG;;;;;;;;;GASG;AACH,MAAa,UAAU;IAKrB,YAAY,GAAoB;QAJhC,SAAI,GAAG,YAAY,CAAA;QAKjB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;IACvC,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,IAAqB;QAC/B,wDAAwD;IAC1D,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,IAAqB;QAC/B,kDAAkD;IACpD,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,IAAqB;QACjC,oDAAoD;IACtD,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;IAEO,YAAY,CAAC,GAAoB;QACvC,MAAM,OAAO,GAA2B;YACtC,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,SAAS,CAAqB;YACpE,UAAU,EAAE,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC;YAClD,QAAQ,EAAE,GAAG,CAAC,QAAQ;YACtB,eAAe,EAAE,IAAI,C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;gBACpC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;gBAC1B,uDAAuD;gBACvD,OAAO,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;YACjE,CAAC;YACD,GAAG,CAAC,OAAO,EAAE,IAAI;gBACf,MAAM,MAAM,GAAG,MAAM,EAAE,CAAA;gBACvB,IAAI,MAAM,IAAI,IAAI;oBAAE,OAAO,KAAK,CAAA;gBAChC,+DAA+D;gBAC/D,gEAAgE;gBAChE,iDAAiD;gBACjD,IAAI,CAAC;oBACH,OAAO,IAAI,IAAI,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,SAAS,CAAA;gBACrD,CAAC;gBAAC,MAAM,CAAC;oBACP,OAAO,KAAK,CAAA;gBACd,CAAC;YACH,CAAC;YACD,OAAO;gBACL,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAA;YACxC,CAAC;YACD,wBAAwB,CAAC,OAAO,EAAE,IAAI;gBACpC,MAAM,MAAM,GAAG,MAAM,EAAE,CAAA;gBACvB,IAAI,MAAM,IAAI,IAAI;oBAAE,OAAO,SAAS,CAAA;gBACpC,OAAO,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;YACtD,CAAC;YACD,cAAc;gBACZ,OAAO,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAA;YAC9C,CAAC;SACF,CACF,CAAA;IACH,CAAC;CACF;AAjGD,gCAiGC"}
@@ -0,0 +1,133 @@
1
+ import { AcmeKitContainer, PluginDetails } from "@acmekit/framework/types";
2
+ import { DmlEntity } from "@acmekit/framework/utils";
3
+ import { TestDatabase } from "../database";
4
+ /**
5
+ * Stage interface — each stage owns setup, reset, and destroy.
6
+ */
7
+ export interface BootstrapStage {
8
+ /** Human-readable name for error messages (e.g., "DatabaseStage") */
9
+ name: string;
10
+ /**
11
+ * Called once during beforeAll.
12
+ * Set up long-lived resources (DB, Express server, etc.)
13
+ */
14
+ setup(ctx: PipelineContext): Promise<void>;
15
+ /**
16
+ * Called during beforeEach to reset state between tests.
17
+ * E.g., TRUNCATE tables, re-run module loaders.
18
+ */
19
+ reset(ctx: PipelineContext): Promise<void>;
20
+ /**
21
+ * Called once during afterAll to tear everything down.
22
+ * Release connections, stop servers, drop databases.
23
+ */
24
+ destroy(ctx: PipelineContext): Promise<void>;
25
+ }
26
+ /**
27
+ * Shared mutable context that stages read from and write to.
28
+ * Replaces the scattered private fields across current runner classes.
29
+ */
30
+ export interface PipelineContext {
31
+ mode: "app" | "plugin" | "module";
32
+ http: boolean;
33
+ cwd: string;
34
+ dbConfig: {
35
+ dbName: string;
36
+ clientUrl: string;
37
+ schema: string;
38
+ debug: boolean;
39
+ };
40
+ env: Record<string, any>;
41
+ pluginPath?: string;
42
+ pluginOptions?: Record<string, unknown>;
43
+ additionalModules?: Record<string, any>;
44
+ moduleName?: string;
45
+ moduleResolve?: string;
46
+ moduleModels?: any[];
47
+ moduleOptions?: Record<string, any>;
48
+ moduleDependencies?: string[];
49
+ joinerConfig?: any[];
50
+ injectedDependencies?: Record<string, any>;
51
+ disableAutoTeardown?: boolean;
52
+ syntheticConfig: Record<string, any> | null;
53
+ pgConnection: any | null;
54
+ dbUtils: any | null;
55
+ MikroOrmWrapper: TestDatabase | null;
56
+ discoveredModels: (Function | DmlEntity<any, any>)[];
57
+ container: AcmeKitContainer | null;
58
+ acmekitApp: any | null;
59
+ moduleService: any | null;
60
+ apiUtils: any | null;
61
+ expressPort: number | null;
62
+ loadedApplication: any | null;
63
+ shutdown: (() => Promise<void>)[];
64
+ plugins: PluginDetails[];
65
+ allModulesConfig: Record<string, any>;
66
+ moduleOptionsConfig: any | null;
67
+ hooks: RunnerHooks;
68
+ }
69
+ export interface RunnerHooks {
70
+ beforeSetup?: () => Promise<void>;
71
+ afterSetup?: (ctx: {
72
+ container: AcmeKitContainer;
73
+ acmekitApp: any;
74
+ api?: any;
75
+ }) => Promise<void>;
76
+ beforeReset?: () => Promise<void>;
77
+ afterReset?: () => Promise<void>;
78
+ }
79
+ /**
80
+ * Full config accepted by integrationTestRunner().
81
+ * Validated at construction time.
82
+ */
83
+ export interface IntegrationTestRunnerConfig<TService = any> {
84
+ mode: "app" | "plugin" | "module";
85
+ http?: boolean;
86
+ cwd?: string;
87
+ acmekitConfigFile?: string;
88
+ env?: Record<string, any>;
89
+ disableAutoTeardown?: boolean;
90
+ pluginPath?: string;
91
+ pluginOptions?: Record<string, unknown>;
92
+ additionalModules?: Record<string, any>;
93
+ moduleName?: string;
94
+ resolve?: string;
95
+ moduleModels?: any[];
96
+ moduleOptions?: Record<string, any>;
97
+ moduleDependencies?: string[];
98
+ joinerConfig?: any[];
99
+ dbName?: string;
100
+ schema?: string;
101
+ debug?: boolean;
102
+ injectedDependencies?: Record<string, any>;
103
+ hooks?: RunnerHooks;
104
+ testSuite: (options: IntegrationTestOptions<TService>) => void;
105
+ }
106
+ /**
107
+ * Fixtures returned to the test suite callback.
108
+ */
109
+ export interface IntegrationTestOptions<TService = any> {
110
+ container: AcmeKitContainer;
111
+ acmekitApp: any;
112
+ dbConfig: {
113
+ schema: string;
114
+ clientUrl: string;
115
+ dbName: string;
116
+ };
117
+ MikroOrmWrapper: TestDatabase;
118
+ api?: any;
119
+ service?: TService;
120
+ dbConnection?: any;
121
+ dbUtils?: any;
122
+ getContainer?: () => AcmeKitContainer;
123
+ getAcmeKitApp?: () => any;
124
+ utils?: {
125
+ waitWorkflowExecutions: () => Promise<void>;
126
+ };
127
+ }
128
+ /**
129
+ * Validates runner config at construction time.
130
+ * Throws immediately with clear, actionable error messages.
131
+ */
132
+ export declare function validateConfig(config: IntegrationTestRunnerConfig): void;
133
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../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AAQ,CAAC,KAAK,IAAI,CAAA;CAC/D;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB,CAAC,QAAQ,GAAG,GAAG;IAEpD,SAAS,EAAE,gBAAgB,CAAA;IAC3B,UAAU,EAAE,GAAG,CAAA;IACf,QAAQ,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;IAC/D,eAAe,EAAE,YAAY,CAAA;IAG7B,GAAG,CAAC,EAAE,GAAG,CAAA;IAGT,OAAO,CAAC,EAAE,QAAQ,CAAA;IAGlB,YAAY,CAAC,EAAE,GAAG,CAAA;IAClB,OAAO,CAAC,EAAE,GAAG,CAAA;IACb,YAAY,CAAC,EAAE,MAAM,gBAAgB,CAAA;IACrC,aAAa,CAAC,EAAE,MAAM,GAAG,CAAA;IACzB,KAAK,CAAC,EAAE;QAAE,sBAAsB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;KAAE,CAAA;CACxD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,2BAA2B,GAAG,IAAI,CAkCxE"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateConfig = validateConfig;
4
+ /**
5
+ * Validates runner config at construction time.
6
+ * Throws immediately with clear, actionable error messages.
7
+ */
8
+ function validateConfig(config) {
9
+ if (config.mode === "plugin" && !config.pluginPath) {
10
+ throw new Error(`integrationTestRunner: "plugin" mode requires "pluginPath". ` +
11
+ `Example: integrationTestRunner({ mode: "plugin", pluginPath: process.cwd(), ... })`);
12
+ }
13
+ if (config.mode === "module" && !config.moduleName) {
14
+ throw new Error(`integrationTestRunner: "module" mode requires "moduleName". ` +
15
+ `Example: integrationTestRunner({ mode: "module", moduleName: "blog", ... })`);
16
+ }
17
+ if (config.mode === "module" && config.http === true) {
18
+ throw new Error(`integrationTestRunner: "module" mode does not support http. ` +
19
+ `Use mode: "plugin" with http: true to test API routes.`);
20
+ }
21
+ if (config.mode === "app" && config.pluginPath) {
22
+ throw new Error(`integrationTestRunner: "pluginPath" is not valid in "app" mode. ` +
23
+ `Use mode: "plugin" to test a plugin.`);
24
+ }
25
+ if (!config.testSuite || typeof config.testSuite !== "function") {
26
+ throw new Error(`integrationTestRunner: "testSuite" is required and must be a function.`);
27
+ }
28
+ }
29
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/pipeline/types.ts"],"names":[],"mappings":";;AAgKA,wCAkCC;AAtCD;;;GAGG;AACH,SAAgB,cAAc,CAAC,MAAmC;IAChE,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;QACnD,MAAM,IAAI,KAAK,CACb,8DAA8D;YAC5D,oFAAoF,CACvF,CAAA;IACH,CAAC;IAED,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;QACnD,MAAM,IAAI,KAAK,CACb,8DAA8D;YAC5D,6EAA6E,CAChF,CAAA;IACH,CAAC;IAED,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;QACrD,MAAM,IAAI,KAAK,CACb,8DAA8D;YAC5D,wDAAwD,CAC3D,CAAA;IACH,CAAC;IAED,IAAI,MAAM,CAAC,IAAI,KAAK,KAAK,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;QAC/C,MAAM,IAAI,KAAK,CACb,kEAAkE;YAChE,sCAAsC,CACzC,CAAA;IACH,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,SAAS,IAAI,OAAO,MAAM,CAAC,SAAS,KAAK,UAAU,EAAE,CAAC;QAChE,MAAM,IAAI,KAAK,CACb,wEAAwE,CACzE,CAAA;IACH,CAAC;AACH,CAAC"}
@@ -1 +1 @@
1
- {"root":["../src/acmekit-test-runner.ts","../src/database.ts","../src/events.ts","../src/index.ts","../src/init-modules.ts","../src/jest.ts","../src/mock-event-bus-service.ts","../src/module-test-runner.ts","../src/plugin-test-runner.ts","../src/__fixtures__/test-module/index.ts","../src/__fixtures__/test-module/service.ts","../src/__fixtures__/test-module/services/internal.ts","../src/__tests__/events.spec.ts","../src/__tests__/module-test-runner.spec.ts","../src/acmekit-test-runner-utils/bootstrap-app.ts","../src/acmekit-test-runner-utils/clear-instances.ts","../src/acmekit-test-runner-utils/config.ts","../src/acmekit-test-runner-utils/index.ts","../src/acmekit-test-runner-utils/use-db.ts","../src/acmekit-test-runner-utils/utils.ts","../src/acmekit-test-runner-utils/wait-workflow-executions.ts"],"version":"5.9.3"}
1
+ {"root":["../src/acmekit-test-runner.ts","../src/database.ts","../src/events.ts","../src/index.ts","../src/init-modules.ts","../src/integration-test-runner.ts","../src/jest.ts","../src/mock-event-bus-service.ts","../src/module-test-runner.ts","../src/plugin-test-runner.ts","../src/__fixtures__/test-module/index.ts","../src/__fixtures__/test-module/service.ts","../src/__fixtures__/test-module/services/internal.ts","../src/__tests__/events.spec.ts","../src/__tests__/module-test-runner.spec.ts","../src/acmekit-test-runner-utils/bootstrap-app.ts","../src/acmekit-test-runner-utils/clear-instances.ts","../src/acmekit-test-runner-utils/config.ts","../src/acmekit-test-runner-utils/index.ts","../src/acmekit-test-runner-utils/use-db.ts","../src/acmekit-test-runner-utils/utils.ts","../src/acmekit-test-runner-utils/wait-workflow-executions.ts","../src/pipeline/errors.ts","../src/pipeline/pipeline.ts","../src/pipeline/types.ts","../src/pipeline/stages/config.ts","../src/pipeline/stages/database.ts","../src/pipeline/stages/http.ts","../src/pipeline/stages/module.ts","../src/pipeline/stages/plugin-resources.ts","../src/pipeline/stages/proxy.ts"],"version":"5.9.3"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acmekit/test-utils",
3
- "version": "2.13.82",
3
+ "version": "2.13.84",
4
4
  "description": "Test utils for AcmeKit",
5
5
  "main": "dist/index.js",
6
6
  "repository": {
@@ -25,8 +25,8 @@
25
25
  "author": "AcmeKit",
26
26
  "license": "MIT",
27
27
  "devDependencies": {
28
- "@acmekit/core-flows": "2.13.82",
29
- "@acmekit/framework": "2.13.82"
28
+ "@acmekit/core-flows": "2.13.84",
29
+ "@acmekit/framework": "2.13.84"
30
30
  },
31
31
  "dependencies": {
32
32
  "@types/express": "^4.17.21",
@@ -36,9 +36,9 @@
36
36
  "ulid": "^2.3.0"
37
37
  },
38
38
  "peerDependencies": {
39
- "@acmekit/acmekit": "2.13.82",
40
- "@acmekit/core-flows": "2.13.82",
41
- "@acmekit/framework": "2.13.82"
39
+ "@acmekit/acmekit": "2.13.84",
40
+ "@acmekit/core-flows": "2.13.84",
41
+ "@acmekit/framework": "2.13.84"
42
42
  },
43
43
  "peerDependenciesMeta": {
44
44
  "@acmekit/acmekit": {