testeranto 0.128.0 → 0.134.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 (386) hide show
  1. package/.aider.chat.history.md +137197 -0
  2. package/.aider.input.history +334 -0
  3. package/.aider.tags.cache.v3/18/8b/7dfca822129dad10b5cacadf7728.val +0 -0
  4. package/.aider.tags.cache.v3/{ec/c0/161c249c35be853cc40cf11f9267.val → 62/f5/8af72140d93c58db2f6aa5bf3f1f.val} +0 -0
  5. package/.aider.tags.cache.v3/8d/fa/12860238755bcfab9af8a93c52ab.val +0 -0
  6. package/.aider.tags.cache.v3/{b7/e6/5be87b62aeaf2bc244ff41c1b61a.val → a7/97/6d37fce350ad2d588f36729db0cd.val} +0 -0
  7. package/.aider.tags.cache.v3/{e3/e6/3501625caf5d5eb171f0d248462e.val → ad/3c/10f2ab1397f6d544e613d2a6acaf.val} +0 -0
  8. package/.aider.tags.cache.v3/cache.db +0 -0
  9. package/.aider.tags.cache.v3/cache.db-shm +0 -0
  10. package/.aider.tags.cache.v3/cache.db-wal +0 -0
  11. package/.aider.tags.cache.v3/dd/5b/0ade824b0841c7c11e9352c5d2ca.val +0 -0
  12. package/README.md +560 -19
  13. package/bundle.js +8 -75
  14. package/dist/common/src/Init.js +6 -1
  15. package/dist/common/src/Node.js +6 -4
  16. package/dist/common/src/NodeSidecar.js +15 -0
  17. package/dist/common/src/PM/PM_WithEslintAndTsc.js +187 -0
  18. package/dist/common/src/PM/__tests__/nodeSidecar.testeranto.js +109 -0
  19. package/dist/common/src/PM/__tests__/pureSidecar.testeranto.js +94 -0
  20. package/dist/common/src/PM/__tests__/webSidecar.testeranto.js +94 -0
  21. package/dist/common/src/PM/base.js +33 -16
  22. package/dist/common/src/PM/main.js +488 -422
  23. package/dist/common/src/PM/node.js +44 -19
  24. package/dist/common/src/PM/nodeSidecar.js +65 -0
  25. package/dist/common/src/PM/pure.js +55 -47
  26. package/dist/common/src/PM/pureSidecar.js +48 -0
  27. package/dist/common/src/PM/sidecar.js +11 -0
  28. package/dist/common/src/PM/web.js +24 -6
  29. package/dist/common/src/PM/webSidecar.js +47 -0
  30. package/dist/common/src/PureSidecar.js +13 -0
  31. package/dist/common/src/SP__Polygon.test.js +10 -0
  32. package/dist/common/src/WebSidecar.js +14 -0
  33. package/dist/common/src/build.js +63 -10
  34. package/dist/common/src/defaultConfig.js +1 -0
  35. package/dist/common/src/esbuildConfigs/consoleDetectorPlugin.js +27 -0
  36. package/dist/common/src/esbuildConfigs/pure.js +15 -1
  37. package/dist/common/src/esbuildConfigs/web.js +10 -1
  38. package/dist/common/src/{SubPackages/react-dom/jsx/index.js → lib/Sidecar.js} +4 -0
  39. package/dist/common/src/lib/abstractBase.js +7 -5
  40. package/dist/common/src/lib/basebuilder.js +1 -3
  41. package/dist/common/src/lib/classBuilder.js +4 -17
  42. package/dist/common/src/lib/core.js +11 -6
  43. package/dist/common/src/lib/index.js +13 -4
  44. package/dist/common/src/lib/pmProxy.js +1 -1
  45. package/dist/common/src/mothership/index.js +16 -0
  46. package/dist/common/src/mothership/test.js +65 -0
  47. package/dist/common/src/utils/queue.js +36 -0
  48. package/dist/common/src/utils.js +34 -5
  49. package/dist/common/testeranto.config.js +77 -39
  50. package/dist/common/tsconfig.common.tsbuildinfo +1 -1
  51. package/dist/module/src/Init.js +6 -1
  52. package/dist/module/src/Node.js +6 -4
  53. package/dist/module/src/NodeSidecar.js +11 -0
  54. package/dist/module/src/PM/PM_WithEslintAndTsc.js +180 -0
  55. package/dist/module/src/PM/__tests__/nodeSidecar.testeranto.js +104 -0
  56. package/dist/module/src/PM/__tests__/pureSidecar.testeranto.js +89 -0
  57. package/dist/module/src/PM/__tests__/webSidecar.testeranto.js +89 -0
  58. package/dist/module/src/PM/base.js +33 -16
  59. package/dist/module/src/PM/main.js +489 -423
  60. package/dist/module/src/PM/node.js +44 -19
  61. package/dist/module/src/PM/nodeSidecar.js +58 -0
  62. package/dist/module/src/PM/pure.js +55 -44
  63. package/dist/module/src/PM/pureSidecar.js +41 -0
  64. package/dist/module/src/PM/sidecar.js +7 -0
  65. package/dist/module/src/PM/web.js +24 -6
  66. package/dist/module/src/PM/webSidecar.js +40 -0
  67. package/dist/module/src/Project.js +154 -75
  68. package/dist/module/src/PureSidecar.js +9 -0
  69. package/dist/module/src/ReportClient.js +132 -97
  70. package/dist/module/src/SP__Polygon.test.js +8 -0
  71. package/dist/module/src/TestReport.js +32 -14
  72. package/dist/module/src/WebSidecar.js +10 -0
  73. package/dist/module/src/build.js +63 -10
  74. package/dist/module/src/defaultConfig.js +1 -0
  75. package/dist/module/src/esbuildConfigs/consoleDetectorPlugin.js +24 -0
  76. package/dist/module/src/esbuildConfigs/pure.js +15 -1
  77. package/dist/module/src/esbuildConfigs/web.js +10 -1
  78. package/dist/module/src/lib/Sidecar.js +2 -0
  79. package/dist/module/src/lib/abstractBase.js +7 -5
  80. package/dist/module/src/lib/basebuilder.js +1 -3
  81. package/dist/module/src/lib/classBuilder.js +4 -17
  82. package/dist/module/src/lib/core.js +11 -6
  83. package/dist/module/src/lib/index.js +12 -4
  84. package/dist/module/src/lib/pmProxy.js +1 -1
  85. package/dist/module/src/mothership/index.js +11 -0
  86. package/dist/module/src/mothership/test.js +60 -0
  87. package/dist/module/src/utils/queue.js +32 -0
  88. package/dist/module/src/utils.js +34 -5
  89. package/dist/module/testeranto.config.js +77 -36
  90. package/dist/module/tsconfig.module.tsbuildinfo +1 -1
  91. package/dist/prebuild/Project.js +3288 -385
  92. package/dist/prebuild/ReportClient.js +0 -24638
  93. package/dist/prebuild/TestReport.js +14 -8
  94. package/dist/prebuild/build.mjs +159 -15
  95. package/dist/prebuild/init-docs.mjs +2 -5
  96. package/dist/prebuild/mothership/index.mjs +17 -0
  97. package/dist/prebuild/run.mjs +696 -404
  98. package/dist/types/src/NodeSidecar.d.ts +6 -0
  99. package/dist/types/src/PM/PM_WithEslintAndTsc.d.ts +23 -0
  100. package/dist/types/src/PM/__tests__/nodeSidecar.testeranto.d.ts +20 -0
  101. package/dist/types/src/PM/__tests__/pureSidecar.testeranto.d.ts +20 -0
  102. package/dist/types/src/PM/__tests__/webSidecar.testeranto.d.ts +20 -0
  103. package/dist/types/src/PM/base.d.ts +6 -5
  104. package/dist/types/src/PM/index.d.ts +5 -3
  105. package/dist/types/src/PM/main.d.ts +23 -26
  106. package/dist/types/src/PM/node.d.ts +8 -6
  107. package/dist/types/src/PM/nodeSidecar.d.ts +13 -0
  108. package/dist/types/src/PM/pure.d.ts +4 -3
  109. package/dist/types/src/PM/pureSidecar.d.ts +11 -0
  110. package/dist/types/src/PM/sidecar.d.ts +8 -0
  111. package/dist/types/src/PM/web.d.ts +18 -8
  112. package/dist/types/src/PM/webSidecar.d.ts +11 -0
  113. package/dist/types/src/PureSidecar.d.ts +8 -0
  114. package/dist/types/src/Types.d.ts +109 -43
  115. package/dist/types/src/WebSidecar.d.ts +8 -0
  116. package/dist/types/src/esbuildConfigs/consoleDetectorPlugin.d.ts +2 -0
  117. package/dist/types/src/lib/Sidecar.d.ts +5 -0
  118. package/dist/types/src/lib/abstractBase.d.ts +6 -6
  119. package/dist/types/src/lib/classBuilder.d.ts +7 -1
  120. package/dist/types/src/lib/core.d.ts +7 -1
  121. package/dist/types/src/lib/index.d.ts +10 -4
  122. package/dist/types/src/lib/types.d.ts +12 -2
  123. package/dist/types/src/mothership/index.d.ts +2 -0
  124. package/dist/types/src/mothership/test.d.ts +21 -0
  125. package/dist/types/src/utils/queue.d.ts +11 -0
  126. package/dist/types/src/utils.d.ts +4 -7
  127. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  128. package/package.json +19 -105
  129. package/src/Init.ts +6 -5
  130. package/src/Node.ts +7 -4
  131. package/src/NodeSidecar.ts +22 -0
  132. package/src/PM/PM_WithEslintAndTsc.ts +284 -0
  133. package/src/PM/__tests__/nodeSidecar.testeranto.ts +173 -0
  134. package/src/PM/__tests__/pureSidecar.testeranto.ts +157 -0
  135. package/src/PM/__tests__/webSidecar.testeranto.ts +157 -0
  136. package/src/PM/base.ts +38 -17
  137. package/src/PM/index.ts +9 -3
  138. package/src/PM/main.ts +617 -578
  139. package/src/PM/node.ts +67 -23
  140. package/src/PM/nodeSidecar.ts +73 -0
  141. package/src/PM/pure.ts +68 -58
  142. package/src/PM/pureSidecar.ts +56 -0
  143. package/src/PM/sidecar.ts +48 -0
  144. package/src/PM/web.ts +42 -11
  145. package/src/PM/webSidecar.ts +55 -0
  146. package/src/Project.tsx +312 -109
  147. package/src/Pure.ts +0 -2
  148. package/src/PureSidecar.ts +14 -0
  149. package/src/ReportClient.tsx +164 -170
  150. package/src/SP__Polygon.test.ts +13 -0
  151. package/src/TestReport.tsx +77 -6
  152. package/src/Types.ts +227 -122
  153. package/src/WebSidecar.ts +14 -0
  154. package/src/build.ts +101 -14
  155. package/src/defaultConfig.ts +1 -0
  156. package/src/esbuildConfigs/README.md +46 -0
  157. package/src/esbuildConfigs/consoleDetectorPlugin.ts +29 -0
  158. package/src/esbuildConfigs/pure.ts +22 -1
  159. package/src/esbuildConfigs/web.ts +13 -0
  160. package/src/lib/Sidecar.ts +6 -0
  161. package/src/lib/TEST_ADAPTER_RENAME.md +48 -0
  162. package/src/lib/abstractBase.ts +12 -9
  163. package/src/lib/basebuilder.ts +5 -4
  164. package/src/lib/classBuilder.ts +15 -18
  165. package/src/lib/core.ts +24 -11
  166. package/src/lib/index.ts +38 -18
  167. package/src/lib/pmProxy.ts +3 -1
  168. package/src/lib/types.ts +15 -2
  169. package/src/mothership/index.ts +15 -0
  170. package/src/mothership/test.ts +137 -0
  171. package/src/run.ts +0 -1
  172. package/src/utils/queue.ts +41 -0
  173. package/src/utils.ts +41 -15
  174. package/testeranto/bundles/node/mothership/chunk-PG6KUKNP.mjs +44 -0
  175. package/testeranto/bundles/node/mothership/chunk-V2EQEXU2.mjs +1032 -0
  176. package/testeranto/bundles/node/mothership/metafile.json +389 -0
  177. package/testeranto/bundles/node/mothership/src/PM/__tests__/nodeSidecar.testeranto.mjs +1219 -0
  178. package/testeranto/bundles/node/mothership/src/PM/__tests__/pureSidecar.testeranto.mjs +156 -0
  179. package/testeranto/bundles/node/mothership/src/PM/__tests__/sidecar.testeranto.mjs +1199 -0
  180. package/testeranto/bundles/node/mothership/src/PM/__tests__/webSidecar.testeranto.mjs +156 -0
  181. package/testeranto/bundles/node/mothership/src/mothership/test.mjs +24411 -0
  182. package/testeranto/bundles/pure/mothership/metafile.json +8 -0
  183. package/testeranto/bundles/web/mothership/metafile.json +8 -0
  184. package/testeranto/index.html +4 -4
  185. package/testeranto/reports/mothership/config.json +25 -0
  186. package/testeranto/reports/{redux → mothership}/index.html +8 -8
  187. package/testeranto/reports/mothership/src/PM/__tests__/nodeSidecar.testeranto/node/console_log.txt +0 -0
  188. package/testeranto/reports/mothership/src/PM/__tests__/nodeSidecar.testeranto/node/index.html +20 -0
  189. package/testeranto/reports/mothership/src/PM/__tests__/nodeSidecar.testeranto/node/lint_errors.json +1564 -0
  190. package/testeranto/reports/mothership/src/PM/__tests__/nodeSidecar.testeranto/node/log.txt +0 -0
  191. package/testeranto/reports/mothership/src/PM/__tests__/nodeSidecar.testeranto/node/prompt.txt +22 -0
  192. package/testeranto/reports/mothership/src/PM/__tests__/nodeSidecar.testeranto/node/type_errors.txt +35 -0
  193. package/testeranto/reports/mothership/src/PM/__tests__/pureSidecar.testeranto/node/index.html +20 -0
  194. package/testeranto/reports/mothership/src/PM/__tests__/pureSidecar.testeranto/node/lint_errors.json +80 -0
  195. package/testeranto/reports/mothership/src/PM/__tests__/pureSidecar.testeranto/node/prompt.txt +12 -0
  196. package/testeranto/reports/mothership/src/PM/__tests__/pureSidecar.testeranto/node/type_errors.txt +26 -0
  197. package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/bdd_errors.txt +1 -0
  198. package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/console_log.txt +0 -0
  199. package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/index.html +20 -0
  200. package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/lint_errors.json +1564 -0
  201. package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/log.txt +0 -0
  202. package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/prompt.txt +22 -0
  203. package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/tests.json +56 -0
  204. package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/type_errors.txt +29 -0
  205. package/testeranto/reports/mothership/src/PM/__tests__/webSidecar.testeranto/node/index.html +20 -0
  206. package/testeranto/reports/mothership/src/PM/__tests__/webSidecar.testeranto/node/lint_errors.json +80 -0
  207. package/testeranto/reports/mothership/src/PM/__tests__/webSidecar.testeranto/node/prompt.txt +12 -0
  208. package/testeranto/reports/mothership/src/PM/__tests__/webSidecar.testeranto/node/type_errors.txt +26 -0
  209. package/testeranto/reports/mothership/src/mothership/test/node/bdd_errors.txt +1 -0
  210. package/testeranto/reports/mothership/src/mothership/test/node/console_log.txt +4 -0
  211. package/testeranto/reports/mothership/src/mothership/test/node/index.html +20 -0
  212. package/testeranto/reports/mothership/src/mothership/test/node/lint_errors.json +1 -0
  213. package/testeranto/reports/mothership/src/mothership/test/node/log.txt +0 -0
  214. package/testeranto/reports/mothership/src/mothership/test/node/prompt.txt +12 -0
  215. package/testeranto/reports/mothership/src/mothership/test/node/tests.json +24 -0
  216. package/testeranto/reports/mothership/src/mothership/test/node/type_errors.txt +18 -0
  217. package/testeranto/reports/mothership/summary.json +9 -0
  218. package/testeranto.config.ts +82 -44
  219. package/tsc.log +78 -81
  220. package/dist/common/src/SubPackages/react/component/index.js +0 -20
  221. package/dist/common/src/SubPackages/react/component/node.js +0 -10
  222. package/dist/common/src/SubPackages/react/component/pure.js +0 -10
  223. package/dist/common/src/SubPackages/react/component/web.js +0 -10
  224. package/dist/common/src/SubPackages/react/jsx/index.js +0 -64
  225. package/dist/common/src/SubPackages/react/jsx/node.js +0 -10
  226. package/dist/common/src/SubPackages/react/jsx/pure.js +0 -10
  227. package/dist/common/src/SubPackages/react/jsx/web.js +0 -10
  228. package/dist/common/src/SubPackages/react-dom/component/dynamic.js +0 -61
  229. package/dist/common/src/SubPackages/react-dom/component/node.js +0 -10
  230. package/dist/common/src/SubPackages/react-dom/component/pure.js +0 -10
  231. package/dist/common/src/SubPackages/react-dom/component/static.js +0 -26
  232. package/dist/common/src/SubPackages/react-dom/component/web.js +0 -16
  233. package/dist/common/src/SubPackages/react-dom/jsx/dynamic.js +0 -31
  234. package/dist/common/src/SubPackages/react-dom/jsx/node.js +0 -10
  235. package/dist/common/src/SubPackages/react-dom/jsx/pure.js +0 -10
  236. package/dist/common/src/SubPackages/react-dom/jsx/static.js +0 -59
  237. package/dist/common/src/SubPackages/react-dom/jsx/web.js +0 -16
  238. package/dist/common/src/SubPackages/react-test-renderer/MemoExoticComponent/node.js +0 -54
  239. package/dist/common/src/SubPackages/react-test-renderer/component/index.js +0 -15
  240. package/dist/common/src/SubPackages/react-test-renderer/component/interface.js +0 -70
  241. package/dist/common/src/SubPackages/react-test-renderer/component/node.js +0 -8
  242. package/dist/common/src/SubPackages/react-test-renderer/component/pure.js +0 -8
  243. package/dist/common/src/SubPackages/react-test-renderer/component/test/implementation.js +0 -57
  244. package/dist/common/src/SubPackages/react-test-renderer/component/test/node.js +0 -10
  245. package/dist/common/src/SubPackages/react-test-renderer/component/test/pure.js +0 -10
  246. package/dist/common/src/SubPackages/react-test-renderer/component/test/web.js +0 -10
  247. package/dist/common/src/SubPackages/react-test-renderer/component/web.js +0 -8
  248. package/dist/common/src/SubPackages/react-test-renderer/fc/node.js +0 -60
  249. package/dist/common/src/SubPackages/react-test-renderer/fc/web.js +0 -60
  250. package/dist/common/src/SubPackages/react-test-renderer/jsx/index.js +0 -67
  251. package/dist/common/src/SubPackages/react-test-renderer/jsx/node.js +0 -10
  252. package/dist/common/src/SubPackages/react-test-renderer/jsx/pure.js +0 -10
  253. package/dist/common/src/SubPackages/react-test-renderer/jsx/web.js +0 -10
  254. package/dist/common/src/SubPackages/react-test-renderer/jsx-promised/index.js +0 -52
  255. package/dist/common/src/SubPackages/react-test-renderer/jsx-promised/node.js +0 -10
  256. package/dist/common/src/SubPackages/react-test-renderer/jsx-promised/web.js +0 -10
  257. package/dist/common/src/examples/react/component/index.js +0 -33
  258. package/dist/common/src/examples/react/component/test.js +0 -36
  259. package/dist/module/src/SubPackages/react/component/index.js +0 -13
  260. package/dist/module/src/SubPackages/react/component/node.js +0 -5
  261. package/dist/module/src/SubPackages/react/component/pure.js +0 -5
  262. package/dist/module/src/SubPackages/react/component/web.js +0 -5
  263. package/dist/module/src/SubPackages/react/jsx/index.js +0 -58
  264. package/dist/module/src/SubPackages/react/jsx/node.js +0 -5
  265. package/dist/module/src/SubPackages/react/jsx/pure.js +0 -5
  266. package/dist/module/src/SubPackages/react/jsx/web.js +0 -5
  267. package/dist/module/src/SubPackages/react-dom/component/dynamic.js +0 -54
  268. package/dist/module/src/SubPackages/react-dom/component/node.js +0 -5
  269. package/dist/module/src/SubPackages/react-dom/component/pure.js +0 -5
  270. package/dist/module/src/SubPackages/react-dom/component/static.js +0 -22
  271. package/dist/module/src/SubPackages/react-dom/component/web.js +0 -11
  272. package/dist/module/src/SubPackages/react-dom/jsx/dynamic.js +0 -27
  273. package/dist/module/src/SubPackages/react-dom/jsx/node.js +0 -5
  274. package/dist/module/src/SubPackages/react-dom/jsx/pure.js +0 -5
  275. package/dist/module/src/SubPackages/react-dom/jsx/static.js +0 -53
  276. package/dist/module/src/SubPackages/react-dom/jsx/web.js +0 -11
  277. package/dist/module/src/SubPackages/react-test-renderer/MemoExoticComponent/node.js +0 -16
  278. package/dist/module/src/SubPackages/react-test-renderer/component/index.js +0 -14
  279. package/dist/module/src/SubPackages/react-test-renderer/component/interface.js +0 -31
  280. package/dist/module/src/SubPackages/react-test-renderer/component/node.js +0 -3
  281. package/dist/module/src/SubPackages/react-test-renderer/component/pure.js +0 -3
  282. package/dist/module/src/SubPackages/react-test-renderer/component/test/implementation.js +0 -54
  283. package/dist/module/src/SubPackages/react-test-renderer/component/test/node.js +0 -5
  284. package/dist/module/src/SubPackages/react-test-renderer/component/test/pure.js +0 -5
  285. package/dist/module/src/SubPackages/react-test-renderer/component/test/web.js +0 -5
  286. package/dist/module/src/SubPackages/react-test-renderer/component/web.js +0 -3
  287. package/dist/module/src/SubPackages/react-test-renderer/fc/node.js +0 -22
  288. package/dist/module/src/SubPackages/react-test-renderer/fc/web.js +0 -22
  289. package/dist/module/src/SubPackages/react-test-renderer/jsx/index.js +0 -28
  290. package/dist/module/src/SubPackages/react-test-renderer/jsx/node.js +0 -5
  291. package/dist/module/src/SubPackages/react-test-renderer/jsx/pure.js +0 -5
  292. package/dist/module/src/SubPackages/react-test-renderer/jsx/web.js +0 -5
  293. package/dist/module/src/SubPackages/react-test-renderer/jsx-promised/index.js +0 -16
  294. package/dist/module/src/SubPackages/react-test-renderer/jsx-promised/node.js +0 -5
  295. package/dist/module/src/SubPackages/react-test-renderer/jsx-promised/web.js +0 -5
  296. package/dist/module/src/examples/react/component/index.js +0 -26
  297. package/dist/module/src/examples/react/component/test.js +0 -32
  298. package/dist/prebuild/ReportClient.css +0 -11342
  299. package/dist/tsconfig.tsbuildinfo +0 -1
  300. package/dist/types/src/SubPackages/react/component/index.d.ts +0 -4
  301. package/dist/types/src/SubPackages/react/component/node.d.ts +0 -4
  302. package/dist/types/src/SubPackages/react/component/pure.d.ts +0 -4
  303. package/dist/types/src/SubPackages/react/component/web.d.ts +0 -4
  304. package/dist/types/src/SubPackages/react/jsx/index.d.ts +0 -5
  305. package/dist/types/src/SubPackages/react/jsx/node.d.ts +0 -4
  306. package/dist/types/src/SubPackages/react/jsx/pure.d.ts +0 -4
  307. package/dist/types/src/SubPackages/react/jsx/web.d.ts +0 -4
  308. package/dist/types/src/SubPackages/react-dom/component/dynamic.d.ts +0 -20
  309. package/dist/types/src/SubPackages/react-dom/component/node.d.ts +0 -4
  310. package/dist/types/src/SubPackages/react-dom/component/pure.d.ts +0 -4
  311. package/dist/types/src/SubPackages/react-dom/component/static.d.ts +0 -9
  312. package/dist/types/src/SubPackages/react-dom/component/web.d.ts +0 -4
  313. package/dist/types/src/SubPackages/react-dom/jsx/dynamic.d.ts +0 -5
  314. package/dist/types/src/SubPackages/react-dom/jsx/index.d.ts +0 -6
  315. package/dist/types/src/SubPackages/react-dom/jsx/node.d.ts +0 -4
  316. package/dist/types/src/SubPackages/react-dom/jsx/pure.d.ts +0 -4
  317. package/dist/types/src/SubPackages/react-dom/jsx/static.d.ts +0 -5
  318. package/dist/types/src/SubPackages/react-dom/jsx/web.d.ts +0 -5
  319. package/dist/types/src/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +0 -6
  320. package/dist/types/src/SubPackages/react-test-renderer/component/index.d.ts +0 -5
  321. package/dist/types/src/SubPackages/react-test-renderer/component/interface.d.ts +0 -3
  322. package/dist/types/src/SubPackages/react-test-renderer/component/node.d.ts +0 -4
  323. package/dist/types/src/SubPackages/react-test-renderer/component/pure.d.ts +0 -4
  324. package/dist/types/src/SubPackages/react-test-renderer/component/test/implementation.d.ts +0 -4
  325. package/dist/types/src/SubPackages/react-test-renderer/component/test/node.d.ts +0 -3
  326. package/dist/types/src/SubPackages/react-test-renderer/component/test/pure.d.ts +0 -4
  327. package/dist/types/src/SubPackages/react-test-renderer/component/test/web.d.ts +0 -3
  328. package/dist/types/src/SubPackages/react-test-renderer/component/web.d.ts +0 -4
  329. package/dist/types/src/SubPackages/react-test-renderer/fc/node.d.ts +0 -8
  330. package/dist/types/src/SubPackages/react-test-renderer/fc/web.d.ts +0 -9
  331. package/dist/types/src/SubPackages/react-test-renderer/jsx/index.d.ts +0 -11
  332. package/dist/types/src/SubPackages/react-test-renderer/jsx/node.d.ts +0 -4
  333. package/dist/types/src/SubPackages/react-test-renderer/jsx/pure.d.ts +0 -4
  334. package/dist/types/src/SubPackages/react-test-renderer/jsx/web.d.ts +0 -4
  335. package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/index.d.ts +0 -15
  336. package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/node.d.ts +0 -5
  337. package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/web.d.ts +0 -5
  338. package/dist/types/src/examples/react/component/index.d.ts +0 -13
  339. package/dist/types/src/examples/react/component/test.d.ts +0 -17
  340. package/src/SubPackages/react/component/index.ts +0 -28
  341. package/src/SubPackages/react/component/node.ts +0 -17
  342. package/src/SubPackages/react/component/pure.ts +0 -17
  343. package/src/SubPackages/react/component/web.ts +0 -17
  344. package/src/SubPackages/react/jsx/index.ts +0 -75
  345. package/src/SubPackages/react/jsx/node.ts +0 -23
  346. package/src/SubPackages/react/jsx/pure.ts +0 -23
  347. package/src/SubPackages/react/jsx/web.ts +0 -24
  348. package/src/SubPackages/react-dom/component/dynamic.ts +0 -107
  349. package/src/SubPackages/react-dom/component/node.ts +0 -17
  350. package/src/SubPackages/react-dom/component/pure.ts +0 -17
  351. package/src/SubPackages/react-dom/component/static.ts +0 -41
  352. package/src/SubPackages/react-dom/component/web.ts +0 -32
  353. package/src/SubPackages/react-dom/jsx/dynamic.ts +0 -46
  354. package/src/SubPackages/react-dom/jsx/index.ts +0 -6
  355. package/src/SubPackages/react-dom/jsx/node.ts +0 -18
  356. package/src/SubPackages/react-dom/jsx/pure.ts +0 -18
  357. package/src/SubPackages/react-dom/jsx/static.ts +0 -87
  358. package/src/SubPackages/react-dom/jsx/web.ts +0 -26
  359. package/src/SubPackages/react-test-renderer/MemoExoticComponent/node.ts +0 -54
  360. package/src/SubPackages/react-test-renderer/component/index.ts +0 -32
  361. package/src/SubPackages/react-test-renderer/component/interface.ts +0 -43
  362. package/src/SubPackages/react-test-renderer/component/node.ts +0 -18
  363. package/src/SubPackages/react-test-renderer/component/pure.ts +0 -18
  364. package/src/SubPackages/react-test-renderer/component/test/implementation.ts +0 -63
  365. package/src/SubPackages/react-test-renderer/component/test/node.ts +0 -14
  366. package/src/SubPackages/react-test-renderer/component/test/pure.ts +0 -14
  367. package/src/SubPackages/react-test-renderer/component/test/web.ts +0 -14
  368. package/src/SubPackages/react-test-renderer/component/web.ts +0 -18
  369. package/src/SubPackages/react-test-renderer/fc/node.ts +0 -83
  370. package/src/SubPackages/react-test-renderer/fc/web.ts +0 -80
  371. package/src/SubPackages/react-test-renderer/jsx/index.ts +0 -61
  372. package/src/SubPackages/react-test-renderer/jsx/node.ts +0 -31
  373. package/src/SubPackages/react-test-renderer/jsx/pure.ts +0 -31
  374. package/src/SubPackages/react-test-renderer/jsx/web.ts +0 -32
  375. package/src/SubPackages/react-test-renderer/jsx-promised/index.ts +0 -73
  376. package/src/SubPackages/react-test-renderer/jsx-promised/node.ts +0 -36
  377. package/src/SubPackages/react-test-renderer/jsx-promised/web.ts +0 -36
  378. package/src/examples/react/component/index.tsx +0 -35
  379. package/src/examples/react/component/test.ts +0 -83
  380. package/testeranto/bundles/node/redux/metafile.json +0 -559
  381. package/testeranto/bundles/pure/redux/metafile.json +0 -554
  382. package/testeranto/bundles/web/redux/metafile.json +0 -504
  383. package/testeranto/bundles/web/redux/test/web.html +0 -19
  384. package/testeranto/reports/redux/config.json +0 -38
  385. package/testeranto/reports/redux/summary.json +0 -20
  386. /package/dist/{module/src/SubPackages/react-dom/jsx/index.js → types/src/SP__Polygon.test.d.ts} +0 -0
