testeranto 0.47.34 → 0.47.52

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 (309) hide show
  1. package/.nvmrc +1 -0
  2. package/Bundle.Dockerfile +45 -0
  3. package/README.md +86 -11
  4. package/Report.Dockerfile +43 -0
  5. package/dist/cjs-shim.js +12 -0
  6. package/dist/common/Features.js +3 -37
  7. package/dist/common/Init.js +30 -0
  8. package/dist/common/Node.js +15 -66
  9. package/dist/common/PM/index.js +7 -0
  10. package/dist/common/PM/main.js +641 -0
  11. package/dist/common/PM/node.js +88 -0
  12. package/dist/common/PM/web.js +132 -0
  13. package/dist/common/Project.js +109 -637
  14. package/dist/common/Puppeteer.js +103 -0
  15. package/dist/common/Reporter.js +112 -0
  16. package/dist/common/Scheduler.js +1 -0
  17. package/dist/common/SubPackages/puppeteer.js +21 -0
  18. package/dist/common/{subPackages → SubPackages}/react/component/node.js +4 -4
  19. package/dist/common/{subPackages → SubPackages}/react/component/web.js +4 -4
  20. package/dist/common/SubPackages/react/jsx/index.js +25 -0
  21. package/dist/common/SubPackages/react/jsx/node.js +10 -0
  22. package/dist/common/SubPackages/react/jsx/web.js +10 -0
  23. package/dist/common/{subPackages/react-dom/jsx → SubPackages/react-dom/component}/node.js +6 -6
  24. package/dist/common/SubPackages/react-dom/component/web.js +93 -0
  25. package/dist/common/SubPackages/react-dom/jsx/index.js +2 -0
  26. package/dist/common/SubPackages/react-dom/jsx/node.js +39 -0
  27. package/dist/common/SubPackages/react-dom/jsx/web.js +118 -0
  28. package/dist/common/SubPackages/react-test-renderer/MemoExoticComponent/node.js +44 -0
  29. package/dist/common/SubPackages/react-test-renderer/component/index.js +2 -0
  30. package/dist/common/{subPackages/react-test-renderer/component/index.js → SubPackages/react-test-renderer/component/interface.js} +23 -33
  31. package/dist/common/{subPackages/react-test-renderer/jsx → SubPackages/react-test-renderer/component}/node.js +3 -5
  32. package/dist/common/{subPackages/react/jsx → SubPackages/react-test-renderer/component}/web.js +3 -5
  33. package/dist/common/SubPackages/react-test-renderer/fc/node.js +50 -0
  34. package/dist/common/SubPackages/react-test-renderer/fc/web.js +50 -0
  35. package/dist/common/{subPackages → SubPackages}/react-test-renderer/jsx/index.js +7 -3
  36. package/dist/common/SubPackages/react-test-renderer/jsx/node.js +10 -0
  37. package/dist/common/SubPackages/react-test-renderer/jsx/web.js +10 -0
  38. package/dist/common/SubPackages/react-test-renderer/jsx-promised/index.js +42 -0
  39. package/dist/common/{subPackages/react/jsx → SubPackages/react-test-renderer/jsx-promised}/node.js +2 -2
  40. package/dist/common/TaskManBackEnd.js +174 -0
  41. package/dist/common/Web.js +31 -108
  42. package/dist/common/esbuildConfigs/features.js +14 -0
  43. package/dist/common/esbuildConfigs/index.js +21 -0
  44. package/dist/common/esbuildConfigs/inputFilesPlugin.js +49 -0
  45. package/dist/common/esbuildConfigs/node.js +39 -0
  46. package/dist/common/esbuildConfigs/report.js +14 -0
  47. package/dist/common/esbuildConfigs/tests.js +13 -0
  48. package/dist/common/esbuildConfigs/web.js +57 -0
  49. package/dist/common/lib/abstractBase.js +553 -0
  50. package/dist/common/lib/basebuilder.js +79 -0
  51. package/dist/common/lib/classBuilder.js +42 -0
  52. package/dist/common/lib/core.js +75 -0
  53. package/dist/common/lib/index.js +22 -0
  54. package/dist/common/lib/types.js +2 -0
  55. package/dist/common/mongooseSchemas.js +56 -0
  56. package/dist/common/preload.js +14 -27
  57. package/dist/common/puppeteerConfiger.js +24 -0
  58. package/dist/common/report.html.js +31 -0
  59. package/dist/common/tsconfig.common.tsbuildinfo +1 -1
  60. package/dist/common/utils.js +16 -0
  61. package/dist/common/web.html.js +22 -0
  62. package/dist/module/ExampleTab.js +112 -0
  63. package/dist/module/Features.js +2 -35
  64. package/dist/module/Init.js +25 -0
  65. package/dist/module/Node.js +15 -66
  66. package/dist/module/PM/index.js +3 -0
  67. package/dist/module/PM/main.js +611 -0
  68. package/dist/module/PM/node.js +81 -0
  69. package/dist/module/PM/web.js +125 -0
  70. package/dist/module/Project.js +110 -615
  71. package/dist/module/Puppeteer.js +98 -0
  72. package/dist/module/Reporter.js +107 -0
  73. package/dist/module/Scheduler.js +1 -0
  74. package/dist/module/SubPackages/puppeteer.js +16 -0
  75. package/dist/module/{subPackages → SubPackages}/react/component/node.js +3 -3
  76. package/dist/module/{subPackages → SubPackages}/react/component/web.js +3 -3
  77. package/dist/module/SubPackages/react/jsx/index.js +19 -0
  78. package/dist/module/SubPackages/react/jsx/node.js +5 -0
  79. package/dist/module/SubPackages/react/jsx/web.js +5 -0
  80. package/dist/module/{subPackages → SubPackages}/react-dom/component/node.js +7 -7
  81. package/dist/module/SubPackages/react-dom/component/web.js +88 -0
  82. package/dist/module/SubPackages/react-dom/jsx/node.js +31 -0
  83. package/dist/module/SubPackages/react-dom/jsx/web.js +90 -0
  84. package/dist/module/SubPackages/react-test-renderer/MemoExoticComponent/node.js +16 -0
  85. package/dist/module/SubPackages/react-test-renderer/component/index.js +1 -0
  86. package/dist/module/SubPackages/react-test-renderer/component/interface.js +39 -0
  87. package/dist/module/{subPackages → SubPackages}/react-test-renderer/component/node.js +2 -2
  88. package/dist/module/{subPackages → SubPackages}/react-test-renderer/component/web.js +2 -2
  89. package/dist/module/{subPackages → SubPackages}/react-test-renderer/fc/node.js +3 -3
  90. package/dist/module/SubPackages/react-test-renderer/fc/web.js +22 -0
  91. package/dist/module/{subPackages → SubPackages}/react-test-renderer/jsx/index.js +7 -3
  92. package/dist/module/SubPackages/react-test-renderer/jsx/node.js +5 -0
  93. package/dist/module/SubPackages/react-test-renderer/jsx/web.js +5 -0
  94. package/dist/module/SubPackages/react-test-renderer/jsx-promised/index.js +16 -0
  95. package/dist/module/{subPackages/react-test-renderer/jsx → SubPackages/react-test-renderer/jsx-promised}/node.js +1 -1
  96. package/dist/module/TaskManBackEnd.js +169 -0
  97. package/dist/module/TaskManFrontEnd.js +600 -0
  98. package/dist/module/Web.js +31 -108
  99. package/dist/module/esbuildConfigs/features.js +12 -0
  100. package/dist/module/esbuildConfigs/index.js +19 -0
  101. package/dist/module/esbuildConfigs/inputFilesPlugin.js +44 -0
  102. package/dist/module/esbuildConfigs/node.js +34 -0
  103. package/dist/module/esbuildConfigs/report.js +14 -0
  104. package/dist/module/esbuildConfigs/tests.js +11 -0
  105. package/dist/module/esbuildConfigs/web.js +52 -0
  106. package/dist/module/lib/abstractBase.js +545 -0
  107. package/dist/module/lib/basebuilder.js +75 -0
  108. package/dist/module/lib/classBuilder.js +38 -0
  109. package/dist/module/lib/core.js +72 -0
  110. package/dist/module/lib/index.js +18 -0
  111. package/dist/module/lib/types.js +1 -0
  112. package/dist/module/mongooseSchemas.js +50 -0
  113. package/dist/module/preload.js +15 -26
  114. package/dist/module/puppeteerConfiger.js +19 -0
  115. package/dist/module/report.html.js +29 -0
  116. package/dist/module/tsconfig.module.tsbuildinfo +1 -1
  117. package/dist/module/utils.js +9 -0
  118. package/dist/module/web.html.js +20 -0
  119. package/dist/prebuild/TaskManBackEnd.mjs +174 -0
  120. package/dist/prebuild/TaskManFrontEnd.css +12301 -0
  121. package/dist/prebuild/TaskManFrontEnd.js +81264 -0
  122. package/dist/types/Features.d.ts +1 -34
  123. package/dist/types/Init.d.ts +2 -0
  124. package/dist/types/Node.d.ts +5 -11
  125. package/dist/types/PM/index.d.ts +20 -0
  126. package/dist/types/PM/main.d.ts +31 -0
  127. package/dist/types/PM/node.d.ts +27 -0
  128. package/dist/types/PM/web.d.ts +25 -0
  129. package/dist/types/Project.d.ts +3 -29
  130. package/dist/types/Puppeteer.d.ts +2 -0
  131. package/dist/types/Reporter.d.ts +1 -0
  132. package/dist/types/Scheduler.d.ts +0 -0
  133. package/dist/types/SubPackages/puppeteer.d.ts +6 -0
  134. package/dist/types/SubPackages/react/component/node.d.ts +7 -0
  135. package/dist/types/SubPackages/react/component/web.d.ts +7 -0
  136. package/dist/types/SubPackages/react/jsx/index.d.ts +12 -0
  137. package/dist/types/SubPackages/react/jsx/node.d.ts +4 -0
  138. package/dist/types/SubPackages/react/jsx/web.d.ts +4 -0
  139. package/dist/types/SubPackages/react-dom/component/node.d.ts +12 -0
  140. package/dist/types/SubPackages/react-dom/component/web.d.ts +11 -0
  141. package/dist/types/SubPackages/react-dom/jsx/index.d.ts +6 -0
  142. package/dist/types/SubPackages/react-dom/jsx/node.d.ts +6 -0
  143. package/dist/types/SubPackages/react-dom/jsx/web.d.ts +5 -0
  144. package/dist/types/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +5 -0
  145. package/dist/types/SubPackages/react-test-renderer/component/index.d.ts +13 -0
  146. package/dist/types/SubPackages/react-test-renderer/component/interface.d.ts +9 -0
  147. package/dist/types/SubPackages/react-test-renderer/component/node.d.ts +8 -0
  148. package/dist/types/SubPackages/react-test-renderer/component/web.d.ts +3 -0
  149. package/dist/types/SubPackages/react-test-renderer/fc/node.d.ts +8 -0
  150. package/dist/types/SubPackages/react-test-renderer/fc/web.d.ts +8 -0
  151. package/dist/types/{subPackages → SubPackages}/react-test-renderer/jsx/index.d.ts +5 -4
  152. package/dist/types/SubPackages/react-test-renderer/jsx/node.d.ts +8 -0
  153. package/dist/types/SubPackages/react-test-renderer/jsx/web.d.ts +8 -0
  154. package/dist/types/SubPackages/react-test-renderer/jsx-promised/index.d.ts +15 -0
  155. package/dist/types/SubPackages/react-test-renderer/jsx-promised/node.d.ts +4 -0
  156. package/dist/types/SubPackages/react-test-renderer/jsx-promised/web.d.ts +4 -0
  157. package/dist/types/TaskManBackEnd.d.ts +3 -0
  158. package/dist/types/Types.d.ts +49 -16
  159. package/dist/types/Web.d.ts +5 -11
  160. package/dist/types/esbuildConfigs/features.d.ts +4 -0
  161. package/dist/types/esbuildConfigs/index.d.ts +4 -0
  162. package/dist/types/esbuildConfigs/inputFilesPlugin.d.ts +5 -0
  163. package/dist/types/esbuildConfigs/node.d.ts +4 -0
  164. package/dist/types/esbuildConfigs/report.d.ts +0 -0
  165. package/dist/types/esbuildConfigs/tests.d.ts +4 -0
  166. package/dist/types/esbuildConfigs/web.d.ts +4 -0
  167. package/dist/types/lib/abstractBase.d.ts +104 -0
  168. package/dist/types/lib/basebuilder.d.ts +27 -0
  169. package/dist/types/lib/classBuilder.d.ts +7 -0
  170. package/dist/types/lib/core.d.ts +8 -0
  171. package/dist/types/lib/index.d.ts +59 -0
  172. package/dist/types/lib/types.d.ts +62 -0
  173. package/dist/types/mongooseSchemas.d.ts +124 -0
  174. package/dist/types/preload.d.ts +0 -1
  175. package/dist/types/puppeteerConfiger.d.ts +4 -0
  176. package/dist/types/report.html.d.ts +2 -0
  177. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  178. package/dist/types/utils.d.ts +2 -0
  179. package/dist/types/web.html.d.ts +2 -0
  180. package/index.html +30 -0
  181. package/package.json +151 -79
  182. package/src/ExampleTab.tsx +219 -0
  183. package/src/Features.ts +2 -58
  184. package/src/Init.ts +51 -0
  185. package/src/Node.ts +71 -157
  186. package/src/PM/index.ts +25 -0
  187. package/src/PM/main.ts +830 -0
  188. package/src/PM/node.ts +128 -0
  189. package/src/PM/web.ts +166 -0
  190. package/src/Project.ts +158 -797
  191. package/src/Puppeteer.ts +141 -0
  192. package/src/Reporter.ts +126 -0
  193. package/src/Scheduler.ts +0 -0
  194. package/src/SubPackages/puppeteer.ts +51 -0
  195. package/src/SubPackages/react/component/node.ts +43 -0
  196. package/src/SubPackages/react/component/web.ts +43 -0
  197. package/src/SubPackages/react/jsx/index.ts +42 -0
  198. package/src/SubPackages/react/jsx/node.ts +26 -0
  199. package/src/SubPackages/react/jsx/web.ts +30 -0
  200. package/src/{subPackages → SubPackages}/react-dom/component/node.ts +24 -44
  201. package/src/SubPackages/react-dom/component/web.ts +143 -0
  202. package/src/SubPackages/react-dom/jsx/index.ts +6 -0
  203. package/src/SubPackages/react-dom/jsx/node.ts +68 -0
  204. package/src/SubPackages/react-dom/jsx/web.ts +139 -0
  205. package/src/SubPackages/react-test-renderer/MemoExoticComponent/node.ts +38 -0
  206. package/src/SubPackages/react-test-renderer/component/index.ts +23 -0
  207. package/src/SubPackages/react-test-renderer/component/interface.ts +48 -0
  208. package/src/SubPackages/react-test-renderer/component/node.ts +17 -0
  209. package/src/SubPackages/react-test-renderer/component/web.ts +17 -0
  210. package/src/SubPackages/react-test-renderer/fc/node.ts +49 -0
  211. package/src/SubPackages/react-test-renderer/fc/web.ts +48 -0
  212. package/src/SubPackages/react-test-renderer/jsx/index.ts +48 -0
  213. package/src/SubPackages/react-test-renderer/jsx/node.ts +20 -0
  214. package/src/SubPackages/react-test-renderer/jsx/web.ts +20 -0
  215. package/src/SubPackages/react-test-renderer/jsx-promised/index.ts +40 -0
  216. package/src/SubPackages/react-test-renderer/jsx-promised/node.ts +19 -0
  217. package/src/SubPackages/react-test-renderer/jsx-promised/web.ts +22 -0
  218. package/src/TaskManBackEnd.ts +228 -0
  219. package/src/TaskManFrontEnd.tsx +1222 -0
  220. package/src/Types.ts +222 -17
  221. package/src/Web.ts +86 -217
  222. package/src/cjs-shim.js +12 -0
  223. package/src/esbuildConfigs/features.ts +17 -0
  224. package/src/esbuildConfigs/index.ts +23 -0
  225. package/src/esbuildConfigs/inputFilesPlugin.ts +65 -0
  226. package/src/esbuildConfigs/node.ts +62 -0
  227. package/src/esbuildConfigs/report.ts +15 -0
  228. package/src/esbuildConfigs/tests.ts +14 -0
  229. package/src/esbuildConfigs/web.ts +79 -0
  230. package/src/lib/abstractBase.ts +910 -0
  231. package/src/lib/basebuilder.ts +214 -0
  232. package/src/lib/classBuilder.ts +131 -0
  233. package/src/lib/core.ts +224 -0
  234. package/src/lib/index.ts +226 -0
  235. package/src/lib/types.ts +303 -0
  236. package/src/mongooseSchemas.ts +105 -0
  237. package/src/preload.ts +14 -28
  238. package/src/puppeteerConfiger.ts +26 -0
  239. package/src/report.html.ts +29 -0
  240. package/src/utils.ts +15 -0
  241. package/src/web.html.ts +20 -0
  242. package/tests/Rectangle.test.ts +189 -0
  243. package/trash/TaskMan.Dockerfile +23 -0
  244. package/trash/TaskMan1.Dockerfile +43 -0
  245. package/trash/devBot.dockerfile +12 -0
  246. package/trash/docker-compose-dev.yml +9 -0
  247. package/trash/docker-compose-prod.yml +18 -0
  248. package/trash/electronBuild.ts +32 -0
  249. package/tsconfig.json +18 -6
  250. package/tsconfig.module.json +14 -4
  251. package/tsconfig.types.json +13 -4
  252. package/dist/common/NodeWriter.js +0 -56
  253. package/dist/common/core.js +0 -396
  254. package/dist/common/electron.js +0 -52
  255. package/dist/common/subPackages/react/jsx/index.js +0 -26
  256. package/dist/common/subPackages/react-dom/component/node.js +0 -101
  257. package/dist/common/subPackages/react-dom/component/web.js +0 -61
  258. package/dist/common/subPackages/react-dom/jsx/web.js +0 -76
  259. package/dist/common/subPackages/react-test-renderer/component/node.js +0 -8
  260. package/dist/common/subPackages/react-test-renderer/component/web.js +0 -8
  261. package/dist/module/NodeWriter.js +0 -50
  262. package/dist/module/Report.js +0 -186
  263. package/dist/module/core.js +0 -387
  264. package/dist/module/electron.js +0 -47
  265. package/dist/module/subPackages/react/jsx/index.js +0 -22
  266. package/dist/module/subPackages/react/jsx/node.js +0 -5
  267. package/dist/module/subPackages/react/jsx/web.js +0 -5
  268. package/dist/module/subPackages/react-dom/component/web.js +0 -56
  269. package/dist/module/subPackages/react-dom/jsx/node.js +0 -93
  270. package/dist/module/subPackages/react-dom/jsx/web.js +0 -48
  271. package/dist/module/subPackages/react-test-renderer/component/index.js +0 -52
  272. package/dist/types/NodeWriter.d.ts +0 -2
  273. package/dist/types/core.d.ts +0 -220
  274. package/dist/types/subPackages/react/component/node.d.ts +0 -12
  275. package/dist/types/subPackages/react/component/web.d.ts +0 -12
  276. package/dist/types/subPackages/react/jsx/index.d.ts +0 -15
  277. package/dist/types/subPackages/react/jsx/node.d.ts +0 -4
  278. package/dist/types/subPackages/react/jsx/web.d.ts +0 -4
  279. package/dist/types/subPackages/react-dom/component/node.d.ts +0 -14
  280. package/dist/types/subPackages/react-dom/component/web.d.ts +0 -19
  281. package/dist/types/subPackages/react-dom/jsx/node.d.ts +0 -14
  282. package/dist/types/subPackages/react-dom/jsx/web.d.ts +0 -15
  283. package/dist/types/subPackages/react-test-renderer/component/index.d.ts +0 -20
  284. package/dist/types/subPackages/react-test-renderer/component/node.d.ts +0 -9
  285. package/dist/types/subPackages/react-test-renderer/component/web.d.ts +0 -9
  286. package/dist/types/subPackages/react-test-renderer/jsx/node.d.ts +0 -4
  287. package/dist/types/subPackages/react-test-renderer/jsx/web.d.ts +0 -4
  288. package/src/NodeWriter.ts +0 -72
  289. package/src/Report.tsx +0 -392
  290. package/src/core.ts +0 -1396
  291. package/src/electron.ts +0 -59
  292. package/src/subPackages/react/component/node.ts +0 -75
  293. package/src/subPackages/react/component/web.ts +0 -80
  294. package/src/subPackages/react/jsx/index.ts +0 -64
  295. package/src/subPackages/react/jsx/node.ts +0 -29
  296. package/src/subPackages/react/jsx/web.ts +0 -29
  297. package/src/subPackages/react-dom/component/web.ts +0 -129
  298. package/src/subPackages/react-dom/jsx/node.ts +0 -150
  299. package/src/subPackages/react-dom/jsx/web.ts +0 -117
  300. package/src/subPackages/react-test-renderer/component/index.ts +0 -101
  301. package/src/subPackages/react-test-renderer/component/node.ts +0 -30
  302. package/src/subPackages/react-test-renderer/component/web.ts +0 -30
  303. package/src/subPackages/react-test-renderer/fc/node.tsx +0 -77
  304. package/src/subPackages/react-test-renderer/jsx/index.ts +0 -51
  305. package/src/subPackages/react-test-renderer/jsx/node.ts +0 -31
  306. package/src/subPackages/react-test-renderer/jsx/web.ts +0 -31
  307. /package/dist/common/{subPackages/react-test-renderer/jsx → SubPackages/react-test-renderer/jsx-promised}/web.js +0 -0
  308. /package/dist/{types/electron.d.ts → module/SubPackages/react-dom/jsx/index.js} +0 -0
  309. /package/dist/module/{subPackages/react-test-renderer/jsx → SubPackages/react-test-renderer/jsx-promised}/web.js +0 -0
