testeranto 0.166.0 → 0.171.0

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 (187) hide show
  1. package/dist/common/src/NavBar.js +45 -0
  2. package/dist/common/src/PM/main.js +81 -59
  3. package/dist/common/src/Pure.js +17 -15
  4. package/dist/common/src/ReportServer.js +48 -5
  5. package/dist/common/src/Web.js +35 -20
  6. package/dist/common/src/components/SunriseAnimation.test/implementation.js +1 -0
  7. package/dist/common/src/components/SunriseAnimation.test/index.js +1 -0
  8. package/dist/common/src/components/SunriseAnimation.test/interface.js +1 -0
  9. package/dist/common/src/components/SunriseAnimation.test/specification.js +1 -0
  10. package/dist/common/src/components/TestStatusBadge.js +55 -0
  11. package/dist/common/src/components/pure/ProjectPageView.js +204 -0
  12. package/dist/common/src/components/pure/ProjectPageView.test/adapter.js +20 -0
  13. package/dist/common/src/components/pure/ProjectPageView.test/implementation.js +71 -0
  14. package/dist/common/src/components/pure/ProjectPageView.test/index.js +10 -0
  15. package/dist/common/src/components/pure/ProjectPageView.test/specification.js +19 -0
  16. package/dist/common/src/components/pure/ProjectPageView.test/types.js +2 -0
  17. package/dist/common/src/lib/BaseSuite.js +3 -3
  18. package/dist/common/src/lib/BaseSuite.test/test.js +1 -1
  19. package/dist/common/src/lib/abstractBase.js +41 -14
  20. package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.adapter.js +1 -1
  21. package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.mock.js +1 -1
  22. package/dist/common/src/lib/basebuilder.js +9 -7
  23. package/dist/common/src/lib/core.test/MockCore.js +17 -15
  24. package/dist/common/src/lib/pmProxy.js +185 -64
  25. package/dist/common/testeranto.config.js +6 -0
  26. package/dist/common/tsconfig.common.tsbuildinfo +1 -1
  27. package/dist/module/src/App.js +3 -3
  28. package/dist/module/src/PM/main.js +81 -59
  29. package/dist/module/src/ProjectsPage.js +1 -110
  30. package/dist/module/src/Pure.js +17 -15
  31. package/dist/module/src/ReportServer.js +48 -5
  32. package/dist/module/src/TestPage.js +45 -16
  33. package/dist/module/src/Web.js +35 -20
  34. package/dist/module/src/components/SunriseAnimation.test/implementation.js +1 -0
  35. package/dist/module/src/components/SunriseAnimation.test/index.js +1 -0
  36. package/dist/module/src/components/SunriseAnimation.test/interface.js +1 -0
  37. package/dist/module/src/components/SunriseAnimation.test/specification.js +1 -0
  38. package/dist/module/src/components/pure/ProjectPageView.js +197 -0
  39. package/dist/module/src/components/pure/ProjectPageView.test/adapter.js +17 -0
  40. package/dist/module/src/components/pure/ProjectPageView.test/implementation.js +68 -0
  41. package/dist/module/src/components/pure/ProjectPageView.test/index.js +5 -0
  42. package/dist/module/src/components/pure/ProjectPageView.test/specification.js +15 -0
  43. package/dist/module/src/components/pure/ProjectPageView.test/types.js +1 -0
  44. package/dist/module/src/components/pure/ProjectsPageView.js +58 -0
  45. package/dist/module/src/components/pure/TestPageView.js +136 -0
  46. package/dist/module/src/components/stateful/ProjectPage.js +63 -0
  47. package/dist/module/src/components/stateful/ProjectsPage.js +55 -0
  48. package/dist/module/src/components/stateful/TestPage.js +82 -0
  49. package/dist/module/src/lib/BaseSuite.js +3 -3
  50. package/dist/module/src/lib/BaseSuite.test/test.js +1 -1
  51. package/dist/module/src/lib/abstractBase.js +41 -14
  52. package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.adapter.js +1 -1
  53. package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.mock.js +1 -1
  54. package/dist/module/src/lib/basebuilder.js +9 -7
  55. package/dist/module/src/lib/core.test/MockCore.js +17 -15
  56. package/dist/module/src/lib/pmProxy.js +185 -64
  57. package/dist/module/testeranto.config.js +6 -0
  58. package/dist/module/tsconfig.module.tsbuildinfo +1 -1
  59. package/dist/prebuild/App.js +541 -495
  60. package/dist/prebuild/ReportServer.mjs +44 -4
  61. package/dist/prebuild/run.mjs +67 -39
  62. package/dist/types/src/NavBar.d.ts +19 -0
  63. package/dist/types/src/PM/index.d.ts +3 -1
  64. package/dist/types/src/PM/main.d.ts +0 -4
  65. package/dist/types/src/PM/node.d.ts +2 -2
  66. package/dist/types/src/components/SunriseAnimation.test/interface.d.ts +0 -0
  67. package/dist/types/src/components/SunriseAnimation.test/specification.d.ts +0 -0
  68. package/dist/types/src/components/TestStatusBadge.d.ts +15 -0
  69. package/dist/types/src/components/pure/ProjectPageView.d.ts +14 -0
  70. package/dist/types/src/components/pure/ProjectPageView.test/adapter.d.ts +3 -0
  71. package/dist/types/src/components/pure/ProjectPageView.test/implementation.d.ts +3 -0
  72. package/dist/types/src/components/pure/ProjectPageView.test/index.d.ts +3 -0
  73. package/dist/types/src/components/pure/ProjectPageView.test/specification.d.ts +3 -0
  74. package/dist/types/src/components/pure/ProjectPageView.test/types.d.ts +39 -0
  75. package/dist/types/src/lib/BaseSuite.d.ts +2 -0
  76. package/dist/types/src/lib/abstractBase.d.ts +12 -0
  77. package/dist/types/src/lib/index.d.ts +0 -1
  78. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  79. package/package.json +3 -2
  80. package/src/App.tsx +5 -9
  81. package/src/PM/index.ts +1 -1
  82. package/src/PM/main.ts +87 -82
  83. package/src/PM/node.ts +2 -2
  84. package/src/ProjectsPage.tsx +1 -164
  85. package/src/Pure.ts +17 -17
  86. package/src/ReportServer.ts +49 -6
  87. package/src/TestPage.tsx +78 -5
  88. package/src/Web.ts +35 -35
  89. package/src/components/SunriseAnimation.test/implementation.ts +0 -0
  90. package/src/components/SunriseAnimation.test/index.ts +0 -0
  91. package/src/components/SunriseAnimation.test/interface.ts +0 -0
  92. package/src/components/SunriseAnimation.test/specification.ts +0 -0
  93. package/src/components/pure/ProjectPageView.test/adapter.ts +21 -0
  94. package/src/components/pure/ProjectPageView.test/implementation.tsx +84 -0
  95. package/src/components/pure/ProjectPageView.test/index.ts +8 -0
  96. package/src/components/pure/ProjectPageView.test/specification.ts +31 -0
  97. package/src/components/pure/ProjectPageView.test/types.ts +55 -0
  98. package/src/components/pure/ProjectPageView.tsx +332 -0
  99. package/src/components/pure/ProjectsPageView.tsx +99 -0
  100. package/src/components/pure/TestPageView.tsx +278 -0
  101. package/src/components/stateful/ProjectPage.tsx +83 -0
  102. package/src/components/stateful/ProjectsPage.tsx +73 -0
  103. package/src/components/stateful/TestPage.tsx +107 -0
  104. package/src/lib/BaseSuite.test/test.ts +1 -1
  105. package/src/lib/BaseSuite.ts +9 -4
  106. package/src/lib/abstractBase.ts +45 -14
  107. package/src/lib/baseBuilder.test/baseBuilder.test.adapter.ts +1 -1
  108. package/src/lib/baseBuilder.test/baseBuilder.test.mock.ts +1 -1
  109. package/src/lib/basebuilder.ts +9 -9
  110. package/src/lib/core.test/MockCore.ts +26 -19
  111. package/src/lib/index.ts +1 -1
  112. package/src/lib/pmProxy.ts +184 -87
  113. package/testeranto/App.js +541 -495
  114. package/testeranto/bundles/node/allTests/{chunk-4ONUZRZ4.mjs → chunk-3EUGBAOM.mjs} +1 -1
  115. package/testeranto/bundles/node/allTests/{chunk-FFBRDUBH.mjs → chunk-E75CSRER.mjs} +247 -124
  116. package/testeranto/bundles/node/allTests/{chunk-NQEP7SN4.mjs → chunk-M6DO7VMB.mjs} +1 -1
  117. package/testeranto/bundles/node/allTests/metafile.json +41 -41
  118. package/testeranto/bundles/node/allTests/src/lib/BaseSuite.test/node.test.mjs +4 -4
  119. package/testeranto/bundles/node/allTests/src/lib/baseBuilder.test/baseBuilder.test.node.mjs +4 -4
  120. package/testeranto/bundles/node/allTests/src/lib/classBuilder.test/classBuilder.test.mjs +3 -3
  121. package/testeranto/bundles/node/allTests/src/lib/core.test/core.test.mjs +11 -23
  122. package/testeranto/bundles/node/allTests/src/lib/pmProxy.test/index.mjs +2 -2
  123. package/testeranto/bundles/pure/allTests/{chunk-CSMXYJ65.mjs → chunk-KHDVEHF7.mjs} +3 -18
  124. package/testeranto/bundles/pure/allTests/{chunk-QK4IXLF6.mjs → chunk-VMUSFSZM.mjs} +247 -124
  125. package/testeranto/bundles/pure/allTests/metafile.json +77 -47
  126. package/testeranto/bundles/pure/allTests/src/Pure.test.mjs +2 -2
  127. package/testeranto/bundles/pure/allTests/src/lib/BaseSuite.test/pure.test.mjs +3 -3
  128. package/testeranto/bundles/pure/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure.mjs +3 -30
  129. package/testeranto/bundles/web/allTests/chunk-HPYA4YZC.mjs +2283 -0
  130. package/testeranto/bundles/web/allTests/{chunk-TU3MJSSI.mjs → chunk-RLDR6LJN.mjs} +302 -127
  131. package/testeranto/bundles/web/allTests/chunk-U7AW26HL.mjs +997 -0
  132. package/testeranto/bundles/web/allTests/metafile.json +15065 -46
  133. package/testeranto/bundles/web/allTests/src/components/pure/ProjectPageView.test/index.html +19 -0
  134. package/testeranto/bundles/web/allTests/src/components/pure/ProjectPageView.test/index.mjs +37524 -0
  135. package/testeranto/bundles/web/allTests/src/lib/BaseSuite.test/web.test.mjs +20 -2
  136. package/testeranto/bundles/web/allTests/src/lib/baseBuilder.test/baseBuilder.test.web.mjs +27 -3
  137. package/testeranto/reports/allTests/config.json +8 -0
  138. package/testeranto/reports/allTests/src/Pure.test/pure/type_errors.txt +9 -3
  139. package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/bdd_errors.txt +1 -0
  140. package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/lint_errors.txt +13 -0
  141. package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/logs.txt +50 -0
  142. package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/message.txt +2 -0
  143. package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/prompt.txt +17 -0
  144. package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/tests.json +32 -0
  145. package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/type_errors.txt +68 -0
  146. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/logs.txt +0 -0
  147. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/tests.json +6 -3
  148. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/type_errors.txt +8 -1
  149. package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/tests.json +6 -3
  150. package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/type_errors.txt +9 -3
  151. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/logs.txt +0 -0
  152. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/prompt.txt +2 -2
  153. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/tests.json +6 -3
  154. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/type_errors.txt +10 -5
  155. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/logs.txt +0 -0
  156. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/tests.json +18 -9
  157. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/type_errors.txt +8 -1
  158. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/type_errors.txt +10 -5
  159. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/logs.txt +0 -0
  160. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/prompt.txt +2 -2
  161. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/tests.json +18 -9
  162. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/type_errors.txt +10 -5
  163. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/logs.txt +0 -0
  164. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/tests.json +36 -18
  165. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/type_errors.txt +8 -1
  166. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/lint_errors.txt +0 -12
  167. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/logs.txt +2 -2
  168. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/type_errors.txt +11 -8
  169. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/logs.txt +0 -0
  170. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/tests.json +28 -14
  171. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/type_errors.txt +8 -1
  172. package/testeranto/reports/allTests/summary.json +16 -9
  173. package/testeranto/reportsweb_build_errors +25 -0
  174. package/testeranto.config.ts +7 -0
  175. package/tsc.log +313 -237
  176. package/testeranto/bundles/web/allTests/src/lib/BaseSuite.test/web.test/manifest.json +0 -1
  177. package/testeranto/bundles/web/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/manifest.json +0 -1
  178. package/testeranto/reports/allTests/src/Pure.test/pure/manifest.json +0 -1
  179. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/manifest.json +0 -1
  180. package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/manifest.json +0 -1
  181. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/manifest.json +0 -1
  182. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/manifest.json +0 -1
  183. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/manifest.json +0 -1
  184. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/manifest.json +0 -1
  185. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/manifest.json +0 -1
  186. /package/{testeranto/reports/allTests/src/Pure.test/pure/logs.txt → dist/types/src/components/SunriseAnimation.test/implementation.d.ts} +0 -0
  187. /package/{testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/logs.txt → dist/types/src/components/SunriseAnimation.test/index.d.ts} +0 -0
