testeranto 0.135.0 → 0.140.1

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 +29 -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 +246 -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/README.md CHANGED
@@ -2,33 +2,30 @@
2
2
 
3
3
  ## The AI-powered BDD test framework for TypeScript projects
4
4
 
5
- 🚧 WARNING: Testeranto is still under development and is not ready for production yet. 🚧
5
+ #### 🚧 WARNING: Testeranto is still under development and is not ready for production yet. 🚧
6
6
 
7
- demo video: [youtube](https://www.youtube.com/embed/WvU5xMqGi6Q)
8
-
9
- source: [github.com/adamwong246/testeranto](https://github.com/adamwong246/testeranto)
10
-
11
- npm: [npmjs.com/package/testeranto](https://www.npmjs.com/package/testeranto)
12
-
13
- dev: [github.dev/adamwong246/testeranto](https://github.dev/adamwong246/testeranto)
14
-
15
- example repo: [testeranto-starter](https://github.com/adamwong246/testeranto-starter)
7
+ - README: [index.html]: [](https://adamwong246.github.io/testeranto/)
8
+ - demo: [youtube](https://www.youtube.com/embed/WvU5xMqGi6Q)
9
+ - source: [github.com/adamwong246/testeranto](https://github.com/adamwong246/testeranto)
10
+ - npm: [npmjs.com/package/testeranto](https://www.npmjs.com/package/testeranto)
11
+ - dev: [github.dev/adamwong246/testeranto](https://github.dev/adamwong246/testeranto)
12
+ - example repo: [testeranto-starter](https://github.com/adamwong246/testeranto-starter)
16
13
 
17
14
  ## What is testeranto?
18
15
 
19
16
  - Testeranto produces test results which can be fed to Aider.ai to automatically fix failing tests.
20
17
  - 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.
21
- - Testeranto can be run in the frontend or the backend, or both.
18
+ - Testeranto can run tests in the frontend or the backend, or both.
22
19
  - Testeranto can be used to test anything that can be bundled with esbuild.
23
20
  - Testeranto connects "features" to "tests". This allows the AI to read feature documentation from external systems, like Jira.
24
21
  - Testeranto generates test results into static a website which can be deployed to github pages easily.
22
+ - Testeranto uses esbuild to bundle it's tests. The result is used to refine the list of files added to the context of the AI. **The consequence of this is that you can fit all relevant files, and ONLY the relevant files, into the LLMs context.**
25
23
 
26
24
  ## Key Technologies
27
25
 
28
- Testeranto builds on modern JavaScript/TypeScript tooling:
29
-
30
- | Technology | Purpose |
26
+ | | |
31
27
  | ---------- | -------------------------------------- |
28
+ | ESM | Modern javascript tooling |
32
29
  | TypeScript | Strongly-typed test definitions |
33
30
  | Puppeteer | Cross-runtime testing (Node & Browser) |
34
31
  | esbuild | Fast test bundling |
@@ -63,138 +60,35 @@ const RectangleSpec = (Suite, Given, When, Then) => [
63
60
  ];
64
61
  ```
65
62
 
66
- 3. Run your tests in two separate terminals:
63
+ 3. Run the tests
64
+
65
+ To start testeranto in dev mode, build your tests in one terminal and execute them in another
67
66
 
68
67
  ```bash
69
68
  # Terminal 1 - Build in watch mode
70
- yarn t-build rectangle.test.ts dev
69
+ yarn t-build rectangle.test.ts yourProject dev
71
70
 
72
71
  # Terminal 2 - Run in watch mode
73
- yarn t-run rectangle.test.ts dev
72
+ yarn t-run rectangle.test.ts yourProject dev
74
73
  ```
75
74
 
76
- ### Development Workflow
77
-
78
- ```mermaid
79
-
80
- flowchart LR
81
-
82
- subgraph hh["humans"]
83
- direction LR
84
- Human[🧑💻 ]
85
- end
86
-
87
- subgraph bb["AI"]
88
- direction LR
89
- Bot[🤖🧠 aider]
90
- end
91
-
92
-
93
- tests ---> L
94
- subgraph tests
95
- direction LR
96
- A[Test Specification]
97
- B[Test Interface]
98
- C[Test Implementation]
99
- K[application code]
100
- end
101
-
102
- subgraph buildSystem
103
- direction TB
104
- L["t-build"]
105
- M[t-run]
106
- L ---> M
75
+ or build and run your tests only once
107
76
 
108
- M ---> N
109
- M --->O
110
- M --->P
111
- N["BDD tests"]
112
- O["Static analysis"]
113
- P["Type checking"]
114
-
115
- Q["reports"]
116
- N ---> Q
117
- O ---> Q
118
- P ---> Q
119
- end
120
-
121
- Q ---> bb
122
-
123
- buildSystem ---> bb
124
- bb ---> tests
125
- hh ---> tests
126
-
127
- %% Styling
128
- style Human fill:#268bd2,stroke:#586e75,color:#fdf6e3
129
- style Bot fill:#d33682,stroke:#586e75,color:#fdf6e3
130
-
131
- %% Layout tweaks
132
- classDef column margin-right:20px
133
-
134
- ```
135
-
136
- ## Architecture Overview
137
-
138
- ```mermaid
139
- flowchart TD
140
- subgraph ThreePillars["Testeranto Core"]
141
- Builder[Test Builder]
142
- Runner[Test Runner]
143
- Aider[AI Integration]
144
- end
145
-
146
- subgraph BuilderComponents[" "]
147
- Specification[Specification]
148
- Implementation[Implementation]
149
- Interface[Interface]
150
- end
151
-
152
- subgraph Runtimes[" "]
153
- Node[Node]
154
- Web[Browser]
155
- Pure[JS]
156
- end
157
-
158
- Builder --> Runner
159
- Runner --> Aider
160
- Aider --> Builder
161
-
162
- Builder --> BuilderComponents
163
- Runner --> Runtimes
164
-
165
- style ThreePillars fill:none,stroke:#586e75
166
- style Builder fill:#268bd2,stroke:#586e75,color:#fdf6e3
167
- style Runner fill:#268bd2,stroke:#586e75,color:#fdf6e3
168
- style Aider fill:#b58900,stroke:#586e75,color:#002b36
169
- style BuilderComponents fill:#002b36,stroke:#586e75,color:#eee8d5
170
- style Runtimes fill:#073642,stroke:#586e75,color:#eee8d5
171
- style Specification fill:#2aa198,stroke:#586e75,color:#002b36
172
- style Implementation fill:#2aa198,stroke:#586e75,color:#002b36
173
- style Interface fill:#2aa198,stroke:#586e75,color:#002b36
174
- style Node fill:#859900,stroke:#586e75,color:#002b36
175
- style Web fill:#859900,stroke:#586e75,color:#002b36
176
- style Pure fill:#859900,stroke:#586e75,color:#002b36
77
+ ```bash
78
+ yarn t-build rectangle.test.ts yourProject once && yarn t-run rectangle.test.ts yourProject once
177
79
  ```
178
80
 
179
81
  ## Runtime Platforms
180
82
 
181
- Testeranto runs tests in multiple runtime environments, each suited for different testing scenarios:
182
-
183
- | Runtime | Description | When To Use | Key Characteristics |
184
- | -------- | ------------------------------------------------- | ---------------------------------------------------------------------- | ------------------------------------------------------- |
185
- | **Node** | Full IO access with Node.js built-in modules | Testing backend code, Node APIs, or anything needing filesystem access | Runs in Node v8 via fork, has access to fs, crypto, etc |
186
- | **Web** | DOM API access with browser capabilities | Testing frontend code, UI interactions, or visual regression | Runs in Chrome page, can take screenshots/recordings |
187
- | **Pure** | Isolated JS runtime without external dependencies | Fast unit tests that don't need external resources | Dynamically imported into main thread, no IO access |
188
-
189
- **Key Considerations:**
190
-
191
- - Use **Node** for testing backend services, file operations, or anything requiring Node.js APIs
192
- - Use **Web** when testing browser-specific code that references `document` or `window`
193
- - Use **Pure** for fast, isolated unit tests where you don't need console output or external resources
83
+ | | Runs on | You should use this runtime for... | Important differences |
84
+ | -------- | ----------------------------- | ------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
85
+ | **Node** | node V8 with fork | testing backend code, Node APIs (like `fs` and `crypto`), or anything needing filesystem access | has access to the filesystem and io |
86
+ | **Web** | chrome browser | testing frontend code, anything that uses `document` or `window`, UI interactions, or visual regression | can take screenshots/recordings |
87
+ | **Pure** | node v8, dynamically imported | testing code which can run on both node-v8 and the the browser | Very similar to "Node" but has no IO access and thus, no console.log. This runtime is theoretically faster. |
194
88
 
195
89
  ## CLI Commands
196
90
 
197
- | Command | Description |
91
+ | | |
198
92
  | ------------------------------------- | --------------------------------------------- |
199
93
  | `yarn t-init` | Create a new testeranto project |
200
94
  | `yarn t-build <YOUR_TESTS> dev\|once` | Build test bundles (watch or single-run mode) |
@@ -202,7 +96,7 @@ Testeranto runs tests in multiple runtime environments, each suited for differen
202
96
  | `yarn t-report` | Launch test report server |
203
97
  | `yarn t-aider` | Fix failing tests with AI |
204
98
 
205
- Example workflow:
99
+ ## Example workflow:
206
100
 
207
101
  ```bash
208
102
  # Initialize project
@@ -224,7 +118,7 @@ yarn t-run test/rectangle.test.ts once
224
118
  yarn t-aider
225
119
  ```
226
120
 
227
- ## AI
121
+ ## Aider
228
122
 
229
123
  Testeranto generates a "prompt" alongside test results. This prompt is passed to aider as input.
230
124
 
@@ -241,14 +135,14 @@ Testeranto generates a "prompt" alongside test results. This prompt is passed to
241
135
  /load testeranto/reports/allTests/node/test/node/featurePrompt.txt
242
136
 
243
137
  // tell the AI what to do
244
- /code 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"
138
+ 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"
245
139
  ```
246
140
 
247
141
  ## "Features"
248
142
 
249
143
  Testeranto connects "features" 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.
250
144
 
251
- ```ts
145
+ ```typescript
252
146
  import someMarkdownFile from "someMarkdownFile.md";
253
147
 
254
148
  ...
package/bundle.js CHANGED
@@ -25,7 +25,7 @@ await esbuild.build({
25
25
  })
26
26
 
27
27
  await esbuild.build({
28
- entryPoints: ['src/ReportClient.tsx', 'src/TestReport.tsx', 'src/Project.tsx'],
28
+ entryPoints: ['src/TestReport.tsx', 'src/Project.tsx'],
29
29
  bundle: true,
30
30
  format: "iife",
31
31
  platform: "browser",
@@ -25,7 +25,10 @@ exports.default = async () => {
25
25
  }
26
26
  });
27
27
  fs_1.default.copyFileSync(`node_modules/testeranto/dist/prebuild/Project.js`, `testeranto/Project.js`);
28
- fs_1.default.copyFileSync(`node_modules/testeranto/dist/prebuild/ReportClient.js`, `testeranto/ReportClient.js`);
28
+ // fs.copyFileSync(
29
+ // `node_modules/testeranto/dist/prebuild/ReportClient.js`,
30
+ // `testeranto/ReportClient.js`
31
+ // );
29
32
  fs_1.default.copyFileSync(`node_modules/testeranto/dist/prebuild/Project.css`, `testeranto/Project.css`);
30
33
  // fs.copyFileSync(
31
34
  // `node_modules/testeranto/dist/prebuild/ReportClient.css`,
@@ -51,6 +51,6 @@ const testeranto = async (input, testSpecification, testImplementation, testInte
51
51
  // });
52
52
  // });
53
53
  }
54
- return t;
54
+ // return t;
55
55
  };
56
56
  exports.default = testeranto;
@@ -41,7 +41,7 @@ const implementation = {
41
41
  return mockProcess;
42
42
  },
43
43
  addListener: () => mockProcess,
44
- removeListener: () => mockProcess
44
+ removeListener: () => mockProcess,
45
45
  };
46
46
  process = mockProcess;
47
47
  let writeCalled = false;
@@ -63,7 +63,7 @@ const implementation = {
63
63
  removeListener: () => {
64
64
  removeListenerCalled = true;
65
65
  return mockProcess;
66
- }
66
+ },
67
67
  };
68
68
  process = mockProcess;
69
69
  await sidecar.send("test-command", "test");
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ /* eslint-disable @typescript-eslint/no-unused-vars */
3
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
4
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
5
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
6
  };
@@ -10,8 +12,6 @@ const index_js_1 = require("./lib/index.js");
10
12
  let errorCallback = (e) => { };
11
13
  let unhandledrejectionCallback = (event) => {
12
14
  console.log("window.addEventListener unhandledrejection", event);
13
- // cb({ error: event.reason.message });
14
- // throw event;
15
15
  };
16
16
  class WebTesteranto extends core_js_1.default {
17
17
  constructor(input, testSpecification, testImplementation, testResourceRequirement, testInterface) {
@@ -48,6 +48,7 @@ const web_js_1 = __importDefault(require("./esbuildConfigs/web.js"));
48
48
  const pure_js_1 = __importDefault(require("./esbuildConfigs/pure.js"));
49
49
  const web_html_js_1 = __importDefault(require("./web.html.js"));
50
50
  const utils_js_1 = require("./utils.js");
51
+ const buildTemplates_js_1 = require("./utils/buildTemplates.js");
51
52
  readline_1.default.emitKeypressEvents(process.stdin);
52
53
  if (process.stdin.isTTY)
53
54
  process.stdin.setRawMode(true);
@@ -144,60 +145,11 @@ Promise.resolve(`${process.cwd() + "/" + "testeranto.config.ts"}`).then(s => __i
144
145
  if (!fs_1.default.existsSync(`testeranto/reports/${testName}`)) {
145
146
  fs_1.default.mkdirSync(`testeranto/reports/${testName}`);
146
147
  }
147
- fs_1.default.writeFileSync(`${process.cwd()}/testeranto/reports/${testName}/index.html`, `
148
- <!DOCTYPE html>
149
- <html lang="en">
150
-
151
- <head>
152
- <meta name="description" content="Webpage description goes here" />
153
- <meta charset="utf-8" />
154
- <title>${pckge.name} - testeranto</title>
155
- <meta name="viewport" content="width=device-width, initial-scale=1" />
156
- <meta name="author" content="" />
157
-
158
- <link rel="stylesheet" href="../ReportClient.css" />
159
- <script type="module" src="../ReportClient.js"></script>
160
-
161
- </head>
162
-
163
- <body>
164
- <div id="root">
165
- react is loading
166
- </div>
167
- </body>
168
-
169
- </html>
170
- `);
148
+ fs_1.default.writeFileSync(`${process.cwd()}/testeranto/reports/${testName}/index.html`, (0, buildTemplates_js_1.testReportPage)(pckge.name, bigConfig.reportDomain));
149
+ fs_1.default.writeFileSync(`${process.cwd()}/testeranto/reports/${testName}/dev.html`, (0, buildTemplates_js_1.testReportPage)(pckge.name, "/"));
171
150
  fs_1.default.writeFileSync(`testeranto/reports/${testName}/config.json`, JSON.stringify(config, null, 2));
172
- fs_1.default.writeFileSync(`${process.cwd()}/testeranto/index.html`, `
173
- <!DOCTYPE html>
174
- <html lang="en">
175
-
176
- <head>
177
- <meta name="description" content="Webpage description goes here" />
178
- <meta charset="utf-8" />
179
- <title>${pckge.name} - testeranto</title>
180
- <meta name="viewport" content="width=device-width, initial-scale=1" />
181
- <meta name="author" content="" />
182
- <base href="https://adamwong246.github.io/spacetrash_v8" target="_blank">
183
-
184
- <script type="application/json" id="bigConfig">
185
- ${JSON.stringify(Object.keys(bigConfig.projects))}
186
- </script>
187
-
188
- <link rel="stylesheet" href="/reports/Project.css" />
189
- <script type="module" src="/reports/Project.js"></script>
190
-
191
- </head>
192
-
193
- <body>
194
- <div id="root">
195
- react is loading
196
- </div>
197
- </body>
198
-
199
- </html>
200
- `);
151
+ fs_1.default.writeFileSync(`${process.cwd()}/testeranto/index.html`, (0, buildTemplates_js_1.testsReportPage)(pckge.name, bigConfig.reportDomain, bigConfig.projects));
152
+ fs_1.default.writeFileSync(`${process.cwd()}/testeranto/dev.html`, (0, buildTemplates_js_1.testsReportPage)(pckge.name, "/", bigConfig.projects));
201
153
  Promise.resolve(Promise.all([...getSecondaryEndpointsPoints("web")].map(async (sourceFilePath) => {
202
154
  const sourceFileSplit = sourceFilePath.split("/");
203
155
  const sourceDir = sourceFileSplit.slice(0, -1);
@@ -244,26 +196,8 @@ Promise.resolve(`${process.cwd() + "/" + "testeranto.config.ts"}`).then(s => __i
244
196
  .slice(0, -1)
245
197
  .join(".")}/${runtime}`;
246
198
  await fs_1.default.mkdirSync(folder, { recursive: true });
247
- fs_1.default.writeFileSync(`${folder}/index.html`, `
248
- <!DOCTYPE html>
249
- <html lang="en">
250
-
251
- <head>
252
- <meta name="description" content="Webpage description goes here" />
253
- <meta charset="utf-8" />
254
- <title>${testName} - testeranto</title>
255
- <meta name="viewport" content="width=device-width, initial-scale=1" />
256
- <meta name="author" content="" />
257
-
258
- <link rel="stylesheet" href="../../../../../../TestReport.css" />
259
- <script src="../../../../../../TestReport.js"></script>
260
-
261
- </head>
262
-
263
- <body>
264
- <div id="root"/>
265
- </body>
266
- `);
199
+ fs_1.default.writeFileSync(`${folder}/index.html`, (0, buildTemplates_js_1.idkPage)(testName, bigConfig.reportDomain));
200
+ fs_1.default.writeFileSync(`${folder}/dev.html`, (0, buildTemplates_js_1.idkPage)(testName, ""));
267
201
  });
268
202
  });
269
203
  [
@@ -11,7 +11,6 @@ const config = {
11
11
  nodePlugins: [],
12
12
  webPlugins: [],
13
13
  importPlugins: [],
14
- externalTests: {},
15
14
  featureIngestor: function (s) {
16
15
  throw new Error("Function not implemented.");
17
16
  },
@@ -1,4 +1,6 @@
1
1
  "use strict";
2
+ /* eslint-disable @typescript-eslint/no-unused-vars */
3
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
4
  Object.defineProperty(exports, "__esModule", { value: true });
3
5
  exports.BaseCheck = exports.BaseThen = exports.BaseWhen = exports.BaseGiven = exports.BaseSuite = void 0;
4
6
  const pmProxy_js_1 = require("./pmProxy.js");
@@ -1,4 +1,8 @@
1
1
  "use strict";
2
+ /* eslint-disable @typescript-eslint/no-unused-vars */
3
+ /* eslint-disable @typescript-eslint/no-empty-object-type */
4
+ /* eslint-disable no-async-promise-executor */
5
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
6
  Object.defineProperty(exports, "__esModule", { value: true });
3
7
  exports.BaseBuilder = void 0;
4
8
  class BaseBuilder {
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ /* eslint-disable @typescript-eslint/no-unused-vars */
4
+ /* eslint-disable @typescript-eslint/no-explicit-any */
3
5
  const index_js_1 = require("./index.js");
4
6
  const abstractBase_js_1 = require("./abstractBase.js");
5
7
  const classBuilder_js_1 = require("./classBuilder.js");
@@ -49,7 +49,7 @@ process.stdin.on("keypress", (str, key) => {
49
49
  process.exit(-1);
50
50
  }
51
51
  });
52
- let testName = process.argv[2];
52
+ const testName = process.argv[2];
53
53
  const mode = process.argv[3];
54
54
  if (mode !== "once" && mode !== "dev") {
55
55
  console.error("the 2nd argument should be 'dev' or 'once' ");
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.idkPage = exports.testsReportPage = exports.testReportPage = void 0;
4
+ const testReportPage = (packageName, domain) => {
5
+ return `
6
+ <!DOCTYPE html>
7
+ <html lang="en">
8
+
9
+ <head>
10
+ <meta name="description" content="Webpage description goes here" />
11
+ <meta charset="utf-8" />
12
+ <title>${packageName} - testeranto</title>
13
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
14
+ <meta name="author" content="" />
15
+
16
+ <base href="${domain}" target="_blank">
17
+
18
+ <link rel="stylesheet" href="../ReportClient.css" />
19
+ <script type="module" src="../ReportClient.js"></script>
20
+
21
+ </head>
22
+
23
+ <body>
24
+ <div id="root">
25
+ react is loading
26
+ </div>
27
+ </body>
28
+
29
+ </html>
30
+ `;
31
+ };
32
+ exports.testReportPage = testReportPage;
33
+ const testsReportPage = (packageName, domain, projects) => {
34
+ return `
35
+ <!DOCTYPE html>
36
+ <html lang="en">
37
+
38
+ <head>
39
+ <meta name="description" content="Webpage description goes here" />
40
+ <meta charset="utf-8" />
41
+ <title>${packageName} - testeranto</title>
42
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
43
+ <meta name="author" content="" />
44
+ <base href="${domain}" target="_blank">
45
+
46
+ <script type="application/json" id="bigConfig">
47
+ ${JSON.stringify(Object.keys(projects))}
48
+ </script>
49
+
50
+ <link rel="stylesheet" href="./testeranto/Project.css" />
51
+ <script type="module" src="./testeranto/Project.js"></script>
52
+
53
+ </head>
54
+
55
+ <body>
56
+ <div id="root">
57
+ react is loading
58
+ </div>
59
+ </body>
60
+
61
+ </html>
62
+ `;
63
+ };
64
+ exports.testsReportPage = testsReportPage;
65
+ const idkPage = (testName, domain) => {
66
+ return `
67
+ <!DOCTYPE html>
68
+ <html lang="en">
69
+
70
+ <head>
71
+ <meta name="description" content="Webpage description goes here" />
72
+ <base href="${domain}" target="_blank">
73
+ <meta charset="utf-8" />
74
+ <title>${testName} - testeranto</title>
75
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
76
+ <meta name="author" content="" />
77
+
78
+ <link rel="stylesheet" href="./testeranto/TestReport.css" />
79
+ <script src="./testeranto/TestReport.js"></script>
80
+
81
+ </head>
82
+
83
+ <body>
84
+ <div id="root"/>
85
+ </body>
86
+ `;
87
+ };
88
+ exports.idkPage = idkPage;