testeranto 0.79.69 → 0.81.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 (252) hide show
  1. package/.aider.chat.history.md +980 -0
  2. package/.aider.input.history +87 -0
  3. package/.aider.tags.cache.v3/1c/30/af1de2ad7a137afeddb1b01e0c27.val +0 -0
  4. package/.aider.tags.cache.v3/1d/63/88318b65ce58b6bb0487e8ce2656.val +0 -0
  5. package/.aider.tags.cache.v3/2e/67/16ae65530b40038e48e00d666c63.val +0 -0
  6. package/.aider.tags.cache.v3/6f/94/80488a232866fcce7ee657da488b.val +0 -0
  7. package/.aider.tags.cache.v3/cache.db +0 -0
  8. package/.eslintrc.js +5 -2
  9. package/README.md +10 -107
  10. package/build-tests.ts +16 -0
  11. package/dist/common/build-tests.js +38 -0
  12. package/dist/common/init-docs.js +8 -0
  13. package/dist/common/run-tests.js +34 -0
  14. package/dist/common/src/Aider.js +143 -0
  15. package/dist/common/src/Init.js +10 -0
  16. package/dist/common/{PM → src/PM}/main.js +58 -49
  17. package/dist/common/{PM → src/PM}/node.js +1 -1
  18. package/dist/common/{Project.js → src/Project.js} +46 -38
  19. package/dist/common/{Puppeteer.js → src/Puppeteer.js} +51 -40
  20. package/dist/common/{SubPackages → src/SubPackages}/react-dom/jsx/web.js +37 -38
  21. package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx/index.js +17 -2
  22. package/dist/common/src/esbuildConfigs/inputFilesPlugin.js +79 -0
  23. package/dist/common/{esbuildConfigs → src/esbuildConfigs}/node.js +5 -3
  24. package/dist/common/{esbuildConfigs → src/esbuildConfigs}/web.js +4 -4
  25. package/dist/common/{lib → src/lib}/abstractBase.js +80 -24
  26. package/dist/common/{lib → src/lib}/basebuilder.js +14 -3
  27. package/dist/common/{lib → src/lib}/core.js +47 -3
  28. package/dist/common/testeranto.js +15 -0
  29. package/dist/common/tsconfig.common.tsbuildinfo +1 -1
  30. package/dist/module/build-tests.js +10 -0
  31. package/dist/module/init-docs.js +3 -0
  32. package/dist/module/run-tests.js +6 -0
  33. package/dist/module/src/Aider.js +136 -0
  34. package/dist/module/src/Init.js +5 -0
  35. package/dist/module/{PM → src/PM}/main.js +58 -49
  36. package/dist/module/{PM → src/PM}/node.js +1 -1
  37. package/dist/module/{Project.js → src/Project.js} +46 -38
  38. package/dist/module/{Puppeteer.js → src/Puppeteer.js} +51 -40
  39. package/dist/module/{SubPackages → src/SubPackages}/react-dom/jsx/web.js +37 -38
  40. package/dist/module/src/SubPackages/react-test-renderer/jsx/index.js +34 -0
  41. package/dist/module/src/esbuildConfigs/inputFilesPlugin.js +74 -0
  42. package/dist/module/{esbuildConfigs → src/esbuildConfigs}/node.js +4 -2
  43. package/dist/module/{esbuildConfigs → src/esbuildConfigs}/web.js +4 -4
  44. package/dist/module/{lib → src/lib}/abstractBase.js +80 -24
  45. package/dist/module/{lib → src/lib}/basebuilder.js +14 -3
  46. package/dist/module/{lib → src/lib}/core.js +47 -3
  47. package/dist/module/testeranto.js +13 -0
  48. package/dist/module/tsconfig.module.tsbuildinfo +1 -1
  49. package/dist/types/build-tests.d.ts +3 -0
  50. package/dist/types/init-docs.d.ts +2 -0
  51. package/dist/types/run-tests.d.ts +2 -0
  52. package/dist/types/src/Aider.d.ts +1 -0
  53. package/dist/types/{PM → src/PM}/index.d.ts +1 -1
  54. package/dist/types/{PM → src/PM}/main.d.ts +7 -1
  55. package/dist/types/{Project.d.ts → src/Project.d.ts} +6 -1
  56. package/dist/types/{Types.d.ts → src/Types.d.ts} +3 -2
  57. package/dist/types/{lib → src/lib}/abstractBase.d.ts +1 -0
  58. package/dist/types/testeranto.d.ts +16 -0
  59. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  60. package/init-docs.ts +5 -0
  61. package/package.json +54 -29
  62. package/run-tests.ts +9 -0
  63. package/secret +1 -0
  64. package/secret.env +2 -0
  65. package/src/Aider.ts +168 -0
  66. package/src/Init.ts +0 -31
  67. package/src/PM/index.ts +1 -1
  68. package/src/PM/main.ts +71 -61
  69. package/src/PM/node.ts +1 -1
  70. package/src/Project.ts +55 -48
  71. package/src/Puppeteer.ts +66 -52
  72. package/src/SubPackages/react-dom/jsx/web.ts +46 -49
  73. package/src/SubPackages/react-test-renderer/jsx/index.ts +25 -2
  74. package/src/Types.ts +3 -1
  75. package/src/esbuildConfigs/inputFilesPlugin.ts +78 -31
  76. package/src/esbuildConfigs/node.ts +2 -2
  77. package/src/esbuildConfigs/web.ts +4 -4
  78. package/src/lib/abstractBase.ts +88 -30
  79. package/src/lib/basebuilder.ts +17 -3
  80. package/src/lib/core.ts +55 -13
  81. package/testeranto.ts +13 -0
  82. package/tsconfig.common.json +12 -4
  83. package/tsconfig.json +9 -2
  84. package/tsconfig.module.json +2 -2
  85. package/tsconfig.types.json +1 -1
  86. package/Report.Dockerfile +0 -44
  87. package/dist/common/Features.js +0 -51
  88. package/dist/common/Init.js +0 -30
  89. package/dist/common/Reporter.js +0 -112
  90. package/dist/common/Scheduler.js +0 -1
  91. package/dist/common/TaskManBackEnd.js +0 -167
  92. package/dist/common/esbuildConfigs/inputFilesPlugin.js +0 -49
  93. package/dist/common/mongooseSchemas.js +0 -56
  94. package/dist/common/preload.js +0 -15
  95. package/dist/common/report.html.js +0 -31
  96. package/dist/module/ExampleTab.js +0 -112
  97. package/dist/module/Features.js +0 -41
  98. package/dist/module/Init.js +0 -25
  99. package/dist/module/Reporter.js +0 -107
  100. package/dist/module/Scheduler.js +0 -1
  101. package/dist/module/SubPackages/react-test-renderer/jsx/index.js +0 -19
  102. package/dist/module/TaskManBackEnd.js +0 -162
  103. package/dist/module/TaskManFrontEnd.js +0 -605
  104. package/dist/module/esbuildConfigs/inputFilesPlugin.js +0 -44
  105. package/dist/module/mongooseSchemas.js +0 -50
  106. package/dist/module/preload.js +0 -15
  107. package/dist/module/report.html.js +0 -29
  108. package/dist/prebuild/TaskManBackEnd.mjs +0 -170
  109. package/dist/prebuild/TaskManFrontEnd.css +0 -12301
  110. package/dist/prebuild/TaskManFrontEnd.js +0 -81262
  111. package/dist/types/Features.d.ts +0 -35
  112. package/dist/types/Reporter.d.ts +0 -1
  113. package/dist/types/Scheduler.d.ts +0 -0
  114. package/dist/types/TaskManBackEnd.d.ts +0 -3
  115. package/dist/types/mongooseSchemas.d.ts +0 -124
  116. package/dist/types/preload.d.ts +0 -0
  117. package/dist/types/report.html.d.ts +0 -2
  118. package/src/ExampleTab.tsx +0 -219
  119. package/src/Features.ts +0 -64
  120. package/src/Reporter.ts +0 -126
  121. package/src/Scheduler.ts +0 -0
  122. package/src/TaskManBackEnd.ts +0 -226
  123. package/src/TaskManFrontEnd.tsx +0 -1254
  124. package/src/mongooseSchemas.ts +0 -105
  125. package/src/preload.ts +0 -17
  126. package/src/report.html.ts +0 -29
  127. package/tests/Rectangle.test.ts +0 -189
  128. package/trash/TaskMan.Dockerfile +0 -23
  129. package/trash/TaskMan1.Dockerfile +0 -43
  130. package/trash/devBot.dockerfile +0 -12
  131. package/trash/docker-compose-dev.yml +0 -9
  132. package/trash/docker-compose-prod.yml +0 -18
  133. package/trash/electronBuild.ts +0 -32
  134. /package/dist/common/{Node.js → src/Node.js} +0 -0
  135. /package/dist/common/{PM → src/PM}/index.js +0 -0
  136. /package/dist/common/{PM → src/PM}/web.js +0 -0
  137. /package/dist/common/{SubPackages → src/SubPackages}/puppeteer.js +0 -0
  138. /package/dist/common/{SubPackages → src/SubPackages}/react/component/node.js +0 -0
  139. /package/dist/common/{SubPackages → src/SubPackages}/react/component/web.js +0 -0
  140. /package/dist/common/{SubPackages → src/SubPackages}/react/jsx/index.js +0 -0
  141. /package/dist/common/{SubPackages → src/SubPackages}/react/jsx/node.js +0 -0
  142. /package/dist/common/{SubPackages → src/SubPackages}/react/jsx/web.js +0 -0
  143. /package/dist/common/{SubPackages → src/SubPackages}/react-dom/component/node.js +0 -0
  144. /package/dist/common/{SubPackages → src/SubPackages}/react-dom/component/web.js +0 -0
  145. /package/dist/common/{SubPackages → src/SubPackages}/react-dom/jsx/index.js +0 -0
  146. /package/dist/common/{SubPackages → src/SubPackages}/react-dom/jsx/node.js +0 -0
  147. /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/MemoExoticComponent/node.js +0 -0
  148. /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/component/index.js +0 -0
  149. /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/component/interface.js +0 -0
  150. /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/component/node.js +0 -0
  151. /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/component/web.js +0 -0
  152. /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/fc/node.js +0 -0
  153. /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/fc/web.js +0 -0
  154. /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx/node.js +0 -0
  155. /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx/web.js +0 -0
  156. /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/index.js +0 -0
  157. /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/node.js +0 -0
  158. /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/web.js +0 -0
  159. /package/dist/common/{Types.js → src/Types.js} +0 -0
  160. /package/dist/common/{Web.js → src/Web.js} +0 -0
  161. /package/dist/common/{esbuildConfigs → src/esbuildConfigs}/features.js +0 -0
  162. /package/dist/common/{esbuildConfigs → src/esbuildConfigs}/index.js +0 -0
  163. /package/dist/common/{esbuildConfigs → src/esbuildConfigs}/report.js +0 -0
  164. /package/dist/common/{esbuildConfigs → src/esbuildConfigs}/tests.js +0 -0
  165. /package/dist/common/{lib → src/lib}/classBuilder.js +0 -0
  166. /package/dist/common/{lib → src/lib}/index.js +0 -0
  167. /package/dist/common/{lib → src/lib}/types.js +0 -0
  168. /package/dist/common/{puppeteerConfiger.js → src/puppeteerConfiger.js} +0 -0
  169. /package/dist/common/{utils.js → src/utils.js} +0 -0
  170. /package/dist/common/{web.html.js → src/web.html.js} +0 -0
  171. /package/dist/module/{Node.js → src/Node.js} +0 -0
  172. /package/dist/module/{PM → src/PM}/index.js +0 -0
  173. /package/dist/module/{PM → src/PM}/web.js +0 -0
  174. /package/dist/module/{SubPackages → src/SubPackages}/puppeteer.js +0 -0
  175. /package/dist/module/{SubPackages → src/SubPackages}/react/component/node.js +0 -0
  176. /package/dist/module/{SubPackages → src/SubPackages}/react/component/web.js +0 -0
  177. /package/dist/module/{SubPackages → src/SubPackages}/react/jsx/index.js +0 -0
  178. /package/dist/module/{SubPackages → src/SubPackages}/react/jsx/node.js +0 -0
  179. /package/dist/module/{SubPackages → src/SubPackages}/react/jsx/web.js +0 -0
  180. /package/dist/module/{SubPackages → src/SubPackages}/react-dom/component/node.js +0 -0
  181. /package/dist/module/{SubPackages → src/SubPackages}/react-dom/component/web.js +0 -0
  182. /package/dist/module/{SubPackages → src/SubPackages}/react-dom/jsx/index.js +0 -0
  183. /package/dist/module/{SubPackages → src/SubPackages}/react-dom/jsx/node.js +0 -0
  184. /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/MemoExoticComponent/node.js +0 -0
  185. /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/component/index.js +0 -0
  186. /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/component/interface.js +0 -0
  187. /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/component/node.js +0 -0
  188. /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/component/web.js +0 -0
  189. /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/fc/node.js +0 -0
  190. /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/fc/web.js +0 -0
  191. /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx/node.js +0 -0
  192. /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx/web.js +0 -0
  193. /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/index.js +0 -0
  194. /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/node.js +0 -0
  195. /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/web.js +0 -0
  196. /package/dist/module/{Types.js → src/Types.js} +0 -0
  197. /package/dist/module/{Web.js → src/Web.js} +0 -0
  198. /package/dist/module/{esbuildConfigs → src/esbuildConfigs}/features.js +0 -0
  199. /package/dist/module/{esbuildConfigs → src/esbuildConfigs}/index.js +0 -0
  200. /package/dist/module/{esbuildConfigs → src/esbuildConfigs}/report.js +0 -0
  201. /package/dist/module/{esbuildConfigs → src/esbuildConfigs}/tests.js +0 -0
  202. /package/dist/module/{lib → src/lib}/classBuilder.js +0 -0
  203. /package/dist/module/{lib → src/lib}/index.js +0 -0
  204. /package/dist/module/{lib → src/lib}/types.js +0 -0
  205. /package/dist/module/{puppeteerConfiger.js → src/puppeteerConfiger.js} +0 -0
  206. /package/dist/module/{utils.js → src/utils.js} +0 -0
  207. /package/dist/module/{web.html.js → src/web.html.js} +0 -0
  208. /package/dist/types/{Init.d.ts → src/Init.d.ts} +0 -0
  209. /package/dist/types/{Node.d.ts → src/Node.d.ts} +0 -0
  210. /package/dist/types/{PM → src/PM}/node.d.ts +0 -0
  211. /package/dist/types/{PM → src/PM}/web.d.ts +0 -0
  212. /package/dist/types/{Puppeteer.d.ts → src/Puppeteer.d.ts} +0 -0
  213. /package/dist/types/{SubPackages → src/SubPackages}/puppeteer.d.ts +0 -0
  214. /package/dist/types/{SubPackages → src/SubPackages}/react/component/node.d.ts +0 -0
  215. /package/dist/types/{SubPackages → src/SubPackages}/react/component/web.d.ts +0 -0
  216. /package/dist/types/{SubPackages → src/SubPackages}/react/jsx/index.d.ts +0 -0
  217. /package/dist/types/{SubPackages → src/SubPackages}/react/jsx/node.d.ts +0 -0
  218. /package/dist/types/{SubPackages → src/SubPackages}/react/jsx/web.d.ts +0 -0
  219. /package/dist/types/{SubPackages → src/SubPackages}/react-dom/component/node.d.ts +0 -0
  220. /package/dist/types/{SubPackages → src/SubPackages}/react-dom/component/web.d.ts +0 -0
  221. /package/dist/types/{SubPackages → src/SubPackages}/react-dom/jsx/index.d.ts +0 -0
  222. /package/dist/types/{SubPackages → src/SubPackages}/react-dom/jsx/node.d.ts +0 -0
  223. /package/dist/types/{SubPackages → src/SubPackages}/react-dom/jsx/web.d.ts +0 -0
  224. /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/MemoExoticComponent/node.d.ts +0 -0
  225. /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/component/index.d.ts +0 -0
  226. /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/component/interface.d.ts +0 -0
  227. /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/component/node.d.ts +0 -0
  228. /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/component/web.d.ts +0 -0
  229. /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/fc/node.d.ts +0 -0
  230. /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/fc/web.d.ts +0 -0
  231. /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx/index.d.ts +0 -0
  232. /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx/node.d.ts +0 -0
  233. /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx/web.d.ts +0 -0
  234. /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/index.d.ts +0 -0
  235. /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/node.d.ts +0 -0
  236. /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/web.d.ts +0 -0
  237. /package/dist/types/{Web.d.ts → src/Web.d.ts} +0 -0
  238. /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/features.d.ts +0 -0
  239. /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/index.d.ts +0 -0
  240. /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/inputFilesPlugin.d.ts +0 -0
  241. /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/node.d.ts +0 -0
  242. /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/report.d.ts +0 -0
  243. /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/tests.d.ts +0 -0
  244. /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/web.d.ts +0 -0
  245. /package/dist/types/{lib → src/lib}/basebuilder.d.ts +0 -0
  246. /package/dist/types/{lib → src/lib}/classBuilder.d.ts +0 -0
  247. /package/dist/types/{lib → src/lib}/core.d.ts +0 -0
  248. /package/dist/types/{lib → src/lib}/index.d.ts +0 -0
  249. /package/dist/types/{lib → src/lib}/types.d.ts +0 -0
  250. /package/dist/types/{puppeteerConfiger.d.ts → src/puppeteerConfiger.d.ts} +0 -0
  251. /package/dist/types/{utils.d.ts → src/utils.d.ts} +0 -0
  252. /package/dist/types/{web.html.d.ts → src/web.html.d.ts} +0 -0
