testeranto 0.140.2 → 0.146.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 (204) hide show
  1. package/.aider.chat.history.md +11006 -0
  2. package/.aider.input.history +441 -0
  3. package/.aider.tags.cache.v3/06/1a/1ec9fd1f595d4b36094caef45894.val +0 -0
  4. package/.aider.tags.cache.v3/0f/f6/f42b5108253d75de3cb6286df7f6.val +0 -0
  5. package/.aider.tags.cache.v3/{ad/3c/10f2ab1397f6d544e613d2a6acaf.val → 3d/81/8b6f0e9b98ec2952cdb8968ac386.val} +0 -0
  6. package/.aider.tags.cache.v3/cache.db +0 -0
  7. package/.aider.tags.cache.v3/{a7/97/6d37fce350ad2d588f36729db0cd.val → d6/7d/1820c2d4b9330eab7017da4515e7.val} +0 -0
  8. package/README.md +15 -16
  9. package/dist/tsconfig.tsbuildinfo +1 -1
  10. package/docs/aiderTest.sh +1 -0
  11. package/docs/index.md +45 -33
  12. package/docs/testing.ai.txt +98 -0
  13. package/docs/testing.prompt.txt +8 -0
  14. package/package.json +3 -3
  15. package/src/Node.ts +17 -13
  16. package/src/PM/PM_WithEslintAndTsc.ts +83 -67
  17. package/src/PM/main.ts +182 -92
  18. package/src/PM/node.ts +1 -15
  19. package/src/PM/nodeSidecar.ts +0 -1
  20. package/src/Pure.test.ts +299 -0
  21. package/src/Pure.ts +20 -2
  22. package/src/Types.ts +5 -5
  23. package/src/Web.ts +1 -1
  24. package/src/build.ts +0 -1
  25. package/src/esbuildConfigs/consoleDetectorPlugin.ts +28 -14
  26. package/src/esbuildConfigs/nativeImportDetectorPlugin.ts +26 -0
  27. package/src/esbuildConfigs/pure.ts +3 -1
  28. package/src/esbuildConfigs/rebuildPlugin.ts +1 -4
  29. package/src/lib/BaseSuite.test/node.test.ts +12 -0
  30. package/src/lib/BaseSuite.test/pure.test.ts +12 -0
  31. package/src/lib/{BaseSuite.test.ts → BaseSuite.test/test.ts} +36 -27
  32. package/src/lib/BaseSuite.test/web.test.ts +12 -0
  33. package/src/lib/BaseSuite.ts +17 -15
  34. package/src/lib/abstractBase.test/MockGiven.ts +31 -0
  35. package/src/lib/abstractBase.test/MockThen.ts +20 -0
  36. package/src/lib/abstractBase.test/MockWhen.ts +17 -0
  37. package/src/lib/abstractBase.test/implementation.ts +51 -0
  38. package/src/lib/abstractBase.test/index.ts +19 -0
  39. package/src/lib/abstractBase.test/interface.ts +12 -0
  40. package/src/lib/abstractBase.test/specification.ts +49 -0
  41. package/src/lib/abstractBase.test/types.ts +19 -0
  42. package/src/lib/abstractBase.ts +0 -2
  43. package/src/lib/baseBuilder.test/TestBaseBuilder.ts +83 -0
  44. package/src/lib/baseBuilder.test/baseBuilder.test.implementation.ts +134 -0
  45. package/src/lib/baseBuilder.test/baseBuilder.test.interface.ts +18 -0
  46. package/src/lib/baseBuilder.test/baseBuilder.test.node.ts +14 -0
  47. package/src/lib/baseBuilder.test/baseBuilder.test.pure.ts +14 -0
  48. package/src/lib/baseBuilder.test/baseBuilder.test.specification.ts +35 -0
  49. package/src/lib/baseBuilder.test/baseBuilder.test.types.ts +36 -0
  50. package/src/lib/baseBuilder.test/baseBuilder.test.web.ts +14 -0
  51. package/src/lib/basebuilder.ts +2 -1
  52. package/src/lib/classBuilder.test/TestClassBuilder.ts +88 -0
  53. package/src/lib/classBuilder.test/classBuilder.test.implementation.ts +204 -0
  54. package/src/lib/classBuilder.test/classBuilder.test.interface.ts +18 -0
  55. package/src/lib/classBuilder.test/classBuilder.test.specification.ts +113 -0
  56. package/src/lib/classBuilder.test/classBuilder.test.ts +14 -0
  57. package/src/lib/classBuilder.test/classBuilder.test.types.ts +84 -0
  58. package/src/lib/core.test/MockCore.ts +49 -0
  59. package/src/lib/core.test/core.test.implementation.ts +129 -0
  60. package/src/lib/core.test/core.test.interface.ts +18 -0
  61. package/src/lib/core.test/core.test.specification.ts +99 -0
  62. package/src/lib/core.test/core.test.ts +15 -0
  63. package/src/lib/core.test/core.test.types.ts +68 -0
  64. package/src/lib/core.ts +1 -11
  65. package/src/lib/pmProxy.test/implementation.ts +104 -0
  66. package/src/lib/pmProxy.test/index.ts +19 -0
  67. package/src/lib/pmProxy.test/interface.ts +46 -0
  68. package/src/lib/pmProxy.test/mockPM.ts +38 -0
  69. package/src/lib/pmProxy.test/mockPMBase.ts +136 -0
  70. package/src/lib/pmProxy.test/specification.ts +123 -0
  71. package/src/lib/pmProxy.test/types.ts +45 -0
  72. package/src/lib/pmProxy.ts +40 -193
  73. package/src/run.ts +7 -7
  74. package/testeranto/bundles/node/allTests/chunk-NQBTLMSG.mjs +254 -0
  75. package/testeranto/bundles/node/allTests/chunk-RF3LIUSG.mjs +765 -0
  76. package/testeranto/bundles/node/allTests/chunk-YZWFKYY3.mjs +171 -0
  77. package/testeranto/bundles/node/allTests/metafile.json +628 -3567
  78. package/testeranto/bundles/node/allTests/src/lib/BaseSuite.test/node.test.mjs +325 -0
  79. package/testeranto/bundles/node/allTests/src/lib/baseBuilder.test/baseBuilder.test.node.mjs +226 -0
  80. package/testeranto/bundles/node/allTests/src/lib/classBuilder.test/classBuilder.test.mjs +408 -0
  81. package/testeranto/bundles/node/allTests/src/lib/core.test/core.test.mjs +279 -0
  82. package/testeranto/bundles/node/allTests/src/lib/pmProxy.test/index.mjs +4587 -0
  83. package/testeranto/bundles/{node/allTests/chunk-4PJCC2XT.mjs → pure/allTests/chunk-W22WOQNK.mjs} +208 -326
  84. package/testeranto/bundles/pure/allTests/metafile.json +732 -3
  85. package/testeranto/bundles/pure/allTests/src/Pure.test.mjs +369 -0
  86. package/testeranto/bundles/{node/allTests/src/lib/BaseSuite.test.mjs → pure/allTests/src/lib/BaseSuite.test/pure.test.mjs} +26 -8
  87. package/testeranto/bundles/pure/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure.mjs +224 -0
  88. package/testeranto/bundles/web/allTests/chunk-FIZ3WLUB.mjs +943 -0
  89. package/testeranto/bundles/web/allTests/metafile.json +1133 -2
  90. package/testeranto/bundles/web/allTests/src/lib/BaseSuite.test/web.test.html +19 -0
  91. package/testeranto/bundles/web/allTests/src/lib/BaseSuite.test/web.test.mjs +322 -0
  92. package/testeranto/bundles/web/allTests/src/lib/baseBuilder.test/baseBuilder.test.web.html +19 -0
  93. package/testeranto/bundles/web/allTests/src/lib/baseBuilder.test/baseBuilder.test.web.mjs +10964 -0
  94. package/testeranto/index.html +1 -1
  95. package/testeranto/reports/allTests/config.json +50 -11
  96. package/testeranto/reports/allTests/index.html +1 -1
  97. package/testeranto/reports/allTests/src/Pure.test/pure/lint_errors.json +1539 -0
  98. package/testeranto/reports/allTests/src/Pure.test/pure/logs.txt +11 -0
  99. package/testeranto/reports/allTests/src/Pure.test/pure/message +1 -0
  100. package/testeranto/reports/allTests/src/Pure.test/pure/prompt.txt +8 -0
  101. package/testeranto/reports/allTests/src/{PM/__tests__/pureSidecar.testeranto/node → Pure.test/pure}/type_errors.txt +18 -14
  102. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/lint_errors.json +620 -0
  103. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/logs.txt +12 -0
  104. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/message +1 -0
  105. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/prompt.txt +8 -0
  106. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/type_errors.txt +94 -0
  107. package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/index.html +21 -0
  108. package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/lint_errors.json +620 -0
  109. package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/logs.txt +11 -0
  110. package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/message +1 -0
  111. package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/prompt.txt +8 -0
  112. package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/type_errors.txt +104 -0
  113. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/dev.html +21 -0
  114. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/index.html +21 -0
  115. package/testeranto/reports/allTests/src/lib/BaseSuite.test/{node → web.test/web}/lint_errors.json +69 -57
  116. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/logs.txt +10 -0
  117. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/message +1 -0
  118. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/prompt.txt +8 -0
  119. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/type_errors.txt +95 -0
  120. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/dev.html +21 -0
  121. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/index.html +21 -0
  122. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/lint_errors.json +966 -0
  123. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/message +1 -0
  124. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/prompt.txt +11 -0
  125. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/type_errors.txt +57 -0
  126. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/bdd_errors.txt +1 -0
  127. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/dev.html +21 -0
  128. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/index.html +21 -0
  129. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/lint_errors.json +966 -0
  130. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/log.txt +0 -0
  131. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/message +1 -0
  132. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/prompt.txt +11 -0
  133. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/tests.json +57 -0
  134. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/type_errors.txt +57 -0
  135. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/bdd_errors.txt +1 -0
  136. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/dev.html +21 -0
  137. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/index.html +21 -0
  138. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/lint_errors.json +966 -0
  139. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/log.txt +0 -0
  140. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/logs.txt +0 -0
  141. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/message +1 -0
  142. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/prompt.txt +11 -0
  143. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/tests.json +57 -0
  144. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/type_errors.txt +48 -0
  145. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/dev.html +21 -0
  146. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/index.html +21 -0
  147. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/lint_errors.json +791 -0
  148. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/logs.txt +12 -0
  149. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/message +1 -0
  150. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/prompt.txt +11 -0
  151. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/type_errors.txt +55 -0
  152. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/dev.html +21 -0
  153. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/index.html +21 -0
  154. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/lint_errors.json +416 -0
  155. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/logs.txt +17 -0
  156. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/message +1 -0
  157. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/prompt.txt +11 -0
  158. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/type_errors.txt +65 -0
  159. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/dev.html +21 -0
  160. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/index.html +21 -0
  161. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/lint_errors.json +1724 -0
  162. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/log.txt +0 -0
  163. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/logs.txt +30 -0
  164. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/message +1 -0
  165. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/prompt.txt +11 -0
  166. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/type_errors.txt +64 -0
  167. package/testeranto/reports/allTests/summary.json +59 -24
  168. package/testeranto.config.ts +37 -12
  169. package/tsc.log +273 -27
  170. package/testeranto/bundles/node/allTests/chunk-PG6KUKNP.mjs +0 -44
  171. package/testeranto/bundles/node/allTests/src/PM/__tests__/nodeSidecar.testeranto.mjs +0 -187
  172. package/testeranto/bundles/node/allTests/src/PM/__tests__/pureSidecar.testeranto.mjs +0 -156
  173. package/testeranto/bundles/node/allTests/src/PM/__tests__/webSidecar.testeranto.mjs +0 -156
  174. package/testeranto/bundles/node/allTests/src/mothership/test.mjs +0 -24411
  175. package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/index.html +0 -21
  176. package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/lint_errors.json +0 -80
  177. package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/message +0 -1
  178. package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/prompt.txt +0 -8
  179. package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/type_errors.txt +0 -28
  180. package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/index.html +0 -21
  181. package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/lint_errors.json +0 -80
  182. package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/message +0 -1
  183. package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/prompt.txt +0 -8
  184. package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/index.html +0 -21
  185. package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/lint_errors.json +0 -80
  186. package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/message +0 -1
  187. package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/prompt.txt +0 -8
  188. package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/type_errors.txt +0 -32
  189. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/console_log.txt +0 -35
  190. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/index.html +0 -21
  191. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/message +0 -1
  192. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/prompt.txt +0 -7
  193. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/type_errors.txt +0 -68
  194. package/testeranto/reports/allTests/src/mothership/test/node/index.html +0 -21
  195. package/testeranto/reports/allTests/src/mothership/test/node/lint_errors.json +0 -1
  196. package/testeranto/reports/allTests/src/mothership/test/node/message +0 -1
  197. package/testeranto/reports/allTests/src/mothership/test/node/prompt.txt +0 -8
  198. package/testeranto/reports/allTests/src/mothership/test/node/type_errors.txt +0 -24
  199. /package/testeranto/reports/allTests/src/{PM/__tests__/nodeSidecar.testeranto/node → Pure.test/pure}/dev.html +0 -0
  200. /package/testeranto/reports/allTests/src/{PM/__tests__/pureSidecar.testeranto/node/dev.html → Pure.test/pure/index.html} +0 -0
  201. /package/testeranto/reports/allTests/src/{PM/__tests__/webSidecar.testeranto → lib/BaseSuite.test/node.test}/node/dev.html +0 -0
  202. /package/testeranto/reports/allTests/src/lib/BaseSuite.test/{node/dev.html → node.test/node/index.html} +0 -0
  203. /package/testeranto/reports/allTests/src/{mothership/test/node → lib/BaseSuite.test/pure.test/pure}/dev.html +0 -0
  204. /package/testeranto/reports/allTests/src/lib/{BaseSuite.test/node/log.txt → baseBuilder.test/baseBuilder.test.node/node/logs.txt} +0 -0
