testeranto 0.146.2 → 0.146.5
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/dist/common/src/Node.js +9 -6
- package/dist/common/src/PM/PM_WithEslintAndTsc.js +75 -58
- package/dist/common/src/PM/main.js +131 -79
- package/dist/common/src/PM/node.js +1 -14
- package/dist/common/src/PM/nodeSidecar.js +0 -1
- package/dist/common/src/Pure.js +17 -1
- package/dist/common/src/Pure.test.js +172 -0
- package/dist/common/src/build.js +0 -1
- package/dist/common/src/esbuildConfigs/consoleDetectorPlugin.js +22 -11
- package/dist/common/src/esbuildConfigs/nativeImportDetectorPlugin.js +24 -0
- package/dist/common/src/esbuildConfigs/pure.js +2 -1
- package/dist/common/src/esbuildConfigs/rebuildPlugin.js +1 -4
- package/dist/common/src/lib/BaseSuite.js +89 -0
- package/dist/common/src/lib/BaseSuite.test/node.test.js +9 -0
- package/dist/common/src/lib/BaseSuite.test/pure.test.js +9 -0
- package/dist/common/src/lib/BaseSuite.test/test.js +232 -0
- package/dist/common/src/lib/BaseSuite.test/web.test.js +9 -0
- package/dist/common/src/lib/abstractBase.js +1 -90
- package/dist/common/src/lib/abstractBase.test/MockGiven.js +17 -0
- package/dist/common/src/lib/abstractBase.test/MockThen.js +13 -0
- package/dist/common/src/lib/abstractBase.test/MockWhen.js +13 -0
- package/dist/common/src/lib/abstractBase.test/implementation.js +42 -0
- package/dist/common/src/lib/abstractBase.test/index.js +17 -0
- package/dist/common/src/lib/abstractBase.test/interface.js +12 -0
- package/dist/common/src/lib/abstractBase.test/specification.js +19 -0
- package/dist/common/src/lib/abstractBase.test/types.js +2 -0
- package/dist/common/src/lib/baseBuilder.test/TestBaseBuilder.js +36 -0
- package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.implementation.js +97 -0
- package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.interface.js +17 -0
- package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.node.js +11 -0
- package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.pure.js +11 -0
- package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.specification.js +13 -0
- package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.types.js +2 -0
- package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.web.js +11 -0
- package/dist/common/src/lib/basebuilder.js +2 -20
- package/dist/common/src/lib/classBuilder.test/TestClassBuilder.js +41 -0
- package/dist/common/src/lib/classBuilder.test/classBuilder.test.implementation.js +182 -0
- package/dist/common/src/lib/classBuilder.test/classBuilder.test.interface.js +17 -0
- package/dist/common/src/lib/classBuilder.test/classBuilder.test.js +11 -0
- package/dist/common/src/lib/classBuilder.test/classBuilder.test.specification.js +41 -0
- package/dist/common/src/lib/classBuilder.test/classBuilder.test.types.js +2 -0
- package/dist/common/src/lib/core.js +4 -13
- package/dist/common/src/lib/core.test/MockCore.js +25 -0
- package/dist/common/src/lib/core.test/core.test.implementation.js +102 -0
- package/dist/common/src/lib/core.test/core.test.interface.js +18 -0
- package/dist/common/src/lib/core.test/core.test.js +17 -0
- package/dist/common/src/lib/core.test/core.test.specification.js +33 -0
- package/dist/common/src/lib/core.test/core.test.types.js +2 -0
- package/dist/common/src/lib/pmProxy.js +9 -166
- package/dist/common/src/lib/pmProxy.test/implementation.js +76 -0
- package/dist/common/src/lib/pmProxy.test/index.js +15 -0
- package/dist/common/src/lib/pmProxy.test/interface.js +37 -0
- package/dist/common/src/lib/pmProxy.test/mockPM.js +34 -0
- package/dist/common/src/lib/pmProxy.test/mockPMBase.js +115 -0
- package/dist/common/src/lib/pmProxy.test/specification.js +39 -0
- package/dist/common/src/lib/pmProxy.test/types.js +2 -0
- package/dist/common/src/run.js +6 -6
- package/dist/common/testeranto.config.js +33 -18
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/src/Node.js +9 -6
- package/dist/module/src/PM/PM_WithEslintAndTsc.js +75 -58
- package/dist/module/src/PM/main.js +131 -79
- package/dist/module/src/PM/node.js +1 -14
- package/dist/module/src/PM/nodeSidecar.js +0 -1
- package/dist/module/src/Pure.js +17 -1
- package/dist/module/src/Pure.test.js +167 -0
- package/dist/module/src/build.js +0 -1
- package/dist/module/src/esbuildConfigs/consoleDetectorPlugin.js +19 -11
- package/dist/module/src/esbuildConfigs/nativeImportDetectorPlugin.js +21 -0
- package/dist/module/src/esbuildConfigs/pure.js +2 -1
- package/dist/module/src/esbuildConfigs/rebuildPlugin.js +1 -4
- package/dist/module/src/lib/BaseSuite.js +85 -0
- package/dist/module/src/lib/BaseSuite.test/node.test.js +4 -0
- package/dist/module/src/lib/BaseSuite.test/pure.test.js +4 -0
- package/dist/module/src/lib/BaseSuite.test/test.js +227 -0
- package/dist/module/src/lib/BaseSuite.test/web.test.js +4 -0
- package/dist/module/src/lib/abstractBase.js +1 -89
- package/dist/module/src/lib/abstractBase.test/MockGiven.js +13 -0
- package/dist/module/src/lib/abstractBase.test/MockThen.js +9 -0
- package/dist/module/src/lib/abstractBase.test/MockWhen.js +9 -0
- package/dist/module/src/lib/abstractBase.test/implementation.js +39 -0
- package/dist/module/src/lib/abstractBase.test/index.js +12 -0
- package/dist/module/src/lib/abstractBase.test/interface.js +9 -0
- package/dist/module/src/lib/abstractBase.test/specification.js +15 -0
- package/dist/module/src/lib/abstractBase.test/types.js +1 -0
- package/dist/module/src/lib/baseBuilder.test/TestBaseBuilder.js +32 -0
- package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.implementation.js +94 -0
- package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.interface.js +14 -0
- package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.node.js +6 -0
- package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.pure.js +6 -0
- package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.specification.js +9 -0
- package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.types.js +1 -0
- package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.web.js +6 -0
- package/dist/module/src/lib/basebuilder.js +2 -20
- package/dist/module/src/lib/classBuilder.test/TestClassBuilder.js +37 -0
- package/dist/module/src/lib/classBuilder.test/classBuilder.test.implementation.js +179 -0
- package/dist/module/src/lib/classBuilder.test/classBuilder.test.interface.js +14 -0
- package/dist/module/src/lib/classBuilder.test/classBuilder.test.js +6 -0
- package/dist/module/src/lib/classBuilder.test/classBuilder.test.specification.js +37 -0
- package/dist/module/src/lib/classBuilder.test/classBuilder.test.types.js +1 -0
- package/dist/module/src/lib/core.js +3 -12
- package/dist/module/src/lib/core.test/MockCore.js +18 -0
- package/dist/module/src/lib/core.test/core.test.implementation.js +99 -0
- package/dist/module/src/lib/core.test/core.test.interface.js +15 -0
- package/dist/module/src/lib/core.test/core.test.js +12 -0
- package/dist/module/src/lib/core.test/core.test.specification.js +29 -0
- package/dist/module/src/lib/core.test/core.test.types.js +1 -0
- package/dist/module/src/lib/pmProxy.js +9 -166
- package/dist/module/src/lib/pmProxy.test/implementation.js +73 -0
- package/dist/module/src/lib/pmProxy.test/index.js +10 -0
- package/dist/module/src/lib/pmProxy.test/interface.js +34 -0
- package/dist/module/src/lib/pmProxy.test/mockPM.js +30 -0
- package/dist/module/src/lib/pmProxy.test/mockPMBase.js +111 -0
- package/dist/module/src/lib/pmProxy.test/specification.js +35 -0
- package/dist/module/src/lib/pmProxy.test/types.js +1 -0
- package/dist/module/src/run.js +6 -6
- package/dist/module/testeranto.config.js +33 -18
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/prebuild/Project.js +16 -15
- package/dist/prebuild/TestReport.js +14 -12
- package/dist/prebuild/build.mjs +34 -34
- package/dist/prebuild/run.mjs +259 -173
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/src/PM/PM_WithEslintAndTsc.d.ts +2 -1
- package/dist/types/src/PM/main.d.ts +5 -2
- package/dist/types/src/Pure.d.ts +2 -2
- package/dist/types/src/Pure.test.d.ts +36 -0
- package/dist/types/src/Types.d.ts +7 -6
- package/dist/types/src/Web.d.ts +1 -1
- package/dist/types/src/esbuildConfigs/consoleDetectorPlugin.d.ts +1 -1
- package/dist/types/src/esbuildConfigs/nativeImportDetectorPlugin.d.ts +2 -0
- package/dist/types/src/lib/BaseSuite.d.ts +39 -0
- package/dist/types/src/lib/BaseSuite.test/node.test.d.ts +3 -0
- package/dist/types/src/lib/BaseSuite.test/pure.test.d.ts +3 -0
- package/dist/types/src/lib/BaseSuite.test/test.d.ts +42 -0
- package/dist/types/src/lib/BaseSuite.test/web.test.d.ts +3 -0
- package/dist/types/src/lib/abstractBase.d.ts +1 -36
- package/dist/types/src/lib/abstractBase.test/MockGiven.d.ts +7 -0
- package/dist/types/src/lib/abstractBase.test/MockThen.d.ts +6 -0
- package/dist/types/src/lib/abstractBase.test/MockWhen.d.ts +6 -0
- package/dist/types/src/lib/abstractBase.test/implementation.d.ts +3 -0
- package/dist/types/src/lib/abstractBase.test/index.d.ts +3 -0
- package/dist/types/src/lib/abstractBase.test/interface.d.ts +3 -0
- package/dist/types/src/lib/abstractBase.test/specification.d.ts +3 -0
- package/dist/types/src/lib/abstractBase.test/types.d.ts +39 -0
- package/dist/types/src/lib/baseBuilder.test/TestBaseBuilder.d.ts +15 -0
- package/dist/types/src/lib/baseBuilder.test/baseBuilder.test.implementation.d.ts +3 -0
- package/dist/types/src/lib/baseBuilder.test/baseBuilder.test.interface.d.ts +3 -0
- package/dist/types/src/lib/baseBuilder.test/baseBuilder.test.node.d.ts +3 -0
- package/dist/types/src/lib/baseBuilder.test/baseBuilder.test.pure.d.ts +3 -0
- package/dist/types/src/lib/baseBuilder.test/baseBuilder.test.specification.d.ts +3 -0
- package/dist/types/src/lib/baseBuilder.test/baseBuilder.test.types.d.ts +20 -0
- package/dist/types/src/lib/baseBuilder.test/baseBuilder.test.web.d.ts +3 -0
- package/dist/types/src/lib/classBuilder.test/TestClassBuilder.d.ts +21 -0
- package/dist/types/src/lib/classBuilder.test/classBuilder.test.d.ts +3 -0
- package/dist/types/src/lib/classBuilder.test/classBuilder.test.implementation.d.ts +3 -0
- package/dist/types/src/lib/classBuilder.test/classBuilder.test.interface.d.ts +3 -0
- package/dist/types/src/lib/classBuilder.test/classBuilder.test.specification.d.ts +3 -0
- package/dist/types/src/lib/classBuilder.test/classBuilder.test.types.d.ts +56 -0
- package/dist/types/src/lib/core.d.ts +1 -1
- package/dist/types/src/lib/core.test/MockCore.d.ts +10 -0
- package/dist/types/src/lib/core.test/core.test.d.ts +3 -0
- package/dist/types/src/lib/core.test/core.test.implementation.d.ts +3 -0
- package/dist/types/src/lib/core.test/core.test.interface.d.ts +3 -0
- package/dist/types/src/lib/core.test/core.test.specification.d.ts +3 -0
- package/dist/types/src/lib/core.test/core.test.types.d.ts +46 -0
- package/dist/types/src/lib/index.d.ts +2 -1
- package/dist/types/src/lib/pmProxy.d.ts +11 -6
- package/dist/types/src/lib/pmProxy.test/implementation.d.ts +3 -0
- package/dist/types/src/lib/pmProxy.test/index.d.ts +7 -0
- package/dist/types/src/lib/pmProxy.test/interface.d.ts +3 -0
- package/dist/types/src/lib/pmProxy.test/mockPM.d.ts +10 -0
- package/dist/types/src/lib/pmProxy.test/mockPMBase.d.ts +39 -0
- package/dist/types/src/lib/pmProxy.test/specification.d.ts +3 -0
- package/dist/types/src/lib/pmProxy.test/types.d.ts +42 -0
- package/dist/types/src/lib/types.d.ts +2 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/docs.html +35 -33
- package/index.html +23 -30
- package/package.json +8 -18
- package/src/lib/basebuilder.ts +0 -24
- package/testeranto/Project.css +1 -26
- package/testeranto/Project.js +3337 -385
- package/testeranto/TestReport.css +1 -26
- package/testeranto/TestReport.js +43 -16
- package/testeranto/bundles/node/allTests/metafile.json +1 -1
- package/testeranto/bundles/pure/allTests/metafile.json +1 -1
- package/testeranto/bundles/web/allTests/metafile.json +1 -1
- package/testeranto/index.html +1 -1
- package/testeranto/reports/allTests/index.html +1 -1
- package/testeranto/reports/allTests/src/Pure.test/pure/index.html +1 -1
- package/testeranto/reports/allTests/src/Pure.test/pure/lint_errors.json +137 -1539
- package/testeranto/reports/allTests/src/Pure.test/pure/logs.txt +2 -2
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/index.html +1 -1
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/lint_errors.json +58 -620
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/index.html +1 -1
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/lint_errors.json +58 -620
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/logs.txt +2 -2
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/index.html +1 -1
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/lint_errors.json +58 -620
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/index.html +1 -1
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/lint_errors.json +104 -966
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/index.html +1 -1
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/lint_errors.json +104 -966
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/index.html +1 -1
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/lint_errors.json +104 -966
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/index.html +1 -1
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/lint_errors.json +63 -791
- package/testeranto/reports/allTests/src/lib/core.test/core.test/node/index.html +1 -1
- package/testeranto/reports/allTests/src/lib/core.test/core.test/node/lint_errors.json +39 -416
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/index.html +1 -1
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/lint_errors.json +156 -1724
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/logs.txt +3 -3
- package/testeranto.config.ts +1 -1
- package/tsc.log +36 -38
package/docs.html
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
<div class="parallax-background"></div>
|
|
20
20
|
<div id="container">
|
|
21
21
|
<h1>Testeranto docs and core concepts</h1>
|
|
22
|
-
<p>Testeranto's type system provides a rigorous framework for Behavior-Driven Development (BDD) testing.
|
|
22
|
+
<p>Testeranto's type system provides a rigorous framework for Behavior-Driven Development (BDD) testing. The API may seem complex but everything you need to know can be summed up in <strong>1 function, 3 runtimes and 5 essential types, and 1 optional type</strong>. Follow these patterns, and TypeScript's type checker will guide you through the rest.</p>
|
|
23
23
|
<h3>⚠️ this doc is a work in progress. It is 99% accurate but needs some attention to be complete. ⚠️</h3>
|
|
24
24
|
<p>Let's break down the key components using a Rectangle class example.</p>
|
|
25
25
|
<h3>The Test Subject</h3>
|
|
@@ -36,12 +36,24 @@
|
|
|
36
36
|
getArea() {
|
|
37
37
|
return this.width * this.height;
|
|
38
38
|
}
|
|
39
|
-
}</code></pre><h3>Testeranto's
|
|
39
|
+
}</code></pre><h3>Testeranto's 1 function</h3>
|
|
40
|
+
<p>Testeranto has 1 function. This function launches and runs the tests. It is here that all 5 types converge and if you can type this function call correctly, the TS type system should guide you through the rest.</p>
|
|
41
|
+
<pre>async <I extends Ibdd_in_any, O extends Ibdd_out, M>(
|
|
42
|
+
input: I["iinput"],
|
|
43
|
+
testSpecification: ITestSpecification<I, O>,
|
|
44
|
+
testImplementation: ITestImplementation<I, O, M>,
|
|
45
|
+
testInterface: Partial<ITestInterface<I>>,
|
|
46
|
+
testResourceRequirement: ITTestResourceRequest = defaultTestResourceRequirement
|
|
47
|
+
): Promise<Testeranto<I, O, M>></pre><h3>Testeranto's 3 runtimes</h3>
|
|
40
48
|
<p>For each of testeranto's runtime, there is a specific Testeranto main function. Each is it's own import but all 3 are called in the same way.</p>
|
|
41
49
|
<h4>Node</h4>
|
|
42
50
|
<pre>import Testeranto from "testeranto/src/Node"; // <- import the Node main function
|
|
43
51
|
// below this point, all runtimes are identical!
|
|
44
52
|
|
|
53
|
+
import { implementation } from "./Rectangle.test.implementation";
|
|
54
|
+
import { specification } from "./Rectangle.test.specification";
|
|
55
|
+
import { interface } from "./Rectangle.test.interface";
|
|
56
|
+
|
|
45
57
|
// Note the type parameters I, O, and M: these will be important later
|
|
46
58
|
export default Testeranto<
|
|
47
59
|
I extends Ibdd_in,
|
|
@@ -88,36 +100,15 @@ export default Testeranto<
|
|
|
88
100
|
specification,
|
|
89
101
|
implementation,
|
|
90
102
|
interface
|
|
91
|
-
);</pre><h3>Testeranto's 5
|
|
92
|
-
<p>Every testeranto test is built around these 5 types that form a complete testing pipeline
|
|
93
|
-
<
|
|
94
|
-
<li><strong>ITestSpecification</strong> - The "what" of your tests (business requirements)</li>
|
|
95
|
-
<li><strong>ITestImplementation</strong> - The "how" of your tests (concrete operations)</li>
|
|
96
|
-
<li><strong>ITestInterface</strong> - The "glue" between specs and implementation</li>
|
|
97
|
-
<li><strong>Ibdd_in</strong> - Defines the internal test flow shape</li>
|
|
98
|
-
<li><strong>Ibdd_out</strong> - Defines the external test interface</li>
|
|
99
|
-
</ol>
|
|
100
|
-
<pre class="mermaid">flowchart LR
|
|
101
|
-
S[ITestSpecification] -->|defines| O[Ibdd_out]
|
|
102
|
-
I[ITestImplementation] -->|uses| O
|
|
103
|
-
I -->|uses| M[Modifier]
|
|
104
|
-
T[ITestInterface] -->|connects| N[Ibdd_in]
|
|
105
|
-
S -->|flows through| N
|
|
106
|
-
I -->|flows through| N
|
|
107
|
-
|
|
108
|
-
style S fill:#2aa198,stroke:#073642
|
|
109
|
-
style I fill:#859900,stroke:#073642
|
|
110
|
-
style T fill:#b58900,stroke:#073642
|
|
111
|
-
style O fill:#d33682,stroke:#073642
|
|
112
|
-
style N fill:#cb4b16,stroke:#073642
|
|
113
|
-
style M fill:#6c71c4,stroke:#073642</pre><h4>The Specification (ITestSpecification)</h4>
|
|
103
|
+
);</pre><h3>Testeranto's 5 essential types</h3>
|
|
104
|
+
<p>Every testeranto test is built around these 5 types that form a complete testing pipeline.</p>
|
|
105
|
+
<h4>The Specification (ITestSpecification)</h4>
|
|
114
106
|
<p>The Specification defines the business requirements in plain language, completely separate from implementation details. This is where you describe <strong>what</strong> should be tested without worrying about <strong>how</strong>.</p>
|
|
115
107
|
<ul>
|
|
116
108
|
<li>Pure business logic</li>
|
|
117
109
|
<li>Human-readable test descriptions</li>
|
|
118
110
|
<li>Defines test suites, scenarios (Given/When/Then)</li>
|
|
119
111
|
<li>Maps directly to BDD concepts</li>
|
|
120
|
-
<li>Uses Ibdd_out for type safety</li>
|
|
121
112
|
</ul>
|
|
122
113
|
<pre class="language-typescript line-numbers"><code class="language-typescript">import {
|
|
123
114
|
Ibdd_in,
|
|
@@ -220,9 +211,8 @@ export const implementation: ITestImplementation<
|
|
|
220
211
|
Default: () => new Rectangle(2, 2),
|
|
221
212
|
},
|
|
222
213
|
};</pre><h4>The Interface aka ITestInterface</h4>
|
|
223
|
-
<p>The test interface is code which is NOT
|
|
224
|
-
<pre>
|
|
225
|
-
import {
|
|
214
|
+
<p>The test interface is code which is NOT business logic. The interface adapts your test subject so that the BDD hooks can be applied. The interface implements the traditional BDD steps "before all", "after all", "before each", "after each", etc</p>
|
|
215
|
+
<pre>import {
|
|
226
216
|
Ibdd_in,
|
|
227
217
|
ITestInterface,
|
|
228
218
|
} from "testeranto/src/CoreTypes";
|
|
@@ -246,7 +236,7 @@ export const testInterface: ITestInterface<
|
|
|
246
236
|
afterAll: () => {},
|
|
247
237
|
assertThis: (x: any, y) => {},
|
|
248
238
|
};</pre><h4>type I aka Ibdd_in</h4>
|
|
249
|
-
<p>
|
|
239
|
+
<p>This type describes the "inner" shape of your BDD tests. Over the course of the execution of the test, the subject will change shapes- this test describe those changes.</p>
|
|
250
240
|
<pre>import { Ibdd_in } from "testeranto/src/CoreTypes";
|
|
251
241
|
|
|
252
242
|
// TODO this is inaccurate
|
|
@@ -259,7 +249,7 @@ export type I = Ibdd_in<
|
|
|
259
249
|
(...x) => (rectangle: Rectangle, utils: IPM) => Rectangle,
|
|
260
250
|
(rectangle: Rectangle, utils: IPM) => Rectangle
|
|
261
251
|
>;</pre><h4>type O aka Ibdd_out</h4>
|
|
262
|
-
<p>
|
|
252
|
+
<p>This type describes the "outer" shape of your BDD tests. This type describes the set of legal BDD clauses.</p>
|
|
263
253
|
<pre>import { Ibdd_out } from "testeranto/src/CoreTypes";
|
|
264
254
|
|
|
265
255
|
export type O = Ibdd_out<
|
|
@@ -295,7 +285,8 @@ export type O = Ibdd_out<
|
|
|
295
285
|
WidthOfOneAndHeightOfOne;
|
|
296
286
|
WidthAndHeightOf: [number, number];
|
|
297
287
|
}
|
|
298
|
-
>;</pre><
|
|
288
|
+
>;</pre><h3>Testeranto's 1 optional type</h3>
|
|
289
|
+
<h4>type M (optional)</h4>
|
|
299
290
|
<p>this type describes the modifications to the shape of the "specification". It can be used to make your BDD tests DRYer but is not necessary</p>
|
|
300
291
|
<pre>export type M = {
|
|
301
292
|
givens: {
|
|
@@ -515,7 +506,18 @@ export default Testeranto<
|
|
|
515
506
|
);
|
|
516
507
|
|
|
517
508
|
|
|
518
|
-
</pre>
|
|
509
|
+
</pre><h2>Trouble shooting</h2>
|
|
510
|
+
<h3>Double check your runtimes.</h3>
|
|
511
|
+
<p>Every test has a runtime, which must defined in 2 places. Both must match.</p>
|
|
512
|
+
<ol>
|
|
513
|
+
<li>The import of the runtime</li>
|
|
514
|
+
<li>The runtime defined alongside the test in testeranto.config.ts</li>
|
|
515
|
+
</ol>
|
|
516
|
+
<p>By convention, test filenames reveal their runtime. Ex: <code>__tests__/yourClass.node.test</code>. This is ONLY a convention. It has no real bearing on the runtime.</p>
|
|
517
|
+
<h2>Dos and Don'ts</h2>
|
|
518
|
+
<h3>Do pass your test subject to the main testeranto function.</h3>
|
|
519
|
+
<h3>Don't import your test subject elsewhere in your tests.</h3>
|
|
520
|
+
|
|
519
521
|
</div>
|
|
520
522
|
<!-- Prism.js JS -->
|
|
521
523
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/prism.min.js"></script>
|
package/index.html
CHANGED
|
@@ -20,24 +20,24 @@
|
|
|
20
20
|
<div id="container">
|
|
21
21
|
<h1>testeranto</h1>
|
|
22
22
|
<h2>The AI-powered BDD test framework for TypeScript projects</h2>
|
|
23
|
-
<h4>🚧 WARNING: Testeranto is still under development
|
|
23
|
+
<h4>🚧 WARNING: Testeranto is still under development but is not ready for production yet. I am rapidly working to release a beta ASAP. If you are interested in joining this beta program, please contact me. 🚧</h4>
|
|
24
24
|
<ul>
|
|
25
|
-
<li>README: <a href="https://adamwong246.github.io/testeranto/">
|
|
25
|
+
<li>README: <a href="https://adamwong246.github.io/testeranto/testeranto">adamwong246.github.io/testeranto/testeranto</a></li>
|
|
26
26
|
<li>demo: <a href="https://www.youtube.com/embed/WvU5xMqGi6Q">youtube</a></li>
|
|
27
27
|
<li>source: <a href="https://github.com/adamwong246/testeranto">github.com/adamwong246/testeranto</a></li>
|
|
28
28
|
<li>npm: <a href="https://www.npmjs.com/package/testeranto">npmjs.com/package/testeranto</a></li>
|
|
29
|
-
<li>dev: <a href="https://github.dev/adamwong246/testeranto">github.dev/adamwong246/testeranto</a></li>
|
|
30
29
|
<li>example repo: <a href="https://github.com/adamwong246/testeranto-starter">testeranto-starter</a></li>
|
|
30
|
+
<li>tests report: <a href="https://adamwong246.github.io/testeranto/testeranto/index.html">adamwong246.github.io/testeranto/testeranto</a></li>
|
|
31
31
|
</ul>
|
|
32
32
|
<h2>What is testeranto?</h2>
|
|
33
33
|
<ul>
|
|
34
|
-
<li>Testeranto produces test results
|
|
35
|
-
<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
|
|
36
|
-
<li>Testeranto can run tests in the frontend
|
|
34
|
+
<li>Testeranto produces test results that can be fed to Aider.ai to automatically fix failing tests.</li>
|
|
35
|
+
<li>Testeranto tests are specified in a strongly-typed gherkin-like syntax. Rather than testing your code directly, Testeranto requires you to wrap your code with a semantic interface that is based on TS type signatures.</li>
|
|
36
|
+
<li>Testeranto can run tests in the frontend, the backend, or both.</li>
|
|
37
37
|
<li>Testeranto can be used to test anything that can be bundled with esbuild.</li>
|
|
38
38
|
<li>Testeranto connects "features" to "tests". This allows the AI to read feature documentation from external systems, like Jira.</li>
|
|
39
|
-
<li>Testeranto generates test results
|
|
40
|
-
<li>Testeranto uses esbuild to bundle
|
|
39
|
+
<li>Testeranto generates test results as a static website that can be easily deployed to GitHub Pages.</li>
|
|
40
|
+
<li>Testeranto uses esbuild to bundle its tests. The result is used to refine the list of files added to the AI's context. <strong>The consequence of this is that you can fit all relevant files, and only the relevant files, into the LLM's context.</strong></li>
|
|
41
41
|
</ul>
|
|
42
42
|
<h2>Key Technologies</h2>
|
|
43
43
|
<table>
|
|
@@ -75,10 +75,6 @@
|
|
|
75
75
|
<td>tsc</td>
|
|
76
76
|
<td>Type checking of test files</td>
|
|
77
77
|
</tr>
|
|
78
|
-
<tr>
|
|
79
|
-
<td>Markdown</td>
|
|
80
|
-
<td>Feature documentation format</td>
|
|
81
|
-
</tr>
|
|
82
78
|
</tbody></table>
|
|
83
79
|
<h2>Quick Start</h2>
|
|
84
80
|
<ol>
|
|
@@ -113,28 +109,24 @@ yarn t-run rectangle.test.ts yourProject dev</pre><p>or build and run your tests
|
|
|
113
109
|
<thead>
|
|
114
110
|
<tr>
|
|
115
111
|
<th></th>
|
|
116
|
-
<th>Runs on</th>
|
|
117
112
|
<th>You should use this runtime for...</th>
|
|
118
113
|
<th>Important differences</th>
|
|
119
114
|
</tr>
|
|
120
115
|
</thead>
|
|
121
116
|
<tbody><tr>
|
|
122
|
-
<td><strong>Node</strong
|
|
123
|
-
<td>node V8 with fork</td>
|
|
117
|
+
<td><strong>Node</strong> : node V8 with fork</td>
|
|
124
118
|
<td>testing backend code, Node APIs (like <code>fs</code> and <code>crypto</code>), or anything needing filesystem access</td>
|
|
125
119
|
<td>has access to the filesystem and io</td>
|
|
126
120
|
</tr>
|
|
127
121
|
<tr>
|
|
128
|
-
<td><strong>Web</strong
|
|
129
|
-
<td>chrome browser</td>
|
|
122
|
+
<td><strong>Web</strong> : chrome browser</td>
|
|
130
123
|
<td>testing frontend code, anything that uses <code>document</code> or <code>window</code>, UI interactions, or visual regression</td>
|
|
131
124
|
<td>can take screenshots/recordings</td>
|
|
132
125
|
</tr>
|
|
133
126
|
<tr>
|
|
134
|
-
<td><strong>Pure</strong
|
|
135
|
-
<td>node
|
|
136
|
-
<td>
|
|
137
|
-
<td>Very similar to "Node" but has no IO access and thus, no console.log. This runtime is theoretically faster.</td>
|
|
127
|
+
<td><strong>Pure</strong> : node v8, dynamically imported</td>
|
|
128
|
+
<td>testing code that can run on both node-v8 and the browser</td>
|
|
129
|
+
<td>Very similar to "Node" but has no IO access and thus no console.log. This runtime is theoretically faster.</td>
|
|
138
130
|
</tr>
|
|
139
131
|
</tbody></table>
|
|
140
132
|
<h2>CLI Commands</h2>
|
|
@@ -185,7 +177,7 @@ yarn t-run test/rectangle.test.ts once
|
|
|
185
177
|
# Get AI help with failures
|
|
186
178
|
yarn t-aider</pre><h2>Aider</h2>
|
|
187
179
|
<p>Testeranto generates a "prompt" alongside test results. This prompt is passed to aider as input.</p>
|
|
188
|
-
<pre>// input src files
|
|
180
|
+
<pre>// input src files that can be edited by Aider
|
|
189
181
|
/add test/node.ts
|
|
190
182
|
|
|
191
183
|
// test report files that inform aider but should not be edited
|
|
@@ -214,18 +206,19 @@ test0: Given.Default(
|
|
|
214
206
|
[Then.getWidth(4), Then.getHeight(19)]
|
|
215
207
|
),
|
|
216
208
|
...
|
|
217
|
-
</code></pre><h2>
|
|
218
|
-
<p>
|
|
219
|
-
<
|
|
220
|
-
<
|
|
209
|
+
</code></pre><h2><code>eslint</code> and <code>tsc</code></h2>
|
|
210
|
+
<p>Alongside the BDD tests, Testeranto runs ESLint and tsc on the input files to generate a list of static analysis errors and type errors, respectively.</p>
|
|
211
|
+
<hr>
|
|
212
|
+
<h2>Sidecars (COMING SOON)</h2>
|
|
213
|
+
<p>Alongside your test, you can include a number of "sidecars" - other bundled JavaScript assets upon which your test depends. For example, suppose you have an app with frontend and backend components. You could run a React test in the web and include the Node HTTP server as a sidecar.</p>
|
|
221
214
|
<h2>Subprojects</h2>
|
|
222
|
-
<p>Testeranto has a core repo, but there are also
|
|
215
|
+
<p>Testeranto has a core repo, but there are also sub-projects which implement tests by type and by technology</p>
|
|
223
216
|
<h3>testeranto-solidity</h3>
|
|
224
|
-
<p>Test a solidity contract. Also included is an example of deploying a
|
|
217
|
+
<p>Test a solidity contract. Also included is an example of deploying a contract to a ganache server.</p>
|
|
225
218
|
<h3>testeranto-reduxtoolkit</h3>
|
|
226
|
-
<p>
|
|
219
|
+
<p>Tests a Redux store.</p>
|
|
227
220
|
<h3>testeranto-http</h3>
|
|
228
|
-
<p>
|
|
221
|
+
<p>Tests a Node HTTP server.</p>
|
|
229
222
|
<h3>testeranto-react (COMING SOON)</h3>
|
|
230
223
|
<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>
|
|
231
224
|
<h3>testeranto-express (COMING SOON)</h3>
|
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.146.
|
|
4
|
+
"version": "0.146.5",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": "18.18.0"
|
|
7
7
|
},
|
|
@@ -132,7 +132,8 @@
|
|
|
132
132
|
"t-run": "tsx src/run.ts",
|
|
133
133
|
"t-init": "tsx dist/prebuild/init-docs.mjs",
|
|
134
134
|
"t-report": "tsx dist/prebuild/ReportServer.mjs",
|
|
135
|
-
"build-docs": "node scripts/compile-docs.js"
|
|
135
|
+
"build-docs": "node scripts/compile-docs.js",
|
|
136
|
+
"do_it": "clear && rm -rf testeranto/** && yarn build && yarn t-init && yarn t-build allTests once && yarn t-run allTests once && yarn build-docs && yarn type-check"
|
|
136
137
|
},
|
|
137
138
|
"peerDependencies": {
|
|
138
139
|
"@types/react": "18.2.0",
|
|
@@ -145,6 +146,9 @@
|
|
|
145
146
|
"typescript": "4.8.2",
|
|
146
147
|
"typescript-eslint": "^8.29.0"
|
|
147
148
|
},
|
|
149
|
+
"dependenciesPurpose": {
|
|
150
|
+
"express": "Used in unfinished feature 'mothership'"
|
|
151
|
+
},
|
|
148
152
|
"devDependencies": {
|
|
149
153
|
"@eslint/js": "^9.23.0",
|
|
150
154
|
"@swc/core": "^1.3.26",
|
|
@@ -159,8 +163,6 @@
|
|
|
159
163
|
"@typescript-eslint/eslint-plugin": "^5.46.0",
|
|
160
164
|
"@typescript-eslint/parser": "^5.46.0",
|
|
161
165
|
"marked": "^12.0.2",
|
|
162
|
-
"testeranto-solidity": "latest",
|
|
163
|
-
"testeranto_with_reduxjs_toolkit": "latest",
|
|
164
166
|
"ts-node": "^10.9.1",
|
|
165
167
|
"typescript": "^5.8.2"
|
|
166
168
|
},
|
|
@@ -176,7 +178,6 @@
|
|
|
176
178
|
"bootstrap": "^5.3.4",
|
|
177
179
|
"chai": "^5.2.0",
|
|
178
180
|
"chromium": "^3.0.3",
|
|
179
|
-
"dot-prop": "^9.0.0",
|
|
180
181
|
"esbuild": "0.17.5",
|
|
181
182
|
"esbuild-plugin-external-package": "^1.0.0",
|
|
182
183
|
"esbuild-plugin-import-map": "^2.1.0",
|
|
@@ -190,30 +191,19 @@
|
|
|
190
191
|
"express": "^4.21.2",
|
|
191
192
|
"fs-extra": "^11.2.0",
|
|
192
193
|
"fs.promises.exists": "^1.1.4",
|
|
193
|
-
"glob": "^10.3.12",
|
|
194
|
-
"is-path-inside": "^4.0.0",
|
|
195
|
-
"iterm-tab": "^0.4.0",
|
|
196
|
-
"live-server": "^1.2.2",
|
|
197
194
|
"mermaid": "^11.8.1",
|
|
198
195
|
"mermaid-isomorphic": "^3.0.4",
|
|
199
196
|
"node-static": "^0.7.11",
|
|
200
|
-
"octokit": "^4.1.2",
|
|
201
197
|
"puppeteer": "^24.4.0",
|
|
202
198
|
"puppeteer-core": "24.4.0",
|
|
203
199
|
"react": "18.2.0",
|
|
204
200
|
"react-bootstrap": "^2.10.9",
|
|
205
201
|
"react-dom": "18.2.0",
|
|
206
|
-
"
|
|
207
|
-
"react-test-renderer": "18.2.0",
|
|
208
|
-
"recursive-watch": "^1.1.4",
|
|
209
|
-
"rpc-over-ipc": "^1.0.0",
|
|
210
|
-
"testeranto": "^0.125.3",
|
|
202
|
+
"testeranto": "",
|
|
211
203
|
"tsc-prog": "^2.3.0",
|
|
212
204
|
"tsx": "^4.19.3",
|
|
213
205
|
"typescript-eslint": "^8.29.1",
|
|
214
206
|
"url": "^0.11.4",
|
|
215
|
-
"uuid": "^10.0.0"
|
|
216
|
-
"why-is-node-running": "^3.2.2",
|
|
217
|
-
"ws": "^8.16.0"
|
|
207
|
+
"uuid": "^10.0.0"
|
|
218
208
|
}
|
|
219
209
|
}
|
package/src/lib/basebuilder.ts
CHANGED
|
@@ -130,30 +130,6 @@ export abstract class BaseBuilder<
|
|
|
130
130
|
|
|
131
131
|
await puppetMaster.writeFileSync(`bdd_errors.txt`, fails.toString());
|
|
132
132
|
|
|
133
|
-
// await puppetMaster.writeFileSync(
|
|
134
|
-
// `index.html`,
|
|
135
|
-
// `
|
|
136
|
-
// <!DOCTYPE html>
|
|
137
|
-
// <html lang="en">
|
|
138
|
-
|
|
139
|
-
// <head>
|
|
140
|
-
// <meta name="description" content="Webpage description goes here" />
|
|
141
|
-
// <meta charset="utf-8" />
|
|
142
|
-
// <title>kokomoBay - testeranto</title>
|
|
143
|
-
// <meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
144
|
-
// <meta name="author" content="" />
|
|
145
|
-
|
|
146
|
-
// <link rel="stylesheet" href="/kokomoBay/testeranto/TestReport.css" />
|
|
147
|
-
// <script src="/kokomoBay/testeranto/TestReport.js"></script>
|
|
148
|
-
|
|
149
|
-
// </head>
|
|
150
|
-
|
|
151
|
-
// <body>
|
|
152
|
-
// <div id="root"/>
|
|
153
|
-
// </body>
|
|
154
|
-
// `
|
|
155
|
-
// );
|
|
156
|
-
|
|
157
133
|
await puppetMaster.writeFileSync(
|
|
158
134
|
`tests.json`,
|
|
159
135
|
JSON.stringify(this.toObj(), null, 2)
|
package/testeranto/Project.css
CHANGED
|
@@ -2030,10 +2030,6 @@ progress {
|
|
|
2030
2030
|
display: block;
|
|
2031
2031
|
padding: 0;
|
|
2032
2032
|
}
|
|
2033
|
-
.form-control::-moz-placeholder {
|
|
2034
|
-
color: var(--bs-secondary-color);
|
|
2035
|
-
opacity: 1;
|
|
2036
|
-
}
|
|
2037
2033
|
.form-control::placeholder {
|
|
2038
2034
|
color: var(--bs-secondary-color);
|
|
2039
2035
|
opacity: 1;
|
|
@@ -2513,19 +2509,10 @@ textarea.form-control-lg {
|
|
|
2513
2509
|
.form-floating > .form-control-plaintext {
|
|
2514
2510
|
padding: 1rem .75rem;
|
|
2515
2511
|
}
|
|
2516
|
-
.form-floating > .form-control-plaintext::-moz-placeholder,
|
|
2517
|
-
.form-floating > .form-control::-moz-placeholder {
|
|
2518
|
-
color: transparent;
|
|
2519
|
-
}
|
|
2520
2512
|
.form-floating > .form-control-plaintext::placeholder,
|
|
2521
2513
|
.form-floating > .form-control::placeholder {
|
|
2522
2514
|
color: transparent;
|
|
2523
2515
|
}
|
|
2524
|
-
.form-floating > .form-control-plaintext:not(:-moz-placeholder),
|
|
2525
|
-
.form-floating > .form-control:not(:-moz-placeholder) {
|
|
2526
|
-
padding-top: 1.625rem;
|
|
2527
|
-
padding-bottom: .625rem;
|
|
2528
|
-
}
|
|
2529
2516
|
.form-floating > .form-control-plaintext:focus,
|
|
2530
2517
|
.form-floating > .form-control-plaintext:not(:placeholder-shown),
|
|
2531
2518
|
.form-floating > .form-control:focus,
|
|
@@ -2543,9 +2530,6 @@ textarea.form-control-lg {
|
|
|
2543
2530
|
padding-bottom: .625rem;
|
|
2544
2531
|
padding-left: .75rem;
|
|
2545
2532
|
}
|
|
2546
|
-
.form-floating > .form-control:not(:-moz-placeholder) ~ label {
|
|
2547
|
-
transform: scale(.85) translateY(-.5rem) translateX(.15rem);
|
|
2548
|
-
}
|
|
2549
2533
|
.form-floating > .form-control-plaintext ~ label,
|
|
2550
2534
|
.form-floating > .form-control:focus ~ label,
|
|
2551
2535
|
.form-floating > .form-control:not(:placeholder-shown) ~ label,
|
|
@@ -2555,15 +2539,6 @@ textarea.form-control-lg {
|
|
|
2555
2539
|
.form-floating > .form-control:-webkit-autofill ~ label {
|
|
2556
2540
|
transform: scale(.85) translateY(-.5rem) translateX(.15rem);
|
|
2557
2541
|
}
|
|
2558
|
-
.form-floating > textarea:not(:-moz-placeholder) ~ label::after {
|
|
2559
|
-
position: absolute;
|
|
2560
|
-
inset: 1rem 0.375rem;
|
|
2561
|
-
z-index: -1;
|
|
2562
|
-
height: 1.5em;
|
|
2563
|
-
content: "";
|
|
2564
|
-
background-color: var(--bs-body-bg);
|
|
2565
|
-
border-radius: var(--bs-border-radius);
|
|
2566
|
-
}
|
|
2567
2542
|
.form-floating > textarea:focus ~ label::after,
|
|
2568
2543
|
.form-floating > textarea:not(:placeholder-shown) ~ label::after {
|
|
2569
2544
|
position: absolute;
|
|
@@ -11360,7 +11335,7 @@ footer {
|
|
|
11360
11335
|
|
|
11361
11336
|
bootstrap/dist/css/bootstrap.min.css:
|
|
11362
11337
|
(*!
|
|
11363
|
-
* Bootstrap v5.3.
|
|
11338
|
+
* Bootstrap v5.3.5 (https://getbootstrap.com/)
|
|
11364
11339
|
* Copyright 2011-2025 The Bootstrap Authors
|
|
11365
11340
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
11366
11341
|
*)
|