testeranto 0.134.0 → 0.140.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/.aider.chat.history.md +14577 -0
  2. package/.aider.input.history +566 -0
  3. package/.aider.tags.cache.v3/{8d/fa/12860238755bcfab9af8a93c52ab.val → bd/91/b71f967fd074cf4b757081b429b7.val} +0 -0
  4. package/.aider.tags.cache.v3/cache.db +0 -0
  5. package/.aider.tags.cache.v3/{18/8b/7dfca822129dad10b5cacadf7728.val → fb/96/b0f91c7e75e08fc5a6907633cf99.val} +0 -0
  6. package/README.md +29 -423
  7. package/bundle.js +1 -1
  8. package/dist/common/src/CoreTypes.js +2 -0
  9. package/dist/common/src/Init.js +4 -1
  10. package/dist/common/src/Node.js +1 -1
  11. package/dist/common/src/PM/PM_WithEslintAndTsc.js +10 -8
  12. package/dist/common/src/PM/__tests__/nodeSidecar.testeranto.js +2 -2
  13. package/dist/common/src/PM/main.js +12 -7
  14. package/dist/common/src/PM/node.js +10 -3
  15. package/dist/common/src/Web.js +2 -2
  16. package/dist/common/src/build.js +7 -72
  17. package/dist/common/src/defaultConfig.js +0 -1
  18. package/dist/common/src/esbuildConfigs/eslint-formatter-testeranto.js +16 -1
  19. package/dist/common/src/esbuildConfigs/node.js +2 -16
  20. package/dist/common/src/esbuildConfigs/pure.js +2 -16
  21. package/dist/common/src/esbuildConfigs/rebuildPlugin.js +22 -0
  22. package/dist/common/src/esbuildConfigs/web.js +2 -16
  23. package/dist/common/src/lib/abstractBase.js +8 -1
  24. package/dist/common/src/lib/basebuilder.js +4 -0
  25. package/dist/common/src/lib/classBuilder.js +2 -3
  26. package/dist/common/src/lib/core.js +2 -0
  27. package/dist/common/src/run.js +1 -1
  28. package/dist/common/src/utils/buildTemplates.js +88 -0
  29. package/dist/common/tsconfig.common.tsbuildinfo +1 -1
  30. package/dist/module/src/Init.js +4 -1
  31. package/dist/module/src/Node.js +1 -1
  32. package/dist/module/src/PM/PM_WithEslintAndTsc.js +10 -8
  33. package/dist/module/src/PM/__tests__/nodeSidecar.testeranto.js +2 -2
  34. package/dist/module/src/PM/main.js +12 -7
  35. package/dist/module/src/PM/node.js +10 -3
  36. package/dist/module/src/Project.js +41 -47
  37. package/dist/module/src/TestReport.js +34 -31
  38. package/dist/module/src/Web.js +2 -2
  39. package/dist/module/src/build.js +7 -72
  40. package/dist/module/src/defaultConfig.js +0 -1
  41. package/dist/module/src/esbuildConfigs/eslint-formatter-testeranto.js +16 -1
  42. package/dist/module/src/esbuildConfigs/node.js +2 -16
  43. package/dist/module/src/esbuildConfigs/pure.js +2 -16
  44. package/dist/module/src/esbuildConfigs/rebuildPlugin.js +17 -0
  45. package/dist/module/src/esbuildConfigs/web.js +2 -16
  46. package/dist/module/src/lib/abstractBase.js +8 -1
  47. package/dist/module/src/lib/basebuilder.js +4 -0
  48. package/dist/module/src/lib/classBuilder.js +2 -3
  49. package/dist/module/src/lib/core.js +2 -0
  50. package/dist/module/src/run.js +1 -1
  51. package/dist/module/src/utils/buildTemplates.js +82 -0
  52. package/dist/module/tsconfig.module.tsbuildinfo +1 -1
  53. package/dist/prebuild/Project.js +77 -29
  54. package/dist/prebuild/TestReport.js +51 -32
  55. package/dist/prebuild/build.mjs +132 -131
  56. package/dist/prebuild/esbuildConfigs/eslint-formatter-testeranto.mjs +14 -1
  57. package/dist/prebuild/init-docs.mjs +0 -4
  58. package/dist/prebuild/run.mjs +50 -31
  59. package/dist/tsconfig.tsbuildinfo +1 -0
  60. package/dist/types/src/CoreTypes.d.ts +53 -0
  61. package/dist/types/src/Node.d.ts +3 -3
  62. package/dist/types/src/PM/__tests__/nodeSidecar.testeranto.d.ts +2 -4
  63. package/dist/types/src/PM/__tests__/pureSidecar.testeranto.d.ts +2 -4
  64. package/dist/types/src/PM/__tests__/webSidecar.testeranto.d.ts +2 -4
  65. package/dist/types/src/PM/index.d.ts +1 -1
  66. package/dist/types/src/PM/nodeSidecar.d.ts +2 -2
  67. package/dist/types/src/Pure.d.ts +3 -3
  68. package/dist/types/src/Types.d.ts +21 -61
  69. package/dist/types/src/Web.d.ts +3 -3
  70. package/dist/types/src/esbuildConfigs/rebuildPlugin.d.ts +6 -0
  71. package/dist/types/src/lib/abstractBase.d.ts +10 -16
  72. package/dist/types/src/lib/basebuilder.d.ts +3 -3
  73. package/dist/types/src/lib/classBuilder.d.ts +2 -2
  74. package/dist/types/src/lib/core.d.ts +2 -2
  75. package/dist/types/src/lib/index.d.ts +7 -6
  76. package/dist/types/src/lib/types.d.ts +8 -8
  77. package/dist/types/src/mothership/test.d.ts +2 -2
  78. package/dist/types/src/utils/buildTemplates.d.ts +3 -0
  79. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  80. package/docs/index.md +567 -0
  81. package/docs/style.md +116 -0
  82. package/docs.html +537 -0
  83. package/example.css +351 -0
  84. package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-Black.ttf +0 -0
  85. package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-Bold.ttf +0 -0
  86. package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-ExtraBold.ttf +0 -0
  87. package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-Light.ttf +0 -0
  88. package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-Medium.ttf +0 -0
  89. package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-Regular.ttf +0 -0
  90. package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-Thin.ttf +0 -0
  91. package/fonts/M_PLUS_Rounded_1c/OFL.txt +91 -0
  92. package/index.html +245 -24
  93. package/logo.svg +72 -0
  94. package/package.json +11 -2
  95. package/scripts/compile-docs.js +89 -0
  96. package/src/CoreTypes.ts +152 -0
  97. package/src/Init.ts +4 -4
  98. package/src/Node.ts +13 -13
  99. package/src/PM/PM_WithEslintAndTsc.ts +46 -15
  100. package/src/PM/__tests__/nodeSidecar.testeranto.ts +13 -20
  101. package/src/PM/__tests__/pureSidecar.testeranto.ts +8 -15
  102. package/src/PM/__tests__/webSidecar.testeranto.ts +8 -15
  103. package/src/PM/index.ts +1 -1
  104. package/src/PM/main.ts +17 -16
  105. package/src/PM/node.ts +10 -10
  106. package/src/PM/nodeSidecar.ts +2 -2
  107. package/src/PM/pure.ts +0 -4
  108. package/src/Project.tsx +289 -292
  109. package/src/Pure.ts +13 -14
  110. package/src/PureSidecar.ts +1 -0
  111. package/src/TestReport.tsx +179 -165
  112. package/src/Types.ts +52 -151
  113. package/src/Web.ts +15 -14
  114. package/src/build.ts +22 -72
  115. package/src/defaultConfig.ts +2 -1
  116. package/src/esbuildConfigs/eslint-formatter-testeranto.ts +17 -1
  117. package/src/esbuildConfigs/node.ts +2 -18
  118. package/src/esbuildConfigs/pure.ts +2 -18
  119. package/src/esbuildConfigs/rebuildPlugin.ts +23 -0
  120. package/src/esbuildConfigs/web.ts +2 -18
  121. package/src/lib/BaseSuite.test.ts +457 -0
  122. package/src/lib/BaseSuite.ts +155 -0
  123. package/src/lib/abstractBase.ts +13 -163
  124. package/src/lib/basebuilder.ts +11 -11
  125. package/src/lib/classBuilder.ts +13 -7
  126. package/src/lib/core.ts +13 -17
  127. package/src/lib/index.ts +21 -24
  128. package/src/lib/types.ts +23 -9
  129. package/src/mothership/test.ts +13 -10
  130. package/src/run.ts +1 -1
  131. package/src/style.css +1 -1
  132. package/src/utils/buildTemplates.ts +88 -0
  133. package/style.css +496 -0
  134. package/testeranto/bundles/node/{mothership/chunk-V2EQEXU2.mjs → allTests/chunk-4PJCC2XT.mjs} +66 -59
  135. package/testeranto/bundles/node/allTests/metafile.json +4151 -0
  136. package/testeranto/bundles/node/allTests/src/PM/__tests__/nodeSidecar.testeranto.mjs +187 -0
  137. package/testeranto/bundles/node/{mothership → allTests}/src/PM/__tests__/pureSidecar.testeranto.mjs +1 -1
  138. package/testeranto/bundles/node/{mothership → allTests}/src/PM/__tests__/webSidecar.testeranto.mjs +1 -1
  139. package/testeranto/bundles/node/allTests/src/lib/BaseSuite.test.mjs +305 -0
  140. package/testeranto/bundles/node/{mothership → allTests}/src/mothership/test.mjs +1 -1
  141. package/testeranto/dev.html +29 -0
  142. package/testeranto/index.html +28 -27
  143. package/testeranto/reports/allTests/config.json +57 -0
  144. package/testeranto/reports/{mothership/index.html → allTests/dev.html} +2 -0
  145. package/testeranto/reports/allTests/index.html +26 -0
  146. package/testeranto/reports/{mothership/src/PM/__tests__/sidecar.testeranto/node/index.html → allTests/src/PM/__tests__/nodeSidecar.testeranto/node/dev.html} +4 -3
  147. package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/index.html +21 -0
  148. package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/lint_errors.json +80 -0
  149. package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/message +1 -0
  150. package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/prompt.txt +8 -0
  151. package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/type_errors.txt +28 -0
  152. package/testeranto/reports/{mothership/src/PM/__tests__/webSidecar.testeranto/node/index.html → allTests/src/PM/__tests__/pureSidecar.testeranto/node/dev.html} +4 -3
  153. package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/index.html +21 -0
  154. package/testeranto/reports/{mothership → allTests}/src/PM/__tests__/pureSidecar.testeranto/node/lint_errors.json +12 -12
  155. package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/message +1 -0
  156. package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/prompt.txt +8 -0
  157. package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/type_errors.txt +32 -0
  158. package/testeranto/reports/{mothership/src/PM/__tests__/nodeSidecar.testeranto/node/index.html → allTests/src/PM/__tests__/webSidecar.testeranto/node/dev.html} +4 -3
  159. package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/index.html +21 -0
  160. package/testeranto/reports/{mothership → allTests}/src/PM/__tests__/webSidecar.testeranto/node/lint_errors.json +12 -12
  161. package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/message +1 -0
  162. package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/prompt.txt +8 -0
  163. package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/type_errors.txt +32 -0
  164. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/console_log.txt +35 -0
  165. package/testeranto/reports/{mothership/src/PM/__tests__/pureSidecar.testeranto/node/index.html → allTests/src/lib/BaseSuite.test/node/dev.html} +4 -3
  166. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/index.html +21 -0
  167. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/lint_errors.json +608 -0
  168. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/message +1 -0
  169. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/prompt.txt +7 -0
  170. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/type_errors.txt +68 -0
  171. package/testeranto/reports/allTests/src/mothership/test/node/dev.html +21 -0
  172. package/testeranto/reports/allTests/src/mothership/test/node/index.html +21 -0
  173. package/testeranto/reports/allTests/src/mothership/test/node/message +1 -0
  174. package/testeranto/reports/allTests/src/mothership/test/node/prompt.txt +8 -0
  175. package/testeranto/reports/allTests/src/mothership/test/node/type_errors.txt +24 -0
  176. package/testeranto/reports/allTests/summary.json +37 -0
  177. package/testeranto.config.ts +16 -26
  178. package/tsc.log +66 -69
  179. package/.aider.tags.cache.v3/cache.db-shm +0 -0
  180. package/.aider.tags.cache.v3/cache.db-wal +0 -0
  181. package/dist/common/src/SP__Polygon.test.js +0 -10
  182. package/dist/module/src/ReportClient.js +0 -132
  183. package/dist/module/src/SP__Polygon.test.js +0 -8
  184. package/dist/prebuild/ReportClient.js +0 -3
  185. package/src/ReportClient.tsx +0 -164
  186. package/src/SP__Polygon.test.ts +0 -13
  187. package/testeranto/ReportClient.css +0 -11367
  188. package/testeranto/ReportClient.js +0 -24641
  189. package/testeranto/bundles/node/mothership/metafile.json +0 -389
  190. package/testeranto/bundles/node/mothership/src/PM/__tests__/nodeSidecar.testeranto.mjs +0 -1219
  191. package/testeranto/bundles/node/mothership/src/PM/__tests__/sidecar.testeranto.mjs +0 -1199
  192. package/testeranto/reports/mothership/config.json +0 -25
  193. package/testeranto/reports/mothership/src/PM/__tests__/nodeSidecar.testeranto/node/console_log.txt +0 -0
  194. package/testeranto/reports/mothership/src/PM/__tests__/nodeSidecar.testeranto/node/lint_errors.json +0 -1564
  195. package/testeranto/reports/mothership/src/PM/__tests__/nodeSidecar.testeranto/node/prompt.txt +0 -22
  196. package/testeranto/reports/mothership/src/PM/__tests__/nodeSidecar.testeranto/node/type_errors.txt +0 -35
  197. package/testeranto/reports/mothership/src/PM/__tests__/pureSidecar.testeranto/node/prompt.txt +0 -12
  198. package/testeranto/reports/mothership/src/PM/__tests__/pureSidecar.testeranto/node/type_errors.txt +0 -26
  199. package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/bdd_errors.txt +0 -1
  200. package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/console_log.txt +0 -0
  201. package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/lint_errors.json +0 -1564
  202. package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/log.txt +0 -0
  203. package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/prompt.txt +0 -22
  204. package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/tests.json +0 -56
  205. package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/type_errors.txt +0 -29
  206. package/testeranto/reports/mothership/src/PM/__tests__/webSidecar.testeranto/node/prompt.txt +0 -12
  207. package/testeranto/reports/mothership/src/PM/__tests__/webSidecar.testeranto/node/type_errors.txt +0 -26
  208. package/testeranto/reports/mothership/src/mothership/test/node/bdd_errors.txt +0 -1
  209. package/testeranto/reports/mothership/src/mothership/test/node/console_log.txt +0 -4
  210. package/testeranto/reports/mothership/src/mothership/test/node/index.html +0 -20
  211. package/testeranto/reports/mothership/src/mothership/test/node/log.txt +0 -0
  212. package/testeranto/reports/mothership/src/mothership/test/node/prompt.txt +0 -12
  213. package/testeranto/reports/mothership/src/mothership/test/node/tests.json +0 -24
  214. package/testeranto/reports/mothership/src/mothership/test/node/type_errors.txt +0 -18
  215. package/testeranto/reports/mothership/summary.json +0 -9
  216. /package/dist/{types/src/SP__Polygon.test.d.ts → module/src/CoreTypes.js} +0 -0
  217. /package/testeranto/bundles/node/{mothership → allTests}/chunk-PG6KUKNP.mjs +0 -0
  218. /package/testeranto/bundles/pure/{mothership → allTests}/metafile.json +0 -0
  219. /package/testeranto/bundles/web/{mothership → allTests}/metafile.json +0 -0
  220. /package/testeranto/reports/{mothership/src/PM/__tests__/nodeSidecar.testeranto → allTests/src/lib/BaseSuite.test}/node/log.txt +0 -0
  221. /package/testeranto/reports/{mothership → allTests}/src/mothership/test/node/lint_errors.json +0 -0
