testeranto 0.140.2 → 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 (204) hide show
  1. package/.aider.chat.history.md +11006 -0
  2. package/.aider.input.history +441 -0
  3. package/.aider.tags.cache.v3/06/1a/1ec9fd1f595d4b36094caef45894.val +0 -0
  4. package/.aider.tags.cache.v3/0f/f6/f42b5108253d75de3cb6286df7f6.val +0 -0
  5. package/.aider.tags.cache.v3/{ad/3c/10f2ab1397f6d544e613d2a6acaf.val → 3d/81/8b6f0e9b98ec2952cdb8968ac386.val} +0 -0
  6. package/.aider.tags.cache.v3/cache.db +0 -0
  7. package/.aider.tags.cache.v3/{a7/97/6d37fce350ad2d588f36729db0cd.val → d6/7d/1820c2d4b9330eab7017da4515e7.val} +0 -0
  8. package/README.md +15 -16
  9. package/dist/tsconfig.tsbuildinfo +1 -1
  10. package/docs/aiderTest.sh +1 -0
  11. package/docs/index.md +45 -33
  12. package/docs/testing.ai.txt +98 -0
  13. package/docs/testing.prompt.txt +8 -0
  14. package/package.json +3 -3
  15. package/src/Node.ts +17 -13
  16. package/src/PM/PM_WithEslintAndTsc.ts +83 -67
  17. package/src/PM/main.ts +182 -92
  18. package/src/PM/node.ts +1 -15
  19. package/src/PM/nodeSidecar.ts +0 -1
  20. package/src/Pure.test.ts +299 -0
  21. package/src/Pure.ts +20 -2
  22. package/src/Types.ts +5 -5
  23. package/src/Web.ts +1 -1
  24. package/src/build.ts +0 -1
  25. package/src/esbuildConfigs/consoleDetectorPlugin.ts +28 -14
  26. package/src/esbuildConfigs/nativeImportDetectorPlugin.ts +26 -0
  27. package/src/esbuildConfigs/pure.ts +3 -1
  28. package/src/esbuildConfigs/rebuildPlugin.ts +1 -4
  29. package/src/lib/BaseSuite.test/node.test.ts +12 -0
  30. package/src/lib/BaseSuite.test/pure.test.ts +12 -0
  31. package/src/lib/{BaseSuite.test.ts → BaseSuite.test/test.ts} +36 -27
  32. package/src/lib/BaseSuite.test/web.test.ts +12 -0
  33. package/src/lib/BaseSuite.ts +17 -15
  34. package/src/lib/abstractBase.test/MockGiven.ts +31 -0
  35. package/src/lib/abstractBase.test/MockThen.ts +20 -0
  36. package/src/lib/abstractBase.test/MockWhen.ts +17 -0
  37. package/src/lib/abstractBase.test/implementation.ts +51 -0
  38. package/src/lib/abstractBase.test/index.ts +19 -0
  39. package/src/lib/abstractBase.test/interface.ts +12 -0
  40. package/src/lib/abstractBase.test/specification.ts +49 -0
  41. package/src/lib/abstractBase.test/types.ts +19 -0
  42. package/src/lib/abstractBase.ts +0 -2
  43. package/src/lib/baseBuilder.test/TestBaseBuilder.ts +83 -0
  44. package/src/lib/baseBuilder.test/baseBuilder.test.implementation.ts +134 -0
  45. package/src/lib/baseBuilder.test/baseBuilder.test.interface.ts +18 -0
  46. package/src/lib/baseBuilder.test/baseBuilder.test.node.ts +14 -0
  47. package/src/lib/baseBuilder.test/baseBuilder.test.pure.ts +14 -0
  48. package/src/lib/baseBuilder.test/baseBuilder.test.specification.ts +35 -0
  49. package/src/lib/baseBuilder.test/baseBuilder.test.types.ts +36 -0
  50. package/src/lib/baseBuilder.test/baseBuilder.test.web.ts +14 -0
  51. package/src/lib/basebuilder.ts +2 -1
  52. package/src/lib/classBuilder.test/TestClassBuilder.ts +88 -0
  53. package/src/lib/classBuilder.test/classBuilder.test.implementation.ts +204 -0
  54. package/src/lib/classBuilder.test/classBuilder.test.interface.ts +18 -0
  55. package/src/lib/classBuilder.test/classBuilder.test.specification.ts +113 -0
  56. package/src/lib/classBuilder.test/classBuilder.test.ts +14 -0
  57. package/src/lib/classBuilder.test/classBuilder.test.types.ts +84 -0
  58. package/src/lib/core.test/MockCore.ts +49 -0
  59. package/src/lib/core.test/core.test.implementation.ts +129 -0
  60. package/src/lib/core.test/core.test.interface.ts +18 -0
  61. package/src/lib/core.test/core.test.specification.ts +99 -0
  62. package/src/lib/core.test/core.test.ts +15 -0
  63. package/src/lib/core.test/core.test.types.ts +68 -0
  64. package/src/lib/core.ts +1 -11
  65. package/src/lib/pmProxy.test/implementation.ts +104 -0
  66. package/src/lib/pmProxy.test/index.ts +19 -0
  67. package/src/lib/pmProxy.test/interface.ts +46 -0
  68. package/src/lib/pmProxy.test/mockPM.ts +38 -0
  69. package/src/lib/pmProxy.test/mockPMBase.ts +136 -0
  70. package/src/lib/pmProxy.test/specification.ts +123 -0
  71. package/src/lib/pmProxy.test/types.ts +45 -0
  72. package/src/lib/pmProxy.ts +40 -193
  73. package/src/run.ts +7 -7
  74. package/testeranto/bundles/node/allTests/chunk-NQBTLMSG.mjs +254 -0
  75. package/testeranto/bundles/node/allTests/chunk-RF3LIUSG.mjs +765 -0
  76. package/testeranto/bundles/node/allTests/chunk-YZWFKYY3.mjs +171 -0
  77. package/testeranto/bundles/node/allTests/metafile.json +628 -3567
  78. package/testeranto/bundles/node/allTests/src/lib/BaseSuite.test/node.test.mjs +325 -0
  79. package/testeranto/bundles/node/allTests/src/lib/baseBuilder.test/baseBuilder.test.node.mjs +226 -0
  80. package/testeranto/bundles/node/allTests/src/lib/classBuilder.test/classBuilder.test.mjs +408 -0
  81. package/testeranto/bundles/node/allTests/src/lib/core.test/core.test.mjs +279 -0
  82. package/testeranto/bundles/node/allTests/src/lib/pmProxy.test/index.mjs +4587 -0
  83. package/testeranto/bundles/{node/allTests/chunk-4PJCC2XT.mjs → pure/allTests/chunk-W22WOQNK.mjs} +208 -326
  84. package/testeranto/bundles/pure/allTests/metafile.json +732 -3
  85. package/testeranto/bundles/pure/allTests/src/Pure.test.mjs +369 -0
  86. package/testeranto/bundles/{node/allTests/src/lib/BaseSuite.test.mjs → pure/allTests/src/lib/BaseSuite.test/pure.test.mjs} +26 -8
  87. package/testeranto/bundles/pure/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure.mjs +224 -0
  88. package/testeranto/bundles/web/allTests/chunk-FIZ3WLUB.mjs +943 -0
  89. package/testeranto/bundles/web/allTests/metafile.json +1133 -2
  90. package/testeranto/bundles/web/allTests/src/lib/BaseSuite.test/web.test.html +19 -0
  91. package/testeranto/bundles/web/allTests/src/lib/BaseSuite.test/web.test.mjs +322 -0
  92. package/testeranto/bundles/web/allTests/src/lib/baseBuilder.test/baseBuilder.test.web.html +19 -0
  93. package/testeranto/bundles/web/allTests/src/lib/baseBuilder.test/baseBuilder.test.web.mjs +10964 -0
  94. package/testeranto/index.html +1 -1
  95. package/testeranto/reports/allTests/config.json +50 -11
  96. package/testeranto/reports/allTests/index.html +1 -1
  97. package/testeranto/reports/allTests/src/Pure.test/pure/lint_errors.json +1539 -0
  98. package/testeranto/reports/allTests/src/Pure.test/pure/logs.txt +11 -0
  99. package/testeranto/reports/allTests/src/Pure.test/pure/message +1 -0
  100. package/testeranto/reports/allTests/src/Pure.test/pure/prompt.txt +8 -0
  101. package/testeranto/reports/allTests/src/{PM/__tests__/pureSidecar.testeranto/node → Pure.test/pure}/type_errors.txt +18 -14
  102. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/lint_errors.json +620 -0
  103. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/logs.txt +12 -0
  104. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/message +1 -0
  105. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/prompt.txt +8 -0
  106. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/type_errors.txt +94 -0
  107. package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/index.html +21 -0
  108. package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/lint_errors.json +620 -0
  109. package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/logs.txt +11 -0
  110. package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/message +1 -0
  111. package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/prompt.txt +8 -0
  112. package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/type_errors.txt +104 -0
  113. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/dev.html +21 -0
  114. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/index.html +21 -0
  115. package/testeranto/reports/allTests/src/lib/BaseSuite.test/{node → web.test/web}/lint_errors.json +69 -57
  116. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/logs.txt +10 -0
  117. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/message +1 -0
  118. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/prompt.txt +8 -0
  119. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/type_errors.txt +95 -0
  120. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/dev.html +21 -0
  121. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/index.html +21 -0
  122. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/lint_errors.json +966 -0
  123. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/message +1 -0
  124. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/prompt.txt +11 -0
  125. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/type_errors.txt +57 -0
  126. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/bdd_errors.txt +1 -0
  127. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/dev.html +21 -0
  128. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/index.html +21 -0
  129. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/lint_errors.json +966 -0
  130. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/log.txt +0 -0
  131. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/message +1 -0
  132. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/prompt.txt +11 -0
  133. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/tests.json +57 -0
  134. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/type_errors.txt +57 -0
  135. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/bdd_errors.txt +1 -0
  136. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/dev.html +21 -0
  137. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/index.html +21 -0
  138. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/lint_errors.json +966 -0
  139. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/log.txt +0 -0
  140. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/logs.txt +0 -0
  141. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/message +1 -0
  142. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/prompt.txt +11 -0
  143. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/tests.json +57 -0
  144. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/type_errors.txt +48 -0
  145. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/dev.html +21 -0
  146. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/index.html +21 -0
  147. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/lint_errors.json +791 -0
  148. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/logs.txt +12 -0
  149. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/message +1 -0
  150. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/prompt.txt +11 -0
  151. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/type_errors.txt +55 -0
  152. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/dev.html +21 -0
  153. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/index.html +21 -0
  154. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/lint_errors.json +416 -0
  155. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/logs.txt +17 -0
  156. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/message +1 -0
  157. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/prompt.txt +11 -0
  158. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/type_errors.txt +65 -0
  159. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/dev.html +21 -0
  160. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/index.html +21 -0
  161. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/lint_errors.json +1724 -0
  162. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/log.txt +0 -0
  163. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/logs.txt +30 -0
  164. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/message +1 -0
  165. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/prompt.txt +11 -0
  166. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/type_errors.txt +64 -0
  167. package/testeranto/reports/allTests/summary.json +59 -24
  168. package/testeranto.config.ts +37 -12
  169. package/tsc.log +273 -27
  170. package/testeranto/bundles/node/allTests/chunk-PG6KUKNP.mjs +0 -44
  171. package/testeranto/bundles/node/allTests/src/PM/__tests__/nodeSidecar.testeranto.mjs +0 -187
  172. package/testeranto/bundles/node/allTests/src/PM/__tests__/pureSidecar.testeranto.mjs +0 -156
  173. package/testeranto/bundles/node/allTests/src/PM/__tests__/webSidecar.testeranto.mjs +0 -156
  174. package/testeranto/bundles/node/allTests/src/mothership/test.mjs +0 -24411
  175. package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/index.html +0 -21
  176. package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/lint_errors.json +0 -80
  177. package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/message +0 -1
  178. package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/prompt.txt +0 -8
  179. package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/type_errors.txt +0 -28
  180. package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/index.html +0 -21
  181. package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/lint_errors.json +0 -80
  182. package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/message +0 -1
  183. package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/prompt.txt +0 -8
  184. package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/index.html +0 -21
  185. package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/lint_errors.json +0 -80
  186. package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/message +0 -1
  187. package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/prompt.txt +0 -8
  188. package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/type_errors.txt +0 -32
  189. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/console_log.txt +0 -35
  190. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/index.html +0 -21
  191. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/message +0 -1
  192. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/prompt.txt +0 -7
  193. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/type_errors.txt +0 -68
  194. package/testeranto/reports/allTests/src/mothership/test/node/index.html +0 -21
  195. package/testeranto/reports/allTests/src/mothership/test/node/lint_errors.json +0 -1
  196. package/testeranto/reports/allTests/src/mothership/test/node/message +0 -1
  197. package/testeranto/reports/allTests/src/mothership/test/node/prompt.txt +0 -8
  198. package/testeranto/reports/allTests/src/mothership/test/node/type_errors.txt +0 -24
  199. /package/testeranto/reports/allTests/src/{PM/__tests__/nodeSidecar.testeranto/node → Pure.test/pure}/dev.html +0 -0
  200. /package/testeranto/reports/allTests/src/{PM/__tests__/pureSidecar.testeranto/node/dev.html → Pure.test/pure/index.html} +0 -0
  201. /package/testeranto/reports/allTests/src/{PM/__tests__/webSidecar.testeranto → lib/BaseSuite.test/node.test}/node/dev.html +0 -0
  202. /package/testeranto/reports/allTests/src/lib/BaseSuite.test/{node/dev.html → node.test/node/index.html} +0 -0
  203. /package/testeranto/reports/allTests/src/{mothership/test/node → lib/BaseSuite.test/pure.test/pure}/dev.html +0 -0
  204. /package/testeranto/reports/allTests/src/lib/{BaseSuite.test/node/log.txt → baseBuilder.test/baseBuilder.test.node/node/logs.txt} +0 -0