@@ -26,6 +26,11 @@ export abstract class BaseGiven<I extends Ibdd_in_any> {
26
26
  initialValues: any;
27
27
  key: string;
28
28
  failed: boolean;
29
+ artifacts: string[] = [];
30
+ protected addArtifact(path: string) {
31
+ console.log(`[Artifact] Adding to ${this.constructor.name}:`, path);
32
+ this.artifacts.push(path);
33
+ }
29
34
 
30
35
  constructor(
31
36
  name: string,
@@ -54,13 +59,14 @@ export abstract class BaseGiven<I extends Ibdd_in_any> {
54
59
  whens: this.whens.map((w) => {
55
60
  if (w && w.toObj) return w.toObj();
56
61
 
57
- console.error("w is not as expected!", w);
62
+ console.error("w is not as expected!", w.toString());
58
63
  return {};
59
64
  }),
60
65
  thens: this.thens.map((t) => t.toObj()),
61
66
  error: this.error ? [this.error, this.error.stack] : null,
62
67
  failed: this.failed,
63
68
  features: this.features,
69
+ artifacts: this.artifacts,
64
70
  };
65
71
  }
66
72
 
@@ -103,22 +109,25 @@ export abstract class BaseGiven<I extends Ibdd_in_any> {
103
109
  artifactory(`given-${key}/${fPath}`, value);
104
110
 
105
111
  this.uberCatcher((e) => {
106
- console.error(e);
112
+ console.error(e.toString());
107
113
  this.error = e.error;
108
114
  tLog(e.stack);
109
115
  });
110
116
 
111
117
  try {
118
+ const proxiedPm = beforeEachProxy(pm, suiteNdx.toString());
119
+ console.log(`[Given] Setting currentStep for beforeEach:`, this.name);
120
+ (proxiedPm as any).currentStep = this;
112
121
  this.store = await this.givenThat(
113
122
  subject,
114
123
  testResourceConfiguration,
115
124
  givenArtifactory,
116
125
  this.givenCB,
117
126
  this.initialValues,
118
- beforeEachProxy(pm, suiteNdx.toString())
127
+ proxiedPm
119
128
  );
120
129
  } catch (e) {
121
- console.error("failure 4 ", e);
130
+ console.error("Given failure: ", e.toString());
122
131
  this.error = e;
123
132
  throw e;
124
133
  }
@@ -163,7 +172,7 @@ export abstract class BaseGiven<I extends Ibdd_in_any> {
163
172
  afterEachProxy(pm, suiteNdx.toString(), key)
164
173
  );
165
174
  } catch (e) {
166
- console.error("afterEach failed!", e);
175
+ console.error("afterEach failed!", e.toString());
167
176
  this.failed = e;
168
177
  throw e;
169
178
 
@@ -178,6 +187,7 @@ export abstract class BaseWhen<I extends Ibdd_in_any> {
178
187
  public name: string;
179
188
  whenCB: (x: I["iselection"]) => I["then"];
180
189
  error: Error;
190
+ artifacts: string[] = [];
181
191
 
182
192
  constructor(name: string, whenCB: (xyz: I["iselection"]) => I["then"]) {
183
193
  this.name = name;
@@ -193,10 +203,19 @@ export abstract class BaseWhen<I extends Ibdd_in_any> {
193
203
 
194
204
  toObj() {
195
205
  console.log("toObj error", this.error);
196
- return {
197
- name: this.name,
198
- error: this.error && this.error.name + this.error.stack,
199
- };
206
+
207
+ if (this.error) {
208
+ return {
209
+ name: this.name,
210
+ error: this.error && this.error.name + this.error.stack,
211
+ artifacts: this.artifacts,
212
+ };
213
+ } else {
214
+ return {
215
+ name: this.name,
216
+ artifacts: this.artifacts,
217
+ };
218
+ }
200
219
  }
201
220
 
202
221
  async test(
@@ -208,19 +227,26 @@ export abstract class BaseWhen<I extends Ibdd_in_any> {
208
227
  ) {
209
228
  try {
210
229
  tLog(" When:", this.name);
211
- console.debug("[DEBUG] Executing When step:", this.name);
230
+ console.debug("[DEBUG] Executing When step:", this.name.toString());
212
231
 
232
+ const proxiedPm = andWhenProxy(pm, filepath);
233
+ console.log(`[When] Setting currentStep for andWhen:`, this.name);
234
+ (proxiedPm as any).currentStep = this;
213
235
  const result = await this.andWhen(
214
236
  store,
215
237
  this.whenCB,
216
238
  testResourceConfiguration,
217
- andWhenProxy(pm, filepath)
239
+ proxiedPm
218
240
  );
219
241
 
220
- console.debug("[DEBUG] When step completed:", this.name);
242
+ console.debug("[DEBUG] When step completed:", this.name.toString());
221
243
  return result;
222
244
  } catch (e: Error) {
223
- console.error("[ERROR] When step failed:", this.name, e);
245
+ console.error(
246
+ "[ERROR] When step failed:",
247
+ this.name.toString(),
248
+ e.toString()
249
+ );
224
250
  this.error = e;
225
251
  throw e;
226
252
  }
@@ -231,6 +257,7 @@ export abstract class BaseThen<I extends Ibdd_in_any> {
231
257
  public name: string;
232
258
  thenCB: (storeState: I["iselection"]) => Promise<I["then"]>;
233
259
  error: boolean;
260
+ artifacts: string[] = [];
234
261
 
235
262
  constructor(
236
263
  name: string,
@@ -245,6 +272,7 @@ export abstract class BaseThen<I extends Ibdd_in_any> {
245
272
  return {
246
273
  name: this.name,
247
274
  error: this.error,
275
+ artifacts: this.artifacts,
248
276
  };
249
277
  }
250
278
 
@@ -263,11 +291,14 @@ export abstract class BaseThen<I extends Ibdd_in_any> {
263
291
  pm: IPM,
264
292
  filepath: string
265
293
  ): Promise<I["then"] | undefined> {
294
+ const proxiedPm = butThenProxy(pm, filepath);
295
+ console.log(`[Then] Setting currentStep for butThen:`, this.name);
296
+ (proxiedPm as any).currentStep = this;
266
297
  return this.butThen(
267
298
  store,
268
299
  async (s: I["iselection"]) => {
269
300
  if (typeof this.thenCB === "function") {
270
- return await this.thenCB(s);
301
+ return await this.thenCB(s, proxiedPm);
271
302
  } else {
272
303
  return this.thenCB;
273
304
  }
@@ -13,7 +13,7 @@ export const testAdapter: ITestAdapter<I> = {
13
13
  initialValues,
14
14
  });
15
15
  const result = initializer();
16
- console.log("Initialization result:", result);
16
+ console.log("Initialization result:", result.toString());
17
17
  return result;
18
18
  },
19
19
  andWhen: async (store, whenCB, testResource, utils) => {
@@ -73,7 +73,7 @@ export class MockBaseBuilder<
73
73
  failed: false,
74
74
  fails: 0,
75
75
  artifacts: [],
76
- logPromise: Promise.resolve(),
76
+ // logPromise: Promise.resolve(),
77
77
  features: [],
78
78
  });
79
79
  }
@@ -103,10 +103,10 @@ export abstract class BaseBuilder<
103
103
  receiveTestResourceConfig: async function (
104
104
  puppetMaster: IPM
105
105
  ): Promise<IFinalResults> {
106
- const logFilePath = "logs.txt";
107
- const access: number = await puppetMaster.createWriteStream(
108
- logFilePath
109
- );
106
+ // const logFilePath = "logs.txt";
107
+ // const access: number = await puppetMaster.createWriteStream(
108
+ // logFilePath
109
+ // );
110
110
 
111
111
  // deprecated?
112
112
  const tLog = async (...l: string[]) => {
@@ -115,10 +115,10 @@ export abstract class BaseBuilder<
115
115
 
116
116
  const suiteDone: BaseSuite<I, O> = await runner(puppetMaster, tLog);
117
117
 
118
- const logPromise = new Promise(async (res) => {
119
- await puppetMaster.end(access);
120
- res(true);
121
- });
118
+ // const logPromise = new Promise(async (res) => {
119
+ // await puppetMaster.end(access);
120
+ // res(true);
121
+ // });
122
122
 
123
123
  const fails = suiteDone.fails;
124
124
 
@@ -133,7 +133,7 @@ export abstract class BaseBuilder<
133
133
  failed: fails > 0,
134
134
  fails,
135
135
  artifacts: this.artifacts || [],
136
- logPromise,
136
+ // logPromise,
137
137
  features: suiteDone.features(),
138
138
  };
139
139
  },
@@ -1,3 +1,5 @@
1
+ /* eslint-disable @typescript-eslint/no-unused-vars */
2
+ /* eslint-disable @typescript-eslint/no-explicit-any */
1
3
  import TesterantoCore from "../core";
2
4
 
3
5
  import {
@@ -31,34 +33,39 @@ export class MockCore<
31
33
  testAdapter: Partial<ITestAdapter<I>>,
32
34
  uberCatcher: (cb: () => void) => void = (cb) => cb()
33
35
  ) {
34
- console.log('[DEBUG] MockCore constructor starting...');
35
-
36
+ console.log("[DEBUG] MockCore constructor starting...");
37
+
36
38
  if (!testImplementation) {
37
- throw new Error('testImplementation is required');
39
+ throw new Error("testImplementation is required");
38
40
  }
39
41
  if (!testSpecification) {
40
- console.warn('[WARN] testSpecification is null/undefined - tests may fail');
42
+ console.warn(
43
+ "[WARN] testSpecification is null/undefined - tests may fail"
44
+ );
41
45
  }
42
-
43
- console.log('[DEBUG] MockCore constructor called with:');
44
- console.log('- input:', JSON.stringify(input, null, 2));
45
- console.log('- testSpecification keys:', Object.keys(testSpecification));
46
- console.log('- testImplementation keys:', Object.keys(testImplementation));
47
- console.log('- testResourceRequirement:', JSON.stringify(testResourceRequirement));
48
- console.log('- testAdapter keys:', Object.keys(testAdapter));
49
-
46
+
47
+ console.log("[DEBUG] MockCore constructor called with:");
48
+ console.log("- input:", JSON.stringify(input, null, 2));
49
+ console.log("- testSpecification keys:", Object.keys(testSpecification));
50
+ console.log("- testImplementation keys:", Object.keys(testImplementation));
51
+ console.log(
52
+ "- testResourceRequirement:",
53
+ JSON.stringify(testResourceRequirement)
54
+ );
55
+ console.log("- testAdapter keys:", Object.keys(testAdapter));
56
+
50
57
  // Validate required implementation methods
51
- const requiredMethods = ['suites', 'givens', 'whens', 'thens'];
52
- requiredMethods.forEach(method => {
58
+ const requiredMethods = ["suites", "givens", "whens", "thens"];
59
+ requiredMethods.forEach((method) => {
53
60
  if (!testImplementation[method]) {
54
61
  throw new Error(`Missing required implementation method: ${method}`);
55
62
  }
56
63
  });
57
64
 
58
- console.log('[DEBUG] Validation passed, calling super...');
59
-
60
- this.testResourceRequirement = testResourceRequirement;
61
- this.testAdapter = testAdapter;
65
+ console.log("[DEBUG] Validation passed, calling super...");
66
+
67
+ // this.testResourceRequirement = testResourceRequirement;
68
+ // this.testAdapter = testAdapter;
62
69
  super(
63
70
  input,
64
71
  testSpecification,
@@ -76,7 +83,7 @@ export class MockCore<
76
83
  failed: false,
77
84
  fails: 0,
78
85
  artifacts: [],
79
- logPromise: Promise.resolve(),
86
+ // logPromise: Promise.resolve(),
80
87
  features: [],
81
88
  };
82
89
  }
package/src/lib/index.ts CHANGED
@@ -131,5 +131,5 @@ export type IFinalResults = {
131
131
  failed: boolean;
132
132
  fails: number;
133
133
  artifacts: Promise<unknown>[];
134
- logPromise: Promise<unknown>;
134
+ // logPromise: Promise<unknown>;
135
135
  };
@@ -38,64 +38,107 @@ const baseProxy: IProxyBase = function (
38
38
  });
39
39
  };
40
40
 
41
- export const butThenProxy: IProxy = (pm: IPM, filepath: string) =>
42
- baseProxy(pm, [
41
+ export const butThenProxy: IProxy = (pm: IPM, filepath: string) => {
42
+ return baseProxy(pm, [
43
43
  [
44
44
  "screencast",
45
- (opts, p) => [
46
- {
47
- ...opts,
48
- path: `${filepath}/butThen/${opts.path}`,
49
- },
50
- p,
51
- ],
45
+ (opts, p) => {
46
+ const path = `${filepath}/butThen/${opts.path}`;
47
+ console.log(`[Proxy] Captured artifact path for butThen:`, path);
48
+ if ((pm as any).currentStep?.addArtifact) {
49
+ (pm as any).currentStep.addArtifact(path);
50
+ } else {
51
+ console.warn('No currentStep or addArtifact method found');
52
+ }
53
+ return [
54
+ {
55
+ ...opts,
56
+ path,
57
+ },
58
+ p,
59
+ ];
60
+ },
52
61
  ],
53
62
 
54
- ["createWriteStream", (fp) => [`${filepath}/butThen/${fp}`]],
63
+ ["createWriteStream", (fp) => {
64
+ const path = `${filepath}/butThen/${fp}`;
65
+ console.log(`[Proxy] Captured artifact path for butThen:`, path);
66
+ if ((pm as any).currentStep?.addArtifact) {
67
+ (pm as any).currentStep.addArtifact(path);
68
+ } else {
69
+ console.warn('No currentStep or addArtifact method found');
70
+ }
71
+ return [path];
72
+ }],
55
73
 
56
74
  [
57
75
  "writeFileSync",
58
- (fp, contents) => [`${filepath}/butThen/${fp}`, contents],
76
+ (fp, contents) => {
77
+ const path = `${filepath}/butThen/${fp}`;
78
+ (pm as any).currentStep?.artifacts?.push(path);
79
+ return [path, contents];
80
+ },
59
81
  ],
60
82
 
61
83
  [
62
84
  "customScreenShot",
63
- (opts, p) => [
64
- {
65
- ...opts,
66
- path: `${filepath}/butThen/${opts.path}`,
67
- },
68
- p,
69
- ],
85
+ (opts, p) => {
86
+ const path = `${filepath}/butThen/${opts.path}`;
87
+ (pm as any).currentStep?.artifacts?.push(path);
88
+ return [
89
+ {
90
+ ...opts,
91
+ path,
92
+ },
93
+ p,
94
+ ];
95
+ },
70
96
  ],
71
97
  ]);
98
+ };
72
99
 
73
100
  export const andWhenProxy: IProxy = (pm: IPM, filepath: string) =>
74
101
  baseProxy(pm, [
75
102
  [
76
103
  "screencast",
77
- (opts, p) => [
78
- {
79
- ...opts,
80
- path: `${filepath}/andWhen/${opts.path}`,
81
- },
82
- p,
83
- ],
104
+ (opts, p) => {
105
+ const path = `${filepath}/andWhen/${opts.path}`;
106
+ (pm as any).currentStep?.artifacts?.push(path);
107
+ return [
108
+ {
109
+ ...opts,
110
+ path,
111
+ },
112
+ p,
113
+ ];
114
+ },
84
115
  ],
85
116
 
86
- ["createWriteStream", (fp) => [`${filepath}/andWhen/${fp}`]],
117
+ ["createWriteStream", (fp) => {
118
+ const path = `${filepath}/andWhen/${fp}`;
119
+ (pm as any).currentStep?.artifacts?.push(path);
120
+ return [path];
121
+ }],
87
122
 
88
- ["writeFileSync", (fp, contents) => [`${filepath}/andWhen${fp}`, contents]],
123
+ ["writeFileSync", (fp, contents) => {
124
+ const path = `${filepath}/andWhen/${fp}`;
125
+ (pm as any).currentStep?.artifacts?.push(path);
126
+ return [path, contents];
127
+ }],
89
128
 
90
129
  [
91
130
  "customScreenShot",
92
- (opts, p) => [
93
- {
94
- ...opts,
95
- path: `${filepath}/andWhen${opts.path}`,
96
- },
97
- p,
98
- ],
131
+ (opts, p) => {
132
+ const path = `${filepath}/andWhen/${opts.path}`;
133
+ (pm as any).currentStep?.artifacts?.push(path);
134
+ return [
135
+ {
136
+ ...opts,
137
+ path,
138
+ },
139
+ p,
140
+ ];
141
+ },
99
142
  ],
100
143
  ]);
101
144
 
@@ -107,33 +150,47 @@ export const afterEachProxy: IProxyAfterEach = (
107
150
  baseProxy(pm, [
108
151
  [
109
152
  "screencast",
110
- (opts, p) => [
111
- {
112
- ...opts,
113
- path: `suite-${suite}/given-${given}/afterEach/${opts.path}`,
114
- },
115
- p,
116
- ],
153
+ (opts, p) => {
154
+ const path = `suite-${suite}/given-${given}/afterEach/${opts.path}`;
155
+ (pm as any).currentStep?.artifacts?.push(path);
156
+ return [
157
+ {
158
+ ...opts,
159
+ path,
160
+ },
161
+ p,
162
+ ];
163
+ },
117
164
  ],
118
165
 
119
- ["createWriteStream", (fp) => [`suite-${suite}/afterEach/${fp}`]],
166
+ ["createWriteStream", (fp) => {
167
+ const path = `suite-${suite}/afterEach/${fp}`;
168
+ (pm as any).currentStep?.artifacts?.push(path);
169
+ return [path];
170
+ }],
171
+
120
172
  [
121
173
  "writeFileSync",
122
- (fp, contents) => [
123
- `suite-${suite}/given-${given}/afterEach/${fp}`,
124
- contents,
125
- ],
174
+ (fp, contents) => {
175
+ const path = `suite-${suite}/given-${given}/afterEach/${fp}`;
176
+ (pm as any).currentStep?.artifacts?.push(path);
177
+ return [path, contents];
178
+ },
126
179
  ],
127
180
 
128
181
  [
129
182
  "customScreenShot",
130
- (opts, p) => [
131
- {
132
- ...opts,
133
- path: `suite-${suite}/given-${given}/afterEach/${opts.path}`,
134
- },
135
- p,
136
- ],
183
+ (opts, p) => {
184
+ const path = `suite-${suite}/given-${given}/afterEach/${opts.path}`;
185
+ (pm as any).currentStep?.artifacts?.push(path);
186
+ return [
187
+ {
188
+ ...opts,
189
+ path,
190
+ },
191
+ p,
192
+ ];
193
+ },
137
194
  ],
138
195
  ]);
139
196
 
@@ -144,72 +201,112 @@ export const beforeEachProxy: IProxyBeforeEach = (
144
201
  baseProxy(pm, [
145
202
  [
146
203
  "screencast",
147
- (opts, p) => [
148
- {
149
- ...opts,
150
- path: `suite-${suite}/beforeEach/${opts.path}`,
151
- },
152
- p,
153
- ],
204
+ (opts, p) => {
205
+ const path = `suite-${suite}/beforeEach/${opts.path}`;
206
+ (pm as any).currentStep?.artifacts?.push(path);
207
+ return [
208
+ {
209
+ ...opts,
210
+ path,
211
+ },
212
+ p,
213
+ ];
214
+ },
154
215
  ],
155
216
 
156
217
  [
157
218
  "writeFileSync",
158
- (fp, contents) => [`suite-${suite}/beforeEach/${fp}`, contents],
219
+ (fp, contents) => {
220
+ const path = `suite-${suite}/beforeEach/${fp}`;
221
+ (pm as any).currentStep?.artifacts?.push(path);
222
+ return [path, contents];
223
+ },
159
224
  ],
160
225
 
161
226
  [
162
227
  "customScreenShot",
163
- (opts, p) => [
164
- {
165
- ...opts,
166
- path: `suite-${suite}/beforeEach/${opts.path}`,
167
- },
168
- p,
169
- ],
228
+ (opts, p) => {
229
+ const path = `suite-${suite}/beforeEach/${opts.path}`;
230
+ (pm as any).currentStep?.artifacts?.push(path);
231
+ return [
232
+ {
233
+ ...opts,
234
+ path,
235
+ },
236
+ p,
237
+ ];
238
+ },
170
239
  ],
171
240
 
172
- ["createWriteStream", (fp) => [`suite-${suite}/beforeEach/${fp}`]],
241
+ ["createWriteStream", (fp) => {
242
+ const path = `suite-${suite}/beforeEach/${fp}`;
243
+ (pm as any).currentStep?.artifacts?.push(path);
244
+ return [path];
245
+ }],
173
246
  ]);
174
247
 
175
248
  export const beforeAllProxy: IProxy = (pm: IPM, suite: string): IPM =>
176
249
  baseProxy(pm, [
177
250
  [
178
251
  "writeFileSync",
179
- (fp, contents) => [`suite-${suite}/beforeAll/${fp}`, contents],
252
+ (fp, contents) => {
253
+ const path = `suite-${suite}/beforeAll/${fp}`;
254
+ (pm as any).currentStep?.artifacts?.push(path);
255
+ return [path, contents];
256
+ },
180
257
  ],
181
258
 
182
259
  [
183
260
  "customScreenShot",
184
- (opts, p) => [
185
- {
186
- ...opts,
187
- path: `suite-${suite}/beforeAll/${opts.path}`,
188
- },
189
- p,
190
- ],
261
+ (opts, p) => {
262
+ const path = `suite-${suite}/beforeAll/${opts.path}`;
263
+ (pm as any).currentStep?.artifacts?.push(path);
264
+ return [
265
+ {
266
+ ...opts,
267
+ path,
268
+ },
269
+ p,
270
+ ];
271
+ },
191
272
  ],
192
273
 
193
- ["createWriteStream", (fp) => [`suite-${suite}/beforeAll/${fp}`]],
274
+ ["createWriteStream", (fp) => {
275
+ const path = `suite-${suite}/beforeAll/${fp}`;
276
+ (pm as any).currentStep?.artifacts?.push(path);
277
+ return [path];
278
+ }],
194
279
  ]);
195
280
 
196
281
  export const afterAllProxy: IProxy = (pm: IPM, suite: string): IPM =>
197
282
  baseProxy(pm, [
198
- ["createWriteStream", (fp) => [`suite-${suite}/afterAll/${fp}`]],
283
+ ["createWriteStream", (fp) => {
284
+ const path = `suite-${suite}/afterAll/${fp}`;
285
+ (pm as any).currentStep?.artifacts?.push(path);
286
+ return [path];
287
+ }],
199
288
 
200
289
  [
201
290
  "writeFileSync",
202
- (fp, contents) => [`suite-${suite}/afterAll/${fp}`, contents],
291
+ (fp, contents) => {
292
+ const path = `suite-${suite}/afterAll/${fp}`;
293
+ (pm as any).currentStep?.artifacts?.push(path);
294
+ return [path, contents];
295
+ },
203
296
  ],
204
297
 
205
298
  [
206
299
  "customScreenShot",
207
- (opts, p) => [
208
- {
209
- ...opts,
210
- path: `suite-${suite}/afterAll/${opts.path}`,
211
- },
212
- p,
213
- ],
300
+ (opts, p) => {
301
+ const path = `suite-${suite}/afterAll/${opts.path}`;
302
+ (pm as any).currentStep?.artifacts?.push(path);
303
+ return [
304
+ {
305
+ ...opts,
306
+ path,
307
+ },
308
+ p,
309
+ ];
310
+ },
214
311
  ],
215
312
  ]);