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.
- package/.aider.chat.history.md +13976 -0
- package/.aider.input.history +530 -0
- package/.aider.tags.cache.v3/{d8/b0/a8966fcd65890fd9f70d7afe8141.val → bd/91/b71f967fd074cf4b757081b429b7.val} +0 -0
- package/.aider.tags.cache.v3/cache.db +0 -0
- package/.aider.tags.cache.v3/{8e/ec/2d4659a1589a0187a757ab1cbefa.val → fb/96/b0f91c7e75e08fc5a6907633cf99.val} +0 -0
- package/README.md +28 -135
- package/bundle.js +1 -1
- package/dist/common/src/Init.js +4 -1
- package/dist/common/src/Node.js +1 -1
- package/dist/common/src/PM/__tests__/nodeSidecar.testeranto.js +2 -2
- package/dist/common/src/Web.js +2 -2
- package/dist/common/src/build.js +7 -73
- package/dist/common/src/defaultConfig.js +0 -1
- package/dist/common/src/lib/abstractBase.js +2 -0
- package/dist/common/src/lib/basebuilder.js +4 -0
- package/dist/common/src/lib/core.js +2 -0
- package/dist/common/src/run.js +1 -1
- package/dist/common/src/utils/buildTemplates.js +88 -0
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/src/Init.js +4 -1
- package/dist/module/src/Node.js +1 -1
- package/dist/module/src/PM/__tests__/nodeSidecar.testeranto.js +2 -2
- package/dist/module/src/Project.js +41 -47
- package/dist/module/src/TestReport.js +34 -31
- package/dist/module/src/Web.js +2 -2
- package/dist/module/src/build.js +7 -73
- package/dist/module/src/defaultConfig.js +0 -1
- package/dist/module/src/lib/abstractBase.js +2 -0
- package/dist/module/src/lib/basebuilder.js +4 -0
- package/dist/module/src/lib/core.js +2 -0
- package/dist/module/src/run.js +1 -1
- package/dist/module/src/utils/buildTemplates.js +82 -0
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/prebuild/Project.js +62 -13
- package/dist/prebuild/TestReport.js +39 -18
- package/dist/prebuild/build.mjs +96 -73
- package/dist/prebuild/init-docs.mjs +0 -4
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/src/CoreTypes.d.ts +5 -3
- package/dist/types/src/Node.d.ts +3 -3
- package/dist/types/src/PM/__tests__/nodeSidecar.testeranto.d.ts +17 -1
- package/dist/types/src/PM/__tests__/pureSidecar.testeranto.d.ts +17 -1
- package/dist/types/src/PM/__tests__/webSidecar.testeranto.d.ts +17 -1
- package/dist/types/src/PM/nodeSidecar.d.ts +2 -2
- package/dist/types/src/Pure.d.ts +3 -3
- package/dist/types/src/Types.d.ts +18 -14
- package/dist/types/src/Web.d.ts +3 -3
- package/dist/types/src/lib/abstractBase.d.ts +8 -8
- package/dist/types/src/lib/basebuilder.d.ts +3 -3
- package/dist/types/src/lib/classBuilder.d.ts +2 -2
- package/dist/types/src/lib/core.d.ts +2 -2
- package/dist/types/src/lib/index.d.ts +7 -6
- package/dist/types/src/lib/types.d.ts +8 -8
- package/dist/types/src/mothership/test.d.ts +20 -1
- package/dist/types/src/utils/buildTemplates.d.ts +3 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/docs/index.md +344 -54
- package/docs/style.md +116 -0
- package/docs.html +537 -0
- package/example.css +351 -0
- package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-Black.ttf +0 -0
- package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-Bold.ttf +0 -0
- package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-ExtraBold.ttf +0 -0
- package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-Light.ttf +0 -0
- package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-Medium.ttf +0 -0
- package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-Regular.ttf +0 -0
- package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-Thin.ttf +0 -0
- package/fonts/M_PLUS_Rounded_1c/OFL.txt +91 -0
- package/index.html +245 -24
- package/logo.svg +72 -0
- package/package.json +6 -2
- package/scripts/compile-docs.js +89 -0
- package/src/CoreTypes.ts +24 -43
- package/src/Init.ts +4 -4
- package/src/Node.ts +6 -20
- package/src/PM/__tests__/nodeSidecar.testeranto.ts +13 -20
- package/src/PM/__tests__/pureSidecar.testeranto.ts +8 -15
- package/src/PM/__tests__/webSidecar.testeranto.ts +8 -15
- package/src/PM/nodeSidecar.ts +2 -2
- package/src/PM/pure.ts +0 -4
- package/src/Project.tsx +289 -292
- package/src/Pure.ts +13 -14
- package/src/PureSidecar.ts +1 -0
- package/src/TestReport.tsx +179 -165
- package/src/Types.ts +29 -144
- package/src/Web.ts +15 -11
- package/src/build.ts +22 -73
- package/src/defaultConfig.ts +2 -1
- package/src/lib/BaseSuite.test.ts +457 -0
- package/src/lib/BaseSuite.ts +155 -0
- package/src/lib/abstractBase.ts +7 -162
- package/src/lib/basebuilder.ts +11 -11
- package/src/lib/classBuilder.ts +8 -3
- package/src/lib/core.ts +12 -12
- package/src/lib/index.ts +21 -24
- package/src/lib/types.ts +23 -9
- package/src/mothership/test.ts +13 -10
- package/src/run.ts +1 -1
- package/src/style.css +1 -1
- package/src/utils/buildTemplates.ts +88 -0
- package/style.css +496 -0
- package/testeranto/bundles/node/{mothership/chunk-V2EQEXU2.mjs → allTests/chunk-4PJCC2XT.mjs} +66 -59
- package/testeranto/bundles/node/allTests/metafile.json +4151 -0
- package/testeranto/bundles/node/allTests/src/PM/__tests__/nodeSidecar.testeranto.mjs +187 -0
- package/testeranto/bundles/node/{mothership → allTests}/src/PM/__tests__/pureSidecar.testeranto.mjs +1 -1
- package/testeranto/bundles/node/{mothership → allTests}/src/PM/__tests__/webSidecar.testeranto.mjs +1 -1
- package/testeranto/bundles/node/allTests/src/lib/BaseSuite.test.mjs +305 -0
- package/testeranto/bundles/node/{mothership → allTests}/src/mothership/test.mjs +1 -1
- package/testeranto/dev.html +29 -0
- package/testeranto/index.html +28 -27
- package/testeranto/reports/allTests/config.json +57 -0
- package/testeranto/reports/{mothership/index.html → allTests/dev.html} +2 -0
- package/testeranto/reports/allTests/index.html +26 -0
- package/testeranto/reports/{mothership/src/PM/__tests__/sidecar.testeranto/node/index.html → allTests/src/PM/__tests__/nodeSidecar.testeranto/node/dev.html} +4 -3
- package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/index.html +21 -0
- package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/lint_errors.json +80 -0
- package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/message +1 -0
- package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/prompt.txt +8 -0
- package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/type_errors.txt +28 -0
- package/testeranto/reports/{mothership/src/PM/__tests__/webSidecar.testeranto/node/index.html → allTests/src/PM/__tests__/pureSidecar.testeranto/node/dev.html} +4 -3
- package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/index.html +21 -0
- package/testeranto/reports/{mothership → allTests}/src/PM/__tests__/pureSidecar.testeranto/node/lint_errors.json +12 -12
- package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/message +1 -0
- package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/prompt.txt +8 -0
- package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/type_errors.txt +32 -0
- package/testeranto/reports/{mothership/src/PM/__tests__/nodeSidecar.testeranto/node/index.html → allTests/src/PM/__tests__/webSidecar.testeranto/node/dev.html} +4 -3
- package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/index.html +21 -0
- package/testeranto/reports/{mothership → allTests}/src/PM/__tests__/webSidecar.testeranto/node/lint_errors.json +12 -12
- package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/message +1 -0
- package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/prompt.txt +8 -0
- package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/type_errors.txt +32 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/console_log.txt +35 -0
- package/testeranto/reports/{mothership/src/PM/__tests__/pureSidecar.testeranto/node/index.html → allTests/src/lib/BaseSuite.test/node/dev.html} +4 -3
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/index.html +21 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/lint_errors.json +608 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/message +1 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/prompt.txt +7 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/type_errors.txt +68 -0
- package/testeranto/reports/allTests/src/mothership/test/node/dev.html +21 -0
- package/testeranto/reports/allTests/src/mothership/test/node/index.html +21 -0
- package/testeranto/reports/allTests/src/mothership/test/node/message +1 -0
- package/testeranto/reports/allTests/src/mothership/test/node/prompt.txt +8 -0
- package/testeranto/reports/allTests/src/mothership/test/node/type_errors.txt +24 -0
- package/testeranto/reports/allTests/summary.json +37 -0
- package/testeranto.config.ts +16 -26
- package/tsc.log +66 -69
- package/dist/common/src/SP__Polygon.test.js +0 -10
- package/dist/module/src/ReportClient.js +0 -132
- package/dist/module/src/SP__Polygon.test.js +0 -8
- package/dist/prebuild/ReportClient.js +0 -3
- package/dist/types/src/SP__Polygon.test.d.ts +0 -1
- package/src/ReportClient.tsx +0 -164
- package/src/SP__Polygon.test.ts +0 -13
- package/testeranto/ReportClient.css +0 -11367
- package/testeranto/ReportClient.js +0 -24641
- package/testeranto/bundles/node/mothership/metafile.json +0 -389
- package/testeranto/bundles/node/mothership/src/PM/__tests__/nodeSidecar.testeranto.mjs +0 -1219
- package/testeranto/bundles/node/mothership/src/PM/__tests__/sidecar.testeranto.mjs +0 -1199
- package/testeranto/reports/mothership/config.json +0 -25
- package/testeranto/reports/mothership/src/PM/__tests__/nodeSidecar.testeranto/node/console_log.txt +0 -0
- package/testeranto/reports/mothership/src/PM/__tests__/nodeSidecar.testeranto/node/lint_errors.json +0 -1564
- package/testeranto/reports/mothership/src/PM/__tests__/nodeSidecar.testeranto/node/prompt.txt +0 -22
- package/testeranto/reports/mothership/src/PM/__tests__/nodeSidecar.testeranto/node/type_errors.txt +0 -35
- package/testeranto/reports/mothership/src/PM/__tests__/pureSidecar.testeranto/node/prompt.txt +0 -12
- package/testeranto/reports/mothership/src/PM/__tests__/pureSidecar.testeranto/node/type_errors.txt +0 -26
- package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/bdd_errors.txt +0 -1
- package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/console_log.txt +0 -0
- package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/lint_errors.json +0 -1564
- package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/log.txt +0 -0
- package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/prompt.txt +0 -22
- package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/tests.json +0 -56
- package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/type_errors.txt +0 -29
- package/testeranto/reports/mothership/src/PM/__tests__/webSidecar.testeranto/node/prompt.txt +0 -12
- package/testeranto/reports/mothership/src/PM/__tests__/webSidecar.testeranto/node/type_errors.txt +0 -26
- package/testeranto/reports/mothership/src/mothership/test/node/bdd_errors.txt +0 -1
- package/testeranto/reports/mothership/src/mothership/test/node/console_log.txt +0 -4
- package/testeranto/reports/mothership/src/mothership/test/node/index.html +0 -20
- package/testeranto/reports/mothership/src/mothership/test/node/log.txt +0 -0
- package/testeranto/reports/mothership/src/mothership/test/node/prompt.txt +0 -12
- package/testeranto/reports/mothership/src/mothership/test/node/tests.json +0 -24
- package/testeranto/reports/mothership/src/mothership/test/node/type_errors.txt +0 -18
- package/testeranto/reports/mothership/summary.json +0 -9
- /package/testeranto/bundles/node/{mothership → allTests}/chunk-PG6KUKNP.mjs +0 -0
- /package/testeranto/bundles/pure/{mothership → allTests}/metafile.json +0 -0
- /package/testeranto/bundles/web/{mothership → allTests}/metafile.json +0 -0
- /package/testeranto/reports/{mothership/src/PM/__tests__/nodeSidecar.testeranto → allTests/src/lib/BaseSuite.test}/node/log.txt +0 -0
- /package/testeranto/reports/{mothership → allTests}/src/mothership/test/node/lint_errors.json +0 -0
package/README.md
CHANGED
|
@@ -2,33 +2,29 @@
|
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
+
- demo video: [youtube](https://www.youtube.com/embed/WvU5xMqGi6Q)
|
|
8
|
+
- source: [github.com/adamwong246/testeranto](https://github.com/adamwong246/testeranto)
|
|
9
|
+
- npm: [npmjs.com/package/testeranto](https://www.npmjs.com/package/testeranto)
|
|
10
|
+
- dev: [github.dev/adamwong246/testeranto](https://github.dev/adamwong246/testeranto)
|
|
11
|
+
- example repo: [testeranto-starter](https://github.com/adamwong246/testeranto-starter)
|
|
16
12
|
|
|
17
13
|
## What is testeranto?
|
|
18
14
|
|
|
19
15
|
- Testeranto produces test results which can be fed to Aider.ai to automatically fix failing tests.
|
|
20
16
|
- 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
|
|
17
|
+
- Testeranto can run tests in the frontend or the backend, or both.
|
|
22
18
|
- Testeranto can be used to test anything that can be bundled with esbuild.
|
|
23
19
|
- Testeranto connects "features" to "tests". This allows the AI to read feature documentation from external systems, like Jira.
|
|
24
20
|
- Testeranto generates test results into static a website which can be deployed to github pages easily.
|
|
21
|
+
- 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
22
|
|
|
26
23
|
## Key Technologies
|
|
27
24
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
| Technology | Purpose |
|
|
25
|
+
| | |
|
|
31
26
|
| ---------- | -------------------------------------- |
|
|
27
|
+
| ESM | Modern javascript tooling |
|
|
32
28
|
| TypeScript | Strongly-typed test definitions |
|
|
33
29
|
| Puppeteer | Cross-runtime testing (Node & Browser) |
|
|
34
30
|
| esbuild | Fast test bundling |
|
|
@@ -63,138 +59,35 @@ const RectangleSpec = (Suite, Given, When, Then) => [
|
|
|
63
59
|
];
|
|
64
60
|
```
|
|
65
61
|
|
|
66
|
-
3. Run
|
|
62
|
+
3. Run the tests
|
|
63
|
+
|
|
64
|
+
To start testeranto in dev mode, build your tests in one terminal and execute them in another
|
|
67
65
|
|
|
68
66
|
```bash
|
|
69
67
|
# Terminal 1 - Build in watch mode
|
|
70
|
-
yarn t-build rectangle.test.ts dev
|
|
68
|
+
yarn t-build rectangle.test.ts yourProject dev
|
|
71
69
|
|
|
72
70
|
# Terminal 2 - Run in watch mode
|
|
73
|
-
yarn t-run rectangle.test.ts dev
|
|
71
|
+
yarn t-run rectangle.test.ts yourProject dev
|
|
74
72
|
```
|
|
75
73
|
|
|
76
|
-
|
|
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
|
|
74
|
+
or build and run your tests only once
|
|
107
75
|
|
|
108
|
-
|
|
109
|
-
|
|
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
|
|
76
|
+
```bash
|
|
77
|
+
yarn t-build rectangle.test.ts yourProject once && yarn t-run rectangle.test.ts yourProject once
|
|
177
78
|
```
|
|
178
79
|
|
|
179
80
|
## Runtime Platforms
|
|
180
81
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
|
184
|
-
|
|
|
185
|
-
| **
|
|
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
|
|
82
|
+
| | Runs on | You should use this runtime for... | Important differences |
|
|
83
|
+
| -------- | ----------------------------- | ------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
|
|
84
|
+
| **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 |
|
|
85
|
+
| **Web** | chrome browser | testing frontend code, anything that uses `document` or `window`, UI interactions, or visual regression | can take screenshots/recordings |
|
|
86
|
+
| **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
87
|
|
|
195
88
|
## CLI Commands
|
|
196
89
|
|
|
197
|
-
|
|
|
90
|
+
| | |
|
|
198
91
|
| ------------------------------------- | --------------------------------------------- |
|
|
199
92
|
| `yarn t-init` | Create a new testeranto project |
|
|
200
93
|
| `yarn t-build <YOUR_TESTS> dev\|once` | Build test bundles (watch or single-run mode) |
|
|
@@ -202,7 +95,7 @@ Testeranto runs tests in multiple runtime environments, each suited for differen
|
|
|
202
95
|
| `yarn t-report` | Launch test report server |
|
|
203
96
|
| `yarn t-aider` | Fix failing tests with AI |
|
|
204
97
|
|
|
205
|
-
Example workflow:
|
|
98
|
+
## Example workflow:
|
|
206
99
|
|
|
207
100
|
```bash
|
|
208
101
|
# Initialize project
|
|
@@ -224,7 +117,7 @@ yarn t-run test/rectangle.test.ts once
|
|
|
224
117
|
yarn t-aider
|
|
225
118
|
```
|
|
226
119
|
|
|
227
|
-
##
|
|
120
|
+
## Aider
|
|
228
121
|
|
|
229
122
|
Testeranto generates a "prompt" alongside test results. This prompt is passed to aider as input.
|
|
230
123
|
|
|
@@ -241,14 +134,14 @@ Testeranto generates a "prompt" alongside test results. This prompt is passed to
|
|
|
241
134
|
/load testeranto/reports/allTests/node/test/node/featurePrompt.txt
|
|
242
135
|
|
|
243
136
|
// tell the AI what to do
|
|
244
|
-
|
|
137
|
+
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
138
|
```
|
|
246
139
|
|
|
247
140
|
## "Features"
|
|
248
141
|
|
|
249
142
|
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
143
|
|
|
251
|
-
```
|
|
144
|
+
```typescript
|
|
252
145
|
import someMarkdownFile from "someMarkdownFile.md";
|
|
253
146
|
|
|
254
147
|
...
|
package/bundle.js
CHANGED
package/dist/common/src/Init.js
CHANGED
|
@@ -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
|
-
|
|
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`,
|
package/dist/common/src/Node.js
CHANGED
|
@@ -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");
|
package/dist/common/src/Web.js
CHANGED
|
@@ -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) {
|
package/dist/common/src/build.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
[
|
|
@@ -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");
|
package/dist/common/src/run.js
CHANGED
|
@@ -49,7 +49,7 @@ process.stdin.on("keypress", (str, key) => {
|
|
|
49
49
|
process.exit(-1);
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
|
-
|
|
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;
|