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
package/src/Types.ts CHANGED
@@ -2,16 +2,39 @@
2
2
  import { Plugin } from "esbuild";
3
3
  import { ITTestResourceConfiguration } from "./lib/index.js";
4
4
  import { PM } from "./PM/index.js";
5
- import { IT, OT } from "../dist/types/src/Types.js";
5
+
6
6
  import {
7
- IGivens,
8
- BaseCheck,
9
- BaseSuite,
10
7
  BaseWhen,
11
8
  BaseThen,
12
9
  BaseGiven,
10
+ BaseCheck,
11
+ IGivens,
13
12
  } from "./lib/abstractBase.js";
14
- import { ITestCheckCallback } from "./lib/types.js";
13
+
14
+ import { Ibdd_in_any, Ibdd_out_any } from "./CoreTypes.js";
15
+ import { BaseSuite } from "./lib/BaseSuite.js";
16
+
17
+ export type ISummary = Record<
18
+ string,
19
+ {
20
+ runTimeError: string;
21
+ typeErrors: number;
22
+ staticErrors: number;
23
+ prompt: string;
24
+ failingFeatures: object;
25
+ }
26
+ >;
27
+
28
+ export type SuiteSpecification<
29
+ I extends Ibdd_in_any,
30
+ O extends Ibdd_out_any
31
+ > = {
32
+ [K in keyof O["suites"]]: (
33
+ name: string,
34
+ givens: IGivens<I>,
35
+ checks: BaseCheck<I>[]
36
+ ) => BaseSuite<I, O>;
37
+ };
15
38
 
16
39
  // Simplified test result summary