@@ -1,39 +1,104 @@
1
1
  import { createRequire } from 'module';const require = createRequire(import.meta.url);
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
9
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
10
- }) : x)(function(x) {
11
- if (typeof require !== "undefined")
12
- return require.apply(this, arguments);
13
- throw new Error('Dynamic require of "' + x + '" is not supported');
14
- });
15
- var __commonJS = (cb, mod) => function __require2() {
16
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
17
- };
18
- var __copyProps = (to, from, except, desc) => {
19
- if (from && typeof from === "object" || typeof from === "function") {
20
- for (let key of __getOwnPropNames(from))
21
- if (!__hasOwnProp.call(to, key) && key !== except)
22
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
2
+
3
+ // src/lib/basebuilder.ts
4
+ var BaseBuilder = class {
5
+ constructor(input, suitesOverrides, givenOverides, whenOverides, thenOverides, checkOverides, testResourceRequirement, testSpecification) {
6
+ this.artifacts = [];
7
+ this.artifacts = [];
8
+ this.testResourceRequirement = testResourceRequirement;
9
+ this.suitesOverrides = suitesOverrides;
10
+ this.givenOverides = givenOverides;
11
+ this.whenOverides = whenOverides;
12
+ this.thenOverides = thenOverides;
13
+ this.checkOverides = checkOverides;
14
+ this.testSpecification = testSpecification;
15
+ this.specs = testSpecification(
16
+ this.Suites(),
17
+ this.Given(),
18
+ this.When(),
19
+ this.Then(),
20
+ this.Check()
21
+ );
22
+ this.testJobs = this.specs.map((suite) => {
23
+ const suiteRunner = (suite2) => async (puppetMaster, tLog) => {
24
+ const x = await suite2.run(
25
+ input,
26
+ puppetMaster.testResourceConfiguration,
27
+ (fPath, value) => puppetMaster.testArtiFactoryfileWriter(
28
+ tLog,
29
+ (p) => {
30
+ this.artifacts.push(p);
31
+ }
32
+ )(puppetMaster.testResourceConfiguration.fs + "/" + fPath, value),
33
+ tLog,
34
+ puppetMaster
35
+ );
36
+ return x;
37
+ };
38
+ const runner = suiteRunner(suite);
39
+ return {
40
+ test: suite,
41
+ toObj: () => {
42
+ return suite.toObj();
43
+ },
44
+ runner,
45
+ receiveTestResourceConfig: async function(puppetMaster) {
46
+ const logFilePath = "log.txt";
47
+ const access = await puppetMaster.createWriteStream(
48
+ logFilePath
49
+ );
50
+ const tLog = async (...l) => {
51
+ };
52
+ const suiteDone = await runner(puppetMaster, tLog);
53
+ const logPromise = new Promise(async (res) => {
54
+ await puppetMaster.end(access);
55
+ res(true);
56
+ });
57
+ const fails = suiteDone.fails;
58
+ await puppetMaster.writeFileSync(`bdd_errors.txt`, fails.toString());
59
+ await puppetMaster.writeFileSync(
60
+ `tests.json`,
61
+ JSON.stringify(this.toObj(), null, 2)
62
+ );
63
+ return {
64
+ failed: fails > 0,
65
+ fails,
66
+ artifacts: this.artifacts || [],
67
+ logPromise,
68
+ features: suiteDone.features()
69
+ };
70
+ }
71
+ };
72
+ });
73
+ }
74
+ // testsJson() {
75
+ // puppetMaster.writeFileSync(
76
+ // `tests.json`,
77
+ // JSON.stringify({ features: suiteDone.features() }, null, 2)
78
+ // );
79
+ // }
80
+ Specs() {
81
+ return this.specs;
82
+ }
83
+ Suites() {
84
+ return this.suitesOverrides;
85
+ }
86
+ Given() {
87
+ return this.givenOverides;
88
+ }
89
+ When() {
90
+ return this.whenOverides;
91
+ }
92
+ Then() {
93
+ return this.thenOverides;
94
+ }
95
+ Check() {
96
+ return this.checkOverides;
23
97
  }
24
- return to;
25
98
  };
26
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
27
- // If the importer is in node compatibility mode or this is not an ESM
28
- // file that has been converted to a CommonJS file using a Babel-
29
- // compatible transform (i.e. "__esModule" has not been set), then set
30
- // "default" to the CommonJS "module.exports" for node compatibility.
31
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
32
- mod
33
- ));
34
99
 
