testeranto 0.135.0 → 0.140.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/.aider.chat.history.md +13976 -0
  2. package/.aider.input.history +530 -0
  3. package/.aider.tags.cache.v3/{d8/b0/a8966fcd65890fd9f70d7afe8141.val → bd/91/b71f967fd074cf4b757081b429b7.val} +0 -0
  4. package/.aider.tags.cache.v3/cache.db +0 -0
  5. package/.aider.tags.cache.v3/{8e/ec/2d4659a1589a0187a757ab1cbefa.val → fb/96/b0f91c7e75e08fc5a6907633cf99.val} +0 -0
  6. package/README.md +28 -135
  7. package/bundle.js +1 -1
  8. package/dist/common/src/Init.js +4 -1
  9. package/dist/common/src/Node.js +1 -1
  10. package/dist/common/src/PM/__tests__/nodeSidecar.testeranto.js +2 -2
  11. package/dist/common/src/Web.js +2 -2
  12. package/dist/common/src/build.js +7 -73
  13. package/dist/common/src/defaultConfig.js +0 -1
  14. package/dist/common/src/lib/abstractBase.js +2 -0
  15. package/dist/common/src/lib/basebuilder.js +4 -0
  16. package/dist/common/src/lib/core.js +2 -0
  17. package/dist/common/src/run.js +1 -1
  18. package/dist/common/src/utils/buildTemplates.js +88 -0
  19. package/dist/common/tsconfig.common.tsbuildinfo +1 -1
  20. package/dist/module/src/Init.js +4 -1
  21. package/dist/module/src/Node.js +1 -1
  22. package/dist/module/src/PM/__tests__/nodeSidecar.testeranto.js +2 -2
  23. package/dist/module/src/Project.js +41 -47
  24. package/dist/module/src/TestReport.js +34 -31
  25. package/dist/module/src/Web.js +2 -2
  26. package/dist/module/src/build.js +7 -73
  27. package/dist/module/src/defaultConfig.js +0 -1
  28. package/dist/module/src/lib/abstractBase.js +2 -0
  29. package/dist/module/src/lib/basebuilder.js +4 -0
  30. package/dist/module/src/lib/core.js +2 -0
  31. package/dist/module/src/run.js +1 -1
  32. package/dist/module/src/utils/buildTemplates.js +82 -0
  33. package/dist/module/tsconfig.module.tsbuildinfo +1 -1
  34. package/dist/prebuild/Project.js +62 -13
  35. package/dist/prebuild/TestReport.js +39 -18
  36. package/dist/prebuild/build.mjs +96 -73
  37. package/dist/prebuild/init-docs.mjs +0 -4
  38. package/dist/tsconfig.tsbuildinfo +1 -0
  39. package/dist/types/src/CoreTypes.d.ts +5 -3
  40. package/dist/types/src/Node.d.ts +3 -3
  41. package/dist/types/src/PM/__tests__/nodeSidecar.testeranto.d.ts +17 -1
  42. package/dist/types/src/PM/__tests__/pureSidecar.testeranto.d.ts +17 -1
  43. package/dist/types/src/PM/__tests__/webSidecar.testeranto.d.ts +17 -1
  44. package/dist/types/src/PM/nodeSidecar.d.ts +2 -2
  45. package/dist/types/src/Pure.d.ts +3 -3
  46. package/dist/types/src/Types.d.ts +18 -14
  47. package/dist/types/src/Web.d.ts +3 -3
  48. package/dist/types/src/lib/abstractBase.d.ts +8 -8
  49. package/dist/types/src/lib/basebuilder.d.ts +3 -3
  50. package/dist/types/src/lib/classBuilder.d.ts +2 -2
  51. package/dist/types/src/lib/core.d.ts +2 -2
  52. package/dist/types/src/lib/index.d.ts +7 -6
  53. package/dist/types/src/lib/types.d.ts +8 -8
  54. package/dist/types/src/mothership/test.d.ts +20 -1
  55. package/dist/types/src/utils/buildTemplates.d.ts +3 -0
  56. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  57. package/docs/index.md +344 -54
  58. package/docs/style.md +116 -0
  59. package/docs.html +537 -0
  60. package/example.css +351 -0
  61. package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-Black.ttf +0 -0
  62. package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-Bold.ttf +0 -0
  63. package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-ExtraBold.ttf +0 -0
  64. package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-Light.ttf +0 -0
  65. package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-Medium.ttf +0 -0
  66. package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-Regular.ttf +0 -0
  67. package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-Thin.ttf +0 -0
  68. package/fonts/M_PLUS_Rounded_1c/OFL.txt +91 -0
  69. package/index.html +245 -24
  70. package/logo.svg +72 -0
  71. package/package.json +6 -2
  72. package/scripts/compile-docs.js +89 -0
  73. package/src/CoreTypes.ts +24 -43
  74. package/src/Init.ts +4 -4
  75. package/src/Node.ts +6 -20
  76. package/src/PM/__tests__/nodeSidecar.testeranto.ts +13 -20
  77. package/src/PM/__tests__/pureSidecar.testeranto.ts +8 -15
  78. package/src/PM/__tests__/webSidecar.testeranto.ts +8 -15
  79. package/src/PM/nodeSidecar.ts +2 -2
  80. package/src/PM/pure.ts +0 -4
  81. package/src/Project.tsx +289 -292
  82. package/src/Pure.ts +13 -14
  83. package/src/PureSidecar.ts +1 -0
  84. package/src/TestReport.tsx +179 -165
  85. package/src/Types.ts +29 -144
  86. package/src/Web.ts +15 -11
  87. package/src/build.ts +22 -73
  88. package/src/defaultConfig.ts +2 -1
  89. package/src/lib/BaseSuite.test.ts +457 -0
  90. package/src/lib/BaseSuite.ts +155 -0
  91. package/src/lib/abstractBase.ts +7 -162
  92. package/src/lib/basebuilder.ts +11 -11
  93. package/src/lib/classBuilder.ts +8 -3
  94. package/src/lib/core.ts +12 -12
  95. package/src/lib/index.ts +21 -24
  96. package/src/lib/types.ts +23 -9
  97. package/src/mothership/test.ts +13 -10
  98. package/src/run.ts +1 -1
  99. package/src/style.css +1 -1
  100. package/src/utils/buildTemplates.ts +88 -0
  101. package/style.css +496 -0
  102. package/testeranto/bundles/node/{mothership/chunk-V2EQEXU2.mjs → allTests/chunk-4PJCC2XT.mjs} +66 -59
  103. package/testeranto/bundles/node/allTests/metafile.json +4151 -0
  104. package/testeranto/bundles/node/allTests/src/PM/__tests__/nodeSidecar.testeranto.mjs +187 -0
  105. package/testeranto/bundles/node/{mothership → allTests}/src/PM/__tests__/pureSidecar.testeranto.mjs +1 -1
  106. package/testeranto/bundles/node/{mothership → allTests}/src/PM/__tests__/webSidecar.testeranto.mjs +1 -1
  107. package/testeranto/bundles/node/allTests/src/lib/BaseSuite.test.mjs +305 -0
  108. package/testeranto/bundles/node/{mothership → allTests}/src/mothership/test.mjs +1 -1
  109. package/testeranto/dev.html +29 -0
  110. package/testeranto/index.html +28 -27
  111. package/testeranto/reports/allTests/config.json +57 -0
  112. package/testeranto/reports/{mothership/index.html → allTests/dev.html} +2 -0
  113. package/testeranto/reports/allTests/index.html +26 -0
  114. package/testeranto/reports/{mothership/src/PM/__tests__/sidecar.testeranto/node/index.html → allTests/src/PM/__tests__/nodeSidecar.testeranto/node/dev.html} +4 -3
  115. package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/index.html +21 -0
  116. package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/lint_errors.json +80 -0
  117. package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/message +1 -0
  118. package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/prompt.txt +8 -0
  119. package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/type_errors.txt +28 -0
  120. package/testeranto/reports/{mothership/src/PM/__tests__/webSidecar.testeranto/node/index.html → allTests/src/PM/__tests__/pureSidecar.testeranto/node/dev.html} +4 -3
  121. package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/index.html +21 -0
  122. package/testeranto/reports/{mothership → allTests}/src/PM/__tests__/pureSidecar.testeranto/node/lint_errors.json +12 -12
  123. package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/message +1 -0
  124. package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/prompt.txt +8 -0
  125. package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/type_errors.txt +32 -0
  126. package/testeranto/reports/{mothership/src/PM/__tests__/nodeSidecar.testeranto/node/index.html → allTests/src/PM/__tests__/webSidecar.testeranto/node/dev.html} +4 -3
  127. package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/index.html +21 -0
  128. package/testeranto/reports/{mothership → allTests}/src/PM/__tests__/webSidecar.testeranto/node/lint_errors.json +12 -12
  129. package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/message +1 -0
  130. package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/prompt.txt +8 -0
  131. package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/type_errors.txt +32 -0
  132. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/console_log.txt +35 -0
  133. package/testeranto/reports/{mothership/src/PM/__tests__/pureSidecar.testeranto/node/index.html → allTests/src/lib/BaseSuite.test/node/dev.html} +4 -3
  134. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/index.html +21 -0
  135. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/lint_errors.json +608 -0
  136. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/message +1 -0
  137. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/prompt.txt +7 -0
  138. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/type_errors.txt +68 -0
  139. package/testeranto/reports/allTests/src/mothership/test/node/dev.html +21 -0
  140. package/testeranto/reports/allTests/src/mothership/test/node/index.html +21 -0
  141. package/testeranto/reports/allTests/src/mothership/test/node/message +1 -0
  142. package/testeranto/reports/allTests/src/mothership/test/node/prompt.txt +8 -0
  143. package/testeranto/reports/allTests/src/mothership/test/node/type_errors.txt +24 -0
  144. package/testeranto/reports/allTests/summary.json +37 -0
  145. package/testeranto.config.ts +16 -26
  146. package/tsc.log +66 -69
  147. package/dist/common/src/SP__Polygon.test.js +0 -10
  148. package/dist/module/src/ReportClient.js +0 -132
  149. package/dist/module/src/SP__Polygon.test.js +0 -8
  150. package/dist/prebuild/ReportClient.js +0 -3
  151. package/dist/types/src/SP__Polygon.test.d.ts +0 -1
  152. package/src/ReportClient.tsx +0 -164
  153. package/src/SP__Polygon.test.ts +0 -13
  154. package/testeranto/ReportClient.css +0 -11367
  155. package/testeranto/ReportClient.js +0 -24641
  156. package/testeranto/bundles/node/mothership/metafile.json +0 -389
  157. package/testeranto/bundles/node/mothership/src/PM/__tests__/nodeSidecar.testeranto.mjs +0 -1219
  158. package/testeranto/bundles/node/mothership/src/PM/__tests__/sidecar.testeranto.mjs +0 -1199
  159. package/testeranto/reports/mothership/config.json +0 -25
  160. package/testeranto/reports/mothership/src/PM/__tests__/nodeSidecar.testeranto/node/console_log.txt +0 -0
  161. package/testeranto/reports/mothership/src/PM/__tests__/nodeSidecar.testeranto/node/lint_errors.json +0 -1564
  162. package/testeranto/reports/mothership/src/PM/__tests__/nodeSidecar.testeranto/node/prompt.txt +0 -22
  163. package/testeranto/reports/mothership/src/PM/__tests__/nodeSidecar.testeranto/node/type_errors.txt +0 -35
  164. package/testeranto/reports/mothership/src/PM/__tests__/pureSidecar.testeranto/node/prompt.txt +0 -12
  165. package/testeranto/reports/mothership/src/PM/__tests__/pureSidecar.testeranto/node/type_errors.txt +0 -26
  166. package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/bdd_errors.txt +0 -1
  167. package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/console_log.txt +0 -0
  168. package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/lint_errors.json +0 -1564
  169. package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/log.txt +0 -0
  170. package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/prompt.txt +0 -22
  171. package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/tests.json +0 -56
  172. package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/type_errors.txt +0 -29
  173. package/testeranto/reports/mothership/src/PM/__tests__/webSidecar.testeranto/node/prompt.txt +0 -12
  174. package/testeranto/reports/mothership/src/PM/__tests__/webSidecar.testeranto/node/type_errors.txt +0 -26
  175. package/testeranto/reports/mothership/src/mothership/test/node/bdd_errors.txt +0 -1
  176. package/testeranto/reports/mothership/src/mothership/test/node/console_log.txt +0 -4
  177. package/testeranto/reports/mothership/src/mothership/test/node/index.html +0 -20
  178. package/testeranto/reports/mothership/src/mothership/test/node/log.txt +0 -0
  179. package/testeranto/reports/mothership/src/mothership/test/node/prompt.txt +0 -12
  180. package/testeranto/reports/mothership/src/mothership/test/node/tests.json +0 -24
  181. package/testeranto/reports/mothership/src/mothership/test/node/type_errors.txt +0 -18
  182. package/testeranto/reports/mothership/summary.json +0 -9
  183. /package/testeranto/bundles/node/{mothership → allTests}/chunk-PG6KUKNP.mjs +0 -0
  184. /package/testeranto/bundles/pure/{mothership → allTests}/metafile.json +0 -0
  185. /package/testeranto/bundles/web/{mothership → allTests}/metafile.json +0 -0
  186. /package/testeranto/reports/{mothership/src/PM/__tests__/nodeSidecar.testeranto → allTests/src/lib/BaseSuite.test}/node/log.txt +0 -0
  187. /package/testeranto/reports/{mothership → allTests}/src/mothership/test/node/lint_errors.json +0 -0
