testeranto 0.75.0 → 0.79.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 (257) hide show
  1. package/.eslintrc.js +5 -2
  2. package/Bundle.Dockerfile +52 -0
  3. package/README.md +25 -24
  4. package/build-tests.ts +16 -0
  5. package/dist/common/build-tests.js +38 -0
  6. package/dist/common/init-docs.js +8 -0
  7. package/dist/common/run-tests.js +34 -0
  8. package/dist/common/src/Aider.js +96 -0
  9. package/dist/common/src/Init.js +10 -0
  10. package/dist/common/{Node.js → src/Node.js} +1 -0
  11. package/dist/common/src/PM/index.js +7 -0
  12. package/dist/common/{PM → src/PM}/main.js +287 -10
  13. package/dist/common/{PM → src/PM}/node.js +4 -0
  14. package/dist/common/{PM → src/PM}/web.js +3 -0
  15. package/dist/common/{Project.js → src/Project.js} +15 -57
  16. package/dist/common/{Puppeteer.js → src/Puppeteer.js} +65 -26
  17. package/dist/common/{SubPackages → src/SubPackages}/react-dom/component/web.js +5 -25
  18. package/dist/common/src/SubPackages/react-dom/jsx/web.js +117 -0
  19. package/dist/common/{SubPackages/react-test-renderer/component/index.js → src/SubPackages/react-test-renderer/component/interface.js} +0 -20
  20. package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/component/node.js +2 -2
  21. package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/component/web.js +2 -2
  22. package/dist/common/{Types.js → src/Types.js} +0 -2
  23. package/dist/common/{esbuildConfigs → src/esbuildConfigs}/index.js +1 -0
  24. package/dist/common/src/esbuildConfigs/inputFilesPlugin.js +52 -0
  25. package/dist/common/{esbuildConfigs → src/esbuildConfigs}/node.js +5 -1
  26. package/dist/common/src/esbuildConfigs/report.js +14 -0
  27. package/dist/common/{esbuildConfigs → src/esbuildConfigs}/web.js +3 -1
  28. package/dist/common/src/lib/abstractBase.js +581 -0
  29. package/dist/common/{lib → src/lib}/basebuilder.js +12 -38
  30. package/dist/common/{lib → src/lib}/classBuilder.js +1 -3
  31. package/dist/common/{lib → src/lib}/core.js +3 -5
  32. package/dist/common/src/lib/types.js +2 -0
  33. package/dist/common/src/utils.js +16 -0
  34. package/dist/common/testeranto.js +15 -0
  35. package/dist/common/tsconfig.common.tsbuildinfo +1 -1
  36. package/dist/module/build-tests.js +10 -0
  37. package/dist/module/init-docs.js +3 -0
  38. package/dist/module/run-tests.js +6 -0
  39. package/dist/module/src/Aider.js +89 -0
  40. package/dist/module/src/Init.js +5 -0
  41. package/dist/module/{Node.js → src/Node.js} +1 -0
  42. package/dist/module/src/PM/index.js +3 -0
  43. package/dist/module/src/PM/main.js +617 -0
  44. package/dist/module/{PM → src/PM}/node.js +4 -0
  45. package/dist/module/{PM → src/PM}/web.js +3 -0
  46. package/dist/module/{Project.js → src/Project.js} +15 -57
  47. package/dist/module/{Puppeteer.js → src/Puppeteer.js} +65 -26
  48. package/dist/module/{SubPackages → src/SubPackages}/react-dom/component/web.js +5 -25
  49. package/dist/module/src/SubPackages/react-dom/jsx/web.js +89 -0
  50. package/dist/module/{SubPackages/react-test-renderer/component/index.js → src/SubPackages/react-test-renderer/component/interface.js} +0 -20
  51. package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/component/node.js +1 -1
  52. package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/component/web.js +1 -1
  53. package/dist/module/{esbuildConfigs → src/esbuildConfigs}/index.js +1 -0
  54. package/dist/module/src/esbuildConfigs/inputFilesPlugin.js +47 -0
  55. package/dist/module/{esbuildConfigs → src/esbuildConfigs}/node.js +5 -1
  56. package/dist/module/src/esbuildConfigs/report.js +14 -0
  57. package/dist/module/{esbuildConfigs → src/esbuildConfigs}/web.js +3 -1
  58. package/dist/module/src/lib/abstractBase.js +573 -0
  59. package/dist/module/{lib → src/lib}/basebuilder.js +12 -38
  60. package/dist/module/{lib → src/lib}/classBuilder.js +1 -3
  61. package/dist/module/{lib → src/lib}/core.js +3 -5
  62. package/dist/module/src/utils.js +9 -0
  63. package/dist/module/testeranto.js +13 -0
  64. package/dist/module/tsconfig.module.tsbuildinfo +1 -1
  65. package/dist/types/build-tests.d.ts +3 -0
  66. package/dist/types/init-docs.d.ts +2 -0
  67. package/dist/types/run-tests.d.ts +2 -0
  68. package/dist/types/src/Aider.d.ts +1 -0
  69. package/dist/types/src/Init.d.ts +2 -0
  70. package/dist/types/src/Node.d.ts +6 -0
  71. package/dist/types/{PM → src/PM}/index.d.ts +3 -2
  72. package/dist/types/{PM → src/PM}/main.d.ts +6 -3
  73. package/dist/types/{PM → src/PM}/node.d.ts +2 -0
  74. package/dist/types/{PM → src/PM}/web.d.ts +1 -0
  75. package/dist/types/{Project.d.ts → src/Project.d.ts} +1 -1
  76. package/dist/types/src/Puppeteer.d.ts +2 -0
  77. package/dist/types/src/SubPackages/puppeteer.d.ts +6 -0
  78. package/dist/types/{SubPackages → src/SubPackages}/react/component/node.d.ts +1 -1
  79. package/dist/types/{SubPackages → src/SubPackages}/react/component/web.d.ts +1 -1
  80. package/dist/types/src/SubPackages/react/jsx/node.d.ts +4 -0
  81. package/dist/types/src/SubPackages/react/jsx/web.d.ts +4 -0
  82. package/dist/types/{SubPackages → src/SubPackages}/react-dom/component/node.d.ts +2 -2
  83. package/dist/types/src/SubPackages/react-dom/component/web.d.ts +11 -0
  84. package/dist/types/src/SubPackages/react-dom/jsx/node.d.ts +6 -0
  85. package/dist/types/src/SubPackages/react-dom/jsx/web.d.ts +5 -0
  86. package/dist/types/src/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +5 -0
  87. package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/component/index.d.ts +0 -7
  88. package/dist/types/src/SubPackages/react-test-renderer/component/interface.d.ts +9 -0
  89. package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/component/node.d.ts +1 -2
  90. package/dist/types/src/SubPackages/react-test-renderer/component/web.d.ts +3 -0
  91. package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/fc/node.d.ts +1 -1
  92. package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/fc/web.d.ts +1 -1
  93. package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx/node.d.ts +1 -2
  94. package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx/web.d.ts +1 -2
  95. package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/node.d.ts +4 -0
  96. package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/web.d.ts +4 -0
  97. package/dist/types/src/Types.d.ts +51 -0
  98. package/dist/types/src/Web.d.ts +6 -0
  99. package/dist/types/src/esbuildConfigs/inputFilesPlugin.d.ts +5 -0
  100. package/dist/types/{lib → src/lib}/abstractBase.d.ts +8 -8
  101. package/dist/types/{lib → src/lib}/basebuilder.d.ts +1 -1
  102. package/dist/types/{lib → src/lib}/classBuilder.d.ts +1 -1
  103. package/dist/types/{lib → src/lib}/core.d.ts +1 -1
  104. package/dist/types/{lib → src/lib}/index.d.ts +5 -5
  105. package/dist/types/{lib → src/lib}/types.d.ts +15 -15
  106. package/dist/types/src/utils.d.ts +2 -0
  107. package/dist/types/testeranto.d.ts +16 -0
  108. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  109. package/docker-compose.yml +37 -0
  110. package/init-docs.ts +5 -0
  111. package/package.json +72 -25
  112. package/run-tests.ts +9 -0
  113. package/src/Aider.ts +125 -0
  114. package/src/Init.ts +20 -0
  115. package/src/Node.ts +31 -2
  116. package/src/PM/index.ts +7 -84
  117. package/src/PM/main.ts +400 -16
  118. package/src/PM/node.ts +6 -0
  119. package/src/PM/web.ts +4 -0
  120. package/src/Project.ts +33 -84
  121. package/src/Puppeteer.ts +115 -62
  122. package/src/SubPackages/react-dom/component/web.ts +10 -30
  123. package/src/SubPackages/react-dom/jsx/web.ts +110 -76
  124. package/src/SubPackages/react-test-renderer/component/index.ts +0 -66
  125. package/src/SubPackages/react-test-renderer/component/interface.ts +48 -0
  126. package/src/SubPackages/react-test-renderer/component/node.ts +2 -1
  127. package/src/SubPackages/react-test-renderer/component/web.ts +2 -1
  128. package/src/Types.ts +138 -29
  129. package/src/Web.ts +32 -2
  130. package/src/esbuildConfigs/index.ts +1 -0
  131. package/src/esbuildConfigs/inputFilesPlugin.ts +67 -0
  132. package/src/esbuildConfigs/node.ts +4 -2
  133. package/src/esbuildConfigs/report.ts +13 -13
  134. package/src/esbuildConfigs/web.ts +4 -0
  135. package/src/lib/abstractBase.ts +366 -36
  136. package/src/lib/basebuilder.ts +26 -52
  137. package/src/lib/classBuilder.ts +14 -2
  138. package/src/lib/core.ts +18 -7
  139. package/src/lib/index.ts +115 -7
  140. package/src/lib/types.ts +143 -37
  141. package/src/utils.ts +15 -0
  142. package/testeranto.ts +13 -0
  143. package/tsconfig.common.json +12 -4
  144. package/tsconfig.json +9 -3
  145. package/tsconfig.module.json +2 -3
  146. package/tsconfig.types.json +1 -2
  147. package/dist/common/Features.js +0 -84
  148. package/dist/common/PM/index.js +0 -71
  149. package/dist/common/Reporter.js +0 -119
  150. package/dist/common/Scheduler.js +0 -1
  151. package/dist/common/SubPackages/react-dom/jsx/web.js +0 -93
  152. package/dist/common/esbuildConfigs/report.js +0 -13
  153. package/dist/common/lib/abstractBase.js +0 -348
  154. package/dist/common/preload.js +0 -15
  155. package/dist/common/report.html.js +0 -31
  156. package/dist/module/Features.js +0 -73
  157. package/dist/module/PM/index.js +0 -67
  158. package/dist/module/PM/main.js +0 -340
  159. package/dist/module/Reporter.js +0 -114
  160. package/dist/module/Scheduler.js +0 -1
  161. package/dist/module/SubPackages/react-dom/jsx/web.js +0 -65
  162. package/dist/module/Types.js +0 -3
  163. package/dist/module/esbuildConfigs/report.js +0 -11
  164. package/dist/module/lib/abstractBase.js +0 -340
  165. package/dist/module/preload.js +0 -15
  166. package/dist/module/report.html.js +0 -29
  167. package/dist/prebuild/Report.css +0 -11358
  168. package/dist/prebuild/Report.js +0 -37585
  169. package/dist/types/Features.d.ts +0 -68
  170. package/dist/types/Node.d.ts +0 -6
  171. package/dist/types/SubPackages/puppeteer.d.ts +0 -6
  172. package/dist/types/SubPackages/react/jsx/node.d.ts +0 -4
  173. package/dist/types/SubPackages/react/jsx/web.d.ts +0 -4
  174. package/dist/types/SubPackages/react-dom/component/web.d.ts +0 -5
  175. package/dist/types/SubPackages/react-dom/jsx/node.d.ts +0 -6
  176. package/dist/types/SubPackages/react-dom/jsx/web.d.ts +0 -5
  177. package/dist/types/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +0 -5
  178. package/dist/types/SubPackages/react-test-renderer/component/web.d.ts +0 -4
  179. package/dist/types/SubPackages/react-test-renderer/jsx-promised/node.d.ts +0 -5
  180. package/dist/types/SubPackages/react-test-renderer/jsx-promised/web.d.ts +0 -5
  181. package/dist/types/Types.d.ts +0 -50
  182. package/dist/types/Web.d.ts +0 -6
  183. package/dist/types/esbuildConfigs/report.d.ts +0 -4
  184. package/dist/types/preload.d.ts +0 -0
  185. package/dist/types/report.html.d.ts +0 -2
  186. package/electronBuild.ts +0 -32
  187. package/src/Features.ts +0 -118
  188. package/src/Report.tsx +0 -521
  189. package/src/Reporter.ts +0 -134
  190. package/src/Scheduler.ts +0 -0
  191. package/src/preload.ts +0 -17
  192. package/src/report.html.ts +0 -29
  193. package/tests/Rectangle.test.ts +0 -189
  194. /package/dist/common/{SubPackages → src/SubPackages}/puppeteer.js +0 -0
  195. /package/dist/common/{SubPackages → src/SubPackages}/react/component/node.js +0 -0
  196. /package/dist/common/{SubPackages → src/SubPackages}/react/component/web.js +0 -0
  197. /package/dist/common/{SubPackages → src/SubPackages}/react/jsx/index.js +0 -0
  198. /package/dist/common/{SubPackages → src/SubPackages}/react/jsx/node.js +0 -0
  199. /package/dist/common/{SubPackages → src/SubPackages}/react/jsx/web.js +0 -0
  200. /package/dist/common/{SubPackages → src/SubPackages}/react-dom/component/node.js +0 -0
  201. /package/dist/common/{SubPackages → src/SubPackages}/react-dom/jsx/index.js +0 -0
  202. /package/dist/common/{SubPackages → src/SubPackages}/react-dom/jsx/node.js +0 -0
  203. /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/MemoExoticComponent/node.js +0 -0
  204. /package/dist/common/{lib/types.js → src/SubPackages/react-test-renderer/component/index.js} +0 -0
  205. /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/fc/node.js +0 -0
  206. /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/fc/web.js +0 -0
  207. /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx/index.js +0 -0
  208. /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx/node.js +0 -0
  209. /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx/web.js +0 -0
  210. /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/index.js +0 -0
  211. /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/node.js +0 -0
  212. /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/web.js +0 -0
  213. /package/dist/common/{Web.js → src/Web.js} +0 -0
  214. /package/dist/common/{esbuildConfigs → src/esbuildConfigs}/features.js +0 -0
  215. /package/dist/common/{esbuildConfigs → src/esbuildConfigs}/tests.js +0 -0
  216. /package/dist/common/{lib → src/lib}/index.js +0 -0
  217. /package/dist/common/{puppeteerConfiger.js → src/puppeteerConfiger.js} +0 -0
  218. /package/dist/common/{web.html.js → src/web.html.js} +0 -0
  219. /package/dist/module/{SubPackages → src/SubPackages}/puppeteer.js +0 -0
  220. /package/dist/module/{SubPackages → src/SubPackages}/react/component/node.js +0 -0
  221. /package/dist/module/{SubPackages → src/SubPackages}/react/component/web.js +0 -0
  222. /package/dist/module/{SubPackages → src/SubPackages}/react/jsx/index.js +0 -0
  223. /package/dist/module/{SubPackages → src/SubPackages}/react/jsx/node.js +0 -0
  224. /package/dist/module/{SubPackages → src/SubPackages}/react/jsx/web.js +0 -0
  225. /package/dist/module/{SubPackages → src/SubPackages}/react-dom/component/node.js +0 -0
  226. /package/dist/module/{SubPackages → src/SubPackages}/react-dom/jsx/index.js +0 -0
  227. /package/dist/module/{SubPackages → src/SubPackages}/react-dom/jsx/node.js +0 -0
  228. /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/MemoExoticComponent/node.js +0 -0
  229. /package/dist/module/{lib/types.js → src/SubPackages/react-test-renderer/component/index.js} +0 -0
  230. /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/fc/node.js +0 -0
  231. /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/fc/web.js +0 -0
  232. /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx/index.js +0 -0
  233. /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx/node.js +0 -0
  234. /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx/web.js +0 -0
  235. /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/index.js +0 -0
  236. /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/node.js +0 -0
  237. /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/web.js +0 -0
  238. /package/dist/{types/Puppeteer.d.ts → module/src/Types.js} +0 -0
  239. /package/dist/module/{Web.js → src/Web.js} +0 -0
  240. /package/dist/module/{esbuildConfigs → src/esbuildConfigs}/features.js +0 -0
  241. /package/dist/module/{esbuildConfigs → src/esbuildConfigs}/tests.js +0 -0
  242. /package/dist/module/{lib → src/lib}/index.js +0 -0
  243. /package/dist/{types/Reporter.d.ts → module/src/lib/types.js} +0 -0
  244. /package/dist/module/{puppeteerConfiger.js → src/puppeteerConfiger.js} +0 -0
  245. /package/dist/module/{web.html.js → src/web.html.js} +0 -0
  246. /package/dist/types/{SubPackages → src/SubPackages}/react/jsx/index.d.ts +0 -0
  247. /package/dist/types/{SubPackages → src/SubPackages}/react-dom/jsx/index.d.ts +0 -0
  248. /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx/index.d.ts +0 -0
  249. /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/index.d.ts +0 -0
  250. /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/features.d.ts +0 -0
  251. /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/index.d.ts +0 -0
  252. /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/node.d.ts +0 -0
  253. /package/dist/types/{Scheduler.d.ts → src/esbuildConfigs/report.d.ts} +0 -0
  254. /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/tests.d.ts +0 -0
  255. /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/web.d.ts +0 -0
  256. /package/dist/types/{puppeteerConfiger.d.ts → src/puppeteerConfiger.d.ts} +0 -0
  257. /package/dist/types/{web.html.d.ts → src/web.html.d.ts} +0 -0