@@ -1,19 +1,16 @@
1
1
  import React, { useEffect, useRef } from "react";
2
2
  import { createElement } from "react";
3
3
  import ReactDom from "react-dom/client";
4
- import { createPortal } from "react-dom";
5
4
  import Testeranto from "../../../Web.js";
5
+ const TesterantoComponent = ({ done, innerComp, }) => {
6
+ const myContainer = useRef(null);
7
+ useEffect(() => {
8
+ console.log("useEffect called!", myContainer.current);
9
+ done(myContainer.current);
10
+ }, []);
11
+ return React.createElement("div", { ref: myContainer }, innerComp());
12
+ };
6
13
  export default (testImplementations, testSpecifications, testInput) => {
7
- console.log("testInput", testInput);
8
- const TesterantoComponent = function ({ done, innerComp, }) {
9
- const myContainer = useRef(null);
10
- useEffect(() => {
11
- console.log("useEffect called!", myContainer.current);
12
- done(myContainer.current);
13
- }, []);
14
- // debugger;
15
- return React.createElement("div", { ref: myContainer }, innerComp());
16
- };
17
14
  const t = Testeranto(testInput, testSpecifications, testImplementations, {
18
15
  beforeAll: async (reactElement, itr) => {
19
16
  return await new Promise((resolve, rej) => {
@@ -37,47 +34,49 @@ export default (testImplementations, testSpecifications, testInput) => {
37
34
  },
38
35
  beforeEach: async (subject, initializer, artificer, testResource, pm) => {
39
36
  return new Promise((resolve, rej) => {
40
- createPortal(TesterantoComponent({
41
- innerComp: () => testInput({
42
- port: 3003,
43
- address: "some-address",
44
- secretKey: "someSecretKey",
45
- abi: "foo",
46
- }),
47
- done: (reactElement) => {
48
- process.nextTick(() => {
49
- resolve(reactElement);
50
- });
51
- },
52
- }), subject.domRoot);
37
+ resolve(subject);
38
+ // const tc = TesterantoComponent({
39
+ // innerComp: () =>
40
+ // testInput({
41
+ // port: 3003,
42
+ // address: "some-address",
43
+ // secretKey: "someSecretKey",
44
+ // abi: "foo",
45
+ // }),
46
+ // done: (reactElement: any) => {
47
+ // console.log("mark9");
48
+ // resolve(reactElement);
49
+ // // process.nextTick(() => {
50
+ // // resolve(reactElement);
51
+ // // });
52
+ // },
53
+ // });
54
+ // console.log("mark9", tc);
55
+ // createPortal(tc, subject.domRoot);
53
56
  });
54
57
  },
55
- andWhen: function (s, whenCB) {
58
+ andWhen: function (s, whenCB, tr, utils) {
56
59
  return new Promise((resolve, rej) => {
57
- process.nextTick(() => {
58
- resolve(whenCB()(s));
59
- });
60
+ console.log("mark9", s, whenCB);
61
+ resolve(whenCB(s, utils));
62
+ // process.nextTick(() => {
63
+ // resolve(whenCB()(s));
64
+ // });
60
65
  });
61
66
  },
62
- butThen: async function (s) {
67
+ butThen: async function (s, thenCB) {
63
68
  return new Promise((resolve, rej) => {
64
- process.nextTick(() => {
65
- resolve(s);
66
- });
69
+ resolve(thenCB(s));
67
70
  });
68
71
  },
69
72
  afterEach: async function (store, ndx, artificer) {
70
73
  return new Promise((resolve, rej) => {
71
- process.nextTick(() => {
72
- resolve({});
73
- });
74
+ resolve({});
74
75
  });
75
76
  },
76
77
  afterAll: (store, artificer) => {
77
78
  return new Promise((resolve, rej) => {
78
- process.nextTick(() => {
79
- resolve({});
80
- });
79
+ resolve({});
81
80
  });
82
81
  },
83
82
  });
@@ -0,0 +1,34 @@
1
+ import React from "react";
2
+ import renderer, { act } from "react-test-renderer";
3
+ const Context = React.createContext({});
4
+ const AppContext = React.createContext({});
5
+ const contextValue = {
6
+ ingredients: ["flour", "sugar", "eggs"],
7
+ temperature: "200",
8
+ };
9
+ export const testInterface = {
10
+ butThen: async function (s, thenCB, tr) {
11
+ // console.log("butThen", thenCB.toString());
12
+ return thenCB(s);
13
+ },
14
+ beforeEach: function (CComponent, props) {
15
+ let component;
16
+ act(() => {
17
+ // component = renderer.create(
18
+ // React.createElement(
19
+ // AppContext.Provider,
20
+ // { value: contextValue },
21
+ // React.createElement(AppContext.Consumer, null, (context) =>
22
+ // React.createElement(CComponent, Object.assign({}, context, {}))
23
+ // )
24
+ // )
25
+ // );
26
+ component = renderer.create(React.createElement(CComponent, props, React.createElement(CComponent, props, [])));
27
+ });
28
+ return component;
29
+ },
30
+ andWhen: async function (renderer, whenCB) {
31
+ await act(() => whenCB(renderer));
32
+ return renderer;
33
+ },
34
+ };
@@ -0,0 +1,74 @@
1
+ import fs from "fs";
2
+ import path from "path";
3
+ export default (platform, entryPoints) => {
4
+ return {
5
+ name: "metafileWriter",
6
+ setup(build) {
7
+ build.onEnd((result) => {
8
+ if (result.errors.length === 0) {
9
+ entryPoints.forEach((entryPoint) => {
10
+ const filePath = path.join("./docs/", platform, entryPoint.split(".").slice(0, -1).join("."), `inputFiles.json`);
11
+ const promptPath = path.join("./docs/", platform, entryPoint.split(".").slice(0, -1).join("."), `prompt.txt`);
12
+ const testPaths = path.join("./docs/", platform, entryPoint.split(".").slice(0, -1).join("."), `tests.json`);
13
+ const dirName = path.dirname(filePath);
14
+ if (!fs.existsSync(dirName)) {
15
+ fs.mkdirSync(dirName, { recursive: true });
16
+ }
17
+ const j = Object.keys(Object.keys(result.metafile.outputs)
18
+ .filter((s) => {
19
+ if (!result.metafile.outputs[s].entryPoint) {
20
+ return false;
21
+ }
22
+ return (path.resolve(result.metafile.outputs[s].entryPoint) ===
23
+ path.resolve(entryPoint));
24
+ })
25
+ .reduce((mm, el) => {
26
+ mm.push(result.metafile.outputs[el].inputs);
27
+ return mm;
28
+ }, [])[0]).filter((f) => {
29
+ const regex = /^src\/.*/g;
30
+ const matches = f.match(regex);
31
+ const passes = (matches === null || matches === void 0 ? void 0 : matches.length) === 1;
32
+ return passes;
33
+ });
34
+ // .filter((f: string) => {
35
+ // const regex = /.*\.test\..*/g;
36
+ // const matches = f.match(regex);
37
+ // const passes = matches?.length === 1;
38
+ // return !passes;
39
+ // })
40
+ const jsonContent = JSON.stringify(j);
41
+ fs.writeFileSync(filePath, jsonContent);
42
+ fs.writeFileSync(promptPath, `
43
+ ${j
44
+ .map((x) => {
45
+ return `/add ${x}`;
46
+ })
47
+ .join("\n")}
48
+ /read ${testPaths}
49
+
50
+ /code fix the failing tests described in ${filePath}.
51
+ `);
52
+ // fs.writeFileSync(
53
+ // promptPath,
54
+ // `
55
+ // from aider.coders import Coder
56
+ // from aider.models import Model
57
+ // import os
58
+ // model = Model("deepseek")
59
+ // coder = Coder.create(main_model=model)
60
+ // coder.run("/read-only", "${testPaths}")
61
+ // ${j
62
+ // .map((x) => {
63
+ // return `coder.run("/add", "${x}")`;
64
+ // })
65
+ // .join("\n")}
66
+ // coder.run("fix the failing tests described in ${filePath}.")
67
+ // `
68
+ // );
69
+ });
70
+ }
71
+ });
72
+ },
73
+ };
74
+ };
@@ -1,7 +1,9 @@
1
1
  import baseEsBuildConfig from "./index.js";
2
- import inputFilesPlugin from "./inputFilesPlugin";
2
+ import inputFilesPlugin from "./inputFilesPlugin.js";
3
3
  export default (config, entryPoints) => {
4
- return Object.assign(Object.assign({}, baseEsBuildConfig(config)), { splitting: true, outdir: config.outdir + "/node", inject: [`./node_modules/testeranto/dist/cjs-shim.js`], metafile: true, supported: {
4
+ return Object.assign(Object.assign({}, baseEsBuildConfig(config)), { splitting: true, outdir: config.outdir + "/node",
5
+ // inject: [`./node_modules/testeranto/dist/cjs-shim.js`],
6
+ metafile: true, supported: {
5
7
  "dynamic-import": true,
6
8
  }, define: {
7
9
  "process.env.FLUENTFFMPEG_COV": "0",
@@ -11,10 +11,10 @@ export default (config, entryPoints) => {
11
11
  outdir: config.outdir + "/web", alias: {
12
12
  react: path.resolve("./node_modules/react"),
13
13
  }, metafile: true, external: [
14
- "testeranto.json",
15
- "features.test.ts",
14
+ // "testeranto.json",
15
+ // "features.test.ts",
16
16
  // "url",
17
- "react",
17
+ // "react",
18
18
  "path",
19
19
  "fs",
20
20
  "stream",
@@ -34,7 +34,7 @@ export default (config, entryPoints) => {
34
34
  "dns",
35
35
  ], platform: "browser", entryPoints: [...entryPoints], plugins: [
36
36
  ...(config.webPlugins || []),
37
- inputFilesPlugin("node", entryPoints),
37
+ inputFilesPlugin("web", entryPoints),
38
38
  {
39
39
  name: "rebuild-notify",
40
40
  setup(build) {
@@ -7,10 +7,22 @@ export class BaseSuite {
7
7
  this.fails = [];
8
8
  }
9
9
  toObj() {
10
+ const givens = Object.keys(this.givens).map((k) => this.givens[k].toObj());
11
+ const features = Object.keys(this.givens)
12
+ .map((k) => this.givens[k].features)
13
+ .flat()
14
+ .filter((value, index, array) => {
15
+ return array.indexOf(value) === index;
16
+ })
17
+ .reduce((mm, lm) => {
18
+ mm[lm] = lm;
19
+ return mm;
20
+ }, {});
10
21
  return {
11
22
  name: this.name,
12
- givens: Object.keys(this.givens).map((k) => this.givens[k].toObj()),
23
+ givens,
13
24
  fails: this.fails,
25
+ features,
14
26
  };
15
27
  }
16
28
  setup(s, artifactory, tr, pm) {
@@ -226,6 +238,7 @@ export class BaseGiven {
226
238
  },
227
239
  });
228
240
  this.store = await this.givenThat(subject, testResourceConfiguration, givenArtifactory, this.givenCB, beforeEachProxy);
241
+ // console.log("mark6", this.store);
229
242
  for (const [whenNdx, whenStep] of this.whens.entries()) {
230
243
  await whenStep.test(this.store, testResourceConfiguration, tLog, pm, `suite-${suiteNdx}/given-${key}/when/${whenNdx}`);
231
244
  }
@@ -235,9 +248,10 @@ export class BaseGiven {
235
248
  }
236
249
  }
237
250
  catch (e) {
251
+ console.error(e);
238
252
  this.error = e;
239
- tLog(e);
240
- tLog("\u0007"); // bell
253
+ tLog(e.stack);
254
+ // tLog("\u0007"); // bell
241
255
  // throw e;
242
256
  }
243
257
  finally {
@@ -323,6 +337,7 @@ export class BaseGiven {
323
337
  return Reflect.get(...arguments);
324
338
  },
325
339
  });
340
+ // console.log("mark5", this.store, key);
326
341
  await this.afterEach(this.store, key, givenArtifactory, afterEachProxy);
327
342
  }
328
343
  catch (e) {
@@ -347,6 +362,14 @@ export class BaseWhen {
347
362
  tLog(" When:", this.name);
348
363
  const name = this.name;
349
364
  const andWhenProxy = new Proxy(pm, {
365
+ // set(obj, prop, value) {
366
+ // return Reflect.set(...arguments);
367
+ // // if (prop === "eyeCount" && value % 2 !== 0) {
368
+ // // console.log("Monsters must have an even number of eyes");
369
+ // // } else {
370
+ // // return Reflect.set(...arguments);
371
+ // // }
372
+ // },
350
373
  get(target, prop, receiver) {
351
374
  if (prop === "writeFileSync") {
352
375
  return (fp, contents) =>
@@ -363,22 +386,12 @@ export class BaseWhen {
363
386
  return pages.map((page) => {
364
387
  return new Proxy(page, {
365
388
  get(pTarget, pProp, pReciever) {
389
+ // console.log("mark get", pTarget, pProp, pReciever);
366
390
  if (pProp === "screenshot") {
367
391
  return async (x) => {
368
- // console.log(
369
- // "custom-screenshot-MARK-afterEachProxy",
370
- // window["custom-screenshot"].toString()
371
- // );
372
392
  return pm.customScreenShot(Object.assign(Object.assign({}, x), { path: `${testResourceConfiguration.fs}/${key}/afterEach` +
373
393
  "/" +
374
394
  x.path }), page);
375
- // return await pTarget[pProp]({
376
- // ...x,
377
- // path:
378
- // `${testResourceConfiguration.fs}/suite-${suiteNdx}/given-${key}/afterEach` +
379
- // "/" +
380
- // x.path,
381
- // });
382
395
  };
383
396
  }
384
397
  else if (pProp === "mainFrame") {
@@ -396,6 +409,33 @@ export class BaseWhen {
396
409
  return pTarget[pProp].bind(pTarget);
397
410
  // return target[pProp];
398
411
  }
412
+ else if (pProp === "click") {
413
+ // console.log("mark12", arguments);
414
+ // return Reflect.get(target, prop, receiver);
415
+ // return pTarget[pProp].bind(pTarget);
416
+ // return target[pProp];
417
+ return (selector, options) => {
418
+ // console.log("mark13", selector, options);
419
+ // debugger;
420
+ pTarget[pProp](selector, options);
421
+ };
422
+ }
423
+ else if (pProp === "$") {
424
+ return Reflect.get(...arguments);
425
+ // return Reflect.get(target, prop, receiver);
426
+ // return pTarget[pProp].bind(pTarget);
427
+ // return target[pProp];
428
+ // return pTarget[pProp].bind(pTarget);
429
+ // return async (s) => {
430
+ // console.log("mark17", s);
431
+ // console.log("pTarget", pTarget);
432
+ // console.log("pProp", pProp);
433
+ // console.log("pReciever", pReciever);
434
+ // // return "XXX";
435
+ // // debugger;
436
+ // return await pTarget[pProp](s);
437
+ // };
438
+ }
399
439
  else {
400
440
  return Reflect.get(...arguments);
401
441
  }
@@ -415,13 +455,21 @@ export class BaseWhen {
415
455
  return Reflect.get(...arguments);
416
456
  },
417
457
  });
418
- try {
419
- return await this.andWhen(store, this.whenCB, testResourceConfiguration, andWhenProxy);
420
- }
421
- catch (e) {
458
+ return this.andWhen(store, this.whenCB, testResourceConfiguration, andWhenProxy).catch((e) => {
422
459
  this.error = true;
423
- throw e;
424
- }
460
+ // throw e;
461
+ });
462
+ // try {
463
+ // return await this.andWhen(
464
+ // store,
465
+ // this.whenCB,
466
+ // testResourceConfiguration,
467
+ // andWhenProxy
468
+ // );
469
+ // } catch (e) {
470
+ // this.error = true;
471
+ // throw e;
472
+ // }
425
473
  }
426
474
  }
427
475
  export class BaseThen {
@@ -501,10 +549,18 @@ export class BaseThen {
501
549
  return Reflect.get(...arguments);
502
550
  },
503
551
  });
504
- const x = await this.butThen(store, this.thenCB, testResourceConfiguration, butThenProxy
505
- // pm
506
- );
507
- return x;
552
+ // const x = await this.butThen(
553
+ // store,
554
+ // this.thenCB,
555
+ // testResourceConfiguration,
556
+ // butThenProxy
557
+ // );
558
+ // return x;
559
+ return this.butThen(store, this.thenCB, testResourceConfiguration, butThenProxy).catch((e) => {
560
+ console.log("mar123");
561
+ this.error = true;
562
+ throw e;
563
+ });
508
564
  }
509
565
  catch (e) {
510
566
  console.log("test failed", e);
@@ -13,12 +13,15 @@ export class BaseBuilder {
13
13
  this.specs = testSpecification(this.Suites(), this.Given(), this.When(), this.Then(), this.Check());
14
14
  this.testJobs = this.specs.map((suite) => {
15
15
  const suiteRunner = (suite) => async (puppetMaster, tLog) => {
16
- await puppetMaster.startPuppeteer({
16
+ const puppeteerBrowser = await puppetMaster.startPuppeteer({
17
17
  browserWSEndpoint: puppetMaster.testResourceConfiguration.browserWSEndpoint,
18
18
  }, puppetMaster.testResourceConfiguration.fs);
19
- return await suite.run(input, puppetMaster.testResourceConfiguration, (fPath, value) => puppetMaster.testArtiFactoryfileWriter(tLog, (p) => {
19
+ const x = await suite.run(input, puppetMaster.testResourceConfiguration, (fPath, value) => puppetMaster.testArtiFactoryfileWriter(tLog, (p) => {
20
20
  this.artifacts.push(p);
21
21
  })(puppetMaster.testResourceConfiguration.fs + "/" + fPath, value), tLog, puppetMaster);
22
+ // await puppetMaster.browser.disconnect();
23
+ // puppeteerBrowser.close();
24
+ return x;
22
25
  };
23
26
  const runner = suiteRunner(suite);
24
27
  return {
@@ -28,7 +31,7 @@ export class BaseBuilder {
28
31
  },
29
32
  runner,
30
33
  receiveTestResourceConfig: async function (puppetMaster) {
31
- await puppetMaster.mkdirSync();
34
+ // await puppetMaster.mkdirSync();
32
35
  const logFilePath = "log.txt";
33
36
  const access = await puppetMaster.createWriteStream(logFilePath);
34
37
  const tLog = (...l) => {
@@ -43,6 +46,14 @@ export class BaseBuilder {
43
46
  return suiteDone.givens[k].error;
44
47
  }).length;
45
48
  puppetMaster.writeFileSync(`exitcode`, numberOfFailures.toString());
49
+ // if (numberOfFailures > 0) {
50
+ // puppetMaster.writeFileSync(
51
+ // `prompt`,
52
+ // `
53
+ // aider --message "make a script that prints hello" hello.js
54
+ // `
55
+ // );
56
+ // }
46
57
  puppetMaster.writeFileSync(`tests.json`, JSON.stringify(this.toObj(), null, 2));
47
58
  console.log(`exiting gracefully with ${numberOfFailures} failures.`);
48
59
  return {
@@ -46,11 +46,55 @@ export default class Testeranto extends ClassBuilder {
46
46
  }
47
47
  }, class When extends BaseWhen {
48
48
  async andWhen(store, whenCB, testResource, pm) {
49
- return await fullTestInterface.andWhen(store, whenCB, testResource, pm);
49
+ try {
50
+ return await fullTestInterface.andWhen(store, whenCB, testResource, pm);
51
+ }
52
+ catch (e) {
53
+ throw e;
54
+ }
55
+ // return fullTestInterface
56
+ // .andWhen(store, whenCB, testResource, pm)
57
+ // .catch((e) => {
58
+ // throw e;
59
+ // });
60
+ // return new Promise((res, rej) => {
61
+ // fullTestInterface.andWhen(store, whenCB, testResource, pm);
62
+ // });
63
+ // return await fullTestInterface.andWhen(
64
+ // store,
65
+ // whenCB,
66
+ // testResource,
67
+ // pm
68
+ // );
50
69
  }
51
70
  }, class Then extends BaseThen {
52
- async butThen(store, thenCB, testResourceConfiguration, pm) {
53
- return await fullTestInterface.butThen(store, thenCB, testResourceConfiguration, pm);
71
+ async butThen(store, thenCB, testResource, pm) {
72
+ return fullTestInterface
73
+ .butThen(store, thenCB, testResource, pm)
74
+ .then((v) => {
75
+ return v;
76
+ }, (e) => {
77
+ console.log(" ERROR ", e);
78
+ throw e;
79
+ });
80
+ // try {
81
+ // console.log("mark 4");
82
+ // return await fullTestInterface.butThen(
83
+ // store,
84
+ // thenCB,
85
+ // testResource,
86
+ // pm
87
+ // );
88
+ // } catch (e) {
89
+ // console.log("mar123");
90
+ // throw e;
91
+ // }
92
+ // return await fullTestInterface.butThen(
93
+ // store,
94
+ // thenCB,
95
+ // testResourceConfiguration,
96
+ // pm
97
+ // );
54
98
  }
55
99
  }, class Check extends BaseCheck {
56
100
  constructor(name, features, checkCallback, whens, thens, initialValues) {
@@ -0,0 +1,13 @@
1
+ export default {
2
+ botEmail: "adamwong246@gmail.com",
3
+ taskman: "adamwong246/kokomobay-taskman",
4
+ outdir: "docs",
5
+ tests: [["./src/LoginButton.test.tsx", "web", { ports: 0 }, []]],
6
+ debugger: true,
7
+ clearScreen: false,
8
+ devMode: true,
9
+ minify: false,
10
+ outbase: ".",
11
+ ports: [],
12
+ externals: [],
13
+ };