@@ -1,387 +0,0 @@
1
- const defaultTestResource = {
2
- name: "",
3
- fs: ".",
4
- ports: [],
5
- scheduled: false
6
- };
7
- export const defaultTestResourceRequirement = {
8
- ports: 0
9
- };
10
- export class BaseSuite {
11
- constructor(name, index, givens = {}, checks = []) {
12
- this.name = name;
13
- this.index = index;
14
- this.givens = givens;
15
- this.checks = checks;
16
- this.fails = [];
17
- }
18
- toObj() {
19
- return {
20
- name: this.name,
21
- givens: Object.keys(this.givens).map((k) => this.givens[k].toObj()),
22
- fails: this.fails,
23
- };
24
- }
25
- setup(s, artifactory) {
26
- return new Promise((res) => res(s));
27
- }
28
- test(t) {
29
- return t;
30
- }
31
- async run(input, testResourceConfiguration, artifactory, tLog) {
32
- this.testResourceConfiguration = testResourceConfiguration;
33
- const suiteArtifactory = (fPath, value) => artifactory(`suite-${this.index}-${this.name}/${fPath}`, value);
34
- const subject = await this.setup(input, suiteArtifactory);
35
- tLog("\nSuite:", this.index, this.name);
36
- for (const k of Object.keys(this.givens)) {
37
- const giver = this.givens[k];
38
- try {
39
- this.store = await giver.give(subject, k, testResourceConfiguration, this.test, suiteArtifactory, tLog);
40
- }
41
- catch (e) {
42
- console.error(e);
43
- this.fails.push(giver);
44
- return this;
45
- }
46
- }
47
- for (const [ndx, thater] of this.checks.entries()) {
48
- await thater.check(subject, thater.name, testResourceConfiguration, this.test, suiteArtifactory, tLog);
49
- }
50
- // @TODO fix me
51
- for (const k of Object.keys(this.givens)) {
52
- const giver = this.givens[k];
53
- giver.afterAll(this.store, artifactory);
54
- }
55
- ////////////////
56
- return this;
57
- }
58
- }
59
- export class BaseGiven {
60
- constructor(name, features, whens, thens) {
61
- this.name = name;
62
- this.features = features;
63
- this.whens = whens;
64
- this.thens = thens;
65
- }
66
- beforeAll(store, artifactory) {
67
- return store;
68
- }
69
- afterAll(store, artifactory) {
70
- return store;
71
- }
72
- toObj() {
73
- return {
74
- name: this.name,
75
- whens: this.whens.map((w) => w.toObj()),
76
- thens: this.thens.map((t) => t.toObj()),
77
- error: this.error ? [this.error, this.error.stack] : null,
78
- features: this.features,
79
- };
80
- }
81
- async afterEach(store, key, artifactory) {
82
- return store;
83
- }
84
- async give(subject, key, testResourceConfiguration, tester, artifactory, tLog) {
85
- tLog(`\n Given: ${this.name}`);
86
- const givenArtifactory = (fPath, value) => artifactory(`given-${key}/${fPath}`, value);
87
- try {
88
- this.store = await this.givenThat(subject, testResourceConfiguration, givenArtifactory);
89
- // tLog(`\n Given this.store`, this.store);
90
- for (const whenStep of this.whens) {
91
- await whenStep.test(this.store, testResourceConfiguration, tLog);
92
- }
93
- for (const thenStep of this.thens) {
94
- const t = await thenStep.test(this.store, testResourceConfiguration, tLog);
95
- tester(t);
96
- }
97
- }
98
- catch (e) {
99
- this.error = e;
100
- tLog(e);
101
- tLog("\u0007"); // bell
102
- // throw e;
103
- }
104
- finally {
105
- try {
106
- await this.afterEach(this.store, key, givenArtifactory);
107
- }
108
- catch (e) {
109
- console.error("afterEach failed! no error will be recorded!", e);
110
- }
111
- }
112
- return this.store;
113
- }
114
- }
115
- export class BaseWhen {
116
- constructor(name, actioner) {
117
- this.name = name;
118
- this.actioner = actioner;
119
- }
120
- toObj() {
121
- return {
122
- name: this.name,
123
- error: this.error,
124
- };
125
- }
126
- async test(store, testResourceConfiguration, tLog) {
127
- tLog(" When:", this.name);
128
- try {
129
- return await this.andWhen(store, this.actioner, testResourceConfiguration);
130
- }
131
- catch (e) {
132
- this.error = true;
133
- throw e;
134
- }
135
- }
136
- }
137
- export class BaseThen {
138
- constructor(name, thenCB) {
139
- this.name = name;
140
- this.thenCB = thenCB;
141
- }
142
- toObj() {
143
- return {
144
- name: this.name,
145
- error: this.error,
146
- };
147
- }
148
- async test(store, testResourceConfiguration, tLog) {
149
- tLog(" Then:", this.name);
150
- try {
151
- return this.thenCB(await this.butThen(store, testResourceConfiguration));
152
- }
153
- catch (e) {
154
- console.log("test failed", e);
155
- this.error = true;
156
- throw e;
157
- }
158
- // try {
159
- // return await (this.thenCB(
160
- // await (async () => {
161
- // try {
162
- // return await (
163
- // (() => {
164
- // try {
165
- // return this.butThen(store, testResourceConfiguration)
166
- // } catch (e) {
167
- // this.error = true;
168
- // throw e
169
- // }
170
- // })()
171
- // );
172
- // } catch (e) {
173
- // this.error = true;
174
- // throw e
175
- // }
176
- // })()
177
- // ));
178
- // } catch (e) {
179
- // this.error = true;
180
- // throw e
181
- // }
182
- }
183
- }
184
- export class BaseCheck {
185
- constructor(name, features, checkCB, whens, thens) {
186
- this.name = name;
187
- this.features = features;
188
- this.checkCB = checkCB;
189
- this.whens = whens;
190
- this.thens = thens;
191
- }
192
- async afterEach(store, key, cb) {
193
- return;
194
- }
195
- async check(subject, key, testResourceConfiguration, tester, artifactory, tLog) {
196
- tLog(`\n Check: ${this.name}`);
197
- const store = await this.checkThat(subject, testResourceConfiguration, artifactory);
198
- await this.checkCB(Object.entries(this.whens).reduce((a, [key, when]) => {
199
- a[key] = async (payload) => {
200
- return await when(payload, testResourceConfiguration).test(store, testResourceConfiguration, tLog);
201
- };
202
- return a;
203
- }, {}), Object.entries(this.thens).reduce((a, [key, then]) => {
204
- a[key] = async (payload) => {
205
- const t = await then(payload, testResourceConfiguration).test(store, testResourceConfiguration, tLog);
206
- tester(t);
207
- };
208
- return a;
209
- }, {}));
210
- await this.afterEach(store, key);
211
- return;
212
- }
213
- }
214
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////
215
- class TesterantoLevelZero {
216
- constructor(cc, suitesOverrides, givenOverides, whenOverides, thenOverides, checkOverides) {
217
- this.cc = cc;
218
- this.constructorator = cc;
219
- this.suitesOverrides = suitesOverrides;
220
- this.givenOverides = givenOverides;
221
- this.whenOverides = whenOverides;
222
- this.thenOverides = thenOverides;
223
- this.checkOverides = checkOverides;
224
- }
225
- Suites() {
226
- return this.suitesOverrides;
227
- }
228
- Given() {
229
- return this.givenOverides;
230
- }
231
- When() {
232
- return this.whenOverides;
233
- }
234
- Then() {
235
- return this.thenOverides;
236
- }
237
- Check() {
238
- return this.checkOverides;
239
- }
240
- }
241
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////
242
- class TesterantoLevelOne {
243
- constructor(testImplementation, testSpecification, input, suiteKlasser, givenKlasser, whenKlasser, thenKlasser, checkKlasser, testResourceRequirement, logWriter) {
244
- this.artifacts = [];
245
- const classySuites = Object.entries(testImplementation.Suites).reduce((a, [key], index) => {
246
- a[key] = (somestring, givens, checks) => {
247
- return new suiteKlasser.prototype.constructor(somestring, index, givens, checks);
248
- };
249
- return a;
250
- }, {});
251
- const classyGivens = Object.keys(testImplementation.Givens)
252
- .reduce((a, key) => {
253
- a[key] = (features, whens, thens, ...xtrasW) => {
254
- return new givenKlasser.prototype.constructor(key, features, whens, thens, testImplementation.Givens[key](...xtrasW));
255
- };
256
- return a;
257
- }, {});
258
- const classyWhens = Object.entries(testImplementation.Whens).reduce((a, [key, whEn]) => {
259
- a[key] = (payload) => {
260
- return new whenKlasser.prototype.constructor(`${whEn.name}: ${payload && payload.toString()}`, whEn(payload));
261
- };
262
- return a;
263
- }, {});
264
- const classyThens = Object.entries(testImplementation.Thens).reduce((a, [key, thEn]) => {
265
- a[key] = (expected, x) => {
266
- return new thenKlasser.prototype.constructor(`${thEn.name}: ${expected && expected.toString()}`, thEn(expected));
267
- };
268
- return a;
269
- }, {});
270
- const classyChecks = Object.entries(testImplementation.Checks).reduce((a, [key, z]) => {
271
- a[key] = (somestring, features, callback) => {
272
- return new checkKlasser.prototype.constructor(somestring, features, callback, classyWhens, classyThens);
273
- };
274
- return a;
275
- }, {});
276
- const classyTesteranto = new (class extends TesterantoLevelZero {
277
- })(input, classySuites, classyGivens, classyWhens, classyThens, classyChecks);
278
- const suites = testSpecification(
279
- /* @ts-ignore:next-line */
280
- classyTesteranto.Suites(), classyTesteranto.Given(), classyTesteranto.When(), classyTesteranto.Then(), classyTesteranto.Check(), logWriter);
281
- const suiteRunner = (suite) => async (testResourceConfiguration, tLog) => {
282
- return await suite.run(input, testResourceConfiguration, (fPath, value) => logWriter.testArtiFactoryfileWriter(tLog, (p) => {
283
- artifacts.push(p);
284
- })(testResourceConfiguration.fs + "/" + fPath, value), tLog);
285
- };
286
- const artifacts = this.artifacts;
287
- this.testJobs = suites.map((suite) => {
288
- const runner = suiteRunner(suite);
289
- return {
290
- test: suite,
291
- testResourceRequirement,
292
- toObj: () => {
293
- return suite.toObj();
294
- },
295
- runner,
296
- receiveTestResourceConfig: async function (testResourceConfiguration = defaultTestResource) {
297
- console.log(`testResourceConfiguration ${JSON.stringify(testResourceConfiguration, null, 2)}`);
298
- await logWriter.mkdirSync(testResourceConfiguration.fs);
299
- const logFilePath = (`${testResourceConfiguration.fs}/log.txt`);
300
- const access = await logWriter.createWriteStream(logFilePath);
301
- const tLog = (...l) => {
302
- console.log(...l);
303
- access.write(`${l.toString()}\n`);
304
- };
305
- const suiteDone = await runner(testResourceConfiguration, tLog);
306
- const resultsFilePath = (`${testResourceConfiguration.fs}/results.json`);
307
- logWriter.writeFileSync(resultsFilePath, JSON.stringify(suiteDone.toObj(), null, 2));
308
- const logPromise = new Promise((res, rej) => {
309
- access.on("finish", () => { res(true); });
310
- });
311
- access.end();
312
- const numberOfFailures = Object.keys(suiteDone.givens).filter((k) => {
313
- // console.log(`suiteDone.givens[k].error`, suiteDone.givens[k].error);
314
- return suiteDone.givens[k].error;
315
- }).length;
316
- console.log(`exiting gracefully with ${numberOfFailures} failures.`);
317
- return {
318
- failed: numberOfFailures,
319
- artifacts,
320
- logPromise
321
- };
322
- },
323
- };
324
- });
325
- }
326
- }
327
- ////////////////////////////////////////////////////////////////////////////////////////////////
328
- export default class TesterantoLevelTwo extends TesterantoLevelOne {
329
- constructor(input, testSpecification, testImplementation, testInterface, testResourceRequirement = defaultTestResourceRequirement, assertioner, beforeEach, afterEach, afterAll, butThen, andWhen, actionHandler, logWriter) {
330
- super(testImplementation, testSpecification, input, class extends BaseSuite {
331
- async setup(s, artifactory) {
332
- return (testInterface.beforeAll || (async (input, artificer) => input))(s, artifactory, this.testResourceConfiguration);
333
- }
334
- test(t) {
335
- return assertioner(t);
336
- }
337
- }, class Given extends BaseGiven {
338
- constructor(name, features, whens, thens, initialValues) {
339
- super(name, features, whens, thens);
340
- this.initialValues = initialValues;
341
- }
342
- async givenThat(subject, testResource, artifactory) {
343
- return beforeEach(subject, this.initialValues, testResource, (fPath, value) =>
344
- // TODO does not work?
345
- artifactory(`beforeEach/${fPath}`, value));
346
- }
347
- afterEach(store, key, artifactory) {
348
- return new Promise((res) => res(afterEach(store, key, (fPath, value) => artifactory(`after/${fPath}`, value))));
349
- }
350
- afterAll(store, artifactory) {
351
- return afterAll(store, (fPath, value) =>
352
- // TODO does not work?
353
- artifactory(`afterAll4-${this.name}/${fPath}`, value));
354
- }
355
- }, class When extends BaseWhen {
356
- constructor(name, actioner, payload) {
357
- super(name, (store) => {
358
- return actionHandler(actioner);
359
- });
360
- this.payload = payload;
361
- }
362
- async andWhen(store, actioner, testResource) {
363
- return await andWhen(store, actioner, testResource);
364
- }
365
- }, class Then extends BaseThen {
366
- constructor(name, callback) {
367
- super(name, callback);
368
- }
369
- async butThen(store, testResourceConfiguration) {
370
- return await butThen(store, this.thenCB, testResourceConfiguration);
371
- }
372
- }, class Check extends BaseCheck {
373
- constructor(name, features, checkCallback, whens, thens, initialValues) {
374
- super(name, features, checkCallback, whens, thens);
375
- this.initialValues = initialValues;
376
- }
377
- async checkThat(subject, testResourceConfiguration, artifactory) {
378
- return beforeEach(subject, this.initialValues, testResourceConfiguration, (fPath, value) => artifactory(`before/${fPath}`, value));
379
- }
380
- afterEach(store, key, artifactory) {
381
- return new Promise((res) => res(afterEach(store, key, (fPath, value) =>
382
- // TODO does not work?
383
- artifactory(`afterEach2-${this.name}/${fPath}`, value))));
384
- }
385
- }, testResourceRequirement, logWriter);
386
- }
387
- }
@@ -1,47 +0,0 @@
1
- import { app, BrowserWindow, ipcMain } from "electron";
2
- import path from "path";
3
- import url from "url";
4
- let win;
5
- function createWindow() {
6
- win = new BrowserWindow({
7
- webPreferences: {
8
- devTools: true,
9
- nodeIntegration: true,
10
- nodeIntegrationInWorker: true,
11
- contextIsolation: false,
12
- preload: path.join(app.getAppPath(), 'preload.js'),
13
- sandbox: false
14
- },
15
- width: 800,
16
- height: 600,
17
- show: false,
18
- });
19
- const u = url.format({
20
- pathname: path.join(process.cwd(), process.argv[2]),
21
- protocol: "file:",
22
- slashes: true,
23
- query: {
24
- requesting: encodeURIComponent(process.argv[3]),
25
- }
26
- });
27
- console.log("loading", u);
28
- win.loadURL(u);
29
- win.webContents.openDevTools();
30
- }
31
- app.on("ready", createWindow);
32
- ipcMain.handle('web-log', (x, message) => {
33
- console.log("web-log)", message);
34
- });
35
- ipcMain.handle('web-error', (x, message) => {
36
- console.log("web-error)", message);
37
- });
38
- ipcMain.handle('web-warn', (x, message) => {
39
- console.log("web-warn)", message);
40
- });
41
- ipcMain.handle('web-info', (x, message) => {
42
- console.log("web-info)", message);
43
- });
44
- ipcMain.handle('quit-app', (x, failed) => {
45
- console.log("quit-app", failed);
46
- app.exit(failed);
47
- });
@@ -1,22 +0,0 @@
1
- // const TesterantoComponent = (testInput) => (props) => {
2
- // const myContainer = useRef(null);
3
- // useEffect(() => {
4
- // console.log(
5
- // "useeffectCalled"
6
- // );
7
- // props.done(myContainer.current);
8
- // }, []);
9
- // return React.createElement('div', { ref: myContainer }, testInput()); //testInput();
10
- // };
11
- export const testInterface = (testInput) => {
12
- return {
13
- beforeEach: async (x, ndx, testRsource, artificer) => {
14
- return new Promise((resolve, rej) => {
15
- resolve(testInput());
16
- });
17
- },
18
- andWhen: function (s, actioner) {
19
- return actioner()(s);
20
- },
21
- };
22
- };
@@ -1,5 +0,0 @@
1
- import Testeranto from "../../../Node";
2
- import { testInterface } from ".";
3
- export default (testImplementations, testSpecifications, testInput) => {
4
- return Testeranto(testInput, testSpecifications, testImplementations, testInterface(testInput));
5
- };
@@ -1,5 +0,0 @@
1
- import Testeranto from "../../../Web";
2
- import { testInterface } from ".";
3
- export default (testImplementations, testSpecifications, testInput) => {
4
- return Testeranto(testInput, testSpecifications, testImplementations, testInterface(testInput));
5
- };
@@ -1,56 +0,0 @@
1
- import { createElement } from "react";
2
- import ReactDom from "react-dom/client";
3
- import Testeranto from "../../../Web";
4
- export default (testImplementations, testSpecifications, testInput) => {
5
- document.addEventListener("DOMContentLoaded", function () {
6
- console.log("DOMContentLoaded");
7
- const elem = document.getElementById("root");
8
- if (elem) {
9
- class TesterantoComponent extends testInput {
10
- constructor(props) {
11
- super(props);
12
- this.done = props.done;
13
- }
14
- componentDidMount() {
15
- super.componentDidMount && super.componentDidMount();
16
- return this.done(this);
17
- }
18
- }
19
- return Testeranto(testInput, testSpecifications, testImplementations, {
20
- beforeAll: async (prototype, artificer) => {
21
- return await new Promise((resolve, rej) => {
22
- const elem = document.getElementById("root");
23
- if (elem) {
24
- resolve({ htmlElement: elem });
25
- }
26
- });
27
- },
28
- beforeEach: async ({ htmlElement }, ndx, testRsource, artificer) => {
29
- return new Promise((resolve, rej) => {
30
- // Ignore these type errors
31
- ReactDom.createRoot(htmlElement).render(createElement(TesterantoComponent, {
32
- done: (reactElement) => {
33
- resolve({
34
- htmlElement,
35
- reactElement,
36
- });
37
- }
38
- }, []));
39
- });
40
- },
41
- andWhen: function (s, actioner) {
42
- return actioner()(s);
43
- },
44
- butThen: async function (s) {
45
- return s;
46
- },
47
- afterEach: async function (store, ndx, artificer) {
48
- return {};
49
- },
50
- afterAll: (store, artificer) => {
51
- return;
52
- },
53
- });
54
- }
55
- });
56
- };
@@ -1,93 +0,0 @@
1
- import { createElement } from "react";
2
- import { renderToStaticMarkup, renderToStaticNodeStream } from "react-dom/server";
3
- import Stream from 'stream';
4
- import Testeranto from "../../../Node";
5
- export { renderToStaticMarkup, renderToStaticNodeStream, Stream };
6
- export default (testImplementations, testSpecifications, testInput) => {
7
- return Testeranto(testInput, testSpecifications, testImplementations, {
8
- // beforeAll: async (
9
- // prototype,
10
- // artificer
11
- // ): Promise<ISubject> => {
12
- // return await new Promise((resolve, rej) => {
13
- // const elem = document.getElementById("root");
14
- // if (elem) {
15
- // resolve({ htmlElement: elem });
16
- // }
17
- // })
18
- // },
19
- beforeEach: async (reactComponent, ndx, testRsource, artificer) => {
20
- return new Promise((resolve, rej) => {
21
- // Ignore these type errors
22
- resolve(createElement(testInput));
23
- });
24
- },
25
- andWhen: async function (s, actioner) {
26
- // return actioner()(s);
27
- return s;
28
- },
29
- butThen: async function (s) {
30
- return s;
31
- },
32
- afterEach: async function (store, ndx, artificer) {
33
- return {};
34
- },
35
- afterAll: (store, artificer) => {
36
- return;
37
- },
38
- });
39
- };
40
- // type IInput = typeof React.Component;
41
- // type InitialState = unknown;
42
- // type IWhenShape = any;
43
- // type IThenShape = any;
44
- // type ISelection = string;
45
- // type IStore = string;
46
- // type ISubject = string
47
- // export default <ITestShape extends ITTestShape>(
48
- // testImplementations: ITestImplementation<
49
- // InitialState,
50
- // ISelection,
51
- // IWhenShape,
52
- // IThenShape,
53
- // ITestShape
54
- // >,
55
- // testSpecifications: ITestSpecification<
56
- // ITestShape,
57
- // ISubject,
58
- // IStore,
59
- // ISelection,
60
- // IThenShape
61
- // >,
62
- // testInput: IInput
63
- // ) => {
64
- // return Testeranto<
65
- // ITestShape,
66
- // IInput,
67
- // ISubject,
68
- // IStore,
69
- // ISelection,
70
- // IThenShape,
71
- // IWhenShape,
72
- // InitialState
73
- // >(
74
- // testInput,
75
- // testSpecifications,
76
- // testImplementations,
77
- // {
78
- // beforeEach: async (
79
- // element,
80
- // ndx,
81
- // testResource,
82
- // artificer
83
- // ): Promise<IStore> => {
84
- // return new Promise((resolve, rej) => {
85
- // resolve(ReactDOMServer.renderToStaticMarkup(element));
86
- // });
87
- // },
88
- // andWhen: function (s: IStore, actioner): Promise<ISelection> {
89
- // throw new Error(`"andWhens" are not permitted`);
90
- // }
91
- // },
92
- // )
93
- // };
@@ -1,48 +0,0 @@
1
- import React, { useEffect, useRef, } from "react";
2
- import ReactDom from "react-dom/client";
3
- import Testeranto from "../../../../src/Web";
4
- export default (testImplementations, testSpecifications, testInput) => {
5
- const TesterantoComponent = function (props) {
6
- const myContainer = useRef(null);
7
- useEffect(() => {
8
- console.log("This only happens ONCE. It happens AFTER the initial render.");
9
- // eslint-disable-next-line react/prop-types
10
- props.done(myContainer.current);
11
- }, []);
12
- return React.createElement('div', { ref: myContainer }, testInput()); //testInput();
13
- };
14
- return Testeranto(testInput, testSpecifications, testImplementations, {
15
- beforeAll: async (prototype, artificer) => {
16
- artificer("./before.txt", "hello artificer");
17
- return await new Promise((resolve, rej) => {
18
- document.addEventListener("DOMContentLoaded", function () {
19
- const elem = document.getElementById("root");
20
- if (elem) {
21
- resolve({ root: elem });
22
- }
23
- });
24
- });
25
- },
26
- beforeEach: async ({ root }, ndx, testRsource, artificer) => {
27
- return new Promise((resolve, rej) => {
28
- ReactDom.createRoot(root).
29
- render(React.createElement(TesterantoComponent, {
30
- done: (react) => resolve({ root, react })
31
- }, []));
32
- });
33
- },
34
- andWhen: function (s, actioner) {
35
- return actioner()(s);
36
- },
37
- butThen: async function (s) {
38
- return s;
39
- },
40
- afterEach: async function (store, ndx, artificer) {
41
- return {};
42
- },
43
- afterAll: (store, artificer) => {
44
- // store.page.browser().close();
45
- return;
46
- },
47
- });
48
- };