35
100
  // src/lib/pmProxy.ts
36
- var prxy = function(pm, mappings) {
101
+ var baseProxy = function(pm, mappings) {
37
102
  return new Proxy(pm, {
38
103
  get: (target, prop, receiver) => {
39
104
  for (const mapping of mappings) {
@@ -47,7 +112,7 @@ var prxy = function(pm, mappings) {
47
112
  }
48
113
  });
49
114
  };
50
- var butThenProxy = (pm, filepath) => prxy(pm, [
115
+ var butThenProxy = (pm, filepath) => baseProxy(pm, [
51
116
  [
52
117
  "screencast",
53
118
  (opts, p) => [
@@ -74,7 +139,7 @@ var butThenProxy = (pm, filepath) => prxy(pm, [
74
139
  ]
75
140
  ]
76
141
  ]);
77
- var andWhenProxy = (pm, filepath) => prxy(pm, [
142
+ var andWhenProxy = (pm, filepath) => baseProxy(pm, [
78
143
  [
79
144
  "screencast",
80
145
  (opts, p) => [
@@ -98,7 +163,7 @@ var andWhenProxy = (pm, filepath) => prxy(pm, [
98
163
  ]
99
164
  ]
100
165
  ]);
101
- var afterEachProxy = (pm, suite, given) => prxy(pm, [
166
+ var afterEachProxy = (pm, suite, given) => baseProxy(pm, [
102
167
  [
103
168
  "screencast",
104
169
  (opts, p) => [
@@ -128,7 +193,7 @@ var afterEachProxy = (pm, suite, given) => prxy(pm, [
128
193
  ]
129
194
  ]
130
195
  ]);
131
- var beforeEachProxy = (pm, suite) => prxy(pm, [
196
+ var beforeEachProxy = (pm, suite) => baseProxy(pm, [
132
197
  [
133
198
  "screencast",
134
199
  (opts, p) => [
@@ -155,7 +220,7 @@ var beforeEachProxy = (pm, suite) => prxy(pm, [
155
220
  ],
156
221
  ["createWriteStream", (fp) => [`suite-${suite}/beforeEach/${fp}`]]
157
222
  ]);
158
- var beforeAllProxy = (pm, suite) => prxy(pm, [
223
+ var beforeAllProxy = (pm, suite) => baseProxy(pm, [
159
224
  [
160
225
  "writeFileSync",
161
226
  (fp, contents) => [`suite-${suite}/beforeAll/${fp}`, contents]
@@ -172,7 +237,7 @@ var beforeAllProxy = (pm, suite) => prxy(pm, [
172
237
  ],
173
238
  ["createWriteStream", (fp) => [`suite-${suite}/beforeAll/${fp}`]]
174
239
  ]);
175
- var afterAllProxy = (pm, suite) => prxy(pm, [
240
+ var afterAllProxy = (pm, suite) => baseProxy(pm, [
176
241
  ["createWriteStream", (fp) => [`suite-${suite}/afterAll/${fp}`]],
177
242
  [
178
243
  "writeFileSync",
@@ -251,7 +316,7 @@ var BaseSuite = class {
251
316
  ).catch((e) => {
252
317
  this.failed = true;
253
318
  this.fails = this.fails + 1;
254
- console.error("Given error:", e);
319
+ console.error("Given error 1:", e);
255
320
  throw e;
256
321
  });
257
322
  }
@@ -279,6 +344,37 @@ var BaseSuite = class {
279
344
  }
280
345
  };
281
346
 
347
+ // src/lib/index.ts
348
+ var BaseTestInterface = () => ({
349
+ beforeAll: async (s) => s,
350
+ beforeEach: async function(subject, initialValues, x, testResource, pm) {
351
+ return subject;
352
+ },
353
+ afterEach: async (s) => s,
354
+ afterAll: (store) => void 0,
355
+ butThen: async (store, thenCb) => {
356
+ return thenCb(store);
357
+ },
358
+ andWhen: async (store, whenCB, testResource, pm) => {
359
+ try {
360
+ await whenCB(store, testResource, pm);
361
+ } catch (error) {
362
+ console.error("Error in andWhen:", error);
363
+ throw error;
364
+ }
365
+ },
366
+ assertThis: (x) => x
367
+ });
368
+ var DefaultTestInterface = (p) => {
369
+ return {
370
+ ...BaseTestInterface,
371
+ ...p
372
+ };
373
+ };
374
+ var defaultTestResourceRequirement = {
375
+ ports: 0
376
+ };
377
+
282
378
  // src/lib/abstractBase.ts
283
379
  var BaseGiven = class {
284
380
  constructor(name, features, whens, thens, givenCB, initialValues) {
@@ -398,7 +494,6 @@ var BaseWhen = class {
398
494
  testResourceConfiguration,
399
495
  andWhenProxy(pm, filepath)
400
496
  ).catch((e) => {
401
- console.log("MARK9", e);
402
497
  this.error = e;
403
498
  throw e;
404
499
  });
@@ -430,7 +525,6 @@ var BaseThen = class {
430
525
  testResourceConfiguration,
431
526
  butThenProxy(pm, filepath)
432
527
  ).catch((e) => {
433
- console.log("test failed 3", e);
434
528
  this.error = e;
435
529
  throw e;
436
530
  });
@@ -476,134 +570,6 @@ var BaseCheck = class {
476
570
  }
477
571
  };
478
572
 
479
- // src/lib/index.ts
480
- var BaseTestInterface = () => ({
481
- beforeAll: async (s) => s,
482
- beforeEach: async function(subject, initialValues, x, testResource, pm) {
483
- return subject;
484
- },
485
- afterEach: async (s) => s,
486
- afterAll: (store) => void 0,
487
- butThen: async (store, thenCb) => {
488
- return thenCb(store);
489
- },
490
- andWhen: async (store, whenCB, testResource, pm) => {
491
- try {
492
- await whenCB(store, testResource, pm);
493
- } catch (error) {
494
- console.error("Error in andWhen:", error);
495
- throw error;
496
- }
497
- },
498
- assertThis: (x) => x
499
- });
500
- var DefaultTestInterface = (p) => {
501
- return {
502
- ...BaseTestInterface,
503
- ...p
504
- };
505
- };
506
- var defaultTestResourceRequirement = {
507
- ports: 0
508
- };
509
-
510
- // src/lib/basebuilder.ts
511
- var BaseBuilder = class {
512
- constructor(input, suitesOverrides, givenOverides, whenOverides, thenOverides, checkOverides, testResourceRequirement, testSpecification) {
513
- this.artifacts = [];
514
- this.artifacts = [];
515
- this.testResourceRequirement = testResourceRequirement;
516
- this.suitesOverrides = suitesOverrides;
517
- this.givenOverides = givenOverides;
518
- this.whenOverides = whenOverides;
519
- this.thenOverides = thenOverides;
520
- this.checkOverides = checkOverides;
521
- this.testSpecification = testSpecification;
522
- this.specs = testSpecification(
523
- this.Suites(),
524
- this.Given(),
525
- this.When(),
526
- this.Then(),
527
- this.Check()
528
- );
529
- this.testJobs = this.specs.map((suite) => {
530
- const suiteRunner = (suite2) => async (puppetMaster, tLog) => {
531
- const x = await suite2.run(
532
- input,
533
- puppetMaster.testResourceConfiguration,
534
- (fPath, value) => puppetMaster.testArtiFactoryfileWriter(
535
- tLog,
536
- (p) => {
537
- this.artifacts.push(p);
538
- }
539
- )(puppetMaster.testResourceConfiguration.fs + "/" + fPath, value),
540
- tLog,
541
- puppetMaster
542
- );
543
- return x;
544
- };
545
- const runner = suiteRunner(suite);
546
- return {
547
- test: suite,
548
- toObj: () => {
549
- return suite.toObj();
550
- },
551
- runner,
552
- receiveTestResourceConfig: async function(puppetMaster) {
553
- const logFilePath = "log.txt";
554
- const access = await puppetMaster.createWriteStream(
555
- logFilePath
556
- );
557
- const tLog = async (...l) => {
558
- };
559
- const suiteDone = await runner(puppetMaster, tLog);
560
- const logPromise = new Promise(async (res) => {
561
- await puppetMaster.end(access);
562
- res(true);
563
- });
564
- const fails = suiteDone.fails;
565
- await puppetMaster.writeFileSync(`bdd_errors.txt`, fails.toString());
566
- await puppetMaster.writeFileSync(
567
- `tests.json`,
568
- JSON.stringify(this.toObj(), null, 2)
569
- );
570
- return {
571
- failed: fails > 0,
572
- fails,
573
- artifacts: this.artifacts || [],
574
- logPromise,
575
- features: suiteDone.features()
576
- };
577
- }
578
- };
579
- });
580
- }
581
- // testsJson() {
582
- // puppetMaster.writeFileSync(
583
- // `tests.json`,
584
- // JSON.stringify({ features: suiteDone.features() }, null, 2)
585
- // );
586
- // }
587
- Specs() {
588
- return this.specs;
589
- }
590
- Suites() {
591
- return this.suitesOverrides;
592
- }
593
- Given() {
594
- return this.givenOverides;
595
- }
596
- When() {
597
- return this.whenOverides;
598
- }
599
- Then() {
600
- return this.thenOverides;
601
- }
602
- Check() {
603
- return this.checkOverides;
604
- }
605
- };
606
-
607
573
  // src/lib/classBuilder.ts
608
574
  var ClassBuilder = class extends BaseBuilder {
609
575
  constructor(testImplementation, testSpecification, input, suiteKlasser, givenKlasser, whenKlasser, thenKlasser, checkKlasser, testResourceRequirement) {
@@ -691,7 +657,7 @@ var ClassBuilder = class extends BaseBuilder {
691
657
  };
692
658
 
693
659
  // src/lib/core.ts
694
- var Testeranto = class extends ClassBuilder {
660
+ var TesterantoCore = class extends ClassBuilder {
695
661
  constructor(input, testSpecification, testImplementation, testResourceRequirement = defaultTestResourceRequirement, testInterface, uberCatcher) {
696
662
  const fullTestInterface = DefaultTestInterface(testInterface);
697
663
  super(
@@ -779,110 +745,75 @@ var Testeranto = class extends ClassBuilder {
779
745
  }
780
746
  };
781
747
 
782
- // src/PM/node.ts
783
- import net from "net";
784
- import fs from "fs";
785
- import path from "path";
786
-
787
748
  // src/PM/index.ts
788
749
  var PM = class {
789
750
  };
790
751
 
791
- // src/PM/node.ts
792
- var fPaths = [];
793
- var PM_Node = class extends PM {
794
- constructor(t, ipcFile) {
752
+ // src/PM/pure.ts
753
+ var PM_Pure = class extends PM {
754
+ constructor(t) {
795
755
  super();
756
+ this.server = {};
796
757
  this.testResourceConfiguration = t;
797
- this.client = net.createConnection(ipcFile, () => {
798
- return;
799
- });
800
758
  }
801
- start() {
802
- throw new Error("DEPREFECATED");
759
+ getInnerHtml(selector, page) {
760
+ throw new Error("pure.ts getInnHtml not implemented");
761
+ return Promise.resolve("");
803
762
  }
804
- stop() {
805
- throw new Error("stop not implemented.");
763
+ stopSideCar(uid) {
764
+ throw new Error("pure.ts getInnHtml not implemented");
765
+ return Promise.resolve(true);
806
766
  }
807
- send(command, ...argz) {
808
- const key = Math.random().toString();
809
- if (!this.client) {
810
- console.error(
811
- `Tried to send "${command} (${argz})" but the test has not been started and the IPC client is not established. Exiting as failure!`
812
- );
813
- process.exit(-1);
814
- }
815
- return new Promise((res) => {
816
- const myListener = (event) => {
817
- const x = JSON.parse(event);
818
- if (x.key === key) {
819
- process.removeListener("message", myListener);
820
- res(x.payload);
821
- }
822
- };
823
- process.addListener("message", myListener);
824
- this.client.write(JSON.stringify([command, ...argz, key]));
825
- });
767
+ start() {
768
+ return new Promise((r) => r());
826
769
  }
827
- async launchSideCar(n) {
828
- return this.send(
829
- "launchSideCar",
830
- n,
831
- this.testResourceConfiguration.name
832
- );
770
+ stop() {
771
+ return new Promise((r) => r());
833
772
  }
834
- stopSideCar(n) {
835
- return this.send(
836
- "stopSideCar",
837
- n,
838
- this.testResourceConfiguration.name
839
- );
773
+ launchSideCar(n) {
774
+ return globalThis["launchSideCar"](n, this.testResourceConfiguration.name);
840
775
  }
841
- async pages() {
842
- return this.send("pages", ...arguments);
776
+ pages() {
777
+ return globalThis["pages"]();
843
778
  }
844
779
  waitForSelector(p, s) {
845
- return this.send("waitForSelector", ...arguments);
780
+ return globalThis["waitForSelector"](p, s);
846
781
  }
847
782
  closePage(p) {
848
- return this.send("closePage", ...arguments);
783
+ return globalThis["closePage"](p);
849
784
  }
850
- goto(page, url) {
851
- return this.send("goto", ...arguments);
785
+ goto(cdpPage, url) {
786
+ return globalThis["goto"](cdpPage.mainFrame()._id, url);
852
787
  }
853
- async newPage() {
854
- return this.send("newPage");
788
+ newPage() {
789
+ return globalThis["newPage"]();
855
790
  }
856
- $(selector, page) {
857
- return this.send("$", ...arguments);
791
+ $(selector) {
792
+ return globalThis["$"](selector);
858
793
  }
859
794
  isDisabled(selector) {
860
- return this.send("isDisabled", ...arguments);
795
+ return globalThis["isDisabled"](selector);
861
796
  }
862
- getAttribute(selector, attribute, p) {
863
- return this.send("getAttribute", ...arguments);
797
+ getAttribute(selector, attribute) {
798
+ return globalThis["getAttribute"](selector, attribute);
864
799
  }
865
- getInnerHtml(selector, p) {
866
- return this.send("getInnerHtml", ...arguments);
800
+ getValue(selector) {
801
+ return globalThis["getValue"](selector);
867
802
  }
868
- // setValue(selector: string) {
869
- // return this.send("getValue", ...arguments);
870
- // }
871
803
  focusOn(selector) {
872
- return this.send("focusOn", ...arguments);
804
+ return globalThis["focusOn"](selector);
873
805
  }
874
- typeInto(selector) {
875
- return this.send("typeInto", ...arguments);
806
+ typeInto(selector, value) {
807
+ return globalThis["typeInto"](selector, value);
876
808
  }
877
809
  page() {
878
- return this.send("page");
810
+ return globalThis["page"]();
879
811
  }
880
812
  click(selector) {
881
- return this.send("click", ...arguments);
813
+ return globalThis["click"](selector);
882
814
  }
883
815
  screencast(opts, page) {
884
- return this.send(
885
- "screencast",
816
+ return globalThis["screencast"](
886
817
  {
887
818
  ...opts,
888
819
  path: this.testResourceConfiguration.fs + "/" + opts.path
@@ -892,100 +823,62 @@ var PM_Node = class extends PM {
892
823
  );
893
824
  }
894
825
  screencastStop(p) {
895
- return this.send("screencastStop", ...arguments);
826
+ return globalThis["screencastStop"](p);
896
827
  }
897
- customScreenShot(x, y) {
898
- const opts = x[0];
899
- const page = x[1];
900
- return this.send(
901
- "customScreenShot",
828
+ customScreenShot(opts, page) {
829
+ return globalThis["customScreenShot"](
902
830
  {
903
831
  ...opts,
904
832
  path: this.testResourceConfiguration.fs + "/" + opts.path
905
833
  },
906
- this.testResourceConfiguration.name,
907
- page
834
+ page,
835
+ this.testResourceConfiguration.name
908
836
  );
909
837
  }
910
- async existsSync(destFolder) {
911
- return await this.send(
912
- "existsSync",
838
+ existsSync(destFolder) {
839
+ return globalThis["existsSync"](
913
840
  this.testResourceConfiguration.fs + "/" + destFolder
914
841
  );
915
842
  }
916
843
  mkdirSync() {
917
- return this.send("mkdirSync", this.testResourceConfiguration.fs + "/");
844
+ return globalThis["mkdirSync"](this.testResourceConfiguration.fs + "/");
918
845
  }
919
- async write(uid, contents) {
920
- return await this.send("write", ...arguments);
846
+ write(uid, contents) {
847
+ return globalThis["write"](uid, contents);
921
848
  }
922
- async writeFileSync(filepath, contents) {
923
- return await this.send(
924
- "writeFileSync",
849
+ writeFileSync(filepath, contents) {
850
+ return globalThis["writeFileSync"](
925
851
  this.testResourceConfiguration.fs + "/" + filepath,
926
852
  contents,
927
853
  this.testResourceConfiguration.name
928
854
  );
929
855
  }
930
- async createWriteStream(filepath) {
931
- return await this.send(
932
- "createWriteStream",
856
+ createWriteStream(filepath) {
857
+ return globalThis["createWriteStream"](
933
858
  this.testResourceConfiguration.fs + "/" + filepath,
934
859
  this.testResourceConfiguration.name
935
860
  );
936
861
  }
937
- async end(uid) {
938
- return await this.send("end", ...arguments);
862
+ end(uid) {
863
+ return globalThis["end"](uid);
939
864
  }
940
- async customclose() {
941
- return await this.send(
942
- "customclose",
865
+ customclose() {
866
+ globalThis["customclose"](
943
867
  this.testResourceConfiguration.fs,
944
868
  this.testResourceConfiguration.name
945
869
  );
946
870
  }
947
871
  testArtiFactoryfileWriter(tLog, callback) {
948
- return (fPath, value) => {
949
- callback(
950
- new Promise((res, rej) => {
951
- tLog("testArtiFactory =>", fPath);
952
- const cleanPath = path.resolve(fPath);
953
- fPaths.push(cleanPath.replace(process.cwd(), ``));
954
- const targetDir = cleanPath.split("/").slice(0, -1).join("/");
955
- fs.mkdir(targetDir, { recursive: true }, async (error) => {
956
- if (error) {
957
- console.error(`\u2757\uFE0FtestArtiFactory failed`, targetDir, error);
958
- }
959
- if (Buffer.isBuffer(value)) {
960
- fs.writeFileSync(fPath, value, "binary");
961
- res();
962
- } else if (`string` === typeof value) {
963
- fs.writeFileSync(fPath, value.toString(), {
964
- encoding: "utf-8"
965
- });
966
- res();
967
- } else {
968
- const pipeStream = value;
969
- const myFile = fs.createWriteStream(fPath);
970
- pipeStream.pipe(myFile);
971
- pipeStream.on("close", () => {
972
- myFile.close();
973
- res();
974
- });
975
- }
976
- });
977
- })
978
- );
979
- };
980
- }
981
- // launch(options?: PuppeteerLaunchOptions): Promise<Browser>;
982
- startPuppeteer(options) {
983
872
  }
873
+ // startPuppeteer(options?: any): any {
874
+ // // return puppeteer.connect(options).then((b) => {
875
+ // // this.browser = b;
876
+ // // });
877
+ // }
984
878
  };
985
879
 
986
- // src/Node.ts
987
- var ipcfile;
988
- var NodeTesteranto = class extends Testeranto {
880
+ // src/Pure.ts
881
+ var PureTesteranto = class extends TesterantoCore {
989
882
  constructor(input, testSpecification, testImplementation, testResourceRequirement, testInterface) {
990
883
  super(
991
884
  input,
@@ -999,41 +892,30 @@ var NodeTesteranto = class extends Testeranto {
999
892
  }
1000
893
  async receiveTestResourceConfig(partialTestResource) {
1001
894
  const t = JSON.parse(partialTestResource);
1002
- const pm = new PM_Node(t, ipcfile);
1003
- return await this.testJobs[0].receiveTestResourceConfig(pm);
895
+ const pm = new PM_Pure(t);
896
+ try {
897
+ return await this.testJobs[0].receiveTestResourceConfig(pm);
898
+ } catch (e) {
899
+ return -2;
900
+ }
1004
901
  }
1005
902
  };
1006
- var testeranto = async (input, testSpecification, testImplementation, testInterface, testResourceRequirement = defaultTestResourceRequirement) => {
1007
- const t = new NodeTesteranto(
903
+ var Pure_default = async (input, testSpecification, testImplementation, testInterface, testResourceRequirement = defaultTestResourceRequirement) => {
904
+ return new PureTesteranto(
1008
905
  input,
1009
906
  testSpecification,
1010
907
  testImplementation,
1011
908
  testResourceRequirement,
1012
909
  testInterface
1013
910
  );
1014
- process.on("unhandledRejection", (reason, promise) => {
1015
- console.error("Unhandled Rejection at:", promise, "reason:", reason);
1016
- });
1017
- try {
1018
- ipcfile = process.argv[3];
1019
- const f = await t.receiveTestResourceConfig(process.argv[2]);
1020
- console.error("goodbye node with failures", f.fails);
1021
- process.exit(f.fails);
1022
- } catch (e) {
1023
- console.error("goodbye node with caught error", e);
1024
- process.exit(-1);
1025
- }
1026
911
  };
1027
- var Node_default = testeranto;
1028
912
 
1029
913
  export {
1030
- __require,
1031
- __commonJS,
1032
- __toESM,
1033
- BaseSuite,
1034
914
  BaseGiven,
1035
915
  BaseWhen,
1036
916
  BaseThen,
1037
917
  BaseCheck,
1038
- Node_default
918
+ BaseBuilder,
919
+ BaseSuite,
920
+ Pure_default
1039
921
  };