@@ -0,0 +1,1199 @@
1
+ import { createRequire } from 'module';const require = createRequire(import.meta.url);
2
+
3
+ // src/PM/nodeSidecar.ts
4
+ import net from "net";
5
+
6
+ // src/PM/sidecar.ts
7
+ var PM_sidecar = class {
8
+ testArtiFactoryfileWriter(tLog, callback) {
9
+ return (fPath, value) => {
10
+ callback(Promise.resolve());
11
+ };
12
+ }
13
+ // abstract $(selector: string): any;
14
+ // abstract click(selector: string): any;
15
+ // abstract closePage(p): any;
16
+ // abstract createWriteStream(
17
+ // filepath: string,
18
+ // testName: string
19
+ // ): Promise<string>;
20
+ // abstract customclose();
21
+ // abstract customScreenShot(opts: object, page?: string): any;
22
+ // abstract end(uid: number): Promise<boolean>;
23
+ // abstract existsSync(fp: string): Promise<boolean>;
24
+ // abstract focusOn(selector: string): any;
25
+ // abstract getAttribute(selector: string, attribute: string): any;
26
+ // abstract getValue(value: string): any;
27
+ // abstract goto(p, url: string): any;
28
+ // abstract isDisabled(selector: string): Promise<boolean>;
29
+ // abstract mkdirSync(a: string);
30
+ // abstract newPage(): Promise<string>;
31
+ // abstract page(): Promise<string | undefined>;
32
+ // abstract pages(): Promise<string[]>;
33
+ // abstract screencast(o: ScreenRecorderOptions, p: Page | string): any;
34
+ // abstract screencastStop(s: string): any;
35
+ // abstract typeInto(selector: string, value: string): any;
36
+ // abstract waitForSelector(p, sel: string);
37
+ // abstract write(uid: number, contents: string): Promise<boolean>;
38
+ // abstract writeFileSync(f: string, c: string, t: string): Promise<boolean>;
39
+ // abstract launchSideCar(
40
+ // n: number
41
+ // ): Promise<[number, ITTestResourceConfiguration]>;
42
+ // abstract stopSideCar(n: number): Promise<any>;
43
+ };
44
+
45
+ // src/PM/nodeSidecar.ts
46
+ var PM_Node_Sidecar = class extends PM_sidecar {
47
+ constructor(t) {
48
+ super();
49
+ this.testResourceConfiguration = t;
50
+ this.client = {};
51
+ }
52
+ start(stopper) {
53
+ return new Promise((res) => {
54
+ process.on("message", async (message) => {
55
+ if (message === "stop") {
56
+ console.log("STOP!", stopper.toString());
57
+ await stopper();
58
+ process.exit();
59
+ } else if (message.path) {
60
+ this.client = net.createConnection(message.path, () => {
61
+ res();
62
+ });
63
+ }
64
+ });
65
+ });
66
+ }
67
+ stop() {
68
+ return new Promise((resolve) => {
69
+ if (this.client) {
70
+ this.client.end(() => resolve());
71
+ } else {
72
+ resolve();
73
+ }
74
+ });
75
+ }
76
+ testArtiFactoryfileWriter(tLog, callback) {
77
+ return (fPath, value) => {
78
+ callback(Promise.resolve());
79
+ };
80
+ }
81
+ send(command, ...argz) {
82
+ return new Promise((res) => {
83
+ const key = Math.random().toString();
84
+ const myListener = (event) => {
85
+ const x = JSON.parse(event);
86
+ if (x.key === key) {
87
+ process.removeListener("message", myListener);
88
+ res(x.payload);
89
+ }
90
+ };
91
+ process.addListener("message", myListener);
92
+ this.client.write(JSON.stringify([command, ...argz, key]));
93
+ });
94
+ }
95
+ };
96
+
97
+ // src/lib/index.ts
98
+ var BaseTestInterface = {
99
+ beforeAll: async (s) => s,
100
+ beforeEach: async function(subject, initialValues, x, testResource, pm) {
101
+ return subject;
102
+ },
103
+ afterEach: async (s) => s,
104
+ afterAll: (store) => void 0,
105
+ butThen: async (store, thenCb) => {
106
+ return thenCb(store);
107
+ },
108
+ andWhen: async (store, whenCB, testResource, pm) => {
109
+ await whenCB(store, testResource, pm);
110
+ },
111
+ assertThis: (x) => x
112
+ };
113
+ var DefaultTestInterface = (p) => {
114
+ return {
115
+ ...BaseTestInterface,
116
+ ...p
117
+ };
118
+ };
119
+ var defaultTestResourceRequirement = {
120
+ ports: 0
121
+ };
122
+
123
+ // src/lib/pmProxy.ts
124
+ var prxy = function(pm, mappings) {
125
+ return new Proxy(pm, {
126
+ get: (target, prop, receiver) => {
127
+ for (const mapping of mappings) {
128
+ const method = mapping[0];
129
+ const arger = mapping[1];
130
+ if (prop === method) {
131
+ return (...x) => target[prop](arger(...x));
132
+ }
133
+ }
134
+ return (...x) => target[prop](...x);
135
+ }
136
+ });
137
+ };
138
+ var butThenProxy = (pm, filepath) => prxy(pm, [
139
+ [
140
+ "screencast",
141
+ (opts, p) => [
142
+ {
143
+ ...opts,
144
+ path: `${filepath}/butThen/${opts.path}`
145
+ },
146
+ p
147
+ ]
148
+ ],
149
+ ["createWriteStream", (fp) => [`${filepath}/butThen/${fp}`]],
150
+ [
151
+ "writeFileSync",
152
+ (fp, contents) => [`${filepath}/butThen/${fp}`, contents]
153
+ ],
154
+ [
155
+ "customScreenShot",
156
+ (opts, p) => [
157
+ {
158
+ ...opts,
159
+ path: `${filepath}/butThen/${opts.path}`
160
+ },
161
+ p
162
+ ]
163
+ ]
164
+ ]);
165
+ var andWhenProxy = (pm, filepath) => prxy(pm, [
166
+ [
167
+ "screencast",
168
+ (opts, p) => [
169
+ {
170
+ ...opts,
171
+ path: `${filepath}/andWhen/${opts.path}`
172
+ },
173
+ p
174
+ ]
175
+ ],
176
+ ["createWriteStream", (fp) => [`${filepath}/andWhen/${fp}`]],
177
+ ["writeFileSync", (fp, contents) => [`${filepath}/andWhen${fp}`, contents]],
178
+ [
179
+ "customScreenShot",
180
+ (opts, p) => [
181
+ {
182
+ ...opts,
183
+ path: `${filepath}/andWhen${opts.path}`
184
+ },
185
+ p
186
+ ]
187
+ ]
188
+ ]);
189
+ var afterEachProxy = (pm, suite, given) => prxy(pm, [
190
+ [
191
+ "screencast",
192
+ (opts, p) => [
193
+ {
194
+ ...opts,
195
+ path: `suite-${suite}/given-${given}/afterEach/${opts.path}`
196
+ },
197
+ p
198
+ ]
199
+ ],
200
+ ["createWriteStream", (fp) => [`suite-${suite}/afterEach/${fp}`]],
201
+ [
202
+ "writeFileSync",
203
+ (fp, contents) => [
204
+ `suite-${suite}/given-${given}/afterEach/${fp}`,
205
+ contents
206
+ ]
207
+ ],
208
+ [
209
+ "customScreenShot",
210
+ (opts, p) => [
211
+ {
212
+ ...opts,
213
+ path: `suite-${suite}/given-${given}/afterEach/${opts.path}`
214
+ },
215
+ p
216
+ ]
217
+ ]
218
+ ]);
219
+ var beforeEachProxy = (pm, suite) => prxy(pm, [
220
+ [
221
+ "screencast",
222
+ (opts, p) => [
223
+ {
224
+ ...opts,
225
+ path: `suite-${suite}/beforeEach/${opts.path}`
226
+ },
227
+ p
228
+ ]
229
+ ],
230
+ [
231
+ "writeFileSync",
232
+ (fp, contents) => [`suite-${suite}/beforeEach/${fp}`, contents]
233
+ ],
234
+ [
235
+ "customScreenShot",
236
+ (opts, p) => [
237
+ {
238
+ ...opts,
239
+ path: `suite-${suite}/beforeEach/${opts.path}`
240
+ },
241
+ p
242
+ ]
243
+ ],
244
+ ["createWriteStream", (fp) => [`suite-${suite}/beforeEach/${fp}`]]
245
+ ]);
246
+ var beforeAllProxy = (pm, suite) => prxy(pm, [
247
+ [
248
+ "writeFileSync",
249
+ (fp, contents) => [`suite-${suite}/beforeAll/${fp}`, contents]
250
+ ],
251
+ [
252
+ "customScreenShot",
253
+ (opts, p) => [
254
+ {
255
+ ...opts,
256
+ path: `suite-${suite}/beforeAll/${opts.path}`
257
+ },
258
+ p
259
+ ]
260
+ ],
261
+ ["createWriteStream", (fp) => [`suite-${suite}/beforeAll/${fp}`]]
262
+ ]);
263
+ var afterAllProxy = (pm, suite) => prxy(pm, [
264
+ ["createWriteStream", (fp) => [`suite-${suite}/afterAll/${fp}`]],
265
+ [
266
+ "writeFileSync",
267
+ (fp, contents) => [`suite-${suite}/afterAll/${fp}`, contents]
268
+ ],
269
+ [
270
+ "customScreenShot",
271
+ (opts, p) => [
272
+ {
273
+ ...opts,
274
+ path: `suite-${suite}/afterAll/${opts.path}`
275
+ },
276
+ p
277
+ ]
278
+ ]
279
+ ]);
280
+
281
+ // src/lib/abstractBase.ts
282
+ var BaseSuite = class {
283
+ constructor(name, index, givens = {}, checks = []) {
284
+ this.name = name;
285
+ this.index = index;
286
+ this.givens = givens;
287
+ this.checks = checks;
288
+ this.fails = 0;
289
+ }
290
+ features() {
291
+ const features = Object.keys(this.givens).map((k) => this.givens[k].features).flat().filter((value, index, array) => {
292
+ return array.indexOf(value) === index;
293
+ });
294
+ return features || [];
295
+ }
296
+ toObj() {
297
+ const givens = Object.keys(this.givens).map((k) => this.givens[k].toObj());
298
+ const checks = Object.keys(this.checks).map((k) => this.checks[k].toObj());
299
+ return {
300
+ name: this.name,
301
+ givens,
302
+ checks,
303
+ fails: this.fails,
304
+ failed: this.failed,
305
+ features: this.features()
306
+ };
307
+ }
308
+ setup(s, artifactory, tr, pm) {
309
+ return new Promise((res) => res(s));
310
+ }
311
+ assertThat(t) {
312
+ return !!t;
313
+ }
314
+ afterAll(store, artifactory, pm) {
315
+ return store;
316
+ }
317
+ async run(input, testResourceConfiguration, artifactory, tLog, pm) {
318
+ this.testResourceConfiguration = testResourceConfiguration;
319
+ const suiteArtifactory = (fPath, value) => artifactory(`suite-${this.index}-${this.name}/${fPath}`, value);
320
+ tLog("\nSuite:", this.index, this.name);
321
+ const sNdx = this.index;
322
+ const subject = await this.setup(
323
+ input,
324
+ suiteArtifactory,
325
+ testResourceConfiguration,
326
+ beforeAllProxy(pm, sNdx.toString())
327
+ );
328
+ for (const [gKey, g] of Object.entries(this.givens)) {
329
+ const giver = this.givens[gKey];
330
+ try {
331
+ this.store = await giver.give(
332
+ subject,
333
+ gKey,
334
+ testResourceConfiguration,
335
+ this.assertThat,
336
+ suiteArtifactory,
337
+ tLog,
338
+ pm,
339
+ sNdx
340
+ );
341
+ } catch (e) {
342
+ this.failed = true;
343
+ this.fails = this.fails + 1;
344
+ }
345
+ }
346
+ for (const [ndx, thater] of this.checks.entries()) {
347
+ await thater.check(
348
+ subject,
349
+ thater.name,
350
+ testResourceConfiguration,
351
+ this.assertThat,
352
+ suiteArtifactory,
353
+ tLog,
354
+ pm
355
+ );
356
+ }
357
+ try {
358
+ this.afterAll(
359
+ this.store,
360
+ artifactory,
361
+ afterAllProxy(pm, sNdx.toString())
362
+ );
363
+ } catch (e) {
364
+ console.error(e);
365
+ }
366
+ return this;
367
+ }
368
+ };
369
+ var BaseGiven = class {
370
+ constructor(name, features, whens, thens, givenCB, initialValues) {
371
+ this.name = name;
372
+ this.features = features;
373
+ this.whens = whens;
374
+ this.thens = thens;
375
+ this.givenCB = givenCB;
376
+ this.initialValues = initialValues;
377
+ }
378
+ beforeAll(store) {
379
+ return store;
380
+ }
381
+ toObj() {
382
+ return {
383
+ key: this.key,
384
+ name: this.name,
385
+ whens: this.whens.map((w) => w.toObj()),
386
+ thens: this.thens.map((t) => t.toObj()),
387
+ error: this.error ? [this.error, this.error.stack] : null,
388
+ failed: this.failed,
389
+ features: this.features
390
+ };
391
+ }
392
+ async afterEach(store, key, artifactory, pm) {
393
+ return store;
394
+ }
395
+ async give(subject, key, testResourceConfiguration, tester, artifactory, tLog, pm, suiteNdx) {
396
+ this.key = key;
397
+ tLog(`
398
+ ${this.key}`);
399
+ tLog(`
400
+ Given: ${this.name}`);
401
+ const givenArtifactory = (fPath, value) => artifactory(`given-${key}/${fPath}`, value);
402
+ this.uberCatcher((e) => {
403
+ console.error(e);
404
+ this.error = e.error;
405
+ tLog(e.stack);
406
+ });
407
+ try {
408
+ this.store = await this.givenThat(
409
+ subject,
410
+ testResourceConfiguration,
411
+ givenArtifactory,
412
+ this.givenCB,
413
+ this.initialValues,
414
+ beforeEachProxy(pm, suiteNdx.toString())
415
+ );
416
+ } catch (e) {
417
+ console.error("failure 4 ", e);
418
+ this.error = e;
419
+ throw e;
420
+ }
421
+ try {
422
+ for (const [whenNdx, whenStep] of this.whens.entries()) {
423
+ await whenStep.test(
424
+ this.store,
425
+ testResourceConfiguration,
426
+ tLog,
427
+ pm,
428
+ `suite-${suiteNdx}/given-${key}/when/${whenNdx}`
429
+ );
430
+ }
431
+ for (const [thenNdx, thenStep] of this.thens.entries()) {
432
+ const t = await thenStep.test(
433
+ this.store,
434
+ testResourceConfiguration,
435
+ tLog,
436
+ pm,
437
+ `suite-${suiteNdx}/given-${key}/then-${thenNdx}`
438
+ );
439
+ return tester(t);
440
+ }
441
+ } catch (e) {
442
+ this.failed = true;
443
+ tLog(e.stack);
444
+ throw e;
445
+ } finally {
446
+ try {
447
+ await this.afterEach(
448
+ this.store,
449
+ this.key,
450
+ givenArtifactory,
451
+ afterEachProxy(pm, suiteNdx.toString(), key)
452
+ );
453
+ } catch (e) {
454
+ console.error("afterEach failed!", e);
455
+ this.failed = e;
456
+ throw e;
457
+ }
458
+ }
459
+ return this.store;
460
+ }
461
+ };
462
+ var BaseWhen = class {
463
+ constructor(name, whenCB) {
464
+ this.name = name;
465
+ this.whenCB = whenCB;
466
+ }
467
+ toObj() {
468
+ console.log("toObj error", this.error);
469
+ return {
470
+ name: this.name,
471
+ error: this.error && this.error.name + this.error.stack
472
+ };
473
+ }
474
+ async test(store, testResourceConfiguration, tLog, pm, filepath) {
475
+ tLog(" When:", this.name);
476
+ return await this.andWhen(
477
+ store,
478
+ this.whenCB,
479
+ testResourceConfiguration,
480
+ andWhenProxy(pm, filepath)
481
+ ).catch((e) => {
482
+ console.log("MARK9", e);
483
+ this.error = e;
484
+ throw e;
485
+ });
486
+ }
487
+ };
488
+ var BaseThen = class {
489
+ constructor(name, thenCB) {
490
+ this.name = name;
491
+ this.thenCB = thenCB;
492
+ this.error = false;
493
+ }
494
+ toObj() {
495
+ return {
496
+ name: this.name,
497
+ error: this.error
498
+ };
499
+ }
500
+ async test(store, testResourceConfiguration, tLog, pm, filepath) {
501
+ return this.butThen(
502
+ store,
503
+ async (s) => {
504
+ tLog(" Then!!!:", this.name);
505
+ if (typeof this.thenCB === "function") {
506
+ return await this.thenCB(s);
507
+ } else {
508
+ return this.thenCB;
509
+ }
510
+ },
511
+ testResourceConfiguration,
512
+ butThenProxy(pm, filepath)
513
+ ).catch((e) => {
514
+ console.log("test failed 3", e);
515
+ this.error = e;
516
+ throw e;
517
+ });
518
+ }
519
+ check() {
520
+ }
521
+ };
522
+ var BaseCheck = class {
523
+ constructor(name, features, checker, x, checkCB) {
524
+ this.name = name;
525
+ this.features = features;
526
+ this.checkCB = checkCB;
527
+ this.checker = checker;
528
+ }
529
+ toObj() {
530
+ return {
531
+ key: this.key,
532
+ name: this.name,
533
+ // functionAsString: this.checkCB.toString(),
534
+ features: this.features
535
+ };
536
+ }
537
+ async afterEach(store, key, artifactory, pm) {
538
+ return store;
539
+ }
540
+ beforeAll(store) {
541
+ return store;
542
+ }
543
+ async check(subject, key, testResourceConfiguration, tester, artifactory, tLog, pm) {
544
+ this.key = key;
545
+ tLog(`
546
+ Check: ${this.name}`);
547
+ this.store = await this.checkThat(
548
+ subject,
549
+ testResourceConfiguration,
550
+ artifactory,
551
+ this.checkCB,
552
+ this.initialValues,
553
+ pm
554
+ );
555
+ await this.checker(this.store, pm);
556
+ return;
557
+ }
558
+ };
559
+
560
+ // src/lib/basebuilder.ts
561
+ var BaseBuilder = class {
562
+ constructor(input, suitesOverrides, givenOverides, whenOverides, thenOverides, checkOverides, testResourceRequirement, testSpecification) {
563
+ this.artifacts = [];
564
+ this.artifacts = [];
565
+ this.testResourceRequirement = testResourceRequirement;
566
+ this.suitesOverrides = suitesOverrides;
567
+ this.givenOverides = givenOverides;
568
+ this.whenOverides = whenOverides;
569
+ this.thenOverides = thenOverides;
570
+ this.checkOverides = checkOverides;
571
+ this.testSpecification = testSpecification;
572
+ this.specs = testSpecification(
573
+ this.Suites(),
574
+ this.Given(),
575
+ this.When(),
576
+ this.Then(),
577
+ this.Check()
578
+ );
579
+ this.testJobs = this.specs.map((suite) => {
580
+ const suiteRunner = (suite2) => async (puppetMaster, tLog) => {
581
+ const x = await suite2.run(
582
+ input,
583
+ puppetMaster.testResourceConfiguration,
584
+ (fPath, value) => puppetMaster.testArtiFactoryfileWriter(
585
+ tLog,
586
+ (p) => {
587
+ this.artifacts.push(p);
588
+ }
589
+ )(puppetMaster.testResourceConfiguration.fs + "/" + fPath, value),
590
+ tLog,
591
+ puppetMaster
592
+ );
593
+ return x;
594
+ };
595
+ const runner = suiteRunner(suite);
596
+ return {
597
+ test: suite,
598
+ toObj: () => {
599
+ return suite.toObj();
600
+ },
601
+ runner,
602
+ receiveTestResourceConfig: async function(puppetMaster) {
603
+ const logFilePath = "log.txt";
604
+ const access = await puppetMaster.createWriteStream(
605
+ logFilePath
606
+ );
607
+ const tLog = async (...l) => {
608
+ };
609
+ const suiteDone = await runner(puppetMaster, tLog);
610
+ const logPromise = new Promise(async (res) => {
611
+ await puppetMaster.end(access);
612
+ res(true);
613
+ });
614
+ const fails = suiteDone.fails;
615
+ await puppetMaster.writeFileSync(`bdd_errors.txt`, fails.toString());
616
+ await puppetMaster.writeFileSync(
617
+ `tests.json`,
618
+ JSON.stringify(this.toObj(), null, 2)
619
+ );
620
+ return {
621
+ failed: fails > 0,
622
+ fails,
623
+ artifacts: this.artifacts || [],
624
+ logPromise,
625
+ features: suiteDone.features()
626
+ };
627
+ }
628
+ };
629
+ });
630
+ }
631
+ // testsJson() {
632
+ // puppetMaster.writeFileSync(
633
+ // `tests.json`,
634
+ // JSON.stringify({ features: suiteDone.features() }, null, 2)
635
+ // );
636
+ // }
637
+ Specs() {
638
+ return this.specs;
639
+ }
640
+ Suites() {
641
+ return this.suitesOverrides;
642
+ }
643
+ Given() {
644
+ return this.givenOverides;
645
+ }
646
+ When() {
647
+ return this.whenOverides;
648
+ }
649
+ Then() {
650
+ return this.thenOverides;
651
+ }
652
+ Check() {
653
+ return this.checkOverides;
654
+ }
655
+ };
656
+
657
+ // src/lib/classBuilder.ts
658
+ var ClassBuilder = class extends BaseBuilder {
659
+ constructor(testImplementation, testSpecification, input, suiteKlasser, givenKlasser, whenKlasser, thenKlasser, checkKlasser, testResourceRequirement) {
660
+ const classySuites = Object.entries(testImplementation.suites).reduce(
661
+ (a, [key], index) => {
662
+ a[key] = (somestring, givens, checks) => {
663
+ return new suiteKlasser.prototype.constructor(
664
+ somestring,
665
+ index,
666
+ givens,
667
+ checks
668
+ );
669
+ };
670
+ return a;
671
+ },
672
+ {}
673
+ );
674
+ const classyGivens = Object.entries(testImplementation.givens).reduce(
675
+ (a, [key, g]) => {
676
+ a[key] = (features, whens, thens, ...initialValues) => {
677
+ return new givenKlasser.prototype.constructor(
678
+ key,
679
+ features,
680
+ whens,
681
+ thens,
682
+ testImplementation.givens[key],
683
+ initialValues
684
+ );
685
+ };
686
+ return a;
687
+ },
688
+ {}
689
+ );
690
+ const classyWhens = Object.entries(testImplementation.whens).reduce(
691
+ (a, [key, whEn]) => {
692
+ a[key] = (payload) => {
693
+ return new whenKlasser.prototype.constructor(
694
+ `${whEn.name}: ${payload && payload.toString()}`,
695
+ whEn(payload)
696
+ );
697
+ };
698
+ return a;
699
+ },
700
+ {}
701
+ );
702
+ const classyThens = Object.entries(testImplementation.thens).reduce(
703
+ (a, [key, thEn]) => {
704
+ a[key] = (expected, ...x) => {
705
+ return new thenKlasser.prototype.constructor(
706
+ `${thEn.name}: ${expected && expected.toString()}`,
707
+ thEn(expected, ...x)
708
+ );
709
+ };
710
+ return a;
711
+ },
712
+ {}
713
+ );
714
+ const classyChecks = Object.entries(testImplementation.checks).reduce(
715
+ (a, [key, chEck]) => {
716
+ a[key] = (name, features, checker) => {
717
+ return new checkKlasser.prototype.constructor(
718
+ key,
719
+ features,
720
+ chEck,
721
+ checker
722
+ );
723
+ };
724
+ return a;
725
+ },
726
+ {}
727
+ );
728
+ super(
729
+ input,
730
+ classySuites,
731
+ classyGivens,
732
+ classyWhens,
733
+ classyThens,
734
+ classyChecks,
735
+ testResourceRequirement,
736
+ testSpecification
737
+ );
738
+ }
739
+ };
740
+
741
+ // src/lib/core.ts
742
+ var Testeranto = class extends ClassBuilder {
743
+ constructor(input, testSpecification, testImplementation, testResourceRequirement = defaultTestResourceRequirement, testInterface2, uberCatcher) {
744
+ const fullTestInterface = DefaultTestInterface(testInterface2);
745
+ super(
746
+ testImplementation,
747
+ testSpecification,
748
+ input,
749
+ class extends BaseSuite {
750
+ afterAll(store, artifactory, pm) {
751
+ return fullTestInterface.afterAll(store, pm);
752
+ }
753
+ assertThat(t) {
754
+ return fullTestInterface.assertThis(t);
755
+ }
756
+ async setup(s, artifactory, tr, pm) {
757
+ return (fullTestInterface.beforeAll || (async (input2, artifactory2, tr2, pm2) => input2))(
758
+ s,
759
+ this.testResourceConfiguration,
760
+ // artifactory,
761
+ pm
762
+ );
763
+ }
764
+ },
765
+ class Given extends BaseGiven {
766
+ constructor() {
767
+ super(...arguments);
768
+ this.uberCatcher = uberCatcher;
769
+ }
770
+ async givenThat(subject, testResource, artifactory, initializer, initialValues, pm) {
771
+ return fullTestInterface.beforeEach(
772
+ subject,
773
+ initializer,
774
+ testResource,
775
+ initialValues,
776
+ pm
777
+ );
778
+ }
779
+ afterEach(store, key, artifactory, pm) {
780
+ return new Promise(
781
+ (res) => res(fullTestInterface.afterEach(store, key, pm))
782
+ );
783
+ }
784
+ },
785
+ class When extends BaseWhen {
786
+ async andWhen(store, whenCB, testResource, pm) {
787
+ return await fullTestInterface.andWhen(
788
+ store,
789
+ whenCB,
790
+ testResource,
791
+ pm
792
+ );
793
+ }
794
+ },
795
+ class Then extends BaseThen {
796
+ async butThen(store, thenCB, testResource, pm) {
797
+ return await fullTestInterface.butThen(
798
+ store,
799
+ thenCB,
800
+ testResource,
801
+ pm
802
+ );
803
+ }
804
+ },
805
+ class Check extends BaseCheck {
806
+ constructor(name, features, checkCallback, x, i, c) {
807
+ super(name, features, checkCallback, x, c);
808
+ this.initialValues = i;
809
+ }
810
+ async checkThat(subject, testResourceConfiguration, artifactory, initializer, initialValues, pm) {
811
+ return fullTestInterface.beforeEach(
812
+ subject,
813
+ initializer,
814
+ testResourceConfiguration,
815
+ initialValues,
816
+ pm
817
+ );
818
+ }
819
+ afterEach(store, key, artifactory, pm) {
820
+ return new Promise(
821
+ (res) => res(fullTestInterface.afterEach(store, key, pm))
822
+ );
823
+ }
824
+ },
825
+ testResourceRequirement
826
+ );
827
+ }
828
+ };
829
+
830
+ // src/PM/node.ts
831
+ import net2 from "net";
832
+ import fs from "fs";
833
+ import path from "path";
834
+
835
+ // src/PM/index.ts
836
+ var PM = class {
837
+ };
838
+
839
+ // src/PM/node.ts
840
+ var fPaths = [];
841
+ var PM_Node = class extends PM {
842
+ constructor(t, ipcFile) {
843
+ super();
844
+ this.testResourceConfiguration = t;
845
+ this.client = net2.createConnection(ipcFile, () => {
846
+ return;
847
+ });
848
+ }
849
+ start() {
850
+ throw new Error("DEPREFECATED");
851
+ }
852
+ stop() {
853
+ throw new Error("stop not implemented.");
854
+ }
855
+ send(command, ...argz) {
856
+ const key = Math.random().toString();
857
+ if (!this.client) {
858
+ console.error(
859
+ `Tried to send "${command} (${argz})" but the test has not been started and the IPC client is not established. Exiting as failure!`
860
+ );
861
+ process.exit(-1);
862
+ }
863
+ return new Promise((res) => {
864
+ const myListener = (event) => {
865
+ const x = JSON.parse(event);
866
+ if (x.key === key) {
867
+ process.removeListener("message", myListener);
868
+ res(x.payload);
869
+ }
870
+ };
871
+ process.addListener("message", myListener);
872
+ this.client.write(JSON.stringify([command, ...argz, key]));
873
+ });
874
+ }
875
+ async launchSideCar(n) {
876
+ return this.send(
877
+ "launchSideCar",
878
+ n,
879
+ this.testResourceConfiguration.name
880
+ );
881
+ }
882
+ stopSideCar(n) {
883
+ return this.send(
884
+ "stopSideCar",
885
+ n,
886
+ this.testResourceConfiguration.name
887
+ );
888
+ }
889
+ async pages() {
890
+ return this.send("pages", ...arguments);
891
+ }
892
+ waitForSelector(p, s) {
893
+ return this.send("waitForSelector", ...arguments);
894
+ }
895
+ closePage(p) {
896
+ return this.send("closePage", ...arguments);
897
+ }
898
+ goto(page, url) {
899
+ return this.send("goto", ...arguments);
900
+ }
901
+ async newPage() {
902
+ return this.send("newPage");
903
+ }
904
+ $(selector, page) {
905
+ return this.send("$", ...arguments);
906
+ }
907
+ isDisabled(selector) {
908
+ return this.send("isDisabled", ...arguments);
909
+ }
910
+ getAttribute(selector, attribute, p) {
911
+ return this.send("getAttribute", ...arguments);
912
+ }
913
+ getInnerHtml(selector, p) {
914
+ return this.send("getInnerHtml", ...arguments);
915
+ }
916
+ // setValue(selector: string) {
917
+ // return this.send("getValue", ...arguments);
918
+ // }
919
+ focusOn(selector) {
920
+ return this.send("focusOn", ...arguments);
921
+ }
922
+ typeInto(selector) {
923
+ return this.send("typeInto", ...arguments);
924
+ }
925
+ page() {
926
+ return this.send("page");
927
+ }
928
+ click(selector) {
929
+ return this.send("click", ...arguments);
930
+ }
931
+ screencast(opts, page) {
932
+ return this.send(
933
+ "screencast",
934
+ {
935
+ ...opts,
936
+ path: this.testResourceConfiguration.fs + "/" + opts.path
937
+ },
938
+ page,
939
+ this.testResourceConfiguration.name
940
+ );
941
+ }
942
+ screencastStop(p) {
943
+ return this.send("screencastStop", ...arguments);
944
+ }
945
+ customScreenShot(x, y) {
946
+ const opts = x[0];
947
+ const page = x[1];
948
+ return this.send(
949
+ "customScreenShot",
950
+ {
951
+ ...opts,
952
+ path: this.testResourceConfiguration.fs + "/" + opts.path
953
+ },
954
+ this.testResourceConfiguration.name,
955
+ page
956
+ );
957
+ }
958
+ async existsSync(destFolder) {
959
+ return await this.send(
960
+ "existsSync",
961
+ this.testResourceConfiguration.fs + "/" + destFolder
962
+ );
963
+ }
964
+ mkdirSync() {
965
+ return this.send("mkdirSync", this.testResourceConfiguration.fs + "/");
966
+ }
967
+ async write(uid, contents) {
968
+ return await this.send("write", ...arguments);
969
+ }
970
+ async writeFileSync(filepath, contents) {
971
+ return await this.send(
972
+ "writeFileSync",
973
+ this.testResourceConfiguration.fs + "/" + filepath,
974
+ contents,
975
+ this.testResourceConfiguration.name
976
+ );
977
+ }
978
+ async createWriteStream(filepath) {
979
+ return await this.send(
980
+ "createWriteStream",
981
+ this.testResourceConfiguration.fs + "/" + filepath,
982
+ this.testResourceConfiguration.name
983
+ );
984
+ }
985
+ async end(uid) {
986
+ return await this.send("end", ...arguments);
987
+ }
988
+ async customclose() {
989
+ return await this.send(
990
+ "customclose",
991
+ this.testResourceConfiguration.fs,
992
+ this.testResourceConfiguration.name
993
+ );
994
+ }
995
+ testArtiFactoryfileWriter(tLog, callback) {
996
+ return (fPath, value) => {
997
+ callback(
998
+ new Promise((res, rej) => {
999
+ tLog("testArtiFactory =>", fPath);
1000
+ const cleanPath = path.resolve(fPath);
1001
+ fPaths.push(cleanPath.replace(process.cwd(), ``));
1002
+ const targetDir = cleanPath.split("/").slice(0, -1).join("/");
1003
+ fs.mkdir(targetDir, { recursive: true }, async (error) => {
1004
+ if (error) {
1005
+ console.error(`\u2757\uFE0FtestArtiFactory failed`, targetDir, error);
1006
+ }
1007
+ fs.writeFileSync(
1008
+ path.resolve(
1009
+ targetDir.split("/").slice(0, -1).join("/"),
1010
+ "manifest"
1011
+ ),
1012
+ fPaths.join(`
1013
+ `),
1014
+ {
1015
+ encoding: "utf-8"
1016
+ }
1017
+ );
1018
+ if (Buffer.isBuffer(value)) {
1019
+ fs.writeFileSync(fPath, value, "binary");
1020
+ res();
1021
+ } else if (`string` === typeof value) {
1022
+ fs.writeFileSync(fPath, value.toString(), {
1023
+ encoding: "utf-8"
1024
+ });
1025
+ res();
1026
+ } else {
1027
+ const pipeStream = value;
1028
+ const myFile = fs.createWriteStream(fPath);
1029
+ pipeStream.pipe(myFile);
1030
+ pipeStream.on("close", () => {
1031
+ myFile.close();
1032
+ res();
1033
+ });
1034
+ }
1035
+ });
1036
+ })
1037
+ );
1038
+ };
1039
+ }
1040
+ // launch(options?: PuppeteerLaunchOptions): Promise<Browser>;
1041
+ startPuppeteer(options) {
1042
+ }
1043
+ };
1044
+
1045
+ // src/Node.ts
1046
+ var ipcfile;
1047
+ var NodeTesteranto = class extends Testeranto {
1048
+ constructor(input, testSpecification, testImplementation, testResourceRequirement, testInterface2) {
1049
+ super(
1050
+ input,
1051
+ testSpecification,
1052
+ testImplementation,
1053
+ testResourceRequirement,
1054
+ testInterface2,
1055
+ () => {
1056
+ }
1057
+ );
1058
+ }
1059
+ async receiveTestResourceConfig(partialTestResource) {
1060
+ const t = JSON.parse(partialTestResource);
1061
+ const pm = new PM_Node(t, ipcfile);
1062
+ return await this.testJobs[0].receiveTestResourceConfig(pm);
1063
+ }
1064
+ };
1065
+ var testeranto = async (input, testSpecification, testImplementation, testInterface2, testResourceRequirement = defaultTestResourceRequirement) => {
1066
+ const t = new NodeTesteranto(
1067
+ input,
1068
+ testSpecification,
1069
+ testImplementation,
1070
+ testResourceRequirement,
1071
+ testInterface2
1072
+ );
1073
+ process.on("unhandledRejection", (reason, promise) => {
1074
+ console.error("Unhandled Rejection at:", promise, "reason:", reason);
1075
+ });
1076
+ try {
1077
+ ipcfile = process.argv[3];
1078
+ const f = await t.receiveTestResourceConfig(process.argv[2]);
1079
+ console.error("goodbye node error", f.fails);
1080
+ process.exit(f.fails);
1081
+ } catch (e) {
1082
+ console.error("goodbye node error", e);
1083
+ process.exit(-1);
1084
+ }
1085
+ return t;
1086
+ };
1087
+ var Node_default = testeranto;
1088
+
1089
+ // src/PM/__tests__/sidecar.testeranto.ts
1090
+ var specification = (Suite, Given, When, Then) => {
1091
+ return [
1092
+ Suite.SidecarInitialized(
1093
+ "Sidecar message passing works correctly",
1094
+ {
1095
+ basicSend: Given.SidecarReady(
1096
+ ["can send and receive messages"],
1097
+ [When.SendTestMessage("test-message")],
1098
+ [Then.MessageReceived("test-message")]
1099
+ ),
1100
+ cleanup: Given.SidecarReady(
1101
+ ["cleans up listeners after message"],
1102
+ [When.VerifyCleanup()],
1103
+ [Then.ListenersCleaned()]
1104
+ )
1105
+ },
1106
+ []
1107
+ )
1108
+ ];
1109
+ };
1110
+ var implementation = {
1111
+ suites: { SidecarInitialized: (x) => x },
1112
+ givens: {
1113
+ SidecarReady: () => {
1114
+ const config = {
1115
+ name: "test-sidecar",
1116
+ fs: "/tmp",
1117
+ ports: [3001],
1118
+ browserWSEndpoint: ""
1119
+ };
1120
+ return new PM_Node_Sidecar(config);
1121
+ }
1122
+ },
1123
+ whens: {
1124
+ SendTestMessage: (message) => async (sidecar) => {
1125
+ let callbackFn;
1126
+ process.on = (event, callback) => {
1127
+ if (event === "message") {
1128
+ callbackFn = callback;
1129
+ callback(
1130
+ JSON.stringify({
1131
+ key: "mock-key",
1132
+ payload: message
1133
+ })
1134
+ );
1135
+ }
1136
+ };
1137
+ let writeCalled = false;
1138
+ sidecar.client.write = (data) => {
1139
+ writeCalled = true;
1140
+ return true;
1141
+ };
1142
+ await sidecar.send("test-command", message);
1143
+ return { writeCalled, callbackFn };
1144
+ },
1145
+ VerifyCleanup: () => async (sidecar) => {
1146
+ let addListenerCalled = false;
1147
+ let removeListenerCalled = false;
1148
+ process.addListener = () => addListenerCalled = true;
1149
+ process.removeListener = () => removeListenerCalled = true;
1150
+ await sidecar.send("test-command", "test");
1151
+ return { addListenerCalled, removeListenerCalled };
1152
+ }
1153
+ },
1154
+ thens: {
1155
+ MessageReceived: (expected) => (actual) => {
1156
+ if (actual !== expected) {
1157
+ throw new Error(`Expected "${expected}" but got "${actual}"`);
1158
+ }
1159
+ return actual;
1160
+ },
1161
+ ListenersCleaned: () => (result, { removeListenerCalled }) => {
1162
+ if (!removeListenerCalled) {
1163
+ throw new Error("Expected removeListener to be called");
1164
+ }
1165
+ return result;
1166
+ }
1167
+ },
1168
+ checks: { SidecarState: () => "unknown" }
1169
+ };
1170
+ var testInterface = {
1171
+ beforeEach: async (subject, initializer, testResource, initialValues, pm) => {
1172
+ const sidecar = initializer();
1173
+ sidecar.client = {
1174
+ write: () => true,
1175
+ end: () => {
1176
+ },
1177
+ on: () => {
1178
+ }
1179
+ };
1180
+ return sidecar;
1181
+ },
1182
+ andWhen: async (store, whenCB, testResource, pm) => {
1183
+ try {
1184
+ await whenCB(store, testResource, pm);
1185
+ } catch (e) {
1186
+ console.error("Error in andWhen:", e);
1187
+ throw e;
1188
+ }
1189
+ }
1190
+ };
1191
+ var sidecar_testeranto_default = Node_default(
1192
+ () => new PM_Node_Sidecar({}),
1193
+ specification,
1194
+ implementation,
1195
+ testInterface
1196
+ );
1197
+ export {
1198
+ sidecar_testeranto_default as default
1199
+ };