17
40
  export type TestSummary = {
@@ -82,16 +105,10 @@ export type ProjectConfig = {
82
105
  debug?: boolean;
83
106
  };
84
107
 
85
- // Specification component types
86
- export type SuiteSpecification<I extends IT, O extends OT> = {
87
- [K in keyof O["suites"]]: (
88
- name: string,
89
- givens: IGivens<I>,
90
- checks: BaseCheck<I>[]
91
- ) => BaseSuite<I, O>;
92
- };
93
-
94
- export type GivenSpecification<I extends IT, O extends OT> = {
108
+ export type GivenSpecification<
109
+ I extends Ibdd_in_any,
110
+ O extends Ibdd_out_any
111
+ > = {
95
112
  [K in keyof O["givens"]]: (
96
113
  features: string[],
97
114
  whens: BaseWhen<I>[],
@@ -100,35 +117,32 @@ export type GivenSpecification<I extends IT, O extends OT> = {
100
117
  ) => BaseGiven<I>;
101
118
  };
102
119
 
103
- export type WhenSpecification<I extends IT, O extends OT> = {
120
+ export type WhenSpecification<I extends Ibdd_in_any, O extends Ibdd_out_any> = {
104
121
  [K in keyof O["whens"]]: (...xtrasC: O["whens"][K]) => BaseWhen<I>;
105
122
  };
106
123
 
107
- export type ThenSpecification<I extends IT, O extends OT> = {
124
+ export type ThenSpecification<I extends Ibdd_in_any, O extends Ibdd_out_any> = {
108
125
  [K in keyof O["thens"]]: (...xtrasD: O["thens"][K]) => BaseThen<I>;
109
126
  };
110
127
 
111
- // Complete test specification
112
- export type ITestSpecification<I extends IT, O extends OT> = (
113
- Suite: SuiteSpecification<I, O>,
114
- Given: GivenSpecification<I, O>,
115
- When: WhenSpecification<I, O>,
116
- Then: ThenSpecification<I, O>,
117
- Check: ITestCheckCallback<I, O>
118
- ) => any[];
119
-
120
128
  //////////////////////////////////////////////////////////////////////////////////////////////////////////////
121
129
 
122
130
  // Base implementation types
123
- export type TestSuiteImplementation<O extends OT> = {
131
+ export type TestSuiteImplementation<O extends Ibdd_out_any> = {
124
132
  [K in keyof O["suites"]]: string;
125
133
  };
126
134
 
127
- export type TestGivenImplementation<I extends IT, O extends OT> = {
135
+ export type TestGivenImplementation<
136
+ I extends Ibdd_in_any,
137
+ O extends Ibdd_out_any
138
+ > = {
128
139
  [K in keyof O["givens"]]: (...Ig: O["givens"][K]) => I["given"];
129
140
  };
130
141
 
131
- export type TestWhenImplementation<I extends IT, O extends OT> = {
142
+ export type TestWhenImplementation<
143
+ I extends Ibdd_in_any,
144
+ O extends Ibdd_out_any
145
+ > = {
132
146
  [K in keyof O["whens"]]: (
133
147
  ...Iw: O["whens"][K]
134
148
  ) => (
@@ -138,72 +152,22 @@ export type TestWhenImplementation<I extends IT, O extends OT> = {
138
152
  ) => Promise<I["when"]>;
139
153
  };
140
154
 
141
- export type TestThenImplementation<I extends IT, O extends OT> = {
155
+ export type TestThenImplementation<
156
+ I extends Ibdd_in_any,
157
+ O extends Ibdd_out_any
158
+ > = {
142
159
  [K in keyof O["thens"]]: (
143
160
  ...It: O["thens"][K]
144
161
  ) => (ssel: I["iselection"], utils: PM) => I["then"];
145
162
  };
146
163
 
147
- export type TestCheckImplementation<I extends IT, O extends OT> = {
164
+ export type TestCheckImplementation<
165
+ I extends Ibdd_in_any,
166
+ O extends Ibdd_out_any
167
+ > = {
148
168
  [K in keyof O["checks"]]: (...Ic: O["checks"][K]) => I["given"];
149
169
  };
150
170
 
151
- // Complete test implementation
152
- export type ITestImplementation<
153
- I extends IT,
154
- O extends OT,
155
- modifier = {
156
- whens: TestWhenImplementation<I, O>;
157
- }
158
- > = Modify<
159
- {
160
- suites: TestSuiteImplementation<O>;
161
- givens: TestGivenImplementation<I, O>;
162
- whens: TestWhenImplementation<I, O>;
163
- thens: TestThenImplementation<I, O>;
164
- checks: TestCheckImplementation<I, O>;
165
- },
166
- modifier
167
- >;
168
-
169
- // export type ITestImplementation<
170
- // I extends IT,
171
- // O extends OT,
172
- // modifier = Partial<{
173
- // // givens: string;
174
- // givens: {
175
- // [K in keyof O["givens"]]: (...Ig: O["givens"][K]) => I["given"];
176
- // };
177
- // }>
178
- // > = Modify<
179
- // {
180
- // // suites: {
181
- // // // [K in keyof O["suites"]]: unknown;
182
- // // [K in keyof O["suites"]]: (...Ig: O["suites"][K]) => I["suites"];
183
- // // };
184
- // // suites: [];
185
-
186
- // // givens: {
187
- // // [K in keyof O["givens"]]: (...Ig: O["givens"][K]) => I["given"];
188
- // // };
189
-
190
- // whens: {
191
- // [K in keyof O["whens"]]: (
192
- // ...Iw: O["whens"][K]
193
- // ) => (zel: I["iselection"], utils: PM) => Promise<I["when"]>;
194
- // };
195
- // thens: {
196
- // [K in keyof O["thens"]]: (
197
- // ...It: O["thens"][K]
198
- // ) => (ssel: I["iselection"], utils: PM) => I["then"];
199
- // };
200
- // checks: {
201
- // [K in keyof O["checks"]]: (...Ic: O["checks"][K]) => I["given"];
202
- // };
203
- // },
204
- // modifier
205
- // >;
206
-
207
171
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
208
172
 
209
173
  export type Modify<T, R> = Omit<T, keyof R> & R;
@@ -215,69 +179,6 @@ export type TestWhenShape = Record<string, any>;
215
179
  export type TestThenShape = Record<string, any>;
216
180
  export type TestCheckShape = Record<string, any>;
217
181
 
218
- // Complete BDD output shape
219
- export type Ibdd_out<
220
- ISuites extends TestSuiteShape = TestSuiteShape,
221
- IGivens extends TestGivenShape = TestGivenShape,
222
- IWhens extends TestWhenShape = TestWhenShape,
223
- IThens extends TestThenShape = TestThenShape,
224
- IChecks extends TestCheckShape = TestCheckShape
225
- > = {
226
- suites: ISuites;
227
- givens: IGivens;
228
- whens: IWhens;
229
- thens: IThens;
230
- checks: IChecks;
231
- };
232
-
233
- /**
234
- * Defines the input shape for BDD test definitions.
235
- * This is the core type that structures all test operations.
236
- */
237
- export type Ibdd_in<
238
- IInput, // Type of initial test input
239
- ISubject, // Type of object being tested
240
- IStore, // Type for storing test state between steps
241
- ISelection, // Type for selecting state for assertions
242
- IGiven, // Type for Given step functions
243
- IWhen, // Type for When step functions
244
- IThen // Type for Then step functions
245
- > = {
246
- /** Initial input required to start tests */
247
- iinput: IInput;
248
-
249
- /** The subject being tested (class, function, etc) */
250
- isubject: ISubject;
251
-
252
- /** Complete test state storage */
253
- istore: IStore;
254
-
255
- /** Selected portion of state for assertions */
256
- iselection: ISelection;
257
-
258
- /** Function type for Given steps */
259
- given: IGiven;
260
-
261
- /** Function type for When steps */
262
- when: IWhen;
263
-
264
- /** Function type for Then steps */
265
- then: IThen;
266
- };
267
-
268
- // Example usage:
269
- /*
270
- type CounterTest = Ibdd_in<
271
- number, // Initial count value
272
- Counter, // Test subject is Counter class
273
- { counter: Counter, env: any }, // Store counter + environment
274
- number, // Assert against current count
275
- (init: number) => Counter, // Given creates Counter
276
- (delta: number) => (c: Counter) => void, // When modifies Counter
277
- (expected: number) => (c: Counter) => void // Then asserts count
278
- >;
279
- */
280
-
281
182
  ///////////////////////////////////////////////
282
183
 
283
184
  export type IPluginFactory = (
@@ -293,7 +194,6 @@ export type ITestconfig = {
293
194
  clearScreen: boolean;
294
195
  debugger: boolean;
295
196
  externals: string[];
296
- externalTests: Record<string, { watch: string[]; exec: string }>;
297
197
  featureIngestor: (s: string) => Promise<string>;
298
198
  importPlugins: IPluginFactory[];
299
199
  minify: boolean;
@@ -308,4 +208,5 @@ export type IBuiltConfig = { buildDir: string } & ITestconfig;
308
208
 
309
209
  export type IProject = {
310
210
  projects: Record<string, ITestconfig>;
211
+ reportDomain: string;
311
212
  };
package/src/Web.ts CHANGED
@@ -1,12 +1,15 @@
1
- import { PM_Web } from "./PM/web";
2
- import type {
3
- IT,
1
+ /* eslint-disable @typescript-eslint/no-unused-vars */
2
+ /* eslint-disable @typescript-eslint/no-explicit-any */
3
+
4
+ import {
5
+ ITestSpecification,
4
6
  ITestImplementation,
5
7
  ITestInterface,
6
- ITestSpecification,
7
- IWebTestInterface,
8
- OT,
9
- } from "./Types";
8
+ Ibdd_in_any,
9
+ Ibdd_out,
10
+ } from "./CoreTypes";
11
+ import { PM_Web } from "./PM/web";
12
+
10
13
  import Testeranto from "./lib/core.js";
11
14
  import {
12
15
  ITTestResourceConfiguration,
@@ -17,15 +20,13 @@ import {
17
20
  let errorCallback = (e: any) => {};
18
21
  let unhandledrejectionCallback = (event: PromiseRejectionEvent) => {
19
22
  console.log("window.addEventListener unhandledrejection", event);
20
- // cb({ error: event.reason.message });
21
- // throw event;
22
23
  };
23
24
 
24
- export class WebTesteranto<I extends IT, O extends OT, M> extends Testeranto<
25
- I,
26
- O,
25
+ export class WebTesteranto<
26
+ I extends Ibdd_in_any,
27
+ O extends Ibdd_out,
27
28
  M
28
- > {
29
+ > extends Testeranto<I, O, M> {
29
30
  constructor(
30
31
  input: I["iinput"],
31
32
  testSpecification: ITestSpecification<I, O>,
@@ -82,7 +83,7 @@ export class WebTesteranto<I extends IT, O extends OT, M> extends Testeranto<
82
83
  }
83
84
  }
84
85
 
85
- export default async <I extends IT, O extends OT, M>(
86
+ export default async <I extends Ibdd_in_any, O extends Ibdd_out, M>(
86
87
  input: I["iinput"],
87
88
  testSpecification: ITestSpecification<I, O>,
88
89
  testImplementation: ITestImplementation<I, O, M>,
package/src/build.ts CHANGED
@@ -19,6 +19,12 @@ import {
19
19
  IRunTime,
20
20
  ITestTypes,
21
21
  } from "./Types.js";
22
+ import { config } from "process";
23
+ import {
24
+ idkPage,
25
+ testReportPage,
26
+ testsReportPage,
27
+ } from "./utils/buildTemplates.js";
22
28
 
23
29
  readline.emitKeypressEvents(process.stdin);
24
30
  if (process.stdin.isTTY) process.stdin.setRawMode(true);
@@ -152,30 +158,12 @@ import(process.cwd() + "/" + "testeranto.config.ts").then(async (module) => {
152
158
 
153
159
  fs.writeFileSync(
154
160
  `${process.cwd()}/testeranto/reports/${testName}/index.html`,
155
- `
156
- <!DOCTYPE html>
157
- <html lang="en">
158
-
159
- <head>
160
- <meta name="description" content="Webpage description goes here" />
161
- <meta charset="utf-8" />
162
- <title>${pckge.name} - testeranto</title>
163
- <meta name="viewport" content="width=device-width, initial-scale=1" />
164
- <meta name="author" content="" />
165
-
166
- <link rel="stylesheet" href="../ReportClient.css" />
167
- <script type="module" src="../ReportClient.js"></script>
168
-
169
- </head>
170
-
171
- <body>
172
- <div id="root">
173
- react is loading
174
- </div>
175
- </body>
176
-
177
- </html>
178
- `
161
+ testReportPage(pckge.name, bigConfig.reportDomain)
162
+ );
163
+
164
+ fs.writeFileSync(
165
+ `${process.cwd()}/testeranto/reports/${testName}/dev.html`,
166
+ testReportPage(pckge.name, "/")
179
167
  );
180
168
 
181
169
  fs.writeFileSync(
@@ -185,34 +173,12 @@ import(process.cwd() + "/" + "testeranto.config.ts").then(async (module) => {
185
173
 
186
174
  fs.writeFileSync(
187
175
  `${process.cwd()}/testeranto/index.html`,
188
- `
189
- <!DOCTYPE html>
190
- <html lang="en">
191
-
192
- <head>
193
- <meta name="description" content="Webpage description goes here" />
194
- <meta charset="utf-8" />
195
- <title>${pckge.name} - testeranto</title>
196
- <meta name="viewport" content="width=device-width, initial-scale=1" />
197
- <meta name="author" content="" />
198
-
199
- <script type="application/json" id="bigConfig">
200
- ${JSON.stringify(Object.keys(bigConfig.projects))}
201
- </script>
202
-
203
- <link rel="stylesheet" href="Project.css" />
204
- <script type="module" src="Project.js"></script>
205
-
206
- </head>
207
-
208
- <body>
209
- <div id="root">
210
- react is loading
211
- </div>
212
- </body>
213
-
214
- </html>
215
- `
176
+ testsReportPage(pckge.name, bigConfig.reportDomain, bigConfig.projects)
177
+ );
178
+
179
+ fs.writeFileSync(
180
+ `${process.cwd()}/testeranto/dev.html`,
181
+ testsReportPage(pckge.name, "/", bigConfig.projects)
216
182
  );
217
183
 
218
184
  Promise.resolve(
@@ -280,29 +246,13 @@ import(process.cwd() + "/" + "testeranto.config.ts").then(async (module) => {
280
246
  .join(".")}/${runtime}`;
281
247
 
282
248
  await fs.mkdirSync(folder, { recursive: true });
249
+
283
250
  fs.writeFileSync(
284
251
  `${folder}/index.html`,
285
- `
286
- <!DOCTYPE html>
287
- <html lang="en">
288
-
289
- <head>
290
- <meta name="description" content="Webpage description goes here" />
291
- <meta charset="utf-8" />
292
- <title>${testName} - testeranto</title>
293
- <meta name="viewport" content="width=device-width, initial-scale=1" />
294
- <meta name="author" content="" />
295
-
296
- <link rel="stylesheet" href="../../../../../../TestReport.css" />
297
- <script src="../../../../../../TestReport.js"></script>
298
-
299
- </head>
300
-
301
- <body>
302
- <div id="root"/>
303
- </body>
304
- `
252
+ idkPage(testName, bigConfig.reportDomain)
305
253
  );
254
+
255
+ fs.writeFileSync(`${folder}/dev.html`, idkPage(testName, ""));
306
256
  });
307
257
  });
308
258
 
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/no-unused-vars */
1
2
  import { ITestconfig } from "./lib";
2
3
 
3
4
  const config: ITestconfig = {
@@ -11,7 +12,7 @@ const config: ITestconfig = {
11
12
  nodePlugins: [],
12
13
  webPlugins: [],
13
14
  importPlugins: [],
14
- externalTests: {},
15
+
15
16
  featureIngestor: function (s: string): Promise<string> {
16
17
  throw new Error("Function not implemented.");
17
18
  },
@@ -1,5 +1,21 @@
1
1
  import { LintResult } from "eslint/lib/linter";
2
2
 
3
3
  export default function (results: LintResult[]) {
4
- return JSON.stringify(results, null, 2);
4
+ return results
5
+ .filter((r) => r.messages.length)
6
+ .map((r) => {
7
+ const path = r.filePath.replace(process.cwd() + "/", "");
8
+ return [
9
+ path,
10
+ ...r.messages.map((m) =>
11
+ [
12
+ `${m.line}:${m.column} ${m.message} (${m.ruleId || ""})`,
13
+ ...(m.suggestions?.map(
14
+ (s) => `- ${s.message}${s.fix ? " (fix)" : ""}`
15
+ ) || []),
16
+ ].join("\n")
17
+ ),
18
+ ].join("\n");
19
+ })
20
+ .join("\n\n");
5
21
  }
@@ -5,6 +5,7 @@ import { ITestconfig } from "../lib/index.js";
5
5
  import baseEsBuildConfig from "./index.js";
6
6
  import inputFilesPlugin from "./inputFilesPlugin.js";
7
7
  import featuresPlugin from "./featuresPlugin";
8
+ import rebuildPlugin from "./rebuildPlugin.js";
8
9
 
9
10
  export default (
10
11
  config: ITestconfig,
@@ -44,24 +45,7 @@ export default (
44
45
  featuresPlugin,
45
46
 
46
47
  inputFilesPluginFactory,
47
- {
48
- name: "rebuild-notify",
49
- setup: (build) => {
50
- build.onStart(() => {
51
- console.log(`> node build starting...`);
52
- });
53
- build.onEnd((result) => {
54
- console.log(
55
- `> node build ended with ${result.errors.length} errors`
56
- );
57
- if (result.errors.length > 0) {
58
- console.log(result);
59
- }
60
- // console.log(result);
61
- // result.errors.length !== 0 && process.exit(-1);
62
- });
63
- },
64
- },
48
+ rebuildPlugin("node"),
65
49
 
66
50
  ...(config.nodePlugins.map((p) => p(register, entryPoints)) || []),
67
51
  ],
@@ -8,6 +8,7 @@ import featuresPlugin from "./featuresPlugin.js";
8
8
 
9
9
  import { isBuiltin } from "node:module";
10
10
  import { consoleDetectorPlugin } from "./consoleDetectorPlugin.js";
11
+ import rebuildPlugin from "./rebuildPlugin.js";
11
12
 
12
13
  export default (
13
14
  config: ITestconfig,
@@ -67,24 +68,7 @@ export default (
67
68
  },
68
69
  },
69
70
 
70
- {
71
- name: "rebuild-notify",
72
- setup: (build) => {
73
- build.onStart(() => {
74
- console.log(`> pure build starting...`);
75
- });
76
- build.onEnd((result) => {
77
- console.log(
78
- `> pure build ended with ${result.errors.length} errors`
79
- );
80
- if (result.errors.length > 0) {
81
- console.log(result);
82
- }
83
- // console.log(result);
84
- // result.errors.length !== 0 && process.exit(-1);
85
- });
86
- },
87
- },
71
+ rebuildPlugin("pure"),
88
72
 
89
73
  ...((config.nodePlugins || []).map((p) => p(register, entryPoints)) ||
90
74
  []),
@@ -0,0 +1,23 @@
1
+ import fs from "fs";
2
+
3
+ import { IRunTime } from "../lib";
4
+
5
+ export default (r: IRunTime) => {
6
+ return {
7
+ name: "rebuild-notify",
8
+ setup: (build) => {
9
+ build.onStart(() => {
10
+ console.log(`> web build starting...`);
11
+ });
12
+ build.onEnd((result) => {
13
+ console.log(`> web build ended with ${result.errors.length} errors`);
14
+ if (result.errors.length > 0) {
15
+ fs.writeFileSync(
16
+ `./testeranto/reports${r}_build_errors`,
17
+ JSON.stringify(result, null, 2)
18
+ );
19
+ }
20
+ });
21
+ },
22
+ };
23
+ };
@@ -8,6 +8,7 @@ import { ITestconfig } from "../lib/index.js";
8
8
  import baseEsBuildConfig from "./index.js";
9
9
  import inputFilesPlugin from "./inputFilesPlugin.js";
10
10
  import featuresPlugin from "./featuresPlugin.js";
11
+ import rebuildPlugin from "./rebuildPlugin.js";
11
12
 
12
13
  export default (
13
14
  config: ITestconfig,
@@ -68,24 +69,7 @@ export default (
68
69
  // }
69
70
  }),
70
71
 
71
- {
72
- name: "rebuild-notify",
73
- setup: (build) => {
74
- build.onStart(() => {
75
- console.log(`> web build starting...`);
76
- });
77
- build.onEnd((result) => {
78
- console.log(
79
- `> web build ended with ${result.errors.length} errors`
80
- );
81
- if (result.errors.length > 0) {
82
- console.log(result);
83
- }
84
- // console.log(result);
85
- // result.errors.length !== 0 && process.exit(-1);
86
- });
87
- },
88
- },
72
+ rebuildPlugin("web"),
89
73
 
90
74
  ...((config.webPlugins || []).map((p) => p(register, entryPoints)) || []),
91
75
  ],