@@ -0,0 +1 @@
1
+ aider --load docs/testing.prompt.txt --message-file docs/testing.message.txt
package/docs/index.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Testeranto docs and core concepts
2
2
 
3
- Testeranto's type system provides a rigorous framework for Behavior-Driven Development (BDD) testing. While powerful, the API can initially seem complex but everything you need to know can be summed up in **3 core functions and 5 essential types**. Follow these patterns, and TypeScript's type checker will guide you through the rest.
3
+ Testeranto's type system provides a rigorous framework for Behavior-Driven Development (BDD) testing. The API may seem complex but everything you need to know can be summed up in **1 function, 3 runtimes and 5 essential types, and 1 optional type**. Follow these patterns, and TypeScript's type checker will guide you through the rest.
4
4
 
5
5
  ### ⚠️ this doc is a work in progress. It is 99% accurate but needs some attention to be complete. ⚠️
6
6
 
@@ -26,7 +26,21 @@ class Rectangle {
26
26
  }
27
27
  ```
28
28
 
29
- ### Testeranto's 3 functions
29
+ ### Testeranto's 1 function
30
+
31
+ Testeranto has 1 function. This function launches and runs the tests. It is here that all 5 types converge and if you can type this function call correctly, the TS type system should guide you through the rest.
32
+
33
+ ```ts
34
+ async <I extends Ibdd_in_any, O extends Ibdd_out, M>(
35
+ input: I["iinput"],
36
+ testSpecification: ITestSpecification<I, O>,
37
+ testImplementation: ITestImplementation<I, O, M>,
38
+ testInterface: Partial<ITestInterface<I>>,
39
+ testResourceRequirement: ITTestResourceRequest = defaultTestResourceRequirement
40
+ ): Promise<Testeranto<I, O, M>>
41
+ ```
42
+
43
+ ### Testeranto's 3 runtimes
30
44
 
31
45
  For each of testeranto's runtime, there is a specific Testeranto main function. Each is it's own import but all 3 are called in the same way.
32
46
 
@@ -36,6 +50,10 @@ For each of testeranto's runtime, there is a specific Testeranto main function.
36
50
  import Testeranto from "testeranto/src/Node"; // <- import the Node main function
37
51
  // below this point, all runtimes are identical!
38
52
 
53
+ import { implementation } from "./Rectangle.test.implementation";
54
+ import { specification } from "./Rectangle.test.specification";
55
+ import { interface } from "./Rectangle.test.interface";
56
+
39
57
  // Note the type parameters I, O, and M: these will be important later
40
58
  export default Testeranto<
41
59
  I extends Ibdd_in,
@@ -95,32 +113,9 @@ export default Testeranto<
95
113
  );
96
114
  ```
