testeranto 0.143.0 → 0.146.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 (193) hide show
  1. package/.aider.chat.history.md +1833 -0
  2. package/.aider.input.history +105 -0
  3. package/.aider.tags.cache.v3/{be/72/19ee8e656d160afe9b31523245fe.val → 06/1a/1ec9fd1f595d4b36094caef45894.val} +0 -0
  4. package/.aider.tags.cache.v3/{63/f1/138061b0aadb868173d197c2a0e0.val → 0f/f6/f42b5108253d75de3cb6286df7f6.val} +0 -0
  5. package/.aider.tags.cache.v3/cache.db +0 -0
  6. package/README.md +15 -16
  7. package/dist/tsconfig.tsbuildinfo +1 -1
  8. package/docs/index.md +45 -33
  9. package/package.json +1 -1
  10. package/src/Node.ts +17 -13
  11. package/src/PM/PM_WithEslintAndTsc.ts +71 -69
  12. package/src/PM/main.ts +182 -92
  13. package/src/PM/node.ts +1 -15
  14. package/src/PM/nodeSidecar.ts +0 -1
  15. package/src/Pure.ts +20 -2
  16. package/src/Types.ts +5 -5
  17. package/src/Web.ts +1 -1
  18. package/src/build.ts +0 -1
  19. package/src/esbuildConfigs/consoleDetectorPlugin.ts +28 -14
  20. package/src/esbuildConfigs/nativeImportDetectorPlugin.ts +26 -0
  21. package/src/esbuildConfigs/pure.ts +3 -1
  22. package/src/esbuildConfigs/rebuildPlugin.ts +1 -4
  23. package/src/lib/BaseSuite.test/node.test.ts +12 -0
  24. package/src/lib/BaseSuite.test/pure.test.ts +12 -0
  25. package/src/lib/{BaseSuite.test.ts → BaseSuite.test/test.ts} +20 -30
  26. package/src/lib/BaseSuite.test/web.test.ts +12 -0
  27. package/src/lib/BaseSuite.ts +17 -15
  28. package/src/lib/abstractBase.ts +0 -2
  29. package/src/lib/baseBuilder.test/baseBuilder.test.implementation.ts +2 -1
  30. package/src/lib/baseBuilder.test/baseBuilder.test.node.ts +14 -0
  31. package/src/lib/baseBuilder.test/baseBuilder.test.pure.ts +14 -0
  32. package/src/lib/baseBuilder.test/{baseBuilder.test.ts → baseBuilder.test.web.ts} +2 -1
  33. package/src/lib/basebuilder.ts +2 -1
  34. package/src/lib/classBuilder.test/classBuilder.test.implementation.ts +6 -2
  35. package/src/lib/classBuilder.test/classBuilder.test.interface.ts +1 -0
  36. package/src/lib/classBuilder.test/classBuilder.test.specification.ts +5 -4
  37. package/src/lib/classBuilder.test/classBuilder.test.types.ts +17 -5
  38. package/src/lib/core.ts +0 -10
  39. package/src/lib/pmProxy.test/interface.ts +0 -1
  40. package/src/run.ts +7 -7
  41. package/testeranto/bundles/node/allTests/{chunk-RX4SUFXQ.mjs → chunk-NQBTLMSG.mjs} +15 -12
  42. package/testeranto/bundles/node/allTests/{chunk-UED26IMH.mjs → chunk-RF3LIUSG.mjs} +196 -233
  43. package/testeranto/bundles/node/allTests/{chunk-KYSOR62N.mjs → chunk-YZWFKYY3.mjs} +6 -2
  44. package/testeranto/bundles/node/allTests/metafile.json +294 -4083
  45. package/testeranto/bundles/node/allTests/src/lib/{BaseSuite.test.mjs → BaseSuite.test/node.test.mjs} +9 -7
  46. package/testeranto/bundles/node/allTests/src/lib/baseBuilder.test/{baseBuilder.test.mjs → baseBuilder.test.node.mjs} +8 -8
  47. package/testeranto/bundles/node/allTests/src/lib/classBuilder.test/classBuilder.test.mjs +8 -6
  48. package/testeranto/bundles/node/allTests/src/lib/core.test/core.test.mjs +2 -2
  49. package/testeranto/bundles/node/allTests/src/lib/pmProxy.test/index.mjs +114 -6
  50. package/testeranto/bundles/{node/allTests/chunk-2FXOXAKZ.mjs → pure/allTests/chunk-W22WOQNK.mjs} +377 -256
  51. package/testeranto/bundles/pure/allTests/metafile.json +732 -3
  52. package/testeranto/bundles/{node → pure}/allTests/src/Pure.test.mjs +113 -5
  53. package/testeranto/bundles/pure/allTests/src/lib/BaseSuite.test/pure.test.mjs +323 -0
  54. package/testeranto/bundles/pure/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure.mjs +224 -0
  55. package/testeranto/bundles/{node/allTests/chunk-DWKHII32.mjs → web/allTests/chunk-FIZ3WLUB.mjs} +439 -296
  56. package/testeranto/bundles/web/allTests/metafile.json +1133 -2
  57. package/testeranto/bundles/web/allTests/src/lib/BaseSuite.test/web.test.html +19 -0
  58. package/testeranto/bundles/web/allTests/src/lib/BaseSuite.test/web.test.mjs +322 -0
  59. package/testeranto/bundles/web/allTests/src/lib/baseBuilder.test/baseBuilder.test.web.html +19 -0
  60. package/testeranto/bundles/web/allTests/src/lib/baseBuilder.test/baseBuilder.test.web.mjs +10964 -0
  61. package/testeranto/index.html +1 -1
  62. package/testeranto/reports/allTests/config.json +25 -25
  63. package/testeranto/reports/allTests/index.html +1 -1
  64. package/testeranto/reports/allTests/src/Pure.test/pure/lint_errors.json +1539 -0
  65. package/testeranto/reports/allTests/src/Pure.test/pure/logs.txt +11 -0
  66. package/testeranto/reports/allTests/src/Pure.test/pure/message +1 -0
  67. package/testeranto/reports/allTests/src/Pure.test/pure/prompt.txt +8 -0
  68. package/testeranto/reports/allTests/src/Pure.test/{node → pure}/type_errors.txt +15 -5
  69. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/lint_errors.json +620 -0
  70. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/logs.txt +12 -0
  71. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/message +1 -0
  72. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/prompt.txt +8 -0
  73. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/type_errors.txt +94 -0
  74. package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/lint_errors.json +620 -0
  75. package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/logs.txt +11 -0
  76. package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/message +1 -0
  77. package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/prompt.txt +8 -0
  78. package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/type_errors.txt +104 -0
  79. package/testeranto/reports/allTests/src/lib/BaseSuite.test/{node → web.test/web}/lint_errors.json +119 -107
  80. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/logs.txt +10 -0
  81. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/message +1 -0
  82. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/prompt.txt +8 -0
  83. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/type_errors.txt +95 -0
  84. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/lint_errors.json +966 -0
  85. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/message +1 -0
  86. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/prompt.txt +11 -0
  87. package/testeranto/reports/allTests/src/lib/baseBuilder.test/{baseBuilder.test → baseBuilder.test.node}/node/type_errors.txt +22 -17
  88. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/bdd_errors.txt +1 -0
  89. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/lint_errors.json +966 -0
  90. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/message +1 -0
  91. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/prompt.txt +11 -0
  92. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/tests.json +57 -0
  93. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/type_errors.txt +57 -0
  94. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/bdd_errors.txt +1 -0
  95. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/dev.html +21 -0
  96. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/index.html +21 -0
  97. package/testeranto/reports/allTests/src/lib/baseBuilder.test/{baseBuilder.test/node → baseBuilder.test.web/web}/lint_errors.json +61 -61
  98. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/message +1 -0
  99. package/testeranto/reports/allTests/src/lib/baseBuilder.test/{baseBuilder.test/node → baseBuilder.test.web/web}/prompt.txt +6 -6
  100. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/tests.json +57 -0
  101. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/type_errors.txt +48 -0
  102. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/index.html +1 -1
  103. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/lint_errors.json +106 -86
  104. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/logs.txt +12 -0
  105. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/message +1 -1
  106. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/prompt.txt +2 -2
  107. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/type_errors.txt +26 -38
  108. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/index.html +1 -1
  109. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/{console_log.txt → logs.txt} +8 -8
  110. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/message +1 -1
  111. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/prompt.txt +1 -1
  112. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/type_errors.txt +12 -1
  113. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/index.html +1 -1
  114. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/lint_errors.json +1413 -8
  115. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/logs.txt +30 -0
  116. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/message +1 -1
  117. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/prompt.txt +2 -1
  118. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/type_errors.txt +5 -5
  119. package/testeranto/reports/allTests/summary.json +48 -83
  120. package/testeranto.config.ts +32 -24
  121. package/tsc.log +273 -27
  122. package/.aider.tags.cache.v3/cache.db-shm +0 -0
  123. package/.aider.tags.cache.v3/cache.db-wal +0 -0
  124. package/testeranto/bundles/node/allTests/chunk-4PJCC2XT.mjs +0 -1039
  125. package/testeranto/bundles/node/allTests/chunk-5MQGD4WC.mjs +0 -251
  126. package/testeranto/bundles/node/allTests/chunk-6CGAD2FD.mjs +0 -800
  127. package/testeranto/bundles/node/allTests/chunk-PG6KUKNP.mjs +0 -44
  128. package/testeranto/bundles/node/allTests/chunk-PRPFVO6G.mjs +0 -251
  129. package/testeranto/bundles/node/allTests/chunk-VAAIAWXC.mjs +0 -117
  130. package/testeranto/bundles/node/allTests/chunk-W44DUDBK.mjs +0 -251
  131. package/testeranto/bundles/node/allTests/chunk-YI3EGRMQ.mjs +0 -167
  132. package/testeranto/bundles/node/allTests/src/PM/__tests__/nodeSidecar.testeranto.mjs +0 -188
  133. package/testeranto/bundles/node/allTests/src/PM/__tests__/pureSidecar.testeranto.mjs +0 -157
  134. package/testeranto/bundles/node/allTests/src/PM/__tests__/webSidecar.testeranto.mjs +0 -157
  135. package/testeranto/bundles/node/allTests/src/mothership/test.mjs +0 -24413
  136. package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/index.html +0 -21
  137. package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/lint_errors.json +0 -80
  138. package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/message +0 -1
  139. package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/prompt.txt +0 -8
  140. package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/type_errors.txt +0 -28
  141. package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/index.html +0 -21
  142. package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/lint_errors.json +0 -80
  143. package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/message +0 -1
  144. package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/prompt.txt +0 -8
  145. package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/type_errors.txt +0 -32
  146. package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/index.html +0 -21
  147. package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/lint_errors.json +0 -80
  148. package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/message +0 -1
  149. package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/prompt.txt +0 -8
  150. package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/type_errors.txt +0 -32
  151. package/testeranto/reports/allTests/src/Pure.test/node/console_log.txt +0 -17
  152. package/testeranto/reports/allTests/src/Pure.test/node/index.html +0 -21
  153. package/testeranto/reports/allTests/src/Pure.test/node/lint_errors.json +0 -134
  154. package/testeranto/reports/allTests/src/Pure.test/node/message +0 -1
  155. package/testeranto/reports/allTests/src/Pure.test/node/prompt.txt +0 -7
  156. package/testeranto/reports/allTests/src/lib/BaseGiven.test/node/index.html +0 -21
  157. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/console_log.txt +0 -35
  158. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/index.html +0 -21
  159. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/message +0 -1
  160. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/prompt.txt +0 -7
  161. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/type_errors.txt +0 -93
  162. package/testeranto/reports/allTests/src/lib/BaseThen.test/node/index.html +0 -21
  163. package/testeranto/reports/allTests/src/lib/BaseWhen.test/node/index.html +0 -21
  164. package/testeranto/reports/allTests/src/lib/abstractBase/index/node/index.html +0 -21
  165. package/testeranto/reports/allTests/src/lib/baseBuilder/baseBuilder.test/node/index.html +0 -21
  166. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test/node/console_log.txt +0 -12
  167. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test/node/index.html +0 -21
  168. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test/node/message +0 -1
  169. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/console_log.txt +0 -17
  170. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/console_log.txt +0 -43
  171. package/testeranto/reports/allTests/src/mothership/test/node/console_log.txt +0 -44
  172. package/testeranto/reports/allTests/src/mothership/test/node/index.html +0 -21
  173. package/testeranto/reports/allTests/src/mothership/test/node/lint_errors.json +0 -1
  174. package/testeranto/reports/allTests/src/mothership/test/node/message +0 -1
  175. package/testeranto/reports/allTests/src/mothership/test/node/prompt.txt +0 -8
  176. package/testeranto/reports/allTests/src/mothership/test/node/type_errors.txt +0 -24
  177. package/testeranto/reportsnode_build_errors +0 -12
  178. /package/testeranto/reports/allTests/src/{PM/__tests__/nodeSidecar.testeranto/node → Pure.test/pure}/dev.html +0 -0
  179. /package/testeranto/reports/allTests/src/{PM/__tests__/pureSidecar.testeranto/node/dev.html → Pure.test/pure/index.html} +0 -0
  180. /package/testeranto/reports/allTests/src/{PM/__tests__/webSidecar.testeranto → lib/BaseSuite.test/node.test}/node/dev.html +0 -0
  181. /package/testeranto/reports/allTests/src/{Pure.test/node/dev.html → lib/BaseSuite.test/node.test/node/index.html} +0 -0
  182. /package/testeranto/reports/allTests/src/lib/{BaseGiven.test/node → BaseSuite.test/pure.test/pure}/dev.html +0 -0
  183. /package/testeranto/reports/allTests/src/lib/BaseSuite.test/{node/dev.html → pure.test/pure/index.html} +0 -0
  184. /package/testeranto/reports/allTests/src/lib/{BaseThen.test/node → BaseSuite.test/web.test/web}/dev.html +0 -0
  185. /package/testeranto/reports/allTests/src/lib/{BaseWhen.test/node/dev.html → BaseSuite.test/web.test/web/index.html} +0 -0
  186. /package/testeranto/reports/allTests/src/lib/{abstractBase/index → baseBuilder.test/baseBuilder.test.node}/node/dev.html +0 -0
  187. /package/testeranto/reports/allTests/src/lib/baseBuilder.test/{baseBuilder.test/node/dev.html → baseBuilder.test.node/node/index.html} +0 -0
  188. /package/testeranto/reports/allTests/src/{PM/__tests__/nodeSidecar.testeranto/node/console_log.txt → lib/baseBuilder.test/baseBuilder.test.node/node/logs.txt} +0 -0
  189. /package/testeranto/reports/allTests/src/lib/{baseBuilder/baseBuilder.test/node → baseBuilder.test/baseBuilder.test.pure/pure}/dev.html +0 -0
  190. /package/testeranto/reports/allTests/src/{mothership/test/node/dev.html → lib/baseBuilder.test/baseBuilder.test.pure/pure/index.html} +0 -0
  191. /package/testeranto/reports/allTests/src/{PM/__tests__/nodeSidecar.testeranto/node → lib/baseBuilder.test/baseBuilder.test.pure/pure}/log.txt +0 -0
  192. /package/testeranto/reports/allTests/src/lib/{BaseSuite.test/node → baseBuilder.test/baseBuilder.test.web/web}/log.txt +0 -0
  193. /package/testeranto/reports/allTests/src/{mothership/test/node/log.txt → lib/baseBuilder.test/baseBuilder.test.web/web/logs.txt} +0 -0