@@ -1,174 +1,19 @@
1
1
  /* eslint-disable @typescript-eslint/no-unused-vars */
2
2
  /* eslint-disable @typescript-eslint/no-explicit-any */
3
- import type { IT, OT } from "../Types.js";
4
3
 
5
- import { ITTestResourceConfiguration, ITestArtifactory, ITLog } from ".";
4
+ import { ITestArtifactory, ITLog, ITTestResourceConfiguration } from ".";
6
5
  import { IPM } from "./types.js";
7
6
  import {
8
- afterAllProxy,
9
7
  afterEachProxy,
10
8
  andWhenProxy,
11
- beforeAllProxy,
12
9
  beforeEachProxy,
13
10
  butThenProxy,
14
11
  } from "./pmProxy.js";
12
+ import type { Ibdd_in_any } from "../CoreTypes";
15
13
 
16
- export type IGivens<I extends IT> = Record<string, BaseGiven<I>>;
14
+ export type IGivens<I extends Ibdd_in_any> = Record<string, BaseGiven<I>>;
17
15
 
18
- export abstract class BaseSuite<I extends IT = IT, O extends OT = OT> {
19
- name: string;
20
- givens: IGivens<I>;
21
- checks: BaseCheck<I>[];
22
- store: I["istore"];
23
- testResourceConfiguration: ITTestResourceConfiguration;
24
- index: number;
25
- failed: boolean;
26
- fails: number;
27
-
28
- constructor(
29
- name: string,
30
- index: number,
31
- givens: IGivens<I> = {},
32
- checks: BaseCheck<I>[] = []
33
- ) {
34
- this.name = name;
35
- this.index = index;
36
- this.givens = givens;
37
- this.checks = checks;
38
- this.fails = 0;
39
- }
40
-
41
- public features() {
42
- const features = Object.keys(this.givens)
43
- .map((k) => this.givens[k].features)
44
- .flat()
45
- .filter((value, index, array) => {
46
- return array.indexOf(value) === index;
47
- });
48
- return features || [];
49
- }
50
-
51
- public toObj() {
52
- const givens = Object.keys(this.givens).map((k) => this.givens[k].toObj());
53
- const checks = Object.keys(this.checks).map((k) => this.checks[k].toObj());
54
-
55
- return {
56
- name: this.name,
57
- givens,
58
- checks,
59
- fails: this.fails,
60
- failed: this.failed,
61
- features: this.features(),
62
- };
63
- }
64
-
65
- setup(
66
- s: I["iinput"],
67
- artifactory: ITestArtifactory,
68
- tr: ITTestResourceConfiguration,
69
- pm: IPM
70
- ): Promise<I["isubject"]> {
71
- return new Promise((res) => res(s as unknown as I["isubject"]));
72
- }
73
-
74
- assertThat(t: Awaited<I["then"]> | undefined): boolean {
75
- return !!t;
76
- }
77
-
78
- afterAll(store: I["istore"], artifactory: ITestArtifactory, pm: IPM) {
79
- return store;
80
- }
81
-
82
- async run(
83
- input: I["iinput"],
84
- testResourceConfiguration: ITTestResourceConfiguration,
85
- artifactory: (fPath: string, value: unknown) => void,
86
- tLog: (...string) => void,
87
- pm: IPM
88
- ): Promise<BaseSuite<I, O>> {
89
- this.testResourceConfiguration = testResourceConfiguration;
90
- // tLog("test resources: ", JSON.stringify(testResourceConfiguration));
91
-
92
- const suiteArtifactory = (fPath: string, value: unknown) =>
93
- artifactory(`suite-${this.index}-${this.name}/${fPath}`, value);
94
-
95
- // console.log("\nSuite:", this.index, this.name);
96
- tLog("\nSuite:", this.index, this.name);
97
- const sNdx = this.index;
98
- // const sName = this.name;
99
-
100
- const subject = await this.setup(
101
- input,
102
- suiteArtifactory,
103
- testResourceConfiguration,
104
- beforeAllProxy(pm, sNdx.toString())
105
- );
106
-
107
- for (const [gKey, g] of Object.entries(this.givens)) {
108
- const giver = this.givens[gKey];
109
- try {
110
- this.store = await giver.give(
111
- subject,
112
- gKey,
113
- testResourceConfiguration,
114
- this.assertThat,
115
- suiteArtifactory,
116
- tLog,
117
- pm,
118
- sNdx
119
- );
120
- } catch (e) {
121
- this.failed = true;
122
- this.fails = this.fails + 1;
123
- console.error(e);
124
- // this.fails.push(giver);
125
- // return this;
126
- }
127
- }
128
-
129
- for (const [ndx, thater] of this.checks.entries()) {
130
- await thater.check(
131
- subject,
132
- thater.name,
133
- testResourceConfiguration,
134
- this.assertThat,
135
- suiteArtifactory,
136
- tLog,
137
- pm
138
- );
139
- }
140
-
141
- try {
142
- this.afterAll(
143
- this.store,
144
- artifactory,
145
- afterAllProxy(pm, sNdx.toString())
146
- );
147
- } catch (e) {
148
- console.error(e);
149
- // this.fails.push(this);
150
- // return this;
151
- }
152
-
153
- // @TODO fix me
154
- // for (const k of Object.keys(this.givens)) {
155
- // const giver = this.givens[k];
156
-
157
- // try {
158
- // giver.afterAll(this.store, artifactory, pm);
159
- // } catch (e) {
160
- // console.error(e);
161
- // this.fails.push(giver);
162
- // return this;
163
- // }
164
- // }
165
- ////////////////
166
-
167
- return this;
168
- }
169
- }
170
-
171
- export abstract class BaseGiven<I extends IT = IT> {
16
+ export abstract class BaseGiven<I extends Ibdd_in_any> {
172
17
  name: string;
173
18
  features: string[];
174
19
  whens: BaseWhen<I>[];
@@ -206,7 +51,12 @@ export abstract class BaseGiven<I extends IT = IT> {
206
51
  return {
207
52
  key: this.key,
208
53
  name: this.name,
209
- whens: this.whens.map((w) => w.toObj()),
54
+ whens: this.whens.map((w) => {
55
+ if (w && w.toObj) return w.toObj();
56
+
57
+ console.error("w is not as expected!", w);
58
+ return {};
59
+ }),
210
60
  thens: this.thens.map((t) => t.toObj()),
211
61
  error: this.error ? [this.error, this.error.stack] : null,
212
62
  failed: this.failed,
@@ -324,7 +174,7 @@ export abstract class BaseGiven<I extends IT = IT> {
324
174
  }
325
175
  }
326
176
 
327
- export abstract class BaseWhen<I extends IT> {
177
+ export abstract class BaseWhen<I extends Ibdd_in_any> {
328
178
  public name: string;
329
179
  whenCB: (x: I["iselection"]) => I["then"];
330
180
  error: Error;
@@ -371,7 +221,7 @@ export abstract class BaseWhen<I extends IT> {
371
221
  }
372
222
  }
373
223
 
374
- export abstract class BaseThen<I extends IT> {
224
+ export abstract class BaseThen<I extends Ibdd_in_any> {
375
225
  public name: string;
376
226
  thenCB: (storeState: I["iselection"]) => Promise<I["then"]>;
377
227
  error: boolean;
@@ -430,7 +280,7 @@ export abstract class BaseThen<I extends IT> {
430
280
  check() {}
431
281
  }
432
282
 
433
- export abstract class BaseCheck<I extends IT = IT> {
283
+ export abstract class BaseCheck<I extends Ibdd_in_any> {
434
284
  key: string;
435
285
  name: string;
436
286
  features: string[];
@@ -2,11 +2,16 @@
2
2
  /* eslint-disable @typescript-eslint/no-empty-object-type */
3
3
  /* eslint-disable no-async-promise-executor */
4
4
  /* eslint-disable @typescript-eslint/no-explicit-any */
5
+
5
6
  import { PassThrough } from "stream";
6
7
 
7
- import { IT, ITestSpecification, OT } from "../Types.js";
8
+ import type {
9
+ Ibdd_in_any,
10
+ Ibdd_out_any,
11
+ ITestSpecification,
12
+ } from "../CoreTypes";
8
13
 
9
- import { ITTestResourceRequest, ITestJob, ITLog, IFinalResults } from ".";
14
+ import { ITestJob, ITLog, IFinalResults, ITTestResourceRequest } from ".";
10
15
  import {
11
16
  ISuiteKlasser,
12
17
  IGivenKlasser,
@@ -15,17 +20,12 @@ import {
15
20
  ICheckKlasser,
16
21
  IPM,
17
22
  } from "./types.js";
18
- import {
19
- BaseCheck,
20
- BaseSuite,
21
- BaseWhen,
22
- BaseThen,
23
- BaseGiven,
24
- } from "./abstractBase.js";
23
+ import { BaseCheck, BaseWhen, BaseThen, BaseGiven } from "./abstractBase.js";
24
+ import { BaseSuite } from "./BaseSuite";
25
25
 
26
26
  export abstract class BaseBuilder<
27
- I extends IT,
28
- O extends OT,
27
+ I extends Ibdd_in_any,
28
+ O extends Ibdd_out_any,
29
29
  SuiteExtensions,
30
30
  GivenExtensions,
31
31
  WhenExtensions,
@@ -1,6 +1,11 @@
1
1
  /* eslint-disable @typescript-eslint/no-unused-vars */
2
2
  /* eslint-disable @typescript-eslint/no-explicit-any */
3
- import { IT, ITestImplementation, ITestSpecification, OT } from "../Types.js";
3
+ import type {
4
+ Ibdd_in_any,
5
+ Ibdd_out_any,
6
+ ITestImplementation,
7
+ ITestSpecification,
8
+ } from "../CoreTypes";
4
9
 
5
10
  import { BaseBuilder } from "./basebuilder.js";
6
11
  import {
@@ -16,8 +21,8 @@ import { BaseCheck } from "./abstractBase.js";
16
21
  type IExtenstions = Record<string, unknown>;
17
22
 
18
23
  export abstract class ClassBuilder<
19
- I extends IT = IT,
20
- O extends OT = OT,
24
+ I extends Ibdd_in_any = Ibdd_in_any,
25
+ O extends Ibdd_out_any = Ibdd_out_any,
21
26
  M = unknown
22
27
  > extends BaseBuilder<
23
28
  I,
@@ -63,7 +68,6 @@ export abstract class ClassBuilder<
63
68
  const classyGivens = Object.entries(testImplementation.givens).reduce(
64
69
  (a, [key, g]) => {
65
70
  a[key] = (features, whens, thens, ...initialValues) => {
66
- // console.log("givEn", givEn.toString());
67
71
  return new givenKlasser.prototype.constructor(
68
72
  key,
69
73
  features,
@@ -80,10 +84,10 @@ export abstract class ClassBuilder<
80
84
 
81
85
  const classyWhens = Object.entries(testImplementation.whens).reduce(
82
86
  (a, [key, whEn]: [string, (x) => any]) => {
83
- a[key] = (payload?: any) => {
87
+ a[key] = (...payload: any) => {
84
88
  return new whenKlasser.prototype.constructor(
85
89
  `${whEn.name}: ${payload && payload.toString()}`,
86
- whEn(payload)
90
+ whEn(...payload)
87
91
  );
88
92
  };
89
93
  return a;
@@ -91,7 +95,9 @@ export abstract class ClassBuilder<
91
95
  {}
92
96
  );
93
97
 
94
- const classyThens = Object.entries<(expected: any, ...x: any[]) => any>(testImplementation.thens).reduce(
98
+ const classyThens = Object.entries<(expected: any, ...x: any[]) => any>(
99
+ testImplementation.thens
100
+ ).reduce(
95
101
  (a, [key, thEn]: [string, (s: I["iselection"]) => I["isubject"]]) => {
96
102
  a[key] = (expected, ...x) => {
97
103
  return new thenKlasser.prototype.constructor(
package/src/lib/core.ts CHANGED
@@ -1,12 +1,5 @@
1
+ /* eslint-disable @typescript-eslint/no-unused-vars */
1
2
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
- import {
3
- ITestSpecification,
4
- ITestImplementation,
5
- ITestInterface,
6
- IT,
7
- OT,
8
- } from "../Types.js";
9
-
10
3
  import {
11
4
  DefaultTestInterface,
12
5
  IFinalResults,
@@ -15,19 +8,22 @@ import {
15
8
  ITestArtifactory,
16
9
  defaultTestResourceRequirement,
17
10
  } from "./index.js";
18
- import {
19
- BaseSuite,
20
- BaseGiven,
21
- BaseWhen,
22
- BaseThen,
23
- BaseCheck,
24
- } from "./abstractBase.js";
11
+ import { BaseGiven, BaseWhen, BaseThen, BaseCheck } from "./abstractBase.js";
25
12
  import { ClassBuilder } from "./classBuilder.js";
26
13
  import { IPM } from "./types";
27
14
 
15
+ import type {
16
+ Ibdd_in_any,
17
+ Ibdd_out_any,
18
+ ITestImplementation,
19
+ ITestInterface,
20
+ ITestSpecification,
21
+ } from "../CoreTypes";
22
+ import { BaseSuite } from "./BaseSuite.js";
23
+
28
24
  export default abstract class Testeranto<
29
- I extends IT,
30
- O extends OT,
25
+ I extends Ibdd_in_any,
26
+ O extends Ibdd_out_any,
31
27
  M
32
28
  > extends ClassBuilder<I, O, M> {
33
29
  constructor(
package/src/lib/index.ts CHANGED
@@ -4,21 +4,20 @@ import { PM_Pure } from "../PM/pure.js";
4
4
 
5
5
  import { PM_Node } from "../PM/node.js";
6
6
  import { PM_Web } from "../PM/web.js";
7
- import {
8
- Ibdd_in,
9
- ITestInterface,
10
- ITestconfig,
11
- IBuiltConfig,
12
- IRunTime,
13
- ITestTypes,
14
- IT,
15
- OT,
16
- } from "../Types.js";
17
-
18
- import { IGivens, BaseCheck, BaseSuite } from "./abstractBase.js";
19
- import { IPM } from "./types.js";
7
+ import { ITestconfig, IBuiltConfig, IRunTime, ITestTypes } from "../Types.js";
20
8
 
21
- export const BaseTestInterface = <T extends IT>(): ITestInterface<T> => ({
9
+ import { IGivens, BaseCheck } from "./abstractBase.js";
10
+ import { IPM } from "./types.js";
11
+ import type {
12
+ ITestInterface,
13
+ Ibdd_in_any,
14
+ Ibdd_out_any,
15
+ } from "../CoreTypes.js";
16
+ import { BaseSuite } from "./BaseSuite.js";
17
+
18
+ export const BaseTestInterface = <
19
+ T extends Ibdd_in_any
20
+ >(): ITestInterface<T> => ({
22
21
  beforeAll: async (s: T["istore"]) => s,
23
22
  beforeEach: async function (
24
23
  subject: T["isubject"],
@@ -32,14 +31,14 @@ export const BaseTestInterface = <T extends IT>(): ITestInterface<T> => ({
32
31
  afterEach: async (s: T["istore"]) => s,
33
32
  afterAll: (store: T["istore"]) => undefined,
34
33
  butThen: async (
35
- store: IT["istore"],
36
- thenCb: (s: IT["iselection"]) => Promise<IT["isubject"]>
34
+ store: T["istore"],
35
+ thenCb: (s: T["iselection"]) => Promise<T["isubject"]>
37
36
  ) => {
38
37
  return thenCb(store);
39
38
  },
40
39
  andWhen: async (
41
- store: IT["istore"],
42
- whenCB: IT["when"],
40
+ store: T["istore"],
41
+ whenCB: T["when"],
43
42
  testResource: ITTestResourceConfiguration,
44
43
  pm: IPM
45
44
  ) => {
@@ -53,7 +52,7 @@ export const BaseTestInterface = <T extends IT>(): ITestInterface<T> => ({
53
52
  assertThis: (x: any) => x,
54
53
  });
55
54
 
56
- export const DefaultTestInterface = <T extends IT>(
55
+ export const DefaultTestInterface = <T extends Ibdd_in_any>(
57
56
  p: Partial<ITestInterface<T>>
58
57
  ): ITestInterface<T> => {
59
58
  return {
@@ -99,10 +98,8 @@ export type ITestArtificer = (key: string, data: any) => void;
99
98
  type ITest = {
100
99
  toObj(): object;
101
100
  name: string;
102
- givens: IGivens<
103
- Ibdd_in<unknown, unknown, unknown, unknown, unknown, unknown, unknown>
104
- >;
105
- checks: BaseCheck<IT>[];
101
+ givens: IGivens<Ibdd_in_any>;
102
+ checks: BaseCheck<Ibdd_in_any>[];
106
103
  testResourceConfiguration: ITTestResourceConfiguration;
107
104
  };
108
105
 
@@ -112,7 +109,7 @@ export type ITestJob = {
112
109
  runner: (
113
110
  x: ITTestResourceConfiguration,
114
111
  t: ITLog
115
- ) => Promise<BaseSuite<IT, OT>>;
112
+ ) => Promise<BaseSuite<Ibdd_in_any, Ibdd_out_any>>;
116
113
  testResourceRequirement: ITTestResourceRequirement;
117
114
  receiveTestResourceConfig: (pm: PM_Node | PM_Web | PM_Pure) => IFinalResults;
118
115
  };
package/src/lib/types.ts CHANGED
@@ -1,21 +1,26 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import type { Ibdd_in_any, Ibdd_out_any } from "../CoreTypes";
2
3
  import { PM_Node } from "../PM/node";
3
4
  import { PM_Pure } from "../PM/pure";
4
5
  import { PM_Web } from "../PM/web";
5
- import type { IT, OT } from "../Types";
6
6
 
7
7
  import {
8
8
  IGivens,
9
9
  BaseCheck,
10
- BaseSuite,
11
10
  BaseGiven,
12
11
  BaseWhen,
13
12
  BaseThen,
14
13
  } from "./abstractBase";
14
+ import { BaseSuite } from "./BaseSuite";
15
15
 
16
16
  export type IPM = PM_Node | PM_Web | PM_Pure;
17
17
 
18
- export type TestPhase = 'beforeAll' | 'beforeEach' | 'test' | 'afterEach' | 'afterAll';
18
+ export type TestPhase =
19
+ | "beforeAll"
20
+ | "beforeEach"
21
+ | "test"
22
+ | "afterEach"
23
+ | "afterAll";
19
24
 
20
25
  export type TestError = {
21
26
  phase: TestPhase;
@@ -27,7 +32,10 @@ export type TestError = {
27
32
  isRetryable?: boolean;
28
33
  };
29
34
 
30
- export type ITestCheckCallback<I extends IT, O extends OT> = {
35
+ export type ITestCheckCallback<
36
+ I extends Ibdd_in_any,
37
+ O extends Ibdd_out_any
38
+ > = {
31
39
  [K in keyof O["checks"]]: (
32
40
  name: string,
33
41
  features: string[],
@@ -37,14 +45,14 @@ export type ITestCheckCallback<I extends IT, O extends OT> = {
37
45
  ) => BaseCheck<I>;
38
46
  };
39
47
 
40
- export type ISuiteKlasser<I extends IT, O extends OT> = (
48
+ export type ISuiteKlasser<I extends Ibdd_in_any, O extends Ibdd_out_any> = (
41
49
  name: string,
42
50
  index: number,
43
51
  givens: IGivens<I>,
44
52
  checks: BaseCheck<I>[]
45
53
  ) => BaseSuite<I, O>;
46
54
 
47
- export type IGivenKlasser<I extends IT> = (
55
+ export type IGivenKlasser<I extends Ibdd_in_any> = (
48
56
  name,
49
57
  features,
50
58
  whens,
@@ -52,8 +60,14 @@ export type IGivenKlasser<I extends IT> = (
52
60
  givenCB
53
61
  ) => BaseGiven<I>;
54
62
 
55
- export type IWhenKlasser<I extends IT> = (s, o) => BaseWhen<I>;
63
+ export type IWhenKlasser<I extends Ibdd_in_any> = (s, o) => BaseWhen<I>;
56
64
 
57
- export type IThenKlasser<I extends IT> = (s, o) => BaseThen<I>;
65
+ export type IThenKlasser<I extends Ibdd_in_any> = (s, o) => BaseThen<I>;
58
66
 
59
- export type ICheckKlasser<I extends IT> = (n, f, cb, w, t) => BaseCheck<I>;
67
+ export type ICheckKlasser<I extends Ibdd_in_any> = (
68
+ n,
69
+ f,
70
+ cb,
71
+ w,
72
+ t
73
+ ) => BaseCheck<I>;
@@ -1,18 +1,16 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
2
  /* eslint-disable @typescript-eslint/no-unused-vars */
3
- import { ITTestResourceConfiguration } from "../lib";
4
- import { IPM } from "../lib/types";
5
- import Testeranto from "../Node";
6
- import { PM } from "../PM";
7
-
8
3
  import {
4
+ Ibdd_in,
9
5
  Ibdd_out,
10
6
  ITestSpecification,
11
- IT,
12
7
  ITestImplementation,
13
- Ibdd_in,
14
- IPartialNodeInterface,
15
- } from "../Types";
8
+ Ibdd_in_any,
9
+ } from "../CoreTypes";
10
+ import { ITTestResourceConfiguration } from "../lib";
11
+ import { IPM } from "../lib/types";
12
+ import Testeranto from "../Node";
13
+ import { PM } from "../PM";
16
14
 
17
15
  import appFactory from "./index";
18
16
 
@@ -49,7 +47,12 @@ type O = Ibdd_out<
49
47
  }
50
48
  >;
51
49
 
52
- const specification: ITestSpecification<IT, O> = (Suite, Given, When, Then) => {
50
+ const specification: ITestSpecification<Ibdd_in_any, O> = (
51
+ Suite,
52
+ Given,
53
+ When,
54
+ Then
55
+ ) => {
53
56
  console.log("Suite", Suite);
54
57
  return [
55
58
  Suite.TheMothership(
package/src/run.ts CHANGED
@@ -15,7 +15,7 @@ process.stdin.on("keypress", (str, key) => {
15
15
  }
16
16
  });
17
17
 
18
- let testName = process.argv[2];
18
+ const testName = process.argv[2];
19
19
 
20
20
  const mode = process.argv[3] as "once" | "dev";
21
21
  if (mode !== "once" && mode !== "dev") {
package/src/style.css CHANGED
@@ -5,4 +5,4 @@ footer {
5
5
  position: fixed;
6
6
  bottom: 0;
7
7
  right: 0;
8
- }
8
+ }
@@ -0,0 +1,88 @@
1
+ export const testReportPage = (packageName: string, domain: string) => {
2
+ return `
3
+ <!DOCTYPE html>
4
+ <html lang="en">
5
+
6
+ <head>
7
+ <meta name="description" content="Webpage description goes here" />
8
+ <meta charset="utf-8" />
9
+ <title>${packageName} - testeranto</title>
10
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
11
+ <meta name="author" content="" />
12
+
13
+ <base href="${domain}" target="_blank">
14
+
15
+ <link rel="stylesheet" href="../ReportClient.css" />
16
+ <script type="module" src="../ReportClient.js"></script>
17
+
18
+ </head>
19
+
20
+ <body>
21
+ <div id="root">
22
+ react is loading
23
+ </div>
24
+ </body>
25
+
26
+ </html>
27
+ `;
28
+ };
29
+
30
+ export const testsReportPage = (
31
+ packageName: string,
32
+ domain: string,
33
+ projects
34
+ ) => {
35
+ return `
36
+ <!DOCTYPE html>
37
+ <html lang="en">
38
+
39
+ <head>
40
+ <meta name="description" content="Webpage description goes here" />
41
+ <meta charset="utf-8" />
42
+ <title>${packageName} - testeranto</title>
43
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
44
+ <meta name="author" content="" />
45
+ <base href="${domain}" target="_blank">
46
+
47
+ <script type="application/json" id="bigConfig">
48
+ ${JSON.stringify(Object.keys(projects))}
49
+ </script>
50
+
51
+ <link rel="stylesheet" href="./testeranto/Project.css" />
52
+ <script type="module" src="./testeranto/Project.js"></script>
53
+
54
+ </head>
55
+
56
+ <body>
57
+ <div id="root">
58
+ react is loading
59
+ </div>
60
+ </body>
61
+
62
+ </html>
63
+ `;
64
+ };
65
+
66
+ export const idkPage = (testName: string, domain: string) => {
67
+ return `
68
+ <!DOCTYPE html>
69
+ <html lang="en">
70
+
71
+ <head>
72
+ <meta name="description" content="Webpage description goes here" />
73
+ <base href="${domain}" target="_blank">
74
+ <meta charset="utf-8" />
75
+ <title>${testName} - testeranto</title>
76
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
77
+ <meta name="author" content="" />
78
+
79
+ <link rel="stylesheet" href="./testeranto/TestReport.css" />
80
+ <script src="./testeranto/TestReport.js"></script>
81
+
82
+ </head>
83
+
84
+ <body>
85
+ <div id="root"/>
86
+ </body>
87
+ `;
88
+ };