package/index.html CHANGED
@@ -1,30 +1,251 @@
1
+
1
2
  <!DOCTYPE html>
2
3
  <html lang="en">
3
-
4
4
  <head>
5
- <meta name="description" content="Webpage description goes here" />
6
- <meta charset="utf-8" />
7
- <title>kokomoBay - testeranto</title>
8
- <meta name="viewport" content="width=device-width, initial-scale=1" />
9
- <meta name="author" content="" />
10
-
11
- <link rel="stylesheet" href="/dist/testeranto.css" />
12
- <script src="/dist/testeranto.js"></script>
13
-
14
- <script type="importmap">
15
- {
16
- "imports": {
17
- "tests.test.js": "./tests.test.js",
18
- "features.test.js": "./features.test.js"
19
- }
20
- }
21
- </script>
22
- </head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>README.md</title>
8
+
9
+ <!-- Prism.js CSS -->
10
+ <link href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-tomorrow.min.css" rel="stylesheet" />
11
+ <link href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/line-numbers/prism-line-numbers.min.css" rel="stylesheet" />
23
12
 
13
+ <!-- load style AFTER prism -->
14
+ <link rel="stylesheet" href="style.css">
15
+
16
+
17
+ </head>
24
18
  <body>
25
- <div id="root">
26
- react is loading
27
- </div>
28
- </body>
19
+ <div class="parallax-background"></div>
20
+ <div id="container">
21
+ <h1>testeranto</h1>
22
+ <h2>The AI-powered BDD test framework for TypeScript projects</h2>
23
+ <h4>🚧 WARNING: Testeranto is still under development and is not ready for production yet. 🚧</h4>
24
+ <ul>
25
+ <li>demo video: <a href="https://www.youtube.com/embed/WvU5xMqGi6Q">youtube</a></li>
26
+ <li>source: <a href="https://github.com/adamwong246/testeranto">github.com/adamwong246/testeranto</a></li>
27
+ <li>npm: <a href="https://www.npmjs.com/package/testeranto">npmjs.com/package/testeranto</a></li>
28
+ <li>dev: <a href="https://github.dev/adamwong246/testeranto">github.dev/adamwong246/testeranto</a></li>
29
+ <li>example repo: <a href="https://github.com/adamwong246/testeranto-starter">testeranto-starter</a></li>
30
+ </ul>
31
+ <h2>What is testeranto?</h2>
32
+ <ul>
33
+ <li>Testeranto produces test results which can be fed to Aider.ai to automatically fix failing tests.</li>
34
+ <li>Testeranto tests are specified in a strongly-typed gherkin-like syntax. Rather than testing your code directly, Testeranto requires you wrap your code with a semantic interface which is based on TS type signatures.</li>
35
+ <li>Testeranto can run tests in the frontend or the backend, or both.</li>
36
+ <li>Testeranto can be used to test anything that can be bundled with esbuild.</li>
37
+ <li>Testeranto connects &quot;features&quot; to &quot;tests&quot;. This allows the AI to read feature documentation from external systems, like Jira.</li>
38
+ <li>Testeranto generates test results into static a website which can be deployed to github pages easily.</li>
39
+ <li>Testeranto uses esbuild to bundle it&#39;s tests. The result is used to refine the list of files added to the context of the AI. <strong>The consequence of this is that you can fit all relevant files, and ONLY the relevant files, into the LLMs context.</strong></li>
40
+ </ul>
41
+ <h2>Key Technologies</h2>
42
+ <table>
43
+ <thead>
44
+ <tr>
45
+ <th></th>
46
+ <th></th>
47
+ </tr>
48
+ </thead>
49
+ <tbody><tr>
50
+ <td>ESM</td>
51
+ <td>Modern javascript tooling</td>
52
+ </tr>
53
+ <tr>
54
+ <td>TypeScript</td>
55
+ <td>Strongly-typed test definitions</td>
56
+ </tr>
57
+ <tr>
58
+ <td>Puppeteer</td>
59
+ <td>Cross-runtime testing (Node &amp; Browser)</td>
60
+ </tr>
61
+ <tr>
62
+ <td>esbuild</td>
63
+ <td>Fast test bundling</td>
64
+ </tr>
65
+ <tr>
66
+ <td>Aider.ai</td>
67
+ <td>AI-powered test fixing</td>
68
+ </tr>
69
+ <tr>
70
+ <td>ESLint</td>
71
+ <td>Static analysis of test files</td>
72
+ </tr>
73
+ <tr>
74
+ <td>tsc</td>
75
+ <td>Type checking of test files</td>
76
+ </tr>
77
+ <tr>
78
+ <td>Markdown</td>
79
+ <td>Feature documentation format</td>
80
+ </tr>
81
+ </tbody></table>
82
+ <h2>Quick Start</h2>
83
+ <ol>
84
+ <li>Install testeranto:</li>
85
+ </ol>
86
+ <pre>npm install testeranto</pre><ol start="2">
87
+ <li>Create a test file (e.g., <code>rectangle.test.ts</code>):</li>
88
+ </ol>
89
+ <pre class="language-typescript line-numbers"><code class="language-typescript">import { Given, When, Then } from "testeranto";
90
+
91
+ type Rectangle = { width: number; height: number };
92
+
93
+ const RectangleSpec = (Suite, Given, When, Then) => [
94
+ Suite.Default("Rectangle tests", {
95
+ test1: Given.Default(
96
+ ["Basic rectangle operations"],
97
+ [When.setWidth(5), When.setHeight(10)],
98
+ [Then.getWidth(5), Then.getHeight(10)]
99
+ ),
100
+ }),
101
+ ];</code></pre><ol start="3">
102
+ <li>Run the tests</li>
103
+ </ol>
104
+ <p>To start testeranto in dev mode, build your tests in one terminal and execute them in another</p>
105
+ <pre># Terminal 1 - Build in watch mode
106
+ yarn t-build rectangle.test.ts yourProject dev
107
+
108
+ # Terminal 2 - Run in watch mode
109
+ yarn t-run rectangle.test.ts yourProject dev</pre><p>or build and run your tests only once</p>
110
+ <pre>yarn t-build rectangle.test.ts yourProject once && yarn t-run rectangle.test.ts yourProject once</pre><h2>Runtime Platforms</h2>
111
+ <table>
112
+ <thead>
113
+ <tr>
114
+ <th></th>
115
+ <th>Runs on</th>
116
+ <th>You should use this runtime for...</th>
117
+ <th>Important differences</th>
118
+ </tr>
119
+ </thead>
120
+ <tbody><tr>
121
+ <td><strong>Node</strong></td>
122
+ <td>node V8 with fork</td>
123
+ <td>testing backend code, Node APIs (like <code>fs</code> and <code>crypto</code>), or anything needing filesystem access</td>
124
+ <td>has access to the filesystem and io</td>
125
+ </tr>
126
+ <tr>
127
+ <td><strong>Web</strong></td>
128
+ <td>chrome browser</td>
129
+ <td>testing frontend code, anything that uses <code>document</code> or <code>window</code>, UI interactions, or visual regression</td>
130
+ <td>can take screenshots/recordings</td>
131
+ </tr>
132
+ <tr>
133
+ <td><strong>Pure</strong></td>
134
+ <td>node v8, dynamically imported</td>
135
+ <td>testing code which can run on both node-v8 and the the browser</td>
136
+ <td>Very similar to &quot;Node&quot; but has no IO access and thus, no console.log. This runtime is theoretically faster.</td>
137
+ </tr>
138
+ </tbody></table>
139
+ <h2>CLI Commands</h2>
140
+ <table>
141
+ <thead>
142
+ <tr>
143
+ <th></th>
144
+ <th></th>
145
+ </tr>
146
+ </thead>
147
+ <tbody><tr>
148
+ <td><code>yarn t-init</code></td>
149
+ <td>Create a new testeranto project</td>
150
+ </tr>
151
+ <tr>
152
+ <td><code>yarn t-build &lt;YOUR_TESTS&gt; dev|once</code></td>
153
+ <td>Build test bundles (watch or single-run mode)</td>
154
+ </tr>
155
+ <tr>
156
+ <td><code>yarn t-run &lt;YOUR_TESTS&gt; dev|once</code></td>
157
+ <td>Run tests (watch or single-run mode)</td>
158
+ </tr>
159
+ <tr>
160
+ <td><code>yarn t-report</code></td>
161
+ <td>Launch test report server</td>
162
+ </tr>
163
+ <tr>
164
+ <td><code>yarn t-aider</code></td>
165
+ <td>Fix failing tests with AI</td>
166
+ </tr>
167
+ </tbody></table>
168
+ <h2>Example workflow:</h2>
169
+ <pre># Initialize project
170
+ yarn t-init
171
+
172
+ # Write tests in test/*.test.ts
173
+
174
+ # In terminal 1 - Build tests (watch mode)
175
+ yarn t-build test/rectangle.test.ts dev
29
176
 