package/src/Pure.ts CHANGED
@@ -41,7 +41,13 @@ export class PureTesteranto<
41
41
  async receiveTestResourceConfig(partialTestResource: string) {
42
42
  const t: ITTestResourceConfiguration = JSON.parse(partialTestResource);
43
43
  const pm = new PM_Pure(t);
44
- return await this.testJobs[0].receiveTestResourceConfig(pm);
44
+
45
+ try {
46
+ return await this.testJobs[0].receiveTestResourceConfig(pm);
47
+ } catch (e) {
48
+ return -2;
49
+ }
50
+
45
51
  // const { failed, artifacts, logPromise, features, fails } =
46
52
  // await this.testJobs[0].receiveTestResourceConfig(pm);
47
53
  // // pm.customclose();
@@ -55,7 +61,7 @@ export default async <I extends Ibdd_in_any, O extends Ibdd_out, M>(
55
61
  testImplementation: ITestImplementation<I, O, M>,
56
62
  testInterface: Partial<ITestInterface<I>>,
57
63
  testResourceRequirement: ITTestResourceRequest = defaultTestResourceRequirement
58
- ): Promise<Testeranto<I, O, M>> => {
64
+ ): Promise<number | Testeranto<I, O, M>> => {
59
65
  return new PureTesteranto<I, O, M>(
60
66
  input,
61
67
  testSpecification,
@@ -63,4 +69,16 @@ export default async <I extends Ibdd_in_any, O extends Ibdd_out, M>(
63
69
  testResourceRequirement,
64
70
  testInterface
65
71
  );
72
+
73
+ // try {
74
+ // return new PureTesteranto<I, O, M>(
75
+ // input,
76
+ // testSpecification,
77
+ // testImplementation,
78
+ // testResourceRequirement,
79
+ // testInterface
80
+ // );
81
+ // } catch (e) {
82
+ // return -1;
83
+ // }
66
84
  };
package/src/Types.ts CHANGED
@@ -17,11 +17,11 @@ import { BaseSuite } from "./lib/BaseSuite.js";
17
17
  export type ISummary = Record<
18
18
  string,
19
19
  {
20
- runTimeError: string;
21
- typeErrors: number;
22
- staticErrors: number;
23
- prompt: string;
24
- failingFeatures: object;
20
+ runTimeErrors: number | "?" | undefined;
21
+ typeErrors: number | "?" | undefined;
22
+ staticErrors: number | "?" | undefined;
23
+ prompt: string | "?" | undefined;
24
+ failingFeatures: object | undefined;
25
25
  }
26
26
  >;
27
27
 
package/src/Web.ts CHANGED
@@ -87,7 +87,7 @@ export default async <I extends Ibdd_in_any, O extends Ibdd_out, M>(
87
87
  input: I["iinput"],
88
88
  testSpecification: ITestSpecification<I, O>,
89
89
  testImplementation: ITestImplementation<I, O, M>,
90
- testInterface: Partial<IWebTestInterface<I>>,
90
+ testInterface: Partial<ITestInterface<I>>,
91
91
  testResourceRequirement: ITTestResourceRequest = defaultTestResourceRequirement
92
92
  ): Promise<Testeranto<I, O, M>> => {
93
93
  return new WebTesteranto<I, O, M>(
package/src/build.ts CHANGED
@@ -238,7 +238,6 @@ import(process.cwd() + "/" + "testeranto.config.ts").then(async (module) => {
238
238
  ];
239
239
 
240
240
  x.forEach(async ([runtime, keys]) => {
241
- console.log(runtime, keys);
242
241
  keys.forEach(async (k) => {
243
242
  const folder = `testeranto/reports/${testName}/${k
244
243
  .split(".")
@@ -1,29 +1,43 @@
1
- import type { Plugin } from 'esbuild';
1
+ import type { Plugin } from "esbuild";
2
+
3
+ import fs from "fs";
2
4
 
3
5
  export const consoleDetectorPlugin: Plugin = {
4
- name: 'console-detector',
6
+ name: "console-detector",
5
7
  setup(build) {
6
8
  build.onLoad({ filter: /\.(js|ts)$/ }, async (args) => {
7
- const contents = await require('fs').promises.readFile(args.path, 'utf8');
8
-
9
- const consolePattern = /console\.(log|error|warn|info|debug|trace|dir|dirxml|table|group|groupEnd|clear|count|countReset|assert|profile|profileEnd|time|timeLog|timeEnd|timeStamp|context|memory)/g;
9
+ const contents = await fs.promises.readFile(args.path, "utf8");
10
+
11
+ const consolePattern =
12
+ /console\.(log|error|warn|info|debug|trace|dir|dirxml|table|group|groupEnd|clear|count|countReset|assert|profile|profileEnd|time|timeLog|timeEnd|timeStamp|context|memory)/g;
10
13
  const matches = contents.match(consolePattern);
11
14
 
12
15
  if (matches) {
13
16
  const uniqueMethods = [...new Set(matches)];
14
17
  return {
15
- warnings: uniqueMethods.map(method => ({
16
- text: `Detected ${method} call - Pure runtime does not allow IO operations. Use Node runtime instead.`,
17
- location: {
18
- file: args.path,
19
- line: contents.split('\n').findIndex(line => line.includes(method)) + 1,
20
- column: 0
21
- }
22
- }))
18
+ warnings: uniqueMethods.map((method) => ({
19
+ text: `call of "${method}" was detected, which is not supported in the pure runtime.`,
20
+ // location: {
21
+ // file: args.path,
22
+ // line:
23
+ // contents
24
+ // .split("\n")
25
+ // .findIndex((line) => line.includes(method)) + 1,
26
+ // column: 0,
27
+ // },
28
+ })),
23
29
  };
24
30
  }
25
31
 
26
32
  return null;
27
33
  });
28
- }
34
+ build.onEnd((buildResult) => {
35
+ if (
36
+ buildResult.warnings.find((br) => br.pluginName === "console-detector")
37
+ )
38
+ console.warn(
39
+ `Warning: An unsupported method call was detected in a source file used to build for the pure runtime. It is possible that this method call is in a comment block. If you really want to use this function, change this test to the "node" runtime.`
40
+ );
41
+ });
42
+ },
29
43
  };
@@ -0,0 +1,26 @@
1
+ import type { Plugin } from "esbuild";
2
+
3
+ import { isBuiltin } from "node:module";
4
+
5
+ export const nativeImportDetectorPlugin: Plugin = {
6
+ name: "native-node-import-filter",
7
+ setup(build) {
8
+ build.onResolve({ filter: /fs/ }, (args) => {
9
+ if (isBuiltin(args.path)) {
10
+ return {
11
+ warnings: [
12
+ {
13
+ text: `cannot use native node package "${args.path}" in a "pure" test. If you really want to use this package, convert this test from "pure" to "node"`,
14
+ },
15
+ ],
16
+ };
17
+
18
+ // throw new Error(
19
+ // `cannot use native node package "${args.path}" in a "pure" test. If you really want to use this package, convert this test from "pure" to "node"`
20
+ // );
21
+ }
22
+
23
+ return { path: args.path };
24
+ });
25
+ },
26
+ };
@@ -9,6 +9,7 @@ import featuresPlugin from "./featuresPlugin.js";
9
9
  import { isBuiltin } from "node:module";
10
10
  import { consoleDetectorPlugin } from "./consoleDetectorPlugin.js";
11
11
  import rebuildPlugin from "./rebuildPlugin.js";
12
+ import { nativeImportDetectorPlugin } from "./nativeImportDetectorPlugin.js";
12
13
 
13
14
  export default (
14
15
  config: ITestconfig,
@@ -53,13 +54,14 @@ export default (
53
54
 
54
55
  consoleDetectorPlugin,
55
56
 
57
+ // nativeImportDetectorPlugin,
56
58
  {
57
59
  name: "native-node-import-filter",
58
60
  setup(build) {
59
61
  build.onResolve({ filter: /fs/ }, (args) => {
60
62
  if (isBuiltin(args.path)) {
61
63
  throw new Error(
62
- `cannot use native node package "${args.path}" in a "pure" test. If you really want to use this package, convert this test from "pure" to "node"`
64
+ `You attempted to import a node module "${args.path}" into a "pure" test, which is not allowed. If you really want to use this package, convert this test from "pure" to "node"`
63
65
  );
64
66
  }
65
67
 
@@ -6,11 +6,8 @@ export default (r: IRunTime) => {
6
6
  return {
7
7
  name: "rebuild-notify",
8
8
  setup: (build) => {
9
- build.onStart(() => {
10
- console.log(`> web build starting...`);
11
- });
12
9
  build.onEnd((result) => {
13
- console.log(`> web build ended with ${result.errors.length} errors`);
10
+ console.log(`${r} > build ended with ${result.errors.length} errors`);
14
11
  if (result.errors.length > 0) {
15
12
  fs.writeFileSync(
16
13
  `./testeranto/reports${r}_build_errors`,
@@ -0,0 +1,12 @@
1
+ import Testeranto from "../../Node";
2
+
3
+ import { BaseSuite } from "../BaseSuite";
4
+
5
+ import { I, implementation, O, specification, testInterface } from "./test";
6
+
7
+ export default Testeranto<I, O, {}>(
8
+ BaseSuite,
9
+ specification,
10
+ implementation,
11
+ testInterface
12
+ );
@@ -0,0 +1,12 @@
1
+ import Testeranto from "../../Pure";
2
+
3
+ import { BaseSuite } from "../BaseSuite";
4
+
5
+ import { I, implementation, O, specification, testInterface } from "./test";
6
+
7
+ export default Testeranto<I, O, {}>(
8
+ BaseSuite,
9
+ specification,
10
+ implementation,
11
+ testInterface
12
+ );
@@ -1,32 +1,30 @@
1
- import Testeranto from "../Node";
2
-
3
- import { BaseSuite } from "./BaseSuite";
4
- import { BaseGiven, BaseWhen, BaseThen, BaseCheck } from "./abstractBase";
5
- import { ITTestResourceConfiguration, ITestArtifactory, ITLog } from ".";
6
- import { IPM, ITestCheckCallback } from "./types";
1
+ import { ITTestResourceConfiguration, ITestArtifactory, ITLog } from "..";
7
2
  import {
8
3
  Ibdd_in,
9
4
  Ibdd_out,
10
5
  ITestSpecification,
11
6
  ITestImplementation,
12
7
  ITestInterface,
13
- } from "../CoreTypes";
14
- import { WhenSpecification } from "../Types";
8
+ } from "../../CoreTypes";
9
+ import { WhenSpecification } from "../../Types";
10
+ import { BaseGiven, BaseWhen, BaseThen, BaseCheck } from "../abstractBase";
11
+ import { BaseSuite } from "../BaseSuite";
12
+ import { IPM, ITestCheckCallback } from "../types";
15
13
 
16
14
  // 1. Define our test types with full type safety
17
- type TestStore = {
15
+ export type TestStore = {
18
16
  testStore: boolean;
19
17
  testSelection?: boolean;
20
18
  error?: Error;
21
19
  };
22
20
 
23
- type TestSelection = {
21
+ export type TestSelection = {
24
22
  testSelection: boolean;
25
23
  error?: boolean;
26
24
  };
27
25
 
28
- type I = Ibdd_in<
29
- null, // iinput
26
+ export type I = Ibdd_in<
27
+ typeof BaseSuite,
30
28
  BaseSuite<any, any>, // isubject
31
29
  TestStore, // istore
32
30
  TestSelection, // iselection
@@ -35,7 +33,7 @@ type I = Ibdd_in<
35
33
  (store: TestStore) => Promise<TestSelection> // then
36
34
  >;
37
35
 
38
- type O = Ibdd_out<
36
+ export type O = Ibdd_out<
39
37
  {
40
38
  Default: [string]; // Suite names
41
39
  },
@@ -57,7 +55,7 @@ type O = Ibdd_out<
57
55
  >;
58
56
 
59
57
  // 2. Mock implementations with proper typing
60
- class MockGiven extends BaseGiven<I> {
58
+ export class MockGiven extends BaseGiven<I> {
61
59
  constructor(
62
60
  name: string,
63
61
  features: string[],
@@ -86,7 +84,7 @@ class MockGiven extends BaseGiven<I> {
86
84
  }
87
85
 
88
86
  uberCatcher(e: Error): void {
89
- console.error("Given error:", e);
87
+ console.error("Given error 2:", e);
90
88
  }
91
89
  }
92
90
 
@@ -160,7 +158,7 @@ class TestableSuite extends BaseSuite<I, O> {
160
158
  }
161
159
 
162
160
  // 3. Enhanced Test Specification with more test cases
163
- const specification: ITestSpecification<I, O> = (
161
+ export const specification: ITestSpecification<I, O> = (
164
162
  Suite: ITestSpecification<I, O>,
165
163
  Given: WhenSpecification<I, O>,
166
164
  When: WhenSpecification<I, O>,
@@ -228,20 +226,20 @@ const specification: ITestSpecification<I, O> = (
228
226
  [
229
227
  When.addArtifact(Promise.resolve("test")),
230
228
  When.modifySpecs((specs) => [...specs, "extra"]),
231
- When.modifyJobs((jobs) => [...jobs, {}])
229
+ When.modifyJobs((jobs) => [...jobs, {}]),
232
230
  ],
233
231
  [
234
232
  Then.specsModified(1),
235
233
  Then.jobsModified(1),
236
234
  Then.artifactsTracked(),
237
- Then.testRunSuccessful()
235
+ Then.testRunSuccessful(),
238
236
  ]
239
- )
240
- })
237
+ ),
238
+ }),
241
239
  ];
242
240
 
243
241
  // 4. Enhanced Test Implementation with more operations
244
- const implementation: ITestImplementation<I, O> = {
242
+ export const implementation: ITestImplementation<I, O> = {
245
243
  suites: {
246
244
  Default: "BaseSuite Comprehensive Test Suite" as const,
247
245
  },
@@ -434,7 +432,7 @@ const implementation: ITestImplementation<I, O> = {
434
432
  };
435
433
 
436
434
  // 5. Fully typed Test Interface
437
- const testInterface: ITestInterface<I> = {
435
+ export const testInterface: ITestInterface<I> = {
438
436
  beforeEach: async (
439
437
  subject: I["isubject"],
440
438
  initializer: (context?: any) => I["given"]
@@ -466,11 +464,3 @@ const testInterface: ITestInterface<I> = {
466
464
  pm: IPM
467
465
  ): Promise<I["isubject"]> => input as unknown as I["isubject"],
468
466
  };
469
-
470
- // 6. Run the tests
471
- export default Testeranto<I, O, {}>(
472
- BaseSuite.prototype,
473
- specification,
474
- implementation,
475
- testInterface
476
- );
@@ -0,0 +1,12 @@
1
+ import Testeranto from "../../Web";
2
+
3
+ import { BaseSuite } from "../BaseSuite";
4
+
5
+ import { I, implementation, O, specification, testInterface } from "./test";
6
+
7
+ export default Testeranto<I, O, {}>(
8
+ BaseSuite,
9
+ specification,
10
+ implementation,
11
+ testInterface
12
+ );
@@ -95,21 +95,23 @@ export abstract class BaseSuite<I extends Ibdd_in_any, O extends Ibdd_out_any> {
95
95
 
96
96
  for (const [gKey, g] of Object.entries(this.givens)) {
97
97
  const giver = this.givens[gKey];
98
- this.store = await giver.give(
99
- subject,
100
- gKey,
101
- testResourceConfiguration,
102
- this.assertThat,
103
- suiteArtifactory,
104
- tLog,
105
- pm,
106
- sNdx
107
- ).catch((e) => {
108
- this.failed = true;
109
- this.fails = this.fails + 1;
110
- console.error("Given error:", e);
111
- throw e;
112
- });
98
+ this.store = await giver
99
+ .give(
100
+ subject,
101
+ gKey,
102
+ testResourceConfiguration,
103
+ this.assertThat,
104
+ suiteArtifactory,
105
+ tLog,
106
+ pm,
107
+ sNdx
108
+ )
109
+ .catch((e) => {
110
+ this.failed = true;
111
+ this.fails = this.fails + 1;
112
+ console.error("Given error 1:", e);
113
+ throw e;
114
+ });
113
115
  }
114
116
 
115
117
  for (const [ndx, thater] of this.checks.entries()) {
@@ -214,7 +214,6 @@ export abstract class BaseWhen<I extends Ibdd_in_any> {
214
214
  testResourceConfiguration,
215
215
  andWhenProxy(pm, filepath)
216
216
  ).catch((e: Error) => {
217
- console.log("MARK9", e);
218
217
  this.error = e;
219
218
  throw e;
220
219
  });
@@ -271,7 +270,6 @@ export abstract class BaseThen<I extends Ibdd_in_any> {
271
270
  testResourceConfiguration,
272
271
  butThenProxy(pm, filepath)
273
272
  ).catch((e) => {
274
- console.log("test failed 3", e);
275
273
  this.error = e;
276
274
  throw e;
277
275
  });
@@ -4,7 +4,8 @@ import { ITestImplementation } from "../../CoreTypes";
4
4
  import { TestBaseBuilder } from "./TestBaseBuilder";
5
5
 
6
6
  import { I, O } from "./baseBuilder.test.types";
7
- import { TestBaseBuilder } from "./TestBaseBuilder";
7
+ import { ITTestResourceRequest } from "..";
8
+ import { BaseBuilder } from "../basebuilder";
8
9
 
9
10
  // Define our test subject type
10
11
  type TestSubject = TestBaseBuilder<any, any, any, any, any, any>;
@@ -0,0 +1,14 @@
1
+ import Testeranto from "../../Pure";
2
+
3
+ import { specification } from "./baseBuilder.test.specification";
4
+ import { implementation } from "./baseBuilder.test.implementation";
5
+ import { testInterface } from "./baseBuilder.test.interface";
6
+ import { I, O } from "./baseBuilder.test.types";
7
+ import { BaseBuilder } from "../basebuilder";
8
+
9
+ export default Testeranto<I, O, {}>(
10
+ BaseBuilder.prototype,
11
+ specification,
12
+ implementation,
13
+ testInterface
14
+ );
@@ -0,0 +1,14 @@
1
+ import Testeranto from "../../Pure";
2
+
3
+ import { specification } from "./baseBuilder.test.specification";
4
+ import { implementation } from "./baseBuilder.test.implementation";
5
+ import { testInterface } from "./baseBuilder.test.interface";
6
+ import { I, O } from "./baseBuilder.test.types";
7
+ import { BaseBuilder } from "../basebuilder";
8
+
9
+ export default Testeranto<I, O, {}>(
10
+ BaseBuilder.prototype,
11
+ specification,
12
+ implementation,
13
+ testInterface
14
+ );
@@ -1,9 +1,10 @@
1
- import Testeranto from "../../Node";
1
+ import Testeranto from "../../Web";
2
2
 
3
3
  import { specification } from "./baseBuilder.test.specification";
4
4
  import { implementation } from "./baseBuilder.test.implementation";
5
5
  import { testInterface } from "./baseBuilder.test.interface";
6
6
  import { I, O } from "./baseBuilder.test.types";
7
+ import { BaseBuilder } from "../basebuilder";
7
8
 
8
9
  export default Testeranto<I, O, {}>(
9
10
  BaseBuilder.prototype,
@@ -114,8 +114,9 @@ export abstract class BaseBuilder<
114
114
  logFilePath
115
115
  );
116
116
 
117
+ // deprecated?
117
118
  const tLog = async (...l: string[]) => {
118
- // console.log("x", x);
119
+ //
119
120
  };
120
121
 
121
122
  const suiteDone: BaseSuite<I, O> = await runner(puppetMaster, tLog);
@@ -1,8 +1,12 @@
1
- import { ITestImplementation } from "../../CoreTypes";
1
+ /* eslint-disable @typescript-eslint/no-unused-vars */
2
+ import { PassThrough } from "stream";
3
+
4
+ import { ITestImplementation, ITestSpecification } from "../../CoreTypes";
2
5
  import { TestClassBuilder } from "./TestClassBuilder";
3
6
  import { I, O, M } from "./classBuilder.test.types";
4
- import { PassThrough } from "stream";
7
+
5
8
  import { ITTestResourceRequest } from "..";
9
+ import { specification } from "./classBuilder.test.specification";
6
10
 
7
11
  export const implementation: ITestImplementation<I, O, M> = {
8
12
  suites: {
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
1
2
  import { ITestInterface } from "../../CoreTypes";
2
3
  import { I } from "../baseBuilder.test/baseBuilder.test.types";
3
4
 
@@ -1,3 +1,4 @@
1
+ import { ITestJob } from "..";
1
2
  import { ITestSpecification } from "../../CoreTypes";
2
3
  import { I, O } from "./classBuilder.test.types";
3
4
 
@@ -55,7 +56,7 @@ export const specification: ITestSpecification<I, O> = (
55
56
  Then.givensOverridesConfigured(),
56
57
  Then.whensOverridesConfigured(),
57
58
  Then.thensOverridesConfigured(),
58
- Then.checksOverridesConfigured()
59
+ Then.checksOverridesConfigured(),
59
60
  ]
60
61
  ),
61
62
  },
@@ -101,12 +102,12 @@ export const specification: ITestSpecification<I, O> = (
101
102
  ["Should complete a full test run successfully"],
102
103
  [],
103
104
  [Then.testRunSuccessful()]
104
- )
105
+ ),
105
106
  },
106
107
  [
107
108
  Check.ImplementationCheck((impl) => impl !== null),
108
- Check.SpecificationCheck((spec) => spec !== null)
109
+ Check.SpecificationCheck((spec) => spec !== null),
109
110
  ]
110
- )
111
+ ),
111
112
  ];
112
113
  };
@@ -1,6 +1,12 @@
1
- import { Ibdd_in, Ibdd_out } from "../../CoreTypes";
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import {
3
+ Ibdd_in,
4
+ Ibdd_out,
5
+ ITestImplementation,
6
+ ITestSpecification,
7
+ } from "../../CoreTypes";
2
8
  import { ClassBuilder } from "../classBuilder";
3
- import { ITTestResourceRequest } from "..";
9
+ import { ITestJob, ITTestResourceRequest } from "..";
4
10
 
5
11
  export type I = Ibdd_in<
6
12
  {}, // iinput
@@ -61,12 +67,18 @@ export type O = Ibdd_out<
61
67
 
62
68
  export type M = {
63
69
  givens: {
64
- [K in keyof O["givens"]]: (...args: O["givens"][K]) => ClassBuilder<any, any, any>;
70
+ [K in keyof O["givens"]]: (
71
+ ...args: O["givens"][K]
72
+ ) => ClassBuilder<any, any, any>;
65
73
  };
66
74
  whens: {
67
- [K in keyof O["whens"]]: (...args: O["whens"][K]) => (builder: ClassBuilder<any, any, any>) => ClassBuilder<any, any, any>;
75
+ [K in keyof O["whens"]]: (
76
+ ...args: O["whens"][K]
77
+ ) => (builder: ClassBuilder<any, any, any>) => ClassBuilder<any, any, any>;
68
78
  };
69
79
  thens: {
70
- [K in keyof O["thens"]]: (...args: O["thens"][K]) => (builder: ClassBuilder<any, any, any>) => ClassBuilder<any, any, any>;
80
+ [K in keyof O["thens"]]: (
81
+ ...args: O["thens"][K]
82
+ ) => (builder: ClassBuilder<any, any, any>) => ClassBuilder<any, any, any>;
71
83
  };
72
84
  };
package/src/lib/core.ts CHANGED
@@ -120,16 +120,6 @@ export default abstract class TesterantoCore<
120
120
  testResource,
121
121
  pm
122
122
  );
123
- // try {
124
- // return await fullTestInterface.andWhen(
125
- // store,
126
- // whenCB,
127
- // testResource,
128
- // pm
129
- // );
130
- // } catch (e) {
131
- // console.log("mark22", e);
132
- // }
133
123
  }
134
124
  } as any,
135
125
 
@@ -25,7 +25,6 @@ export const testInterface: ITestInterface<I> = {
25
25
  },
26
26
 
27
27
  butThen: async (store, thenCB, testResource, pm) => {
28
- console.log("mark2 butThen", store, thenCB.toString());
29
28
  const proxiedPM = butThenProxy(pm, "some/path");
30
29
  return thenCB(store, proxiedPM);
31
30
  },
package/src/run.ts CHANGED
@@ -7,7 +7,9 @@ import { ITestconfig, IBuiltConfig, IProject } from "./Types";
7
7
  readline.emitKeypressEvents(process.stdin);
8
8
  if (process.stdin.isTTY) process.stdin.setRawMode(true);
9
9
 
10
- console.log(ansiC.inverse("Press 'x' to shutdown forcefully."));
10
+ console.log(ansiC.inverse("Press 'q' to initiate a graceful shutdown."));
11
+ console.log(ansiC.inverse("Press 'x' to quit forcefully."));
12
+
11
13
  process.stdin.on("keypress", (str, key) => {
12
14
  if (key.name === "x") {
13
15
  console.log(ansiC.inverse("Shutting down forcefully..."));
@@ -15,7 +17,7 @@ process.stdin.on("keypress", (str, key) => {
15
17
  }
16
18
  });
17
19
 
18
- const testName = process.argv[2];
20
+ const projectName = process.argv[2];
19
21
 
20
22
  const mode = process.argv[3] as "once" | "dev";
21
23
  if (mode !== "once" && mode !== "dev") {
@@ -23,19 +25,17 @@ if (mode !== "once" && mode !== "dev") {
23
25
  process.exit(-1);
24
26
  }
25
27
 
26
- console.log("testeranto is running", testName, mode);
27
-
28
28
  import(process.cwd() + "/" + "testeranto.config.ts").then(async (module) => {
29
29
  const bigConfig: IProject = module.default;
30
30
 
31
- const rawConfig: ITestconfig = bigConfig.projects[testName];
31
+ const rawConfig: ITestconfig = bigConfig.projects[projectName];
32
32
 
33
33
  const config: IBuiltConfig = {
34
34
  ...rawConfig,
35
- buildDir: process.cwd() + "/" + `testeranto/${testName}.json`,
35
+ buildDir: process.cwd() + "/" + `testeranto/${projectName}.json`,
36
36
  };
37
37
 
38
- const pm = new PM_Main(config, testName, mode);
38
+ const pm = new PM_Main(config, projectName, mode);
39
39
  pm.start();
40
40
 
41
41
  process.stdin.on("keypress", (str, key) => {