testeranto 0.94.0 → 0.110.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 (308) hide show
  1. package/README.md +1 -0
  2. package/bundle.js +80 -33
  3. package/dist/common/{src/Init.js → Init.js} +28 -0
  4. package/dist/common/{src/PM → PM}/main.js +272 -111
  5. package/dist/common/{src/PM → PM}/node.js +20 -5
  6. package/dist/common/{src/PM → PM}/web.js +19 -4
  7. package/dist/common/ReportServer.js +22 -0
  8. package/dist/common/{src/SubPackages → SubPackages}/react/jsx/index.js +0 -12
  9. package/dist/common/{src/SubPackages → SubPackages}/react/jsx/node.js +1 -6
  10. package/dist/common/{src/SubPackages → SubPackages}/react-dom/component/node.js +3 -16
  11. package/dist/common/{src/SubPackages → SubPackages}/react-dom/component/web.js +3 -3
  12. package/dist/common/{src/SubPackages → SubPackages}/react-dom/jsx/node.js +1 -1
  13. package/dist/common/{src/SubPackages → SubPackages}/react-dom/jsx/web.js +41 -30
  14. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/MemoExoticComponent/node.js +17 -7
  15. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/component/interface.js +17 -7
  16. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/fc/node.js +17 -7
  17. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/fc/web.js +17 -7
  18. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/jsx/index.js +18 -14
  19. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/jsx-promised/index.js +17 -7
  20. package/dist/common/build.js +222 -0
  21. package/dist/common/{src/defaultConfig.js → defaultConfig.js} +1 -0
  22. package/dist/common/esbuildConfigs/eslint-formatter-testeranto.js +6 -0
  23. package/dist/common/esbuildConfigs/inputFilesPlugin.js +27 -0
  24. package/dist/common/{src/esbuildConfigs → esbuildConfigs}/node.js +3 -14
  25. package/dist/common/{src/esbuildConfigs → esbuildConfigs}/web.js +3 -14
  26. package/dist/common/{src/init-docs.js → init-docs.js} +20 -10
  27. package/dist/common/{src/lib → lib}/abstractBase.js +20 -92
  28. package/dist/common/{src/lib → lib}/basebuilder.js +23 -10
  29. package/dist/common/{src/lib → lib}/classBuilder.js +1 -3
  30. package/dist/common/{src/lib → lib}/core.js +26 -10
  31. package/dist/common/{src/lib → lib}/index.js +0 -1
  32. package/dist/common/run.js +297 -0
  33. package/dist/common/tsconfig.common.tsbuildinfo +1 -1
  34. package/dist/common/utils.js +43 -0
  35. package/dist/module/Footer.js +4 -0
  36. package/dist/module/Init.js +63 -0
  37. package/dist/module/{src/PM → PM}/main.js +253 -102
  38. package/dist/module/{src/PM → PM}/node.js +20 -5
  39. package/dist/module/{src/PM → PM}/web.js +19 -4
  40. package/dist/module/ReportClient.js +97 -0
  41. package/dist/module/ReportServer.js +17 -0
  42. package/dist/module/SubPackages/react/jsx/index.js +15 -0
  43. package/dist/module/{src/SubPackages → SubPackages}/react/jsx/node.js +1 -6
  44. package/dist/module/{src/SubPackages → SubPackages}/react-dom/component/node.js +3 -16
  45. package/dist/module/{src/SubPackages → SubPackages}/react-dom/component/web.js +3 -3
  46. package/dist/module/{src/SubPackages → SubPackages}/react-dom/jsx/node.js +3 -3
  47. package/dist/module/{src/SubPackages → SubPackages}/react-dom/jsx/web.js +24 -23
  48. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/jsx/index.js +1 -7
  49. package/dist/module/TestReport.js +91 -0
  50. package/dist/module/build.js +184 -0
  51. package/dist/module/{src/defaultConfig.js → defaultConfig.js} +1 -0
  52. package/dist/module/esbuildConfigs/eslint-formatter-testeranto.js +3 -0
  53. package/dist/module/esbuildConfigs/inputFilesPlugin.js +22 -0
  54. package/dist/module/{src/esbuildConfigs → esbuildConfigs}/node.js +3 -14
  55. package/dist/module/{src/esbuildConfigs → esbuildConfigs}/web.js +3 -14
  56. package/dist/module/{src/init-docs.js → init-docs.js} +1 -1
  57. package/dist/module/{src/lib → lib}/abstractBase.js +20 -92
  58. package/dist/module/{src/lib → lib}/basebuilder.js +23 -10
  59. package/dist/module/{src/lib → lib}/classBuilder.js +1 -3
  60. package/dist/module/{src/lib → lib}/core.js +26 -10
  61. package/dist/module/{src/lib → lib}/index.js +0 -1
  62. package/dist/module/run.js +259 -0
  63. package/dist/module/tsconfig.module.tsbuildinfo +1 -1
  64. package/dist/module/utils.js +29 -0
  65. package/dist/prebuild/ReportClient.css +11367 -0
  66. package/dist/prebuild/ReportClient.js +23641 -0
  67. package/dist/prebuild/ReportServer.mjs +16 -0
  68. package/dist/prebuild/TestReport.css +11367 -0
  69. package/dist/prebuild/TestReport.js +27484 -0
  70. package/dist/prebuild/build.mjs +376 -0
  71. package/dist/prebuild/esbuildConfigs/eslint-formatter-testeranto.mjs +9 -0
  72. package/dist/prebuild/init-docs.mjs +64 -8
  73. package/dist/prebuild/{run-tests.mjs → run.mjs} +501 -182
  74. package/dist/tsconfig.tsbuildinfo +1 -0
  75. package/dist/types/Node.d.ts +12 -0
  76. package/dist/types/{src/PM → PM}/index.d.ts +11 -3
  77. package/dist/types/{src/PM → PM}/main.d.ts +24 -15
  78. package/dist/types/{src/PM → PM}/node.d.ts +11 -6
  79. package/dist/types/{src/PM → PM}/web.d.ts +11 -7
  80. package/dist/types/SubPackages/react/component/node.d.ts +7 -0
  81. package/dist/types/SubPackages/react/component/web.d.ts +7 -0
  82. package/dist/types/SubPackages/react/jsx/index.d.ts +12 -0
  83. package/dist/types/SubPackages/react/jsx/node.d.ts +4 -0
  84. package/dist/types/SubPackages/react/jsx/web.d.ts +4 -0
  85. package/dist/types/SubPackages/react-dom/component/node.d.ts +11 -0
  86. package/dist/types/SubPackages/react-dom/component/web.d.ts +20 -0
  87. package/dist/types/SubPackages/react-dom/jsx/index.d.ts +6 -0
  88. package/dist/types/SubPackages/react-dom/jsx/node.d.ts +7 -0
  89. package/dist/types/SubPackages/react-dom/jsx/web.d.ts +5 -0
  90. package/dist/types/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +6 -0
  91. package/dist/types/SubPackages/react-test-renderer/component/index.d.ts +13 -0
  92. package/dist/types/SubPackages/react-test-renderer/component/node.d.ts +4 -0
  93. package/dist/types/SubPackages/react-test-renderer/component/web.d.ts +4 -0
  94. package/dist/types/SubPackages/react-test-renderer/fc/node.d.ts +8 -0
  95. package/dist/types/SubPackages/react-test-renderer/fc/web.d.ts +9 -0
  96. package/dist/types/SubPackages/react-test-renderer/jsx/index.d.ts +16 -0
  97. package/dist/types/SubPackages/react-test-renderer/jsx/node.d.ts +9 -0
  98. package/dist/types/SubPackages/react-test-renderer/jsx/web.d.ts +9 -0
  99. package/dist/types/SubPackages/react-test-renderer/jsx-promised/index.d.ts +15 -0
  100. package/dist/types/SubPackages/react-test-renderer/jsx-promised/node.d.ts +5 -0
  101. package/dist/types/SubPackages/react-test-renderer/jsx-promised/web.d.ts +5 -0
  102. package/dist/types/Types.d.ts +61 -0
  103. package/dist/types/Web.d.ts +9 -0
  104. package/dist/types/defaultConfig.d.ts +3 -0
  105. package/dist/types/esbuildConfigs/eslint-formatter-testeranto.d.ts +2 -0
  106. package/dist/types/{src/esbuildConfigs → esbuildConfigs}/index.d.ts +1 -1
  107. package/dist/types/{src/esbuildConfigs → esbuildConfigs}/inputFilesPlugin.d.ts +0 -1
  108. package/dist/types/{src/esbuildConfigs → esbuildConfigs}/node.d.ts +1 -1
  109. package/dist/types/{src/esbuildConfigs → esbuildConfigs}/web.d.ts +1 -1
  110. package/dist/types/lib/abstractBase.d.ts +110 -0
  111. package/dist/types/lib/basebuilder.d.ts +27 -0
  112. package/dist/types/lib/classBuilder.d.ts +7 -0
  113. package/dist/types/lib/core.d.ts +7 -0
  114. package/dist/types/lib/index.d.ts +83 -0
  115. package/dist/types/lib/types.d.ts +14 -0
  116. package/dist/types/run.d.ts +1 -0
  117. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  118. package/dist/types/utils.d.ts +9 -0
  119. package/package.json +50 -39
  120. package/src/Footer.tsx +4 -0
  121. package/src/Init.ts +48 -0
  122. package/src/Node.ts +23 -17
  123. package/src/PM/index.ts +13 -9
  124. package/src/PM/main.ts +337 -139
  125. package/src/PM/node.ts +43 -8
  126. package/src/PM/web.ts +34 -6
  127. package/src/ReportClient.tsx +155 -0
  128. package/src/ReportServer.ts +21 -0
  129. package/src/SubPackages/react/component/node.ts +68 -24
  130. package/src/SubPackages/react/component/web.ts +68 -25
  131. package/src/SubPackages/react/jsx/index.ts +39 -18
  132. package/src/SubPackages/react/jsx/node.ts +23 -10
  133. package/src/SubPackages/react/jsx/web.ts +27 -14
  134. package/src/SubPackages/react-dom/component/node.ts +42 -50
  135. package/src/SubPackages/react-dom/component/web.ts +28 -10
  136. package/src/SubPackages/react-dom/jsx/node.ts +54 -56
  137. package/src/SubPackages/react-dom/jsx/web.ts +55 -42
  138. package/src/SubPackages/react-test-renderer/MemoExoticComponent/node.ts +23 -7
  139. package/src/SubPackages/react-test-renderer/component/index.ts +38 -5
  140. package/src/SubPackages/react-test-renderer/component/node.ts +24 -5
  141. package/src/SubPackages/react-test-renderer/component/web.ts +22 -5
  142. package/src/SubPackages/react-test-renderer/fc/node.ts +41 -7
  143. package/src/SubPackages/react-test-renderer/fc/web.ts +43 -11
  144. package/src/SubPackages/react-test-renderer/jsx/index.ts +39 -16
  145. package/src/SubPackages/react-test-renderer/jsx/node.ts +22 -5
  146. package/src/SubPackages/react-test-renderer/jsx/web.ts +22 -5
  147. package/src/SubPackages/react-test-renderer/jsx-promised/index.ts +39 -6
  148. package/src/SubPackages/react-test-renderer/jsx-promised/node.ts +27 -10
  149. package/src/SubPackages/react-test-renderer/jsx-promised/web.ts +26 -12
  150. package/src/TestReport.tsx +176 -0
  151. package/src/Types.ts +131 -129
  152. package/src/Web.ts +24 -18
  153. package/src/build.ts +240 -0
  154. package/src/defaultConfig.ts +2 -1
  155. package/src/esbuildConfigs/eslint-formatter-testeranto.ts +5 -0
  156. package/src/esbuildConfigs/featuresPlugin.ts +0 -1
  157. package/src/esbuildConfigs/index.ts +1 -1
  158. package/src/esbuildConfigs/inputFilesPlugin.ts +2 -114
  159. package/src/esbuildConfigs/node.ts +7 -19
  160. package/src/esbuildConfigs/web.ts +6 -21
  161. package/src/init-docs.ts +2 -1
  162. package/src/lib/abstractBase.ts +140 -195
  163. package/src/lib/basebuilder.ts +57 -45
  164. package/src/lib/classBuilder.ts +15 -15
  165. package/src/lib/core.ts +44 -35
  166. package/src/lib/index.ts +47 -98
  167. package/src/lib/readme.md +12 -0
  168. package/src/lib/types.ts +40 -231
  169. package/src/run.ts +398 -0
  170. package/src/style.css +8 -0
  171. package/src/utils.ts +74 -2
  172. package/tsc.log +106 -0
  173. package/Bundle.Dockerfile +0 -52
  174. package/bin/init-docs.js +0 -24
  175. package/dist/common/dist/module/src/Init.js +0 -40
  176. package/dist/common/src/Aider.js +0 -143
  177. package/dist/common/src/Project.js +0 -227
  178. package/dist/common/src/Puppeteer.js +0 -111
  179. package/dist/common/src/SubPackages/puppeteer.js +0 -21
  180. package/dist/common/src/build-tests.js +0 -39
  181. package/dist/common/src/esbuildConfigs/features.js +0 -14
  182. package/dist/common/src/esbuildConfigs/inputFilesPlugin.js +0 -87
  183. package/dist/common/src/esbuildConfigs/report.js +0 -14
  184. package/dist/common/src/esbuildConfigs/tests.js +0 -13
  185. package/dist/common/src/run-tests.js +0 -39
  186. package/dist/common/src/utils.js +0 -16
  187. package/dist/common/testeranto.js +0 -15
  188. package/dist/module/src/Aider.js +0 -136
  189. package/dist/module/src/Init.js +0 -35
  190. package/dist/module/src/Project.js +0 -220
  191. package/dist/module/src/Puppeteer.js +0 -106
  192. package/dist/module/src/SubPackages/puppeteer.js +0 -16
  193. package/dist/module/src/SubPackages/react/jsx/index.js +0 -27
  194. package/dist/module/src/build-tests.js +0 -11
  195. package/dist/module/src/esbuildConfigs/features.js +0 -12
  196. package/dist/module/src/esbuildConfigs/inputFilesPlugin.js +0 -82
  197. package/dist/module/src/esbuildConfigs/report.js +0 -14
  198. package/dist/module/src/esbuildConfigs/tests.js +0 -11
  199. package/dist/module/src/run-tests.js +0 -11
  200. package/dist/module/src/utils.js +0 -9
  201. package/dist/module/testeranto.js +0 -13
  202. package/dist/prebuild/build-tests.mjs +0 -553
  203. package/dist/types/dist/module/src/Init.d.ts +0 -2
  204. package/dist/types/src/Aider.d.ts +0 -1
  205. package/dist/types/src/Node.d.ts +0 -13
  206. package/dist/types/src/Project.d.ts +0 -12
  207. package/dist/types/src/Puppeteer.d.ts +0 -2
  208. package/dist/types/src/SubPackages/puppeteer.d.ts +0 -6
  209. package/dist/types/src/SubPackages/react/component/node.d.ts +0 -7
  210. package/dist/types/src/SubPackages/react/component/web.d.ts +0 -7
  211. package/dist/types/src/SubPackages/react/jsx/index.d.ts +0 -12
  212. package/dist/types/src/SubPackages/react/jsx/node.d.ts +0 -4
  213. package/dist/types/src/SubPackages/react/jsx/web.d.ts +0 -4
  214. package/dist/types/src/SubPackages/react-dom/component/node.d.ts +0 -12
  215. package/dist/types/src/SubPackages/react-dom/component/web.d.ts +0 -11
  216. package/dist/types/src/SubPackages/react-dom/jsx/index.d.ts +0 -7
  217. package/dist/types/src/SubPackages/react-dom/jsx/node.d.ts +0 -6
  218. package/dist/types/src/SubPackages/react-dom/jsx/web.d.ts +0 -5
  219. package/dist/types/src/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +0 -5
  220. package/dist/types/src/SubPackages/react-test-renderer/component/index.d.ts +0 -13
  221. package/dist/types/src/SubPackages/react-test-renderer/component/node.d.ts +0 -8
  222. package/dist/types/src/SubPackages/react-test-renderer/component/web.d.ts +0 -3
  223. package/dist/types/src/SubPackages/react-test-renderer/fc/node.d.ts +0 -8
  224. package/dist/types/src/SubPackages/react-test-renderer/fc/web.d.ts +0 -8
  225. package/dist/types/src/SubPackages/react-test-renderer/jsx/index.d.ts +0 -17
  226. package/dist/types/src/SubPackages/react-test-renderer/jsx/node.d.ts +0 -8
  227. package/dist/types/src/SubPackages/react-test-renderer/jsx/web.d.ts +0 -8
  228. package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/index.d.ts +0 -16
  229. package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/node.d.ts +0 -4
  230. package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/web.d.ts +0 -4
  231. package/dist/types/src/Types.d.ts +0 -51
  232. package/dist/types/src/Web.d.ts +0 -10
  233. package/dist/types/src/defaultConfig.d.ts +0 -3
  234. package/dist/types/src/esbuildConfigs/features.d.ts +0 -4
  235. package/dist/types/src/esbuildConfigs/report.d.ts +0 -0
  236. package/dist/types/src/esbuildConfigs/tests.d.ts +0 -4
  237. package/dist/types/src/lib/abstractBase.d.ts +0 -110
  238. package/dist/types/src/lib/basebuilder.d.ts +0 -27
  239. package/dist/types/src/lib/classBuilder.d.ts +0 -7
  240. package/dist/types/src/lib/core.d.ts +0 -8
  241. package/dist/types/src/lib/index.d.ts +0 -60
  242. package/dist/types/src/lib/types.d.ts +0 -68
  243. package/dist/types/src/utils.d.ts +0 -2
  244. package/dist/types/testeranto.d.ts +0 -16
  245. package/docker-compose.yml +0 -37
  246. package/src/Aider.ts +0 -168
  247. package/src/Project.ts +0 -292
  248. package/src/Puppeteer.ts +0 -143
  249. package/src/SubPackages/puppeteer.ts +0 -51
  250. package/src/build-tests.ts +0 -12
  251. package/src/esbuildConfigs/features.ts +0 -17
  252. package/src/esbuildConfigs/report.ts +0 -15
  253. package/src/esbuildConfigs/tests.ts +0 -14
  254. package/src/run-tests.ts +0 -12
  255. package/testeranto.ts +0 -13
  256. package/dist/common/{src/Node.js → Node.js} +0 -0
  257. package/dist/common/{src/PM → PM}/index.js +0 -0
  258. package/dist/common/{src/SubPackages → SubPackages}/react/component/node.js +0 -0
  259. package/dist/common/{src/SubPackages → SubPackages}/react/component/web.js +0 -0
  260. package/dist/common/{src/SubPackages → SubPackages}/react/jsx/web.js +0 -0
  261. package/dist/common/{src/SubPackages → SubPackages}/react-dom/jsx/index.js +0 -0
  262. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/component/index.js +0 -0
  263. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/component/node.js +0 -0
  264. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/component/web.js +0 -0
  265. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/jsx/node.js +0 -0
  266. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/jsx/web.js +0 -0
  267. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/jsx-promised/node.js +1 -1
  268. package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/jsx-promised/web.js +0 -0
  269. package/dist/common/{src/Types.js → Types.js} +0 -0
  270. package/dist/common/{src/Web.js → Web.js} +0 -0
  271. package/dist/common/{src/esbuildConfigs → esbuildConfigs}/featuresPlugin.js +0 -0
  272. package/dist/common/{src/esbuildConfigs → esbuildConfigs}/index.js +0 -0
  273. package/dist/common/{src/lib → lib}/types.js +0 -0
  274. package/dist/common/{src/puppeteerConfiger.js → puppeteerConfiger.js} +0 -0
  275. package/dist/common/{src/web.html.js → web.html.js} +0 -0
  276. package/dist/module/{src/Node.js → Node.js} +0 -0
  277. package/dist/module/{src/PM → PM}/index.js +0 -0
  278. package/dist/module/{src/SubPackages → SubPackages}/react/component/node.js +0 -0
  279. package/dist/module/{src/SubPackages → SubPackages}/react/component/web.js +0 -0
  280. package/dist/module/{src/SubPackages → SubPackages}/react/jsx/web.js +0 -0
  281. package/dist/module/{src/SubPackages → SubPackages}/react-dom/jsx/index.js +0 -0
  282. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/MemoExoticComponent/node.js +0 -0
  283. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/component/index.js +0 -0
  284. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/component/interface.js +0 -0
  285. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/component/node.js +0 -0
  286. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/component/web.js +0 -0
  287. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/fc/node.js +0 -0
  288. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/fc/web.js +0 -0
  289. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/jsx/node.js +0 -0
  290. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/jsx/web.js +0 -0
  291. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/jsx-promised/index.js +0 -0
  292. package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/jsx-promised/node.js +1 -1
  293. /package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/jsx-promised/web.js +0 -0
  294. /package/dist/module/{src/Types.js → Types.js} +0 -0
  295. /package/dist/module/{src/Web.js → Web.js} +0 -0
  296. /package/dist/module/{src/esbuildConfigs → esbuildConfigs}/featuresPlugin.js +0 -0
  297. /package/dist/module/{src/esbuildConfigs → esbuildConfigs}/index.js +0 -0
  298. /package/dist/module/{src/lib → lib}/types.js +0 -0
  299. /package/dist/module/{src/puppeteerConfiger.js → puppeteerConfiger.js} +0 -0
  300. /package/dist/module/{src/web.html.js → web.html.js} +0 -0
  301. /package/dist/types/{src/Init.d.ts → Init.d.ts} +0 -0
  302. /package/dist/types/{src/build-tests.d.ts → ReportServer.d.ts} +0 -0
  303. /package/dist/types/{src/SubPackages → SubPackages}/react-test-renderer/component/interface.d.ts +0 -0
  304. /package/dist/types/{src/init-docs.d.ts → build.d.ts} +0 -0
  305. /package/dist/types/{src/esbuildConfigs → esbuildConfigs}/featuresPlugin.d.ts +0 -0
  306. /package/dist/types/{src/run-tests.d.ts → init-docs.d.ts} +0 -0
  307. /package/dist/types/{src/puppeteerConfiger.d.ts → puppeteerConfiger.d.ts} +0 -0
  308. /package/dist/types/{src/web.html.d.ts → web.html.d.ts} +0 -0