30
- </html>
177
+ # In terminal 2 - Run tests (watch mode)
178
+ yarn t-run test/rectangle.test.ts dev
179
+
180
+ # Or for single-run mode:
181
+ yarn t-build test/rectangle.test.ts once
182
+ yarn t-run test/rectangle.test.ts once
183
+
184
+ # Get AI help with failures
185
+ yarn t-aider</pre><h2>Aider</h2>
186
+ <p>Testeranto generates a &quot;prompt&quot; alongside test results. This prompt is passed to aider as input.</p>
187
+ <pre>// input src files which can be edited by aider
188
+ /add test/node.ts
189
+
190
+ // test report files that inform aider but should not be edited
191
+ /read testeranto/reports/allTests/node/test/node/tests.json
192
+ /read testeranto/reports/allTests/test/node/node/lint_errors.json
193
+ /read testeranto/reports/allTests/test/node/node/type_errors.txt
194
+
195
+ // A list of features which can inform aider.
196
+ /load testeranto/reports/allTests/node/test/node/featurePrompt.txt
197
+
198
+ // tell the AI what to do
199
+ Fix the failing tests described in testeranto/reports/allTests/node/test/node/tests.json. Correct any type signature errors described in the files testeranto/reports/allTests/test/node/node/type_errors.txt. Implement any method which throws "Function not implemented. Resolve the lint errors described in testeranto/reports/allTests/test/node/node/lint_errors.json"</pre><h2>&quot;Features&quot;</h2>
200
+ <p>Testeranto connects &quot;features&quot; to tests. The features may be simple strings, but they can also take the form of local markdown files, or remote URLs to external feature tracking systems. For instance, this could be a jira ticket or a github issue. These features are used to inform the AI context.</p>
201
+ <pre class="language-typescript line-numbers"><code class="language-typescript">import someMarkdownFile from "someMarkdownFile.md";
202
+
203
+ ...
204
+
205
+ test0: Given.Default(
206
+ [
207
+ "https://api.github.com/repos/adamwong246/testeranto/issues/8",
208
+ "you can set the width and height of a Rectangle",
209
+ someMarkdownFile
210
+ ],
211
+
212
+ [When.setWidth(4), When.setHeight(19)],
213
+ [Then.getWidth(4), Then.getHeight(19)]
214
+ ),
215
+ ...
216
+ </code></pre><h2>Sidecars (COMING SOON)</h2>
217
+ <p>Along side your test, you can include a number of &quot;sidecars&quot; which are other bundled javascript assets upon which your test depends. For example, suppose you have an app with a frontend and backend component. You could run a react test in the web and include the node http server as a sidecar.</p>
218
+ <h2><code>eslint</code> and <code>tsc</code></h2>
219
+ <p>Alongside the bdd tests, testeranto runs eslint and tsc upon the input files to generate a list of static analysis errors and a list of type errors, respectively.</p>
220
+ <h2>Subprojects</h2>
221
+ <p>Testeranto has a core repo, but there are also subprojects which implement tests by type and by technology</p>
222
+ <h3>testeranto-solidity</h3>
223
+ <p>Test a solidity contract. Also included is an example of deploying a contrct to a ganache server.</p>
224
+ <h3>testeranto-reduxtoolkit</h3>
225
+ <p>Test a redux store.</p>
226
+ <h3>testeranto-http</h3>
227
+ <p>Test a node http server.</p>
228
+ <h3>testeranto-react (COMING SOON)</h3>
229
+ <p>Test a react component. You can choose from a variety of types (jsx functions, class style, etc) and you can test with <code>react</code>, <code>react-dom</code>, or <code>react-test-renderer</code></p>
230
+ <h3>testeranto-express (COMING SOON)</h3>
231
+ <h3>testeranto-xstate (COMING SOON)</h3>
232
+
233
+ </div>
234
+ <!-- Prism.js JS -->
235
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/prism.min.js"></script>
236
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-typescript.min.js"></script>
237
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
238
+ <script>
239
+ document.addEventListener('DOMContentLoaded', function() {
240
+ Prism.highlightAll();
241
+
242
+ // Parallax effect
243
+ const parallaxBg = document.querySelector('.parallax-background');
244
+ window.addEventListener('scroll', function() {
245
+ const scrollPosition = window.pageYOffset;
246
+ parallaxBg.style.transform = 'translateY(scrollPosition)';
247
+ });
248
+ });
249
+ </script>
250
+ </body>
251
+ </html>
package/logo.svg ADDED
@@ -0,0 +1,72 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 300" width="300" height="300">
2
+ <defs>
3
+ <linearGradient id="gradient1" x1="0%" y1="0%" x2="100%" y2="100%">
4
+ <stop offset="0%" stop-color="#FF6B6B" />
5
+ <stop offset="100%" stop-color="#7FB3D5" />
6
+ </linearGradient>
7
+ <linearGradient id="gradient2" x1="0%" y1="0%" x2="100%" y2="100%">
8
+ <stop offset="0%" stop-color="#4ECDC4" />
9
+ <stop offset="100%" stop-color="#00B4A0" />
10
+ </linearGradient>
11
+ </defs>
12
+
13
+ <!-- Playful background shape -->
14
+ <path d="M50,50 Q150,20 250,50 Q280,150 250,250 Q150,280 50,250 Q20,150 50,50 Z"
15
+ fill="url(#gradient1)" stroke="#FF6B6B" stroke-width="4" />
16
+
17
+ <!-- Robot mascot head -->
18
+ <circle cx="150" cy="125" r="40" fill="#7FB3D5" stroke="#292F36" stroke-width="3" />
19
+
20
+ <!-- Robot eyes -->
21
+ <circle cx="130" cy="115" r="8" fill="#292F36" />
22
+ <circle cx="170" cy="115" r="8" fill="#292F36" />
23
+
24
+ <!-- Robot mouth (smile) -->
25
+ <path d="M130,135 Q150,155 170,135" fill="none" stroke="#292F36" stroke-width="3"
26
+ stroke-linecap="round" />
27
+
28
+ <!-- BDD elements orbiting face center (150,125) -->
29
+ <g>
30
+
31
+ <!-- First ball + label -->
32
+ <g xmlns="http://www.w3.org/2000/svg">
33
+
34
+ <circle cx="212" cy="125" r="15" fill="#E6B422" />
35
+
36
+ <text x="212" y="130" text-anchor="middle" fill="#292F36" font-family="monospace"
37
+ font-size="9" font-weight="bold">GIVEN</text>
38
+ <animateTransform attributeName="transform" type="rotate" from="0 150 125" to="360 150
39
+ 125" dur="10s" repeatCount="indefinite" />
40
+ </g>
41
+
42
+ <!-- Second ball + label -->
43
+ <g xmlns="http://www.w3.org/2000/svg">
44
+
45
+ <circle cx="126" cy="181.6" r="15" fill="#FF6B6B" />
46
+
47
+ <text x="126" y="186.6" text-anchor="middle" fill="#292F36" font-family="monospace"
48
+ font-size="10" font-weight="bold">WHEN</text>
49
+ <animateTransform attributeName="transform" type="rotate" from="0 150 125" to="360 150
50
+ 125" dur="10s" repeatCount="indefinite"/>
51
+ </g>
52
+
53
+ <!-- Third ball + label -->
54
+ <g xmlns="http://www.w3.org/2000/svg">
55
+ <circle cx="120" cy="71.4" r="15" fill="#4ECDC4"/>
56
+ <text x="120" y="75.4" text-anchor="middle" fill="#0A0F1F" font-family="monospace"
57
+ font-size="10" font-weight="bold">THEN</text>
58
+ <animateTransform attributeName="transform" type="rotate" from="0 150 125" to="360 150
59
+ 125" dur="10s" repeatCount="indefinite"/>
60
+ </g>
61
+ </g>
62
+
63
+ <!-- Higher title position with more padding -->
64
+ <g>
65
+ <path id="titlePath" d="M50,220 Q150,250 250,220" fill="none" />
66
+ <text font-family="monospace" font-size="33" font-weight="bold" fill="#1D3557">
67
+ <textPath href="#titlePath" startOffset="50%" text-anchor="middle" fill="#292F36">TESTERANTO</textPath>
68
+ </text>
69
+
70
+ </g>
71
+
72
+ </svg>
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.135.0",
4
+ "version": "0.140.0",
5
5
  "engines": {
6
6
  "node": "18.18.0"
7
7
  },