97
115
 
98
- ### Testeranto's 5 Essential Types
99
-
100
- Every testeranto test is built around these 5 types that form a complete testing pipeline:
101
-
102
- 1. **ITestSpecification** - The "what" of your tests (business requirements)
103
- 2. **ITestImplementation** - The "how" of your tests (concrete operations)
104
- 3. **ITestInterface** - The "glue" between specs and implementation
105
- 4. **Ibdd_in** - Defines the internal test flow shape
106
- 5. **Ibdd_out** - Defines the external test interface
107
-
108
- ```mermaid
109
- flowchart LR
110
- S[ITestSpecification] -->|defines| O[Ibdd_out]
111
- I[ITestImplementation] -->|uses| O
112
- I -->|uses| M[Modifier]
113
- T[ITestInterface] -->|connects| N[Ibdd_in]
114
- S -->|flows through| N
115
- I -->|flows through| N
116
-
117
- style S fill:#2aa198,stroke:#073642
118
- style I fill:#859900,stroke:#073642
119
- style T fill:#b58900,stroke:#073642
120
- style O fill:#d33682,stroke:#073642
121
- style N fill:#cb4b16,stroke:#073642
122
- style M fill:#6c71c4,stroke:#073642
123
- ```
116
+ ### Testeranto's 5 essential types
117
+
118
+ Every testeranto test is built around these 5 types that form a complete testing pipeline.
124
119
 