package/src/Types.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ITTestResourceRequest, ITestCheckCallback } from "./lib/index.js";
1
+ import { ITTestResourceConfiguration, ITestArtificer } from "./lib/index.js";
2
2
  import {
3
3
  IGivens,
4
4
  BaseCheck,
@@ -7,96 +7,121 @@ import {
7
7
  BaseThen,
8
8
  BaseGiven,
9
9
  } from "./lib/abstractBase.js";
10
- import Testeranto from "./lib/core.js";
11
- import {
12
- INodeTestInterface,
13
- ITestInterface,
14
- IWebTestInterface,
15
- } from "./lib/types.js";
16
10
  import { PM } from "./PM/index.js";
11
+ import { ITestCheckCallback } from "./lib/types.js";
17
12
 
18
- export type IPartialInterface<
19
- I extends IBaseTest<
20
- unknown,
13
+ export type ITestInterface<
14
+ I extends Ibdd_in<
21
15
  unknown,
22
16
  unknown,
23
17
  unknown,
24
18
  unknown,
25
19
  unknown,
26
20
  unknown,
27
- Record<string, any>,
28
- Record<string, any>,
29
- Record<string, any>,
30
- Record<string, any>,
31
- Record<string, any>
21
+ unknown
32
22
  >
33
- > = Partial<ITestInterface<I>>;
23
+ > = {
24
+ assertThis: (x: I["then"]) => void;
25
+ andWhen: (
26
+ store: I["istore"],
27
+ whenCB: I["when"],
28
+ testResource: ITTestResourceConfiguration,
29
+ pm: PM
30
+ ) => Promise<I["istore"]>;
31
+ butThen: (
32
+ store: I["istore"],
33
+ thenCB: I["then"],
34
+ testResource: ITTestResourceConfiguration,
35
+ pm: PM
36
+ ) => Promise<I["iselection"]>;
37
+ afterAll: (store: I["istore"], pm: PM) => any;
38
+ afterEach: (store: I["istore"], key: string, pm: PM) => Promise<unknown>;
39
+ beforeAll: (
40
+ input: I["iinput"],
41
+ testResource: ITTestResourceConfiguration,
42
+ pm: PM
43
+ ) => Promise<I["isubject"]>;
44
+ beforeEach: (
45
+ subject: I["isubject"],
46
+ initializer: (c?) => I["given"],
47
+ testResource: ITTestResourceConfiguration,
48
+ initialValues,
49
+ pm: PM
50
+ ) => Promise<I["istore"]>;
51
+ };
34
52
 
35
- export type IPartialNodeInterface<
36
- I extends IBaseTest<
37
- unknown,
53
+ export type IWebTestInterface<
54
+ I extends Ibdd_in<
38
55
  unknown,
39
56
  unknown,
40
57
  unknown,
41
58
  unknown,
42
59
  unknown,
43
60
  unknown,
44
- Record<string, any>,
45
- Record<string, any>,
46
- Record<string, any>,
47
- Record<string, any>,
48
- Record<string, any>
61
+ unknown
49
62
  >
50
- > = Partial<INodeTestInterface<I>>;
51
- export type IPartialWebInterface<
52
- I extends IBaseTest<
63
+ > = ITestInterface<I>;
64
+
65
+ export type INodeTestInterface<
66
+ I extends Ibdd_in<
53
67
  unknown,
54
68
  unknown,
55
69
  unknown,
56
70
  unknown,
57
71
  unknown,
58
72
  unknown,
73
+ unknown
74
+ >
75
+ > = ITestInterface<I>;
76
+
77
+ export type IPartialInterface<
78
+ I extends Ibdd_in<
59
79
  unknown,
60
- Record<string, any>,
61
- Record<string, any>,
62
- Record<string, any>,
63
- Record<string, any>,
64
- Record<string, any>
80
+ unknown,
81
+ unknown,
82
+ unknown,
83
+ unknown,
84
+ unknown,
85
+ unknown
65
86
  >
66
- > = Partial<IWebTestInterface<I>>;
87
+ > = Partial<ITestInterface<I>>;
67
88
 
68
- export type IEntry<
69
- ITestShape extends IBaseTest<
89
+ export type IPartialNodeInterface<
90
+ I extends Ibdd_in<
70
91
  unknown,
71
92
  unknown,
72
93
  unknown,
73
94
  unknown,
74
95
  unknown,
75
96
  unknown,
97
+ unknown
98
+ >
99
+ > = Partial<INodeTestInterface<I>>;
100
+ export type IPartialWebInterface<
101
+ I extends Ibdd_in<
76
102
  unknown,
77
- Record<string, any>,
78
- Record<string, any>,
79
- Record<string, any>,
80
- Record<string, any>,
81
- Record<string, any>
103
+ unknown,
104
+ unknown,
105
+ unknown,
106
+ unknown,
107
+ unknown,
108
+ unknown
82
109
  >
83
- > = (
84
- input: ITestShape["iinput"],
85
- testSpecification: ITestSpecification<ITestShape>,
86
- testImplementation: ITestImplementation<ITestShape, object>,
87
- testInterface: IPartialInterface<ITestShape>,
88
- testResourceRequirement: ITTestResourceRequest
89
- ) => Promise<Testeranto<ITestShape>>;
110
+ > = Partial<IWebTestInterface<I>>;
111
+
112
+ //////////////////////////////////////////////////////////////////////////////////////////////////////////////
90
113
 
91
114
  export type ITestSpecification<
92
- ITestShape extends IBaseTest<
93
- unknown,
115
+ I extends Ibdd_in<
94
116
  unknown,
95
117
  unknown,
96
118
  unknown,
97
119
  unknown,
98
120
  unknown,
99
121
  unknown,
122
+ unknown
123
+ >,
124
+ O extends Ibdd_out<
100
125
  Record<string, any>,
101
126
  Record<string, any>,
102
127
  Record<string, any>,
@@ -105,114 +130,96 @@ export type ITestSpecification<
105
130
  >
106
131
  > = (
107
132
  Suite: {
108
- [K in keyof ITestShape["suites"]]: (
133
+ [K in keyof O["suites"]]: (
109
134
  name: string,
110
- givens: IGivens<ITestShape>,
111
- checks: BaseCheck<ITestShape>[]
112
- ) => BaseSuite<ITestShape>;
135
+ givens: IGivens<I>,
136
+ checks: BaseCheck<I, O>[]
137
+ ) => BaseSuite<I, O>;
113
138
  },
114
139
  Given: {
115
- [K in keyof ITestShape["givens"]]: (
140
+ [K in keyof O["givens"]]: (
116
141
  features: string[],
117
- whens: BaseWhen<ITestShape>[],
118
- thens: BaseThen<ITestShape>[],
119
- ...xtrasB: ITestShape["givens"][K]
120
- ) => BaseGiven<ITestShape>;
142
+ whens: BaseWhen<I>[],
143
+ thens: BaseThen<I>[],
144
+ ...xtrasB: O["givens"][K]
145
+ ) => BaseGiven<I>;
121
146
  },
122
147
  When: {
123
- [K in keyof ITestShape["whens"]]: (
124
- ...xtrasC: ITestShape["whens"][K]
125
- ) => BaseWhen<ITestShape>;
148
+ [K in keyof O["whens"]]: (...xtrasC: O["whens"][K]) => BaseWhen<I>;
126
149
  },
127
150
  Then: {
128
- [K in keyof ITestShape["thens"]]: (
129
- ...xtrasD: ITestShape["thens"][K]
130
- ) => BaseThen<ITestShape>;
151
+ [K in keyof O["thens"]]: (...xtrasD: O["thens"][K]) => BaseThen<I>;
131
152
  },
132
- Check: ITestCheckCallback<ITestShape>
153
+ Check: ITestCheckCallback<I, O>
133
154
  ) => any[];
134
155
 
156
+ //////////////////////////////////////////////////////////////////////////////////////////////////////////////
157
+
135
158
  export type ITestImplementation<
136
- ITestShape extends IBaseTest<
137
- unknown,
159
+ I extends Ibdd_in<
138
160
  unknown,
139
161
  unknown,
140
162
  unknown,
141
163
  unknown,
142
164
  unknown,
143
165
  unknown,
166
+ unknown
167
+ >,
168
+ O extends Ibdd_out<
144
169
  Record<string, any>,
145
170
  Record<string, any>,
146
171
  Record<string, any>,
147
172
  Record<string, any>,
148
173
  Record<string, any>
149
- >,
150
- IMod = object
151
- > = Modify<
152
- {
153
- suites: {
154
- [K in keyof ITestShape["suites"]]: string;
155
- };
156
- givens: {
157
- [K in keyof ITestShape["givens"]]: (
158
- ...Ig: ITestShape["givens"][K]
159
- ) => ITestShape["given"];
160
- };
161
- whens: {
162
- [K in keyof ITestShape["whens"]]: (
163
- ...Iw: ITestShape["whens"][K]
164
- ) => (
165
- zel: ITestShape["iselection"],
166
- utils: PM
167
- ) => Promise<ITestShape["when"]>;
168
- };
169
- thens: {
170
- [K in keyof ITestShape["thens"]]: (
171
- ...It: ITestShape["thens"][K]
172
- ) => (ssel: ITestShape["iselection"], utils: PM) => ITestShape["then"];
173
- };
174
- checks: {
175
- [K in keyof ITestShape["checks"]]: (
176
- ...Ic: ITestShape["checks"][K]
177
- ) => ITestShape["given"];
178
- };
179
- },
180
- IMod
181
- >;
182
-
183
- type Modify<T, R> = Omit<T, keyof R> & R;
174
+ >
175
+ > = {
176
+ suites: {
177
+ [K in keyof O["suites"]]: string;
178
+ };
179
+ givens: {
180
+ [K in keyof O["givens"]]: (...Ig: O["givens"][K]) => I["given"];
181
+ };
182
+ whens: {
183
+ [K in keyof O["whens"]]: (
184
+ ...Iw: O["whens"][K]
185
+ ) => (zel: I["iselection"], utils: PM) => Promise<I["when"]>;
186
+ };
187
+ thens: {
188
+ [K in keyof O["thens"]]: (
189
+ ...It: O["thens"][K]
190
+ ) => (ssel: I["iselection"], utils: PM) => I["then"];
191
+ };
192
+ checks: {
193
+ [K in keyof O["checks"]]: (...Ic: O["checks"][K]) => I["given"];
194
+ };
195
+ };
184
196
 
185
- // export type IBaseTest<Shape = any, II = Shape> = {
186
- // iinput: II;
187
- // isubject: Shape;
188
- // istore: Shape;
189
- // iselection: Shape;
190
- // // iinitial;
197
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
191
198
 
192
- // given;
193
- // when;
194
- // then;
199
+ export type Modify<T, R> = Omit<T, keyof R> & R;
195
200
 
196
- // suites: Record<string, any>;
197
- // givens: Record<string, any>;
198
- // whens: Record<string, any>;
199
- // thens: Record<string, any>;
200
- // checks: Record<string, any>;
201
- // };
201
+ export type Ibdd_out<
202
+ ISuites extends Record<string, any>,
203
+ IGivens extends Record<string, any>,
204
+ IWhens extends Record<string, any>,
205
+ IThens extends Record<string, any>,
206
+ IChecks extends Record<string, any>
207
+ > = {
208
+ suites: ISuites;
209
+ givens: IGivens;
210
+ whens: IWhens;
211
+ thens: IThens;
212
+ checks: IChecks;
213
+ };
202
214
 
203
- export type IBaseTest<
215
+ export type Ibdd_in<
204
216
  IInput,
205
217
  ISubject,
206
218
  IStore,
207
219
  ISelection,
208
220
  IGiven,
209
221
  IWhen,
210
- IThen,
211
- ISuites extends Record<string, any>,
212
- IGivens extends Record<string, any>,
213
- IWhens extends Record<string, any>,
214
- IThens extends Record<string, any>,
215
- IChecks extends Record<string, any>
222
+ IThen
216
223
  > = {
217
224
  iinput: IInput;
218
225
  isubject: ISubject;
@@ -221,9 +228,4 @@ export type IBaseTest<
221
228
  given: IGiven;
222
229
  when: IWhen;
223
230
  then: IThen;
224
- suites: ISuites;
225
- givens: IGivens;
226
- whens: IWhens;
227
- thens: IThens;
228
- checks: IChecks;
229
231
  };
package/src/Web.ts CHANGED
@@ -1,17 +1,19 @@
1
- import { error } from "console";
2
1
  import { PM_Web } from "./PM/web";
3
2
  import type {
4
- IBaseTest,
3
+ Ibdd_in,
4
+ Ibdd_out,
5
5
  ITestImplementation,
6
+ ITestInterface,
6
7
  ITestSpecification,
8
+ IWebTestInterface,
7
9
  } from "./Types";
8
10
  import Testeranto from "./lib/core.js";
9
11
  import {
12
+ IFinalResults,
10
13
  ITTestResourceConfiguration,
11
14
  ITTestResourceRequest,
12
15
  defaultTestResourceRequirement,
13
16
  } from "./lib/index.js";
14
- import { IFinalResults, ITestInterface, IWebTestInterface } from "./lib/types";
15
17
 
16
18
  let errorCallback = (e: any) => {};
17
19
  let unhandledrejectionCallback = (event: PromiseRejectionEvent) => {
@@ -21,27 +23,29 @@ let unhandledrejectionCallback = (event: PromiseRejectionEvent) => {
21
23
  };
22
24
 
23
25
  export class WebTesteranto<
24
- TestShape extends IBaseTest<
25
- unknown,
26
+ I extends Ibdd_in<
26
27
  unknown,
27
28
  unknown,
28
29
  unknown,
29
30
  unknown,
30
31
  unknown,
31
32
  unknown,
33
+ unknown
34
+ >,
35
+ O extends Ibdd_out<
32
36
  Record<string, any>,
33
37
  Record<string, any>,
34
38
  Record<string, any>,
35
39
  Record<string, any>,
36
40
  Record<string, any>
37
41
  >
38
- > extends Testeranto<TestShape> {
42
+ > extends Testeranto<I, O> {
39
43
  constructor(
40
- input: TestShape["iinput"],
41
- testSpecification: ITestSpecification<TestShape>,
42
- testImplementation: ITestImplementation<TestShape>,
44
+ input: I["iinput"],
45
+ testSpecification: ITestSpecification<I, O>,
46
+ testImplementation: ITestImplementation<I, O>,
43
47
  testResourceRequirement: ITTestResourceRequest,
44
- testInterface: Partial<ITestInterface<TestShape>>
48
+ testInterface: Partial<ITestInterface<I>>
45
49
  ) {
46
50
  super(
47
51
  input,
@@ -97,14 +101,16 @@ export class WebTesteranto<
97
101
  }
98
102
 
99
103
  export default async <
100
- ITestShape extends IBaseTest<
101
- unknown,
104
+ I extends Ibdd_in<
102
105
  unknown,
103
106
  unknown,
104
107
  unknown,
105
108
  unknown,
106
109
  unknown,
107
110
  unknown,
111
+ unknown
112
+ >,
113
+ O extends Ibdd_out<
108
114
  Record<string, any>,
109
115
  Record<string, any>,
110
116
  Record<string, any>,
@@ -112,13 +118,13 @@ export default async <
112
118
  Record<string, any>
113
119
  >
114
120
  >(
115
- input: ITestShape["iinput"],
116
- testSpecification: ITestSpecification<ITestShape>,
117
- testImplementation: ITestImplementation<ITestShape>,
118
- testInterface: Partial<IWebTestInterface<ITestShape>>,
121
+ input: I["iinput"],
122
+ testSpecification: ITestSpecification<I, O>,
123
+ testImplementation: ITestImplementation<I, O>,
124
+ testInterface: Partial<IWebTestInterface<I>>,
119
125
  testResourceRequirement: ITTestResourceRequest = defaultTestResourceRequirement
120
- ): Promise<Testeranto<ITestShape>> => {
121
- return new WebTesteranto<ITestShape>(
126
+ ): Promise<Testeranto<I, O>> => {
127
+ return new WebTesteranto<I, O>(
122
128
  input,
123
129
  testSpecification,
124
130
  testImplementation,
package/src/build.ts ADDED
@@ -0,0 +1,240 @@
1
+ import fs, { watch } from "fs";
2
+ import path from "path";
3
+ import readline from "readline";
4
+ import { glob } from "glob";
5
+ import esbuild from "esbuild";
6
+
7
+ import esbuildNodeConfiger from "./esbuildConfigs/node.js";
8
+ import esbuildWebConfiger from "./esbuildConfigs/web.js";
9
+ import webHtmlFrame from "./web.html.js";
10
+ import {
11
+ ITestTypes,
12
+ IRunnables,
13
+ IBaseConfig,
14
+ IRunTime,
15
+ IBuiltConfig,
16
+ } from "./lib/index.js";
17
+
18
+ readline.emitKeypressEvents(process.stdin);
19
+ if (process.stdin.isTTY) process.stdin.setRawMode(true);
20
+
21
+ const getRunnables = (
22
+ tests: ITestTypes[],
23
+ payload = {
24
+ nodeEntryPoints: {},
25
+ webEntryPoints: {},
26
+ }
27
+ ): IRunnables => {
28
+ return tests.reduce((pt, cv, cndx, cry) => {
29
+ if (cv[1] === "node") {
30
+ pt.nodeEntryPoints[cv[0]] = path.resolve(
31
+ `./docs/node/${cv[0].split(".").slice(0, -1).concat("mjs").join(".")}`
32
+ );
33
+ } else if (cv[1] === "web") {
34
+ pt.webEntryPoints[cv[0]] = path.resolve(
35
+ `./docs/web/${cv[0].split(".").slice(0, -1).concat("mjs").join(".")}`
36
+ );
37
+ }
38
+
39
+ if (cv[3].length) {
40
+ getRunnables(cv[3], payload);
41
+ }
42
+
43
+ return pt;
44
+ }, payload as IRunnables);
45
+ };
46
+
47
+ import(process.cwd() + "/" + process.argv[2]).then(async (module) => {
48
+ const rawConfig: IBaseConfig = module.default;
49
+
50
+ const getSecondaryEndpointsPoints = (runtime?: IRunTime): string[] => {
51
+ const meta = (ts: ITestTypes[], st: Set<string>): Set<string> => {
52
+ ts.forEach((t) => {
53
+ if (t[1] === runtime) {
54
+ st.add(t[0]);
55
+ }
56
+ if (Array.isArray(t[3])) {
57
+ meta(t[3], st);
58
+ }
59
+ });
60
+ return st;
61
+ };
62
+ return Array.from(meta(config.tests, new Set()));
63
+ };
64
+
65
+ const config: IBuiltConfig = {
66
+ ...rawConfig,
67
+ buildDir: process.cwd() + "/" + rawConfig.outdir,
68
+ };
69
+
70
+ let nodeDone: boolean = false;
71
+ let webDone: boolean = false;
72
+ let mode = config.devMode ? "DEV" : "PROD";
73
+ let status: "build" | "built" = "build";
74
+ // let pm: PM_Main | undefined = new PM_Main(config);
75
+ // const fileHashes = {};
76
+ const { nodeEntryPoints, webEntryPoints } = getRunnables(config.tests);
77
+
78
+ const onNodeDone = () => {
79
+ nodeDone = true;
80
+ onDone();
81
+ };
82
+
83
+ const onWebDone = () => {
84
+ webDone = true;
85
+ onDone();
86
+ };
87
+
88
+ const onDone = async () => {
89
+ if (nodeDone && webDone) {
90
+ status = "built";
91
+ }
92
+ if (nodeDone && webDone && status === "built") {
93
+ // Object.entries(nodeEntryPoints).forEach(([k, outputFile]) => {
94
+ // console.log("watching", outputFile);
95
+ // try {
96
+ // watch(outputFile, async (filename) => {
97
+ // const hash = await fileHash(outputFile);
98
+ // if (fileHashes[k] !== hash) {
99
+ // fileHashes[k] = hash;
100
+ // console.log(`< ${filename} `);
101
+ // pm.launchNode(k, outputFile);
102
+ // }
103
+ // });
104
+ // } catch (e) {
105
+ // console.error(e);
106
+ // }
107
+ // });
108
+ // Object.entries(webEntryPoints).forEach(([k, outputFile]) => {
109
+ // console.log("watching", outputFile);
110
+ // watch(outputFile, async (filename) => {
111
+ // const hash = await fileHash(outputFile);
112
+ // console.log(`< ${filename} ${hash}`);
113
+ // if (fileHashes[k] !== hash) {
114
+ // fileHashes[k] = hash;
115
+ // pm.launchWeb(k, outputFile);
116
+ // }
117
+ // });
118
+ // });
119
+ }
120
+
121
+ if (nodeDone && webDone && mode === "PROD") {
122
+ console.log("Testeranto-EsBuild is all done. Goodbye!");
123
+ process.exit();
124
+ } else {
125
+ if (mode === "PROD") {
126
+ console.log("waiting for tests to finish");
127
+ console.log(
128
+ JSON.stringify(
129
+ {
130
+ nodeDone: nodeDone,
131
+ webDone: webDone,
132
+ mode: mode,
133
+ },
134
+ null,
135
+ 2
136
+ )
137
+ );
138
+ } else {
139
+ console.log("waiting for tests to change");
140
+ }
141
+
142
+ if (config.devMode) {
143
+ console.log("ready and watching for changes...");
144
+ } else {
145
+ // pm.shutDown();
146
+ }
147
+ ////////////////////////////////////////////////////////////////////////////////
148
+ }
149
+ };
150
+
151
+ console.log(
152
+ `Press 'q' to shutdown gracefully. Press 'x' to shutdown forcefully.`
153
+ );
154
+ process.stdin.on("keypress", (str, key) => {
155
+ if (key.name === "q") {
156
+ console.log("Testeranto-Build is shutting down...");
157
+ mode = "PROD";
158
+ onDone();
159
+ }
160
+ if (key.name === "x") {
161
+ console.log("Testeranto-Build is shutting down forcefully...");
162
+ process.exit(-1);
163
+ }
164
+ });
165
+
166
+ fs.writeFileSync(
167
+ `${config.outdir}/testeranto.json`,
168
+ JSON.stringify(config, null, 2)
169
+ );
170
+
171
+ Promise.resolve(
172
+ Promise.all(
173
+ [...getSecondaryEndpointsPoints("web")].map(async (sourceFilePath) => {
174
+ const sourceFileSplit = sourceFilePath.split("/");
175
+ const sourceDir = sourceFileSplit.slice(0, -1);
176
+ const sourceFileName = sourceFileSplit[sourceFileSplit.length - 1];
177
+ const sourceFileNameMinusJs = sourceFileName
178
+ .split(".")
179
+ .slice(0, -1)
180
+ .join(".");
181
+
182
+ const htmlFilePath = path.normalize(
183
+ `${process.cwd()}/${config.outdir}/web/${sourceDir.join(
184
+ "/"
185
+ )}/${sourceFileNameMinusJs}.html`
186
+ );
187
+ const jsfilePath = `./${sourceFileNameMinusJs}.mjs`;
188
+
189
+ return fs.promises
190
+ .mkdir(path.dirname(htmlFilePath), { recursive: true })
191
+ .then((x) =>
192
+ fs.writeFileSync(
193
+ htmlFilePath,
194
+ webHtmlFrame(jsfilePath, htmlFilePath)
195
+ )
196
+ );
197
+ })
198
+ )
199
+ );
200
+
201
+ glob(`./${config.outdir}/chunk-*.mjs`, {
202
+ ignore: "node_modules/**",
203
+ }).then((chunks) => {
204
+ chunks.forEach((chunk) => {
205
+ fs.unlinkSync(chunk);
206
+ });
207
+ });
208
+
209
+ await Promise.all([
210
+ esbuild
211
+ .context(esbuildNodeConfiger(config, Object.keys(nodeEntryPoints)))
212
+ .then(async (nodeContext) => {
213
+ if (config.devMode) {
214
+ await nodeContext.watch().then((v) => {
215
+ onNodeDone();
216
+ });
217
+ } else {
218
+ nodeContext.rebuild().then((v) => {
219
+ onNodeDone();
220
+ });
221
+ }
222
+
223
+ return nodeContext;
224
+ }),
225
+ esbuild
226
+ .context(esbuildWebConfiger(config, Object.keys(webEntryPoints)))
227
+ .then(async (webContext) => {
228
+ if (config.devMode) {
229
+ await webContext.watch().then((v) => {
230
+ onWebDone();
231
+ });
232
+ } else {
233
+ webContext.rebuild().then((v) => {
234
+ onWebDone();
235
+ });
236
+ }
237
+ return webContext;
238
+ }),
239
+ ]);
240
+ });