@@ -1,12 +1,6 @@
1
1
  import { PassThrough } from "stream";
2
2
 
3
- import {
4
- ITTestResourceRequest,
5
- ITestJob,
6
- ITLog,
7
- ILogWriter,
8
- ITTestResourceConfiguration,
9
- } from ".";
3
+ import { ITTestResourceRequest, ITestJob, ITLog } from ".";
10
4
  import { IBaseTest, ITestSpecification } from "../Types.js";
11
5
 
12
6
  import {
@@ -15,9 +9,7 @@ import {
15
9
  IWhenKlasser,
16
10
  IThenKlasser,
17
11
  ICheckKlasser,
18
- // IUtils,
19
12
  } from "./types.js";
20
-
21
13
  import {
22
14
  BaseCheck,
23
15
  BaseSuite,
@@ -28,7 +20,20 @@ import {
28
20
  import { PM } from "../PM/index.js";
29
21
 
30
22
  export abstract class BaseBuilder<
31
- ITestShape extends IBaseTest,
23
+ ITestShape extends IBaseTest<
24
+ unknown,
25
+ unknown,
26
+ unknown,
27
+ unknown,
28
+ unknown,
29
+ unknown,
30
+ unknown,
31
+ Record<string, any>,
32
+ Record<string, any>,
33
+ Record<string, any>,
34
+ Record<string, any>,
35
+ Record<string, any>
36
+ >,
32
37
  SuiteExtensions,
33
38
  GivenExtensions,
34
39
  WhenExtensions,
@@ -59,7 +64,6 @@ export abstract class BaseBuilder<
59
64
  checkOverides: Record<keyof CheckExtensions, ICheckKlasser<ITestShape>>,
60
65
  testResourceRequirement: ITTestResourceRequest,
61
66
  testSpecification: any
62
- // puppetMaster: PM
63
67
  ) {
64
68
  this.artifacts = [];
65
69
  this.testResourceRequirement = testResourceRequirement;
@@ -69,7 +73,6 @@ export abstract class BaseBuilder<
69
73
  this.thenOverides = thenOverides;
70
74
  this.checkOverides = checkOverides;
71
75
  this.testSpecification = testSpecification;
72
- // this.puppetMaster = puppetMaster;
73
76
 
74
77
  this.specs = testSpecification(
75
78
  this.Suites(),
@@ -83,7 +86,6 @@ export abstract class BaseBuilder<
83
86
  const suiteRunner =
84
87
  (suite: BaseSuite<ITestShape>) =>
85
88
  async (
86
- // testResourceConfiguration: ITTestResourceConfiguration,
87
89
  puppetMaster: PM,
88
90
  tLog: ITLog
89
91
  ): Promise<BaseSuite<ITestShape>> => {
@@ -114,7 +116,6 @@ export abstract class BaseBuilder<
114
116
 
115
117
  return {
116
118
  test: suite,
117
- // testResourceRequirement,
118
119
 
119
120
  toObj: () => {
120
121
  return suite.toObj();
@@ -122,48 +123,12 @@ export abstract class BaseBuilder<
122
123
 
123
124
  runner,
124
125
 
125
- receiveTestResourceConfig: async function (
126
- // testResourceConfiguration = {
127
- // name: "",
128
- // fs: ".",
129
- // ports: [],
130
- // browserWSEndpoint: "",
131
- // },
132
- puppetMaster: PM
133
- ) {
134
- // console.log(
135
- // `testResourceConfiguration! ${JSON.stringify(
136
- // testResourceConfiguration,
137
- // null,
138
- // 2
139
- // )}`
140
- // );
141
- // console.log("puppetMaster", puppetMaster);
142
-
143
- await puppetMaster
144
- .mkdirSync
145
- // ""
146
- // puppetMaster.testResourceConfiguration.fs + "/"
147
- ();
148
- // if (!puppetMaster.existsSync(destFolder)) {
149
- // puppetMaster.mkdirSync(destFolder, { recursive: true });
150
- // }
151
-
152
- // puppetMaster.writeFileSync(
153
- // // puppetMaster.testResourceConfiguration.fs + `/tests.json`,
154
- // `tests.json`,
155
- // JSON.stringify(this.toObj(), null, 2)
156
- // );
126
+ receiveTestResourceConfig: async function (puppetMaster: PM) {
127
+ await puppetMaster.mkdirSync();
157
128
 
158
129
  const logFilePath = "log.txt";
159
- // puppetMaster.testResourceConfiguration.fs + `/log.txt`;
160
-
161
130
  const access = await puppetMaster.createWriteStream(logFilePath);
162
-
163
- // console.log("access", access);
164
131
  const tLog = (...l: string[]) => {
165
- // access.write(`${l.toString()}\n`);
166
- // console.log("tLog", l);
167
132
  puppetMaster.write(access, `${l.toString()}\n`);
168
133
  };
169
134
 
@@ -182,6 +147,15 @@ export abstract class BaseBuilder<
182
147
  }).length;
183
148
  puppetMaster.writeFileSync(`exitcode`, numberOfFailures.toString());
184
149
 
150
+ // if (numberOfFailures > 0) {
151
+ // puppetMaster.writeFileSync(
152
+ // `prompt`,
153
+ // `
154
+ // aider --message "make a script that prints hello" hello.js
155
+ // `
156
+ // );
157
+ // }
158
+
185
159
  puppetMaster.writeFileSync(
186
160
  `tests.json`,
187
161
  JSON.stringify(this.toObj(), null, 2)
@@ -17,7 +17,20 @@ import { PM } from "../PM/index.js";
17
17
  import { ITTestResourceRequest } from "./index.js";
18
18
 
19
19
  export abstract class ClassBuilder<
20
- ITestShape extends IBaseTest
20
+ ITestShape extends IBaseTest<
21
+ unknown,
22
+ unknown,
23
+ unknown,
24
+ unknown,
25
+ unknown,
26
+ unknown,
27
+ unknown,
28
+ Record<string, any>,
29
+ Record<string, any>,
30
+ Record<string, any>,
31
+ Record<string, any>,
32
+ Record<string, any>
33
+ >
21
34
  > extends BaseBuilder<ITestShape, any, any, any, any, any> {
22
35
  constructor(
23
36
  testImplementation: ITestImplementation<ITestShape, any>,
@@ -29,7 +42,6 @@ export abstract class ClassBuilder<
29
42
  thenKlasser: IThenKlasser<ITestShape>,
30
43
  checkKlasser: ICheckKlasser<ITestShape>,
31
44
  testResourceRequirement: ITTestResourceRequest
32
- // puppetMaster: PM
33
45
  ) {
34
46
  const classySuites = Object.entries(testImplementation.suites).reduce(
35
47
  (a, [key], index) => {
package/src/lib/core.ts CHANGED
@@ -8,11 +8,8 @@ import {
8
8
  import { ITestInterface } from "./types.js";
9
9
  import {
10
10
  DefaultTestInterface,
11
- ILogWriter,
12
- ITTestResourceConfiguration,
13
11
  ITTestResourceRequest,
14
12
  ITestArtifactory,
15
- ITestJob,
16
13
  defaultTestResourceRequirement,
17
14
  } from "./index.js";
18
15
  import {
@@ -26,7 +23,20 @@ import { ClassBuilder } from "./classBuilder.js";
26
23
  import { PM } from "../PM/index";
27
24
 
28
25
  export default abstract class Testeranto<
29
- ITestShape extends IBaseTest
26
+ ITestShape extends IBaseTest<
27
+ unknown,
28
+ unknown,
29
+ unknown,
30
+ unknown,
31
+ unknown,
32
+ unknown,
33
+ unknown,
34
+ Record<string, any>,
35
+ Record<string, any>,
36
+ Record<string, any>,
37
+ Record<string, any>,
38
+ Record<string, any>
39
+ >
30
40
  > extends ClassBuilder<ITestShape> {
31
41
  constructor(
32
42
  input: ITestShape["iinput"],
@@ -34,7 +44,6 @@ export default abstract class Testeranto<
34
44
  testImplementation: ITestImplementation<ITestShape>,
35
45
  testResourceRequirement: ITTestResourceRequest = defaultTestResourceRequirement,
36
46
  testInterface: Partial<ITestInterface<ITestShape>>
37
- // puppetMaster: PM
38
47
  ) {
39
48
  const fullTestInterface = DefaultTestInterface(testInterface);
40
49
  super(
@@ -146,12 +155,14 @@ export default abstract class Testeranto<
146
155
  async butThen(
147
156
  store: any,
148
157
  thenCB,
149
- testResourceConfiguration?: any
158
+ testResourceConfiguration: any,
159
+ pm: PM
150
160
  ): Promise<ITestShape["iselection"]> {
151
161
  return await fullTestInterface.butThen(
152
162
  store,
153
163
  thenCB,
154
- testResourceConfiguration
164
+ testResourceConfiguration,
165
+ pm
155
166
  );
156
167
  }
157
168
  } as any,
package/src/lib/index.ts CHANGED
@@ -12,7 +12,22 @@ import { ITestInterface } from "./types.js";
12
12
 
13
13
  // import { INodeUtils, ITestInterface, IUtils, IWebUtils } from "./types.js";
14
14
 
15
- export const BaseTestInterface: ITestInterface<IBaseTest> = {
15
+ export const BaseTestInterface: ITestInterface<
16
+ IBaseTest<
17
+ unknown,
18
+ unknown,
19
+ unknown,
20
+ unknown,
21
+ unknown,
22
+ unknown,
23
+ unknown,
24
+ Record<string, any>,
25
+ Record<string, any>,
26
+ Record<string, any>,
27
+ Record<string, any>,
28
+ Record<string, any>
29
+ >
30
+ > = {
16
31
  beforeAll: async (s) => s,
17
32
  beforeEach: async function (
18
33
  subject: any,
@@ -24,8 +39,39 @@ export const BaseTestInterface: ITestInterface<IBaseTest> = {
24
39
  return subject as any;
25
40
  },
26
41
  afterEach: async (s) => s,
27
- afterAll: (store: IBaseTest["istore"]) => undefined,
28
- butThen: async (store: IBaseTest["istore"], thenCb) => thenCb(store),
42
+ afterAll: (
43
+ store: IBaseTest<
44
+ unknown,
45
+ unknown,
46
+ unknown,
47
+ unknown,
48
+ unknown,
49
+ unknown,
50
+ unknown,
51
+ Record<string, any>,
52
+ Record<string, any>,
53
+ Record<string, any>,
54
+ Record<string, any>,
55
+ Record<string, any>
56
+ >["istore"]
57
+ ) => undefined,
58
+ butThen: async (
59
+ store: IBaseTest<
60
+ unknown,
61
+ unknown,
62
+ unknown,
63
+ unknown,
64
+ unknown,
65
+ unknown,
66
+ unknown,
67
+ Record<string, any>,
68
+ Record<string, any>,
69
+ Record<string, any>,
70
+ Record<string, any>,
71
+ Record<string, any>
72
+ >["istore"],
73
+ thenCb
74
+ ) => thenCb(store),
29
75
  andWhen: (a) => a,
30
76
  assertThis: () => null,
31
77
  };
@@ -73,8 +119,38 @@ export type ITestArtificer = (key: string, data: any) => void;
73
119
  type ITest = {
74
120
  toObj(): object;
75
121
  name: string;
76
- givens: IGivens<IBaseTest>;
77
- checks: BaseCheck<IBaseTest>[];
122
+ givens: IGivens<
123
+ IBaseTest<
124
+ unknown,
125
+ unknown,
126
+ unknown,
127
+ unknown,
128
+ unknown,
129
+ unknown,
130
+ unknown,
131
+ Record<string, any>,
132
+ Record<string, any>,
133
+ Record<string, any>,
134
+ Record<string, any>,
135
+ Record<string, any>
136
+ >
137
+ >;
138
+ checks: BaseCheck<
139
+ IBaseTest<
140
+ unknown,
141
+ unknown,
142
+ unknown,
143
+ unknown,
144
+ unknown,
145
+ unknown,
146
+ unknown,
147
+ Record<string, any>,
148
+ Record<string, any>,
149
+ Record<string, any>,
150
+ Record<string, any>,
151
+ Record<string, any>
152
+ >
153
+ >[];
78
154
  testResourceConfiguration: ITTestResourceConfiguration;
79
155
  };
80
156
 
@@ -84,7 +160,24 @@ export type ITestJob<T = PM> = {
84
160
  runner: (
85
161
  x: ITTestResourceConfiguration,
86
162
  t: ITLog
87
- ) => Promise<BaseSuite<IBaseTest>>;
163
+ ) => Promise<
164
+ BaseSuite<
165
+ IBaseTest<
166
+ unknown,
167
+ unknown,
168
+ unknown,
169
+ unknown,
170
+ unknown,
171
+ unknown,
172
+ unknown,
173
+ Record<string, any>,
174
+ Record<string, any>,
175
+ Record<string, any>,
176
+ Record<string, any>,
177
+ Record<string, any>
178
+ >
179
+ >
180
+ >;
88
181
  testResourceRequirement: ITTestResourceRequirement;
89
182
  receiveTestResourceConfig: (pm: PM) => Promise<{
90
183
  failed: number;
@@ -101,7 +194,22 @@ export const defaultTestResourceRequirement: ITTestResourceRequest = {
101
194
 
102
195
  export type ITestArtifactory = (key: string, value: unknown) => unknown;
103
196
 
104
- export type ITestCheckCallback<ITestShape extends IBaseTest> = {
197
+ export type ITestCheckCallback<
198
+ ITestShape extends IBaseTest<
199
+ unknown,
200
+ unknown,
201
+ unknown,
202
+ unknown,
203
+ unknown,
204
+ unknown,
205
+ unknown,
206
+ Record<string, any>,
207
+ Record<string, any>,
208
+ Record<string, any>,
209
+ Record<string, any>,
210
+ Record<string, any>
211
+ >
212
+ > = {
105
213
  [K in keyof ITestShape["checks"]]: (
106
214
  name: string,
107
215
  features: string[],
package/src/lib/types.ts CHANGED
@@ -19,7 +19,7 @@ export type ITestTypes = [string, IRunTime, { ports: number }, ITestTypes[]];
19
19
  export type IJsonConfig = {
20
20
  outdir: string;
21
21
  tests: ITestTypes[];
22
- features: string;
22
+ botEmail: string;
23
23
  };
24
24
 
25
25
  export type IBaseConfig = {
@@ -27,7 +27,6 @@ export type IBaseConfig = {
27
27
  debugger: boolean;
28
28
  devMode: boolean;
29
29
  externals: string[];
30
- features: string;
31
30
  minify: boolean;
32
31
  nodePlugins: any[];
33
32
  outbase: string;
@@ -35,17 +34,34 @@ export type IBaseConfig = {
35
34
  ports: string[];
36
35
  tests: ITestTypes[];
37
36
  webPlugins: any[];
37
+ botEmail: string;
38
38
  };
39
39
 
40
40
  export type IBuiltConfig = { buildDir: string } & IBaseConfig;
41
41
 
42
- export type IWebTestInterface<ITestShape extends IBaseTest> = {
42
+ export type IWebTestInterface<
43
+ ITestShape extends IBaseTest<
44
+ unknown,
45
+ unknown,
46
+ unknown,
47
+ unknown,
48
+ unknown,
49
+ unknown,
50
+ unknown,
51
+ Record<string, any>,
52
+ Record<string, any>,
53
+ Record<string, any>,
54
+ Record<string, any>,
55
+ Record<string, any>
56
+ >
57
+ > = {
43
58
  assertThis: (x: ITestShape["then"]) => void;
44
59
 
45
60
  andWhen: (
46
61
  store: ITestShape["istore"],
47
62
  whenCB: ITestShape["when"],
48
- testResource: ITTestResourceConfiguration
63
+ testResource: ITTestResourceConfiguration,
64
+ utils: PM
49
65
  ) => Promise<ITestShape["istore"]>;
50
66
  butThen: (
51
67
  store: ITestShape["istore"],
@@ -81,17 +97,34 @@ export type IWebTestInterface<ITestShape extends IBaseTest> = {
81
97
  };
82
98
  // & ITestInterface<ITestShape>;
83
99
 
84
- export type INodeTestInterface<ITestShape extends IBaseTest> = {
100
+ export type INodeTestInterface<
101
+ ITestShape extends IBaseTest<
102
+ unknown,
103
+ unknown,
104
+ unknown,
105
+ unknown,
106
+ unknown,
107
+ unknown,
108
+ unknown,
109
+ Record<string, any>,
110
+ Record<string, any>,
111
+ Record<string, any>,
112
+ Record<string, any>,
113
+ Record<string, any>
114
+ >
115
+ > = {
85
116
  assertThis: (x: ITestShape["then"]) => void;
86
117
  andWhen: (
87
118
  store: ITestShape["istore"],
88
119
  whenCB: ITestShape["when"],
89
- testResource: ITTestResourceConfiguration
120
+ testResource: ITTestResourceConfiguration,
121
+ utils: PM
90
122
  ) => Promise<ITestShape["istore"]>;
91
123
  butThen: (
92
124
  store: ITestShape["istore"],
93
125
  thenCB,
94
- testResource: ITTestResourceConfiguration
126
+ testResource: ITTestResourceConfiguration,
127
+ utils: PM
95
128
  ) => Promise<ITestShape["iselection"]>;
96
129
  afterAll: (
97
130
  store: ITestShape["istore"],
@@ -115,13 +148,28 @@ export type INodeTestInterface<ITestShape extends IBaseTest> = {
115
148
  initializer: (c?) => ITestShape["given"],
116
149
  artificer: ITestArtificer,
117
150
  testResource: ITTestResourceConfiguration,
118
- initialValues
119
- // utils: IUtils
151
+ initialValues,
152
+ pm: PM
120
153
  ) => Promise<ITestShape["istore"]>;
121
154
  };
122
155
  // & ITestInterface<ITestShape>;
123
156
 
124
- export type ITestInterface<ITestShape extends IBaseTest> = {
157
+ export type ITestInterface<
158
+ ITestShape extends IBaseTest<
159
+ unknown,
160
+ unknown,
161
+ unknown,
162
+ unknown,
163
+ unknown,
164
+ unknown,
165
+ unknown,
166
+ Record<string, any>,
167
+ Record<string, any>,
168
+ Record<string, any>,
169
+ Record<string, any>,
170
+ Record<string, any>
171
+ >
172
+ > = {
125
173
  assertThis: (x: ITestShape["then"]) => void;
126
174
 
127
175
  andWhen: (
@@ -133,7 +181,8 @@ export type ITestInterface<ITestShape extends IBaseTest> = {
133
181
  butThen: (
134
182
  store: ITestShape["istore"],
135
183
  thenCB,
136
- testResource: ITTestResourceConfiguration
184
+ testResource: ITTestResourceConfiguration,
185
+ pm: PM
137
186
  ) => Promise<ITestShape["iselection"]>;
138
187
 
139
188
  afterAll: (
@@ -163,35 +212,92 @@ export type ITestInterface<ITestShape extends IBaseTest> = {
163
212
  ) => Promise<ITestShape["istore"]>;
164
213
  };
165
214
 
166
- export type ISuiteKlasser<ITestShape extends IBaseTest> = (
215
+ export type ISuiteKlasser<
216
+ ITestShape extends IBaseTest<
217
+ unknown,
218
+ unknown,
219
+ unknown,
220
+ unknown,
221
+ unknown,
222
+ unknown,
223
+ unknown,
224
+ Record<string, any>,
225
+ Record<string, any>,
226
+ Record<string, any>,
227
+ Record<string, any>,
228
+ Record<string, any>
229
+ >
230
+ > = (
167
231
  name: string,
168
232
  index: number,
169
233
  givens: IGivens<ITestShape>,
170
234
  checks: BaseCheck<ITestShape>[]
171
235
  ) => BaseSuite<ITestShape>;
172
236
 
173
- export type IGivenKlasser<ITestShape extends IBaseTest> = (
174
- name,
175
- features,
176
- whens,
177
- thens,
178
- givenCB
179
- ) => BaseGiven<ITestShape>;
180
-
181
- export type IWhenKlasser<ITestShape extends IBaseTest> = (
182
- s,
183
- o
184
- ) => BaseWhen<ITestShape>;
185
-
186
- export type IThenKlasser<ITestShape extends IBaseTest> = (
187
- s,
188
- o
189
- ) => BaseThen<ITestShape>;
190
-
191
- export type ICheckKlasser<ITestShape extends IBaseTest> = (
192
- n,
193
- f,
194
- cb,
195
- w,
196
- t
197
- ) => BaseCheck<ITestShape>;
237
+ export type IGivenKlasser<
238
+ ITestShape extends IBaseTest<
239
+ unknown,
240
+ unknown,
241
+ unknown,
242
+ unknown,
243
+ unknown,
244
+ unknown,
245
+ unknown,
246
+ Record<string, any>,
247
+ Record<string, any>,
248
+ Record<string, any>,
249
+ Record<string, any>,
250
+ Record<string, any>
251
+ >
252
+ > = (name, features, whens, thens, givenCB) => BaseGiven<ITestShape>;
253
+
254
+ export type IWhenKlasser<
255
+ ITestShape extends IBaseTest<
256
+ unknown,
257
+ unknown,
258
+ unknown,
259
+ unknown,
260
+ unknown,
261
+ unknown,
262
+ unknown,
263
+ Record<string, any>,
264
+ Record<string, any>,
265
+ Record<string, any>,
266
+ Record<string, any>,
267
+ Record<string, any>
268
+ >
269
+ > = (s, o) => BaseWhen<ITestShape>;
270
+
271
+ export type IThenKlasser<
272
+ ITestShape extends IBaseTest<
273
+ unknown,
274
+ unknown,
275
+ unknown,
276
+ unknown,
277
+ unknown,
278
+ unknown,
279
+ unknown,
280
+ Record<string, any>,
281
+ Record<string, any>,
282
+ Record<string, any>,
283
+ Record<string, any>,
284
+ Record<string, any>
285
+ >
286
+ > = (s, o) => BaseThen<ITestShape>;
287
+
288
+ export type ICheckKlasser<
289
+ ITestShape extends IBaseTest<
290
+ unknown,
291
+ unknown,
292
+ unknown,
293
+ unknown,
294
+ unknown,
295
+ unknown,
296
+ unknown,
297
+ Record<string, any>,
298
+ Record<string, any>,
299
+ Record<string, any>,
300
+ Record<string, any>,
301
+ Record<string, any>
302
+ >
303
+ > = (n, f, cb, w, t) => BaseCheck<ITestShape>;
package/src/utils.ts ADDED
@@ -0,0 +1,15 @@
1
+ // import { configs } from "eslint-plugin-react";
2
+ import path from "path";
3
+ import { IBuiltConfig, IRunTime } from "./lib/types";
4
+
5
+ export const destinationOfRuntime = (
6
+ f: string,
7
+ r: IRunTime,
8
+ configs: IBuiltConfig
9
+ ) => {
10
+ return path
11
+ .normalize(`${configs.buildDir}/${r}/${f}`)
12
+ .split(".")
13
+ .slice(0, -1)
14
+ .join(".");
15
+ };
package/testeranto.ts ADDED
@@ -0,0 +1,13 @@
1
+ export default {
2
+ botEmail: "adamwong246@gmail.com",
3
+ taskman: "adamwong246/kokomobay-taskman",
4
+ outdir: "docs",
5
+ tests: [["./src/LoginButton.test.tsx", "web", { ports: 0 }, []]],
6
+ debugger: true,
7
+ clearScreen: false,
8
+ devMode: true,
9
+ minify: false,
10
+ outbase: ".",
11
+ ports: [],
12
+ externals: [],
13
+ };
@@ -18,7 +18,10 @@
18
18
  "jsx": "react",
19
19
  "resolveJsonModule": true,
20
20
  "strictNullChecks": true,
21
- "lib": ["dom", "dom.iterable"],
21
+ "lib": [
22
+ "dom",
23
+ "dom.iterable"
24
+ ],
22
25
  "skipLibCheck": true,
23
26
  "strict": false,
24
27
  "forceConsistentCasingInFileNames": true,
@@ -30,6 +33,11 @@
30
33
  "outDir": "dist/common/",
31
34
  "alwaysStrict": true
32
35
  },
33
- "include": ["src/**/*.*ts", "index.d.ts"],
34
- "exclude": ["node_modules"]
35
- }
36
+ "include": [
37
+ "./**/*.*ts",
38
+ "index.d.ts"
39
+ ],
40
+ "exclude": [
41
+ "node_modules"
42
+ ]
43
+ }