125
120
  #### The Specification (ITestSpecification)
126
121
 
@@ -130,7 +125,6 @@ The Specification defines the business requirements in plain language, completel
130
125
  - Human-readable test descriptions
131
126
  - Defines test suites, scenarios (Given/When/Then)
132
127
  - Maps directly to BDD concepts
133
- - Uses Ibdd_out for type safety
134
128
 
135
129
  ```typescript
136
130
  import {
@@ -243,10 +237,9 @@ export const implementation: ITestImplementation<
243
237
 
244
238
  #### The Interface aka ITestInterface
245
239
 
246
- The test interface is code which is NOT BDD . The interface adapts your test subject so that the BDD hooks can be applied. The interface implements the traditional BDD steps "before all", "after all", "before each", "after each", etc
240
+ The test interface is code which is NOT business logic. The interface adapts your test subject so that the BDD hooks can be applied. The interface implements the traditional BDD steps "before all", "after all", "before each", "after each", etc
247
241
 
248
242
  ```ts
249
-
250
243
  import {
251
244
  Ibdd_in,
252
245
  ITestInterface,
@@ -275,7 +268,7 @@ export const testInterface: ITestInterface<
275
268
 
276
269
  #### type I aka Ibdd_in
277
270
 
278
- this type describes the "inner" shape of your BDD tests.
271
+ This type describes the "inner" shape of your BDD tests. Over the course of the execution of the test, the subject will change shapes- this test describe those changes.
279
272
 
280
273
  ```ts
281
274
  import { Ibdd_in } from "testeranto/src/CoreTypes";
@@ -294,7 +287,7 @@ export type I = Ibdd_in<
294
287
 
295
288
  #### type O aka Ibdd_out
296
289
 
297
- this type describes the "outer" shape of your BDD tests.
290
+ This type describes the "outer" shape of your BDD tests. This type describes the set of legal BDD clauses.
298
291
 
299
292
  ```ts
300
293
  import { Ibdd_out } from "testeranto/src/CoreTypes";
@@ -335,6 +328,8 @@ export type O = Ibdd_out<
335
328
  >;
336
329
  ```
337
330
 
331
+ ### Testeranto's 1 optional type
332
+
338
333
  #### type M (optional)
339
334
 
340
335
  this type describes the modifications to the shape of the "specification". It can be used to make your BDD tests DRYer but is not necessary
@@ -565,3 +560,20 @@ export default Testeranto<
565
560
 
566
561
 
567
562
  ```
563
+
564
+ ## Trouble shooting
565
+
566
+ ### Double check your runtimes.
567
+
568
+ Every test has a runtime, which must defined in 2 places. Both must match.
569
+
570
+ 1. The import of the runtime
571
+ 2. The runtime defined alongside the test in testeranto.config.ts
572
+
573
+ By convention, test filenames reveal their runtime. Ex: `__tests__/yourClass.node.test`. This is ONLY a convention. It has no real bearing on the runtime.
574
+
575
+ ## Dos and Don'ts
576
+
577
+ ### Do pass your test subject to the main testeranto function.
578
+
579
+ ### Don't import your test subject elsewhere in your tests.
@@ -0,0 +1,98 @@
1
+ # Testeranto Testing Patterns
2
+
3
+ ## Key Learnings From Self-Testing
4
+
5
+ 1. Test Organization Insights:
6
+ - Mock implementations proved essential for testing abstract base classes
7
+ - Type parameters (I/O/M) need careful documentation for test writers
8
+ - Integration tests revealed subtle proxy chain issues
9
+
10
+ 2. Effective Patterns:
11
+ - Builder tests validate both construction and runtime behavior
12
+ - Proxy tests verify path rewriting and content preservation
13
+ - Error tests check both expected and unexpected cases
14
+ - Lifecycle tests cover full BDD sequence
15
+
16
+ 3. Improvement Opportunities:
17
+ - Need more test utilities for common scenarios
18
+ - Could add test generation from type definitions
19
+ - Should document common test pitfalls
20
+ - Would benefit from more example test suites
21
+
22
+ ## Core Testing Principles
23
+
24
+ 1. Tests follow BDD structure with Given/When/Then
25
+ 2. All tests are strongly typed using I/O/M types
26
+ 3. Test files are organized in a consistent structure:
27
+ /src
28
+ TEST_SUBJECT.ts
29
+ TEST_SUBJECT.test/
30
+ implementation.ts - Concrete test operations
31
+ specification.ts - Test scenarios and assertions
32
+ interface.ts - Test lifecycle hooks
33
+ types.ts - Type definitions
34
+ index.ts - Main test export
35
+
36
+ ## Key Testing Patterns Observed
37
+
38
+ 1. Builder Testing:
39
+ - TestBaseBuilder provides core test infrastructure
40
+ - TestClassBuilder extends it for class-based testing
41
+ - Both use similar test patterns:
42
+ * Initialization validation
43
+ * Spec generation checks
44
+ * Job creation verification
45
+ * Artifact tracking
46
+ * Resource requirement validation
47
+
48
+ 2. Comprehensive Test Cases:
49
+ - Basic functionality tests
50
+ - Custom input scenarios
51
+ - Resource configuration
52
+ - Dynamic modification
53
+ - Error handling
54
+ - Full test run verification
55
+
56
+ 3. Type Safety:
57
+ - Ibdd_in defines internal test flow
58
+ - Ibdd_out defines external interface
59
+ - M type for specification modifications
60
+
61
+ ## Implementation Notes
62
+
63
+ 1. Test builders follow this pattern:
64
+ - Create concrete test implementation
65
+ - Define test specification with scenarios
66
+ - Implement test interface hooks
67
+ - Export via Testeranto runner
68
+
69
+ 2. Key test assertions:
70
+ - Verify proper initialization
71
+ - Check spec generation
72
+ - Validate job creation
73
+ - Track artifacts
74
+ - Confirm resource setup
75
+
76
+ 3. Error handling:
77
+ - Explicit error type checks
78
+ - Expected error messages
79
+ - Async error propagation
80
+
81
+ ## Best Practices
82
+
83
+ 1. For each test:
84
+ - Document test purpose in specification
85
+ - Keep implementations focused
86
+ - Use descriptive type names
87
+ - Include positive and negative cases
88
+
89
+ 2. Test organization:
90
+ - Group related tests in suites
91
+ - Separate concerns in different files
92
+ - Reuse common test patterns
93
+ - Keep test files small and focused
94
+
95
+ 3. Maintenance:
96
+ - Update docs when patterns change
97
+ - Review test types when interfaces change
98
+ - Verify all test cases after refactors
@@ -0,0 +1,8 @@
1
+ /read README.md
2
+
3
+ /read docs/index.md
4
+ /read docs/testing.ai.txt
5
+
6
+ /add src/CoreTypes.ts
7
+ /add src//lib/types.ts
8
+
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "testeranto",
3
3
  "description": "the AI powered BDD test framework for typescript projects",
4
- "version": "0.140.2",
4
+ "version": "0.146.0",
5
5
  "engines": {
6
6
  "node": "18.18.0"
7
7
  },
@@ -128,8 +128,8 @@
128
128
  "build-types": "tsc -p tsconfig.types.json",
129
129
  "type-check": "yarn tsc --noEmit > tsc.log",
130
130
  "type-fix": "aider --model deepseek/deepseek-chat --load type-fix.txt",
131
- "t-build": "tsx dist/prebuild/build.mjs",
132
- "t-run": "tsx dist/prebuild/run.mjs",
131
+ "t-build": "tsx src/build.ts",
132
+ "t-run": "tsx src/run.ts",
133
133
  "t-init": "tsx dist/prebuild/init-docs.mjs",
134
134
  "t-report": "tsx dist/prebuild/ReportServer.mjs",
135
135
  "build-docs": "node scripts/compile-docs.js"
package/src/Node.ts CHANGED
@@ -16,6 +16,8 @@ import {
16
16
 
17
17
  let ipcfile;
18
18
 
19
+ console.log("mark4");
20
+
19
21
  export class NodeTesteranto<
20
22
  I extends Ibdd_in_any,
21
23
  O extends Ibdd_out_any,
@@ -41,6 +43,7 @@ export class NodeTesteranto<
41
43
  }
42
44
 
43
45
  async receiveTestResourceConfig(partialTestResource: string) {
46
+ console.log("receiveTestResourceConfig", partialTestResource);
44
47
  const t: ITTestResourceConfiguration = JSON.parse(partialTestResource);
45
48
  const pm = new PM_Node(t, ipcfile);
46
49
  return await this.testJobs[0].receiveTestResourceConfig(pm);
@@ -58,21 +61,22 @@ const testeranto = async <I extends Ibdd_in_any, O extends Ibdd_out, M>(
58
61
  testInterface: Partial<INodeTestInterface<I>>,
59
62
  testResourceRequirement: ITTestResourceRequest = defaultTestResourceRequirement
60
63
  ): Promise<Testeranto<I, O, M>> => {
61
- const t = new NodeTesteranto<I, O, M>(
62
- input,
63
- testSpecification,
64
- testImplementation,
65
- testResourceRequirement,
66
- testInterface
67
- );
64
+ try {
65
+ const t = new NodeTesteranto<I, O, M>(
66
+ input,
67
+ testSpecification,
68
+ testImplementation,
69
+ testResourceRequirement,
70
+ testInterface
71
+ );
72
+ console.log("args", process.argv);
68
73
 
69
- process.on("unhandledRejection", (reason, promise) => {
70
- console.error("Unhandled Rejection at:", promise, "reason:", reason);
71
- // Optionally, terminate the process or perform cleanup
72
- // t.registerUncaughtPromise(reason, promise);
73
- });
74
+ process.on("unhandledRejection", (reason, promise) => {
75
+ console.error("Unhandled Rejection at:", promise, "reason:", reason);
76
+ // Optionally, terminate the process or perform cleanup
77
+ // t.registerUncaughtPromise(reason, promise);
78
+ });
74
79
 
75
- try {
76
80
  ipcfile = process.argv[3];
77
81
  const f = await t.receiveTestResourceConfig(process.argv[2]);
78
82
 
@@ -30,23 +30,13 @@ export abstract class PM_WithEslintAndTsc extends PM_Base {
30
30
 
31
31
  this.name = name;
32
32
  this.mode = mode;
33
+ this.summary = {};
33
34
 
35
+ // Initialize all test entries first
34
36
  this.configs.tests.forEach(([t, rt, tr, sidecars]) => {
35
- this.summary[t] = {
36
- runTimeError: "?",
37
- typeErrors: "?",
38
- staticErrors: "?",
39
- prompt: "?",
40
- failingFeatures: {},
41
- };
42
- sidecars.forEach(([t]) => {
43
- this.summary[t] = {
44
- // runTimeError: "?",
45
- typeErrors: "?",
46
- staticErrors: "?",
47
- // prompt: "?",
48
- // failingFeatures: {},
49
- };
37
+ this.ensureSummaryEntry(t);
38
+ sidecars.forEach(([sidecarName]) => {
39
+ this.ensureSummaryEntry(sidecarName, true);
50
40
  });
51
41
  });
52
42
  }
@@ -61,7 +51,15 @@ export abstract class PM_WithEslintAndTsc extends PM_Base {
61
51
  addableFiles: string[];
62
52
  }) => {
63
53
  console.log(ansiC.green(ansiC.inverse(`tsc < ${entrypoint}`)));
64
- this.typeCheckIsRunning(entrypoint);
54
+ try {
55
+ this.typeCheckIsRunning(entrypoint);
56
+ } catch (e) {
57
+ console.error("error in tscCheck");
58
+ console.error(e);
59
+ console.error(entrypoint);
60
+ console.error(JSON.stringify(this.summary, null, 2));
61
+ process.exit(-1);
62
+ }
65
63
 
66
64
  const program = tsc.createProgramFromConfig({
67
65
  basePath: process.cwd(), // always required, used for relative paths
@@ -104,7 +102,6 @@ export abstract class PM_WithEslintAndTsc extends PM_Base {
104
102
  });
105
103
 
106
104
  fs.writeFileSync(tscPath, results.join("\n"));
107
-
108
105
  this.typeCheckIsNowDone(entrypoint, results.length);
109
106
  };
110
107
 
@@ -114,7 +111,16 @@ export abstract class PM_WithEslintAndTsc extends PM_Base {
114
111
  addableFiles: string[]
115
112
  ) => {
116
113
  console.log(ansiC.green(ansiC.inverse(`eslint < ${entrypoint}`)));
117
- this.lintIsRunning(entrypoint);
114
+
115
+ try {
116
+ this.lintIsRunning(entrypoint);
117
+ } catch (e) {
118
+ console.error("error in eslintCheck");
119
+ console.error(e);
120
+ console.error(entrypoint);
121
+ console.error(JSON.stringify(this.summary, null, 2));
122
+ process.exit(-1);
123
+ }
118
124
 
119
125
  const results = (await eslint.lintFiles(addableFiles))
120
126
  .filter((r) => r.messages.length)
@@ -165,7 +171,7 @@ export abstract class PM_WithEslintAndTsc extends PM_Base {
165
171
  this.name,
166
172
  entryPoint.split(".").slice(0, -1).join("."),
167
173
  platform,
168
- `console_log.txt`
174
+ `logs.txt`
169
175
  );
170
176
 
171
177
  const lintPath = path.join(
@@ -227,34 +233,89 @@ ${addableFiles
227
233
  this.checkForShutdown();
228
234
  };
229
235
 
236
+ private ensureSummaryEntry(src: string, isSidecar = false) {
237
+ if (!this.summary[src]) {
238
+ this.summary[src] = {
239
+ typeErrors: undefined,
240
+ staticErrors: undefined,
241
+ runTimeErrors: undefined,
242
+ prompt: undefined,
243
+ failingFeatures: {},
244
+ };
245
+ if (isSidecar) {
246
+ // Sidecars don't need all fields
247
+ // delete this.summary[src].runTimeError;
248
+ // delete this.summary[src].prompt;
249
+ }
250
+ }
251
+ return this.summary[src];
252
+ }
253
+
230
254
  typeCheckIsRunning = (src: string) => {
255
+ if (!this.summary[src]) {
256
+ throw `this.summary[${src}] is undefined`;
257
+ }
258
+
231
259
  this.summary[src].typeErrors = "?";
232
260
  };
233
261
 
234
262
  typeCheckIsNowDone = (src: string, failures: number) => {
263
+ if (!this.summary[src]) {
264
+ throw `this.summary[${src}] is undefined`;
265
+ }
266
+
267
+ if (failures === 0) {
268
+ console.log(ansiC.green(ansiC.inverse(`tsc > ${src}`)));
269
+ } else {
270
+ console.log(
271
+ ansiC.red(ansiC.inverse(`tsc > ${src} failed ${failures} times`))
272
+ );
273
+ }
274
+
235
275
  this.summary[src].typeErrors = failures;
236
276
  this.writeBigBoard();
237
277
  this.checkForShutdown();
238
278
  };
239
279
 
240
280
  lintIsRunning = (src: string) => {
281
+ if (!this.summary[src]) {
282
+ throw `this.summary[${src}] is undefined`;
283
+ }
241
284
  this.summary[src].staticErrors = "?";
242
285
  this.writeBigBoard();
243
286
  };
244
287
 
245
288
  lintIsNowDone = (src: string, failures: number) => {
289
+ if (!this.summary[src]) {
290
+ throw `this.summary[${src}] is undefined`;
291
+ }
292
+
293
+ if (failures === 0) {
294
+ console.log(ansiC.green(ansiC.inverse(`eslint > ${src}`)));
295
+ } else {
296
+ console.log(
297
+ ansiC.red(ansiC.inverse(`eslint > ${src} failed ${failures} times`))
298
+ );
299
+ }
300
+
246
301
  this.summary[src].staticErrors = failures;
247
302
  this.writeBigBoard();
248
303
  this.checkForShutdown();
249
304
  };
250
305
 
251
306
  bddTestIsRunning = (src: string) => {
252
- this.summary[src].runTimeError = "?";
307
+ if (!this.summary[src]) {
308
+ throw `this.summary[${src}] is undefined`;
309
+ }
310
+ this.summary[src].runTimeErrors = "?";
253
311
  this.writeBigBoard();
254
312
  };
255
313
 
256
314
  bddTestIsNowDone = (src: string, failures: number) => {
257
- this.summary[src].runTimeError = failures;
315
+ if (!this.summary[src]) {
316
+ throw `this.summary[${src}] is undefined`;
317
+ }
318
+ this.summary[src].runTimeErrors = failures;
258
319
  this.writeBigBoard();
259
320
  this.checkForShutdown();
260
321
  };
@@ -266,50 +327,5 @@ ${addableFiles
266
327
  );
267
328
  };
268
329
 
269
- checkForShutdown = () => {
270
- console.log(ansiC.inverse(`checkForShutdown`));
271
-
272
- this.writeBigBoard();
273
-
274
- if (this.mode === "dev") return;
275
-
276
- let inflight = false;
277
-
278
- Object.keys(this.summary).forEach((k) => {
279
- if (this.summary[k].prompt === "?") {
280
- console.log(ansiC.blue(ansiC.inverse(`🕕 prompt ${k}`)));
281
- inflight = true;
282
- }
283
- });
284
-
285
- Object.keys(this.summary).forEach((k) => {
286
- if (this.summary[k].runTimeError === "?") {
287
- console.log(ansiC.blue(ansiC.inverse(`🕕 runTimeError ${k}`)));
288
- inflight = true;
289
- }
290
- });
291
-
292
- Object.keys(this.summary).forEach((k) => {
293
- if (this.summary[k].staticErrors === "?") {
294
- console.log(ansiC.blue(ansiC.inverse(`🕕 staticErrors ${k}`)));
295
- inflight = true;
296
- }
297
- });
298
-
299
- Object.keys(this.summary).forEach((k) => {
300
- if (this.summary[k].typeErrors === "?") {
301
- console.log(ansiC.blue(ansiC.inverse(`🕕 typeErrors ${k}`)));
302
- inflight = true;
303
- }
304
- });
305
-
306
- this.writeBigBoard();
307
-
308
- if (!inflight) {
309
- this.browser.disconnect().then(() => {
310
- console.log(ansiC.inverse(`${this.name} has been tested. Goodbye.`));
311
- process.exit();
312
- });
313
- }
314
- };
330
+ abstract checkForShutdown();
315
331
  }