@@ -131,7 +131,8 @@
131
131
  "t-build": "tsx dist/prebuild/build.mjs",
132
132
  "t-run": "tsx dist/prebuild/run.mjs",
133
133
  "t-init": "tsx dist/prebuild/init-docs.mjs",
134
- "t-report": "tsx dist/prebuild/ReportServer.mjs"
134
+ "t-report": "tsx dist/prebuild/ReportServer.mjs",
135
+ "build-docs": "node scripts/compile-docs.js"
135
136
  },
136
137
  "peerDependencies": {
137
138
  "@types/react": "18.2.0",
@@ -157,6 +158,7 @@
157
158
  "@types/ws": "^8.5.10",
158
159
  "@typescript-eslint/eslint-plugin": "^5.46.0",
159
160
  "@typescript-eslint/parser": "^5.46.0",
161
+ "marked": "^12.0.2",
160
162
  "testeranto-solidity": "latest",
161
163
  "testeranto_with_reduxjs_toolkit": "latest",
162
164
  "ts-node": "^10.9.1",
@@ -192,6 +194,8 @@
192
194
  "is-path-inside": "^4.0.0",
193
195
  "iterm-tab": "^0.4.0",
194
196
  "live-server": "^1.2.2",
197
+ "mermaid": "^11.8.1",
198
+ "mermaid-isomorphic": "^3.0.4",
195
199
  "node-static": "^0.7.11",
196
200
  "octokit": "^4.1.2",
197
201
  "puppeteer": "^24.4.0",
@@ -0,0 +1,89 @@
1
+ import fs from "fs";
2
+ import path from "path";
3
+ import { marked } from "marked";
4
+
5
+ marked.use({
6
+ renderer: {
7
+ code: function (code, lang) {
8
+ if (lang == "mermaid") return `<pre class="mermaid">${code}</pre>`;
9
+ if (lang == "typescript")
10
+ return `<pre class="language-typescript line-numbers"><code class="language-typescript">${code}</code></pre>`;
11
+ return `<pre>${code}</pre>`;
12
+ },
13
+ },
14
+ });
15
+
16
+ // Simple HTML template with our CSS
17
+ const template = (title, content) => `
18
+ <!DOCTYPE html>
19
+ <html lang="en">
20
+ <head>
21
+ <meta charset="UTF-8">
22
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
23
+ <title>${title}</title>
24
+
25
+ <!-- Prism.js CSS -->
26
+ <link href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-tomorrow.min.css" rel="stylesheet" />
27
+ <link href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/line-numbers/prism-line-numbers.min.css" rel="stylesheet" />
28
+
29
+ <!-- load style AFTER prism -->
30
+ <link rel="stylesheet" href="style.css">
31
+
32
+
33
+ </head>
34
+ <body>
35
+ <div class="parallax-background"></div>
36
+ <div id="container">
37
+ ${content.replace(/<p>⚠️(.*?)<\/p>/g, '<div class="warning">$1</div>')}
38
+ </div>
39
+ <!-- Prism.js JS -->
40
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/prism.min.js"></script>
41
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-typescript.min.js"></script>
42
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
43
+ <script>
44
+ document.addEventListener('DOMContentLoaded', function() {
45
+ Prism.highlightAll();
46
+
47
+ // Parallax effect
48
+ const parallaxBg = document.querySelector('.parallax-background');
49
+ window.addEventListener('scroll', function() {
50
+ const scrollPosition = window.pageYOffset;
51
+ parallaxBg.style.transform = 'translateY(scrollPosition)';
52
+ });
53
+ });
54
+ </script>
55
+ </body>
56
+ </html>
57
+ `;
58
+
59
+ // Process markdown files
60
+ const processFile = (filePath) => {
61
+ const markdown = fs.readFileSync(filePath, "utf8");
62
+ return template(path.basename(filePath), marked.parse(markdown));
63
+ };
64
+
65
+ // Main function
66
+ const main = () => {
67
+ try {
68
+ // Create docs-output directory if it doesn't exist
69
+ const outDir = "./";
70
+ if (!fs.existsSync(outDir)) {
71
+ fs.mkdirSync(outDir);
72
+ }
73
+
74
+ // Process README.md -> documentation.html
75
+ const readmeHtml = processFile("README.md");
76
+ fs.writeFileSync(path.join(outDir, "index.html"), readmeHtml);
77
+ console.log("Generated: index.html");
78
+
79
+ // Process docs/index.md -> api-reference.html
80
+ const docsHtml = processFile("docs/index.md");
81
+ fs.writeFileSync(path.join(outDir, "docs.html"), docsHtml);
82
+ console.log("Generated: docs.html");
83
+ } catch (err) {
84
+ console.error("Error compiling docs:", err);
85
+ process.exit(1);
86
+ }
87
+ };
88
+
89
+ main();
package/src/CoreTypes.ts CHANGED
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
1
2
  import { ITTestResourceConfiguration } from "./lib";
2
3
 
3
4
  import { IPM, ITestCheckCallback } from "./lib/types";
@@ -21,17 +22,7 @@ import {
21
22
 
22
23
  /////////////////////////////////////////////////////////////////////////////////////////
23
24
 
24
- export type ITestInterface<
25
- I extends Ibdd_in<
26
- unknown,
27
- unknown,
28
- unknown,
29
- unknown,
30
- unknown,
31
- unknown,
32
- unknown
33
- >
34
- > = {
25
+ export type ITestInterface<I extends Ibdd_in_any> = {
35
26
  assertThis: (x: I["then"]) => any;
36
27
  andWhen: (
37
28
  store: I["istore"],
@@ -64,22 +55,8 @@ export type ITestInterface<
64
55
  /////////////////////////////////////////////////////////////////////////////////////////
65
56
 
66
57
  export type ITestSpecification<
67
- I extends Ibdd_in<
68
- unknown,
69
- unknown,
70
- unknown,
71
- unknown,
72
- unknown,
73
- unknown,
74
- unknown
75
- >,
76
- O extends Ibdd_out<
77
- TestSuiteShape,
78
- TestGivenShape,
79
- TestWhenShape,
80
- TestThenShape,
81
- TestCheckShape
82
- >
58
+ I extends Ibdd_in_any,
59
+ O extends Ibdd_out_any
83
60
  > = (
84
61
  Suite: SuiteSpecification<I, O>,
85
62
  Given: GivenSpecification<I, O>,
@@ -91,22 +68,8 @@ export type ITestSpecification<
91
68
  /////////////////////////////////////////////////////////////////////////////////////////
92
69
 
93
70
  export type ITestImplementation<
94
- I extends Ibdd_in<
95
- unknown,
96
- unknown,
97
- unknown,
98
- unknown,
99
- unknown,
100
- unknown,
101
- unknown
102
- >,
103
- O extends Ibdd_out<
104
- TestSuiteShape,
105
- TestGivenShape,
106
- TestWhenShape,
107
- TestThenShape,
108
- TestCheckShape
109
- >,
71
+ I extends Ibdd_in_any,
72
+ O extends Ibdd_out_any,
110
73
  modifier = {
111
74
  whens: TestWhenImplementation<I, O>;
112
75
  }
@@ -137,6 +100,14 @@ export type Ibdd_out<
137
100
  checks: IChecks;
138
101
  };
139
102
 
103
+ export type Ibdd_out_any = Ibdd_out<
104
+ TestSuiteShape,
105
+ TestGivenShape,
106
+ TestWhenShape,
107
+ TestThenShape,
108
+ TestCheckShape
109
+ >;
110
+
140
111
  /////////////////////////////////////////////////////////////////////////////////////////
141
112
 
142
113
  export type Ibdd_in<
@@ -169,3 +140,13 @@ export type Ibdd_in<
169
140
  /** Function type for Then steps */
170
141
  then: IThen;
171
142
  };
143
+
144
+ export type Ibdd_in_any = Ibdd_in<
145
+ unknown,
146
+ unknown,
147
+ unknown,
148
+ unknown,
149
+ unknown,
150
+ unknown,
151
+ unknown
152
+ >;
package/src/Init.ts CHANGED
@@ -25,10 +25,10 @@ export default async () => {
25
25
  `testeranto/Project.js`
26
26
  );
27
27
 
28
- fs.copyFileSync(
29
- `node_modules/testeranto/dist/prebuild/ReportClient.js`,
30
- `testeranto/ReportClient.js`
31
- );
28
+ // fs.copyFileSync(
29
+ // `node_modules/testeranto/dist/prebuild/ReportClient.js`,
30
+ // `testeranto/ReportClient.js`
31
+ // );
32
32
 
33
33
  fs.copyFileSync(
34
34
  `node_modules/testeranto/dist/prebuild/Project.css`,
package/src/Node.ts CHANGED
@@ -4,35 +4,21 @@ import {
4
4
  ITTestResourceConfiguration,
5
5
  ITTestResourceRequest,
6
6
  } from "./lib/index.js";
7
- import type {} from // INodeTestInterface,
8
- // IT,
9
- // ITestImplementation,
10
- // ITestInterface,
11
- // ITestSpecification,
12
- // OT,
13
- "./Types.js";
14
7
  import { PM_Node } from "./PM/node.js";
15
8
  import {
16
9
  ITestSpecification,
17
10
  ITestImplementation,
18
11
  ITestInterface,
19
- Ibdd_in,
12
+ Ibdd_in_any,
13
+ Ibdd_out_any,
20
14
  Ibdd_out,
21
15
  } from "./CoreTypes.js";
22
16
 
23
17
  let ipcfile;
24
18
 
25
19
  export class NodeTesteranto<
26
- I extends Ibdd_in<
27
- unknown,
28
- unknown,
29
- unknown,
30
- unknown,
31
- unknown,
32
- unknown,
33
- unknown
34
- >,
35
- O extends Ibdd_out,
20
+ I extends Ibdd_in_any,
21
+ O extends Ibdd_out_any,
36
22
  M
37
23
  > extends Testeranto<I, O, M> {
38
24
  constructor(
@@ -65,7 +51,7 @@ export class NodeTesteranto<
65
51
  }
66
52
  }
67
53
 
68
- const testeranto = async <I extends IT, O extends OT, M>(
54
+ const testeranto = async <I extends Ibdd_in_any, O extends Ibdd_out, M>(
69
55
  input: I["iinput"],
70
56
  testSpecification: ITestSpecification<I, O>,
71
57
  testImplementation: ITestImplementation<I, O, M>,
@@ -108,7 +94,7 @@ const testeranto = async <I extends IT, O extends OT, M>(
108
94
  // });
109
95
  }
110
96
 
111
- return t;
97
+ // return t;
112
98
  };
113
99
 
114
100
  export default testeranto;