testeranto 0.172.0 → 0.177.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 (203) hide show
  1. package/README.md +2 -4
  2. package/dist/common/src/PM/base.js +5 -1
  3. package/dist/common/src/PM/main.js +57 -54
  4. package/dist/common/src/PM/node.js +4 -1
  5. package/dist/common/src/PM/pure.js +4 -1
  6. package/dist/common/src/PM/web.js +6 -3
  7. package/dist/common/src/Pure.js +0 -4
  8. package/dist/common/src/Pure.test.js +1 -1
  9. package/dist/common/src/ReportServer.js +2 -126
  10. package/dist/common/src/ReportServer.test.ts/index.js +78 -0
  11. package/dist/common/src/ReportServerLib.js +141 -0
  12. package/dist/common/src/components/pure/ProjectPageView.test/implementation.js +1 -1
  13. package/dist/common/src/esbuildConfigs/node.js +1 -3
  14. package/dist/common/src/lib/BaseSuite.js +13 -11
  15. package/dist/common/src/lib/abstractBase.js +39 -40
  16. package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.implementation.js +10 -9
  17. package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.specification.js +7 -7
  18. package/dist/common/src/lib/basebuilder.js +13 -2
  19. package/dist/common/src/lib/core.js +1 -0
  20. package/dist/common/src/lib/pmProxy.js +215 -201
  21. package/dist/common/src/lib/pmProxy.test/adapter.js +2 -2
  22. package/dist/common/src/lib/pmProxy.test/implementation.js +1 -1
  23. package/dist/common/testeranto.config.js +47 -32
  24. package/dist/common/tsconfig.common.tsbuildinfo +1 -1
  25. package/dist/module/src/PM/base.js +5 -1
  26. package/dist/module/src/PM/main.js +22 -19
  27. package/dist/module/src/PM/node.js +4 -1
  28. package/dist/module/src/PM/pure.js +4 -1
  29. package/dist/module/src/PM/web.js +6 -3
  30. package/dist/module/src/Pure.js +0 -4
  31. package/dist/module/src/Pure.test.js +1 -1
  32. package/dist/module/src/ReportServer.js +2 -123
  33. package/dist/module/src/ReportServer.test.ts/index.js +73 -0
  34. package/dist/module/src/ReportServerLib.js +134 -0
  35. package/dist/module/src/TestPage.js +29 -17
  36. package/dist/module/src/components/pure/ProjectPageView.test/implementation.js +1 -1
  37. package/dist/module/src/components/pure/TestPageView.js +29 -17
  38. package/dist/module/src/esbuildConfigs/node.js +1 -3
  39. package/dist/module/src/lib/BaseSuite.js +13 -11
  40. package/dist/module/src/lib/abstractBase.js +39 -40
  41. package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.implementation.js +10 -9
  42. package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.specification.js +7 -7
  43. package/dist/module/src/lib/basebuilder.js +13 -2
  44. package/dist/module/src/lib/core.js +1 -0
  45. package/dist/module/src/lib/pmProxy.js +215 -201
  46. package/dist/module/src/lib/pmProxy.test/adapter.js +2 -2
  47. package/dist/module/src/lib/pmProxy.test/implementation.js +1 -1
  48. package/dist/module/testeranto.config.js +47 -32
  49. package/dist/module/tsconfig.module.tsbuildinfo +1 -1
  50. package/dist/prebuild/App.js +3 -3
  51. package/dist/prebuild/ReportServer.mjs +21 -9
  52. package/dist/prebuild/build.mjs +1 -1
  53. package/dist/prebuild/run.mjs +27 -20
  54. package/dist/types/src/PM/base.d.ts +1 -1
  55. package/dist/types/src/PM/node.d.ts +1 -1
  56. package/dist/types/src/PM/pure.d.ts +1 -1
  57. package/dist/types/src/PM/web.d.ts +1 -1
  58. package/dist/types/src/ReportServer.test.ts/index.d.ts +29 -0
  59. package/dist/types/src/ReportServerLib.d.ts +1 -0
  60. package/dist/types/src/Types.d.ts +0 -1
  61. package/dist/types/src/components/pure/ProjectPageView.test/index.d.ts +2 -1
  62. package/dist/types/src/lib/BaseSuite.d.ts +2 -0
  63. package/dist/types/src/lib/abstractBase.d.ts +5 -7
  64. package/dist/types/src/lib/baseBuilder.test/baseBuilder.test.types.d.ts +7 -4
  65. package/dist/types/src/lib/pmProxy.d.ts +3 -3
  66. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  67. package/package.json +3 -3
  68. package/src/PM/base.ts +7 -5
  69. package/src/PM/main.ts +26 -21
  70. package/src/PM/node.ts +6 -1
  71. package/src/PM/pure.ts +6 -1
  72. package/src/PM/web.ts +7 -3
  73. package/src/Pure.test.ts +6 -6
  74. package/src/Pure.ts +0 -8
  75. package/src/ReportServer.test.ts/index.ts +194 -0
  76. package/src/ReportServer.ts +2 -132
  77. package/src/ReportServerLib.ts +147 -0
  78. package/src/TestPage.tsx +65 -5
  79. package/src/Types.ts +0 -1
  80. package/src/components/pure/ProjectPageView.test/implementation.tsx +1 -1
  81. package/src/components/pure/TestPageView.tsx +65 -5
  82. package/src/esbuildConfigs/node.ts +1 -1
  83. package/src/lib/BaseSuite.ts +16 -21
  84. package/src/lib/abstractBase.ts +59 -48
  85. package/src/lib/baseBuilder.test/baseBuilder.test.implementation.ts +22 -10
  86. package/src/lib/baseBuilder.test/baseBuilder.test.specification.ts +9 -9
  87. package/src/lib/baseBuilder.test/baseBuilder.test.types.ts +7 -4
  88. package/src/lib/basebuilder.ts +13 -4
  89. package/src/lib/core.ts +1 -0
  90. package/src/lib/pmProxy.test/adapter.ts +2 -2
  91. package/src/lib/pmProxy.test/implementation.ts +3 -3
  92. package/src/lib/pmProxy.test/types.ts +0 -2
  93. package/src/lib/pmProxy.ts +135 -80
  94. package/testeranto/App.js +3 -3
  95. package/testeranto/bundles/node/core/metafile.json +8 -0
  96. package/testeranto/bundles/pure/core/metafile.json +8 -0
  97. package/testeranto/bundles/web/core/metafile.json +15086 -0
  98. package/testeranto/bundles/web/{allTests → core}/src/components/pure/ProjectPageView.test/index.html +1 -1
  99. package/testeranto/bundles/web/{allTests → core}/src/components/pure/ProjectPageView.test/index.mjs +4109 -1642
  100. package/testeranto/projects.json +1 -1
  101. package/testeranto/reports/core/config.json +24 -0
  102. package/testeranto/reports/{allTests → core}/src/components/pure/ProjectPageView.test/index/web/lint_errors.txt +6 -1
  103. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/logs.txt +59 -0
  104. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/message.txt +2 -0
  105. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/prompt.txt +27 -0
  106. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/suite-0/given-basicRender/then-0/butThen/happyPath.png +0 -0
  107. package/testeranto/reports/{allTests → core}/src/components/pure/ProjectPageView.test/index/web/type_errors.txt +15 -33
  108. package/testeranto/reports/core/summary.json +9 -0
  109. package/testeranto.config.ts +49 -32
  110. package/tsc.log +78 -92
  111. package/testeranto/bundles/node/allTests/chunk-3EUGBAOM.mjs +0 -113
  112. package/testeranto/bundles/node/allTests/chunk-E75CSRER.mjs +0 -800
  113. package/testeranto/bundles/node/allTests/chunk-M6DO7VMB.mjs +0 -252
  114. package/testeranto/bundles/node/allTests/metafile.json +0 -1229
  115. package/testeranto/bundles/node/allTests/src/lib/BaseSuite.test/node.test.mjs +0 -323
  116. package/testeranto/bundles/node/allTests/src/lib/baseBuilder.test/baseBuilder.test.node.mjs +0 -223
  117. package/testeranto/bundles/node/allTests/src/lib/classBuilder.test/classBuilder.test.mjs +0 -411
  118. package/testeranto/bundles/node/allTests/src/lib/core.test/core.test.mjs +0 -528
  119. package/testeranto/bundles/node/allTests/src/lib/pmProxy.test/index.mjs +0 -4752
  120. package/testeranto/bundles/pure/allTests/chunk-KHDVEHF7.mjs +0 -185
  121. package/testeranto/bundles/pure/allTests/chunk-VMUSFSZM.mjs +0 -797
  122. package/testeranto/bundles/pure/allTests/metafile.json +0 -1054
  123. package/testeranto/bundles/pure/allTests/src/Pure.test.mjs +0 -429
  124. package/testeranto/bundles/pure/allTests/src/lib/BaseSuite.test/pure.test.mjs +0 -425
  125. package/testeranto/bundles/pure/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure.mjs +0 -381
  126. package/testeranto/bundles/web/allTests/chunk-HPYA4YZC.mjs +0 -2283
  127. package/testeranto/bundles/web/allTests/chunk-U7AW26HL.mjs +0 -997
  128. package/testeranto/bundles/web/allTests/metafile.json +0 -25
  129. package/testeranto/bundles/web/allTests/src/lib/BaseSuite.test/web.test.html +0 -19
  130. package/testeranto/bundles/web/allTests/src/lib/BaseSuite.test/web.test.mjs +0 -440
  131. package/testeranto/bundles/web/allTests/src/lib/baseBuilder.test/baseBuilder.test.web.html +0 -19
  132. package/testeranto/bundles/web/allTests/src/lib/baseBuilder.test/baseBuilder.test.web.mjs +0 -244
  133. package/testeranto/reports/allTests/config.json +0 -104
  134. package/testeranto/reports/allTests/src/Pure.test/pure/lint_errors.txt +0 -0
  135. package/testeranto/reports/allTests/src/Pure.test/pure/message.txt +0 -2
  136. package/testeranto/reports/allTests/src/Pure.test/pure/prompt.txt +0 -13
  137. package/testeranto/reports/allTests/src/Pure.test/pure/type_errors.txt +0 -101
  138. package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/bdd_errors.txt +0 -1
  139. package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/logs.txt +0 -50
  140. package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/message.txt +0 -2
  141. package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/prompt.txt +0 -17
  142. package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/tests.json +0 -32
  143. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/bdd_errors.txt +0 -1
  144. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/lint_errors.txt +0 -0
  145. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/logs.txt +0 -52
  146. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/message.txt +0 -2
  147. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/prompt.txt +0 -13
  148. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/tests.json +0 -31
  149. package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/type_errors.txt +0 -111
  150. package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/bdd_errors.txt +0 -1
  151. package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/lint_errors.txt +0 -0
  152. package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/message.txt +0 -2
  153. package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/prompt.txt +0 -14
  154. package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/tests.json +0 -31
  155. package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/type_errors.txt +0 -111
  156. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/bdd_errors.txt +0 -1
  157. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/lint_errors.txt +0 -0
  158. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/logs.txt +0 -108
  159. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/message.txt +0 -2
  160. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/prompt.txt +0 -14
  161. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/tests.json +0 -31
  162. package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/type_errors.txt +0 -111
  163. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/bdd_errors.txt +0 -1
  164. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/lint_errors.txt +0 -0
  165. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/logs.txt +0 -35
  166. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/message.txt +0 -2
  167. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/prompt.txt +0 -16
  168. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/tests.json +0 -77
  169. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/type_errors.txt +0 -62
  170. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/lint_errors.txt +0 -0
  171. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/message.txt +0 -2
  172. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/prompt.txt +0 -18
  173. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/type_errors.txt +0 -62
  174. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/bdd_errors.txt +0 -1
  175. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/lint_errors.txt +0 -0
  176. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/logs.txt +0 -69
  177. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/message.txt +0 -2
  178. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/prompt.txt +0 -16
  179. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/tests.json +0 -77
  180. package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/type_errors.txt +0 -62
  181. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/bdd_errors.txt +0 -1
  182. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/lint_errors.txt +0 -0
  183. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/logs.txt +0 -700
  184. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/message.txt +0 -2
  185. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/prompt.txt +0 -16
  186. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/tests.json +0 -164
  187. package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/type_errors.txt +0 -138
  188. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/lint_errors.txt +0 -21
  189. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/logs.txt +0 -7
  190. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/message.txt +0 -2
  191. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/prompt.txt +0 -18
  192. package/testeranto/reports/allTests/src/lib/core.test/core.test/node/type_errors.txt +0 -63
  193. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/bdd_errors.txt +0 -1
  194. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/lint_errors.txt +0 -20
  195. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/logs.txt +0 -31
  196. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/message.txt +0 -2
  197. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/prompt.txt +0 -16
  198. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/tests.json +0 -134
  199. package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/type_errors.txt +0 -76
  200. package/testeranto/reports/allTests/summary.json +0 -79
  201. package/testeranto/reportsnode_build_errors +0 -20
  202. package/testeranto/reportspure_build_errors +0 -343
  203. package/testeranto/reportsweb_build_errors +0 -25
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ /* eslint-disable @typescript-eslint/no-explicit-any */
3
+ /* eslint-disable @typescript-eslint/no-unused-vars */
4
+ /* eslint-disable @typescript-eslint/no-empty-object-type */
5
+ var __importDefault = (this && this.__importDefault) || function (mod) {
6
+ return (mod && mod.__esModule) ? mod : { "default": mod };
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ const Node_1 = __importDefault(require("../Node"));
10
+ const ReportServerLib_1 = require("../ReportServerLib");
11
+ const specification = (Suite, Given, When, Then) => [
12
+ Suite.Default("the http server which is used in development", {
13
+ initialization: Given["the http server which is used in development"](["It should serve the front page", "It should serve the ReportApp"], [], [
14
+ Then["the frontpage looks good"](),
15
+ // Then["the projects page looks good"](),
16
+ // Then["a project page looks good"](),
17
+ // Then["a test page looks good"](),
18
+ ]),
19
+ }),
20
+ ];
21
+ const implementation = {
22
+ suites: {
23
+ Default: "the http server which is used in development",
24
+ },
25
+ givens: {
26
+ "the http server which is used in development": function (subject) {
27
+ // throw new Error("Function not implemented.");
28
+ return subject;
29
+ },
30
+ },
31
+ // There are no "whens", it is a stateless server.
32
+ whens: {},
33
+ thens: {
34
+ "the frontpage looks good": async (port, utils) => {
35
+ // throw new Error("Function not implemented.");
36
+ // utils.newPage(`localhost:${port}`);
37
+ debugger;
38
+ const page = await utils.newPage();
39
+ utils.goto(page, `localhost:${port}`);
40
+ utils.customScreenShot({ path: `frontpage.png` }, page);
41
+ return;
42
+ },
43
+ "the projects page looks good": function () {
44
+ throw new Error("Function not implemented.");
45
+ },
46
+ "a project page looks good": function () {
47
+ throw new Error("Function not implemented.");
48
+ },
49
+ "a test page looks good": function () {
50
+ throw new Error("Function not implemented.");
51
+ },
52
+ },
53
+ };
54
+ const adapter = {
55
+ assertThis: function (x) {
56
+ throw new Error("Function not implemented.");
57
+ },
58
+ andWhen: function (store, whenCB, testResource, pm) {
59
+ throw new Error("Function not implemented.");
60
+ },
61
+ butThen: function (store, thenCB, testResource, pm) {
62
+ throw new Error("Function not implemented.");
63
+ },
64
+ afterAll: function (store, pm) {
65
+ throw new Error("Function not implemented.");
66
+ },
67
+ afterEach: function (store, key, pm) {
68
+ throw new Error("Function not implemented.");
69
+ },
70
+ beforeAll: async function (input, testResource, pm) {
71
+ await new Promise((res, rej) => input(testResource.ports[0]));
72
+ return testResource.ports[0];
73
+ },
74
+ beforeEach: function (subject, initializer, testResource, initialValues, pm) {
75
+ throw new Error("Function not implemented.");
76
+ },
77
+ };
78
+ exports.default = (0, Node_1.default)(ReportServerLib_1.ReportServerOfPort, specification, implementation, adapter);
@@ -0,0 +1,141 @@
1
+ "use strict";
2
+ // simple http server to preview reports
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.ReportServerOfPort = void 0;
8
+ const node_static_1 = __importDefault(require("node-static"));
9
+ const http_1 = __importDefault(require("http"));
10
+ const path_1 = __importDefault(require("path"));
11
+ const fs_1 = __importDefault(require("fs"));
12
+ const fileServer = new node_static_1.default.Server("./", {
13
+ cache: false,
14
+ headers: {
15
+ "Cache-Control": "no-cache, no-store, must-revalidate",
16
+ Pragma: "no-cache",
17
+ Expires: "0",
18
+ },
19
+ });
20
+ const server = http_1.default.createServer((req, res) => {
21
+ // Handle potential double responses
22
+ let responded = false;
23
+ const safeResponse = (handler) => {
24
+ if (responded)
25
+ return;
26
+ responded = true;
27
+ try {
28
+ handler();
29
+ }
30
+ catch (err) {
31
+ console.error("Error handling request:", err);
32
+ if (!res.headersSent) {
33
+ res.writeHead(500);
34
+ }
35
+ res.end("Internal Server Error");
36
+ }
37
+ };
38
+ req.on("error", (err) => {
39
+ console.error("Request error:", err);
40
+ safeResponse(() => {
41
+ if (!res.headersSent) {
42
+ res.writeHead(400);
43
+ }
44
+ res.end("Bad Request");
45
+ });
46
+ });
47
+ req.on("end", () => {
48
+ safeResponse(() => {
49
+ const filePath = path_1.default.join(process.cwd(), req.url || "");
50
+ // First check if file exists
51
+ fs_1.default.stat(filePath, (err, stats) => {
52
+ if (err || !stats.isFile()) {
53
+ // Check if directory exists
54
+ fs_1.default.stat(filePath, (dirErr, dirStats) => {
55
+ if (!dirErr && dirStats.isDirectory()) {
56
+ // Serve directory listing
57
+ fs_1.default.readdir(filePath, (readErr, files) => {
58
+ if (readErr) {
59
+ res.writeHead(500);
60
+ return res.end("Error reading directory");
61
+ }
62
+ res.writeHead(200, { "Content-Type": "text/html" });
63
+ res.write(`
64
+ <html>
65
+ <head>
66
+ <title>Directory Listing: ${req.url}</title>
67
+ <style>
68
+ body { font-family: sans-serif; margin: 2rem; }
69
+ h1 { color: #333; }
70
+ ul { list-style: none; padding: 0; }
71
+ li { padding: 0.5rem; }
72
+ li a { color: #0366d6; text-decoration: none; }
73
+ li a:hover { text-decoration: underline; }
74
+ </style>
75
+ </head>
76
+ <body>
77
+ <h1>Directory: ${req.url}</h1>
78
+ <ul>
79
+ ${files
80
+ .map((file) => `
81
+ <li>
82
+ <a href="${path_1.default.join(req.url || "", file)}">
83
+ ${file}${file.endsWith("/") ? "/" : ""}
84
+ </a>
85
+ </li>
86
+ `)
87
+ .join("")}
88
+ </ul>
89
+ </body>
90
+ </html>
91
+ `);
92
+ res.end();
93
+ });
94
+ }
95
+ else {
96
+ // Neither file nor directory exists - send 404
97
+ if (!res.headersSent) {
98
+ res.writeHead(404, { "Content-Type": "text/plain" });
99
+ res.end("File not found");
100
+ }
101
+ }
102
+ });
103
+ return;
104
+ }
105
+ // File exists - serve it through node-static
106
+ const serve = () => {
107
+ fileServer.serve(req, res, (err) => {
108
+ if (err && !res.headersSent) {
109
+ res.writeHead(err.status || 500);
110
+ res.end(err.message);
111
+ }
112
+ });
113
+ };
114
+ // Ensure we don't double-serve
115
+ if (!res.headersSent) {
116
+ serve();
117
+ }
118
+ });
119
+ });
120
+ });
121
+ req.resume();
122
+ });
123
+ server.on("error", (err) => {
124
+ console.error("Server error:", err);
125
+ });
126
+ process.on("uncaughtException", (err) => {
127
+ console.error("Uncaught exception:", err);
128
+ });
129
+ const start = (port) => {
130
+ if (port) {
131
+ server.listen(port, () => {
132
+ console.log(`Server running on http://localhost:${port}`);
133
+ console.log("Serving files from:", process.cwd());
134
+ });
135
+ }
136
+ else {
137
+ console.log("you need to specify a port");
138
+ }
139
+ };
140
+ const ReportServerOfPort = (port) => start(port);
141
+ exports.ReportServerOfPort = ReportServerOfPort;
@@ -38,7 +38,7 @@ exports.implementation = {
38
38
  thens: {
39
39
  happyPath: () => async ({ container, html }, pm) => {
40
40
  console.group('[Test] Verifying render output');
41
- debugger;
41
+ // debugger
42
42
  const p = await pm.page();
43
43
  await pm.customScreenShot({ path: "happyPath.png" }, p);
44
44
  chai_1.assert.equal(1, 1);
@@ -9,9 +9,7 @@ const featuresPlugin_1 = __importDefault(require("./featuresPlugin"));
9
9
  const rebuildPlugin_js_1 = __importDefault(require("./rebuildPlugin.js"));
10
10
  exports.default = (config, entryPoints, testName) => {
11
11
  const { inputFilesPluginFactory, register } = (0, inputFilesPlugin_js_1.default)("node", testName);
12
- return Object.assign(Object.assign({}, (0, index_js_1.default)(config)), { splitting: true, outdir: `testeranto/bundles/node/${testName}/`,
13
- // inject: [`./node_modules/testeranto/dist/cjs-shim.js`],
14
- metafile: true, supported: {
12
+ return Object.assign(Object.assign({}, (0, index_js_1.default)(config)), { splitting: true, outdir: `testeranto/bundles/node/${testName}/`, inject: [`./node_modules/testeranto/dist/cjs-shim.js`], metafile: true, supported: {
15
13
  "dynamic-import": true,
16
14
  }, define: {
17
15
  "process.env.FLUENTFFMPEG_COV": "0",
@@ -3,18 +3,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BaseSuite = void 0;
4
4
  const pmProxy_1 = require("./pmProxy");
5
5
  class BaseSuite {
6
+ addArtifact(path) {
7
+ console.log("Suite addArtifact", path);
8
+ const normalizedPath = path.replace(/\\/g, "/"); // Normalize path separators
9
+ this.artifacts.push(normalizedPath);
10
+ }
6
11
  constructor(name, index, givens = {}) {
12
+ this.artifacts = [];
7
13
  const suiteName = name || "testSuite"; // Ensure name is never undefined
8
14
  if (!suiteName) {
9
15
  throw new Error("BaseSuite requires a non-empty name");
10
16
  }
11
- console.log("[DEBUG] BaseSuite constructor - name:", suiteName, "index:", index);
12
17
  this.name = suiteName;
13
18
  this.index = index;
14
19
  this.givens = givens;
15
20
  this.fails = 0;
16
- console.log("[DEBUG] BaseSuite initialized:", this.name, this.index);
17
- console.log("[DEBUG] BaseSuite givens:", Object.keys(givens).toString());
18
21
  }
19
22
  features() {
20
23
  try {
@@ -24,11 +27,10 @@ class BaseSuite {
24
27
  .filter((value, index, array) => {
25
28
  return array.indexOf(value) === index;
26
29
  });
27
- console.debug("[DEBUG] Features extracted:", features.toString());
28
30
  return features || [];
29
31
  }
30
32
  catch (e) {
31
- console.error("[ERROR] Failed to extract features:", e);
33
+ console.error("[ERROR] Failed to extract features:", JSON.stringify(e));
32
34
  return [];
33
35
  }
34
36
  }
@@ -56,10 +58,10 @@ class BaseSuite {
56
58
  // tLog("test resources: ", JSON.stringify(testResourceConfiguration));
57
59
  const suiteArtifactory = (fPath, value) => artifactory(`suite-${this.index}-${this.name}/${fPath}`, value);
58
60
  // console.log("\nSuite:", this.index, this.name);
59
- tLog("\nSuite:", this.index, this.name);
61
+ // tLog("\nSuite:", this.index, this.name);
60
62
  const sNdx = this.index;
61
- // const sName = this.name;
62
- const subject = await this.setup(input, suiteArtifactory, testResourceConfiguration, (0, pmProxy_1.beforeAllProxy)(pm, sNdx.toString()));
63
+ const proxiedPm = (0, pmProxy_1.beforeAllProxy)(pm, sNdx.toString(), this);
64
+ const subject = await this.setup(input, suiteArtifactory, testResourceConfiguration, proxiedPm);
63
65
  for (const [gKey, g] of Object.entries(this.givens)) {
64
66
  const giver = this.givens[gKey];
65
67
  this.store = await giver
@@ -67,15 +69,15 @@ class BaseSuite {
67
69
  .catch((e) => {
68
70
  this.failed = true;
69
71
  this.fails = this.fails + 1;
70
- // console.error("Given error 1:", e.toString());
71
72
  throw e;
72
73
  });
73
74
  }
74
75
  try {
75
- this.afterAll(this.store, artifactory, (0, pmProxy_1.afterAllProxy)(pm, sNdx.toString()));
76
+ const afterAllPm = (0, pmProxy_1.afterAllProxy)(pm, sNdx.toString(), this);
77
+ this.afterAll(this.store, artifactory, afterAllPm);
76
78
  }
77
79
  catch (e) {
78
- console.error(e);
80
+ console.error(JSON.stringify(e));
79
81
  // this.fails.push(this);
80
82
  // return this;
81
83
  }
@@ -6,8 +6,9 @@ exports.BaseThen = exports.BaseWhen = exports.BaseGiven = void 0;
6
6
  const pmProxy_js_1 = require("./pmProxy.js");
7
7
  class BaseGiven {
8
8
  addArtifact(path) {
9
- console.log(`[Artifact] Adding to ${this.constructor.name}:`, path);
10
- this.artifacts.push(path);
9
+ console.log("Given addArtifact", path);
10
+ const normalizedPath = path.replace(/\\/g, "/"); // Normalize path separators
11
+ this.artifacts.push(normalizedPath);
11
12
  }
12
13
  constructor(name, features, whens, thens, givenCB, initialValues) {
13
14
  this.artifacts = [];
@@ -28,7 +29,7 @@ class BaseGiven {
28
29
  whens: this.whens.map((w) => {
29
30
  if (w && w.toObj)
30
31
  return w.toObj();
31
- console.error("w is not as expected!", w.toString());
32
+ console.error("w is not as expected!", JSON.stringify(w));
32
33
  return {};
33
34
  }),
34
35
  thens: this.thens.map((t) => t.toObj()),
@@ -52,15 +53,13 @@ class BaseGiven {
52
53
  tLog(e.stack);
53
54
  });
54
55
  try {
55
- const proxiedPm = (0, pmProxy_js_1.beforeEachProxy)(pm, suiteNdx.toString());
56
- console.log(`[Given] Setting currentStep for beforeEach:`, this.name);
57
- proxiedPm.currentStep = this;
56
+ const proxiedPm = (0, pmProxy_js_1.beforeEachProxy)(pm, suiteNdx.toString(), this.addArtifact.bind(this));
58
57
  this.store = await this.givenThat(subject, testResourceConfiguration, givenArtifactory, this.givenCB, this.initialValues, proxiedPm);
59
58
  }
60
59
  catch (e) {
61
- console.error("Given failure: ", e.toString());
62
- this.error = e;
63
- throw e;
60
+ // console.error("Given failure: ", e.stack);
61
+ this.error = e.stack;
62
+ // throw e;
64
63
  }
65
64
  try {
66
65
  // tLog(`\n Given this.store`, this.store);
@@ -70,9 +69,6 @@ class BaseGiven {
70
69
  for (const [thenNdx, thenStep] of this.thens.entries()) {
71
70
  const t = await thenStep.test(this.store, testResourceConfiguration, tLog, pm, `suite-${suiteNdx}/given-${key}/then-${thenNdx}`);
72
71
  tester(t);
73
- // ((t) => {
74
- // return tester(t);
75
- // })();
76
72
  }
77
73
  }
78
74
  catch (e) {
@@ -82,10 +78,11 @@ class BaseGiven {
82
78
  }
83
79
  finally {
84
80
  try {
85
- await this.afterEach(this.store, this.key, givenArtifactory, (0, pmProxy_js_1.afterEachProxy)(pm, suiteNdx.toString(), key));
81
+ const proxiedPm = (0, pmProxy_js_1.afterEachProxy)(pm, suiteNdx.toString(), key, this.addArtifact.bind(this));
82
+ // (proxiedPm as any).currentStep = this;
83
+ await this.afterEach(this.store, this.key, givenArtifactory, proxiedPm);
86
84
  }
87
85
  catch (e) {
88
- console.error("afterEach failed!", e.toString());
89
86
  this.failed = e;
90
87
  throw e;
91
88
  // this.error = e.message;
@@ -96,36 +93,33 @@ class BaseGiven {
96
93
  }
97
94
  exports.BaseGiven = BaseGiven;
98
95
  class BaseWhen {
96
+ addArtifact(path) {
97
+ console.log("When addArtifact", path);
98
+ const normalizedPath = path.replace(/\\/g, "/"); // Normalize path separators
99
+ this.artifacts.push(normalizedPath);
100
+ }
99
101
  constructor(name, whenCB) {
100
102
  this.artifacts = [];
101
103
  this.name = name;
102
104
  this.whenCB = whenCB;
103
105
  }
104
106
  toObj() {
105
- console.log("toObj error", this.error);
106
- if (this.error) {
107
- return {
108
- name: this.name,
109
- error: this.error && this.error.name + this.error.stack,
110
- artifacts: this.artifacts,
111
- };
112
- }
113
- else {
114
- return {
115
- name: this.name,
116
- artifacts: this.artifacts,
117
- };
118
- }
107
+ const obj = {
108
+ name: this.name,
109
+ error: this.error
110
+ ? `${this.error.name}: ${this.error.message}\n${this.error.stack}`
111
+ : null,
112
+ artifacts: this.artifacts || [],
113
+ };
114
+ console.log(`[TOOBJ] Serializing ${this.constructor.name} with artifacts:`, obj.artifacts);
115
+ return obj;
119
116
  }
120
117
  async test(store, testResourceConfiguration, tLog, pm, filepath) {
121
118
  try {
122
- tLog(" When:", this.name);
123
- console.debug("[DEBUG] Executing When step:", this.name.toString());
124
- const proxiedPm = (0, pmProxy_js_1.andWhenProxy)(pm, filepath);
125
- console.log(`[When] Setting currentStep for andWhen:`, this.name);
126
- proxiedPm.currentStep = this;
119
+ // tLog(" When:", this.name);
120
+ const proxiedPm = (0, pmProxy_js_1.andWhenProxy)(pm, filepath, this.addArtifact.bind(this));
121
+ // (proxiedPm as any).currentStep = this;
127
122
  const result = await this.andWhen(store, this.whenCB, testResourceConfiguration, proxiedPm);
128
- console.debug("[DEBUG] When step completed:", this.name.toString());
129
123
  return result;
130
124
  }
131
125
  catch (e) {
@@ -142,18 +136,23 @@ class BaseThen {
142
136
  this.name = name;
143
137
  this.thenCB = thenCB;
144
138
  this.error = false;
139
+ this.artifacts = [];
140
+ }
141
+ addArtifact(path) {
142
+ console.log("Then addArtifact", path);
143
+ const normalizedPath = path.replace(/\\/g, "/"); // Normalize path separators
144
+ this.artifacts.push(normalizedPath);
145
145
  }
146
146
  toObj() {
147
- return {
147
+ const obj = {
148
148
  name: this.name,
149
149
  error: this.error,
150
150
  artifacts: this.artifacts,
151
151
  };
152
+ return obj;
152
153
  }
153
154
  async test(store, testResourceConfiguration, tLog, pm, filepath) {
154
- const proxiedPm = (0, pmProxy_js_1.butThenProxy)(pm, filepath);
155
- console.log(`[Then] Setting currentStep for butThen:`, this.name);
156
- proxiedPm.currentStep = this;
155
+ const proxiedPm = (0, pmProxy_js_1.butThenProxy)(pm, filepath, this.addArtifact.bind(this));
157
156
  return this.butThen(store, async (s) => {
158
157
  if (typeof this.thenCB === "function") {
159
158
  return await this.thenCB(s, proxiedPm);
@@ -161,8 +160,8 @@ class BaseThen {
161
160
  else {
162
161
  return this.thenCB;
163
162
  }
164
- }, testResourceConfiguration, (0, pmProxy_js_1.butThenProxy)(pm, filepath)).catch((e) => {
165
- this.error = e.toString();
163
+ }, testResourceConfiguration, proxiedPm).catch((e) => {
164
+ this.error = e.stack;
166
165
  // throw e;
167
166
  });
168
167
  }
@@ -8,7 +8,7 @@ exports.implementation = {
8
8
  Default: "BaseBuilder test suite",
9
9
  },
10
10
  givens: {
11
- Default: () => {
11
+ "the default BaseBuilder": () => {
12
12
  return new baseBuilder_test_mock_1.MockBaseBuilder({}, // input
13
13
  {}, // suitesOverrides
14
14
  {}, // givenOverrides
@@ -18,11 +18,11 @@ exports.implementation = {
18
18
  () => [] // testSpecification
19
19
  );
20
20
  },
21
- WithCustomInput: (input) => {
22
- return new baseBuilder_test_mock_1.MockBaseBuilder(input, {}, {}, {}, {}, {}, { ports: [] });
21
+ "a BaseBuilder with TestInput": (input) => {
22
+ return new baseBuilder_test_mock_1.MockBaseBuilder(input, {}, {}, {}, {}, { ports: [] }, () => []);
23
23
  },
24
- WithResourceRequirements: (requirements) => {
25
- return new baseBuilder_test_mock_1.MockBaseBuilder({}, {}, {}, {}, {}, {}, requirements);
24
+ "a BaseBuilder with Test Resource Requirements": (requirements) => {
25
+ return new baseBuilder_test_mock_1.MockBaseBuilder({}, {}, {}, {}, {}, requirements, () => []);
26
26
  },
27
27
  },
28
28
  whens: {
@@ -36,8 +36,9 @@ exports.implementation = {
36
36
  },
37
37
  },
38
38
  thens: {
39
- initializedProperly: () => (builder) => {
39
+ "it is initialized": () => (builder, utils) => {
40
40
  var _a;
41
+ utils.writeFileSync("hello.txt", "world");
41
42
  if (!(builder instanceof basebuilder_1.BaseBuilder)) {
42
43
  console.error("Builder instance:", builder);
43
44
  throw new Error(`Builder was not properly initialized - expected BaseBuilder instance but got ${(_a = builder === null || builder === void 0 ? void 0 : builder.constructor) === null || _a === void 0 ? void 0 : _a.name}`);
@@ -58,19 +59,19 @@ exports.implementation = {
58
59
  });
59
60
  return builder;
60
61
  },
61
- specsGenerated: () => (builder) => {
62
+ "it generates TestSpecifications": () => (builder) => {
62
63
  if (!Array.isArray(builder.specs)) {
63
64
  throw new Error("Specs were not generated");
64
65
  }
65
66
  return builder;
66
67
  },
67
- jobsCreated: () => (builder) => {
68
+ "it creates jobs": () => (builder) => {
68
69
  if (!Array.isArray(builder.testJobs)) {
69
70
  throw new Error("Test jobs were not created");
70
71
  }
71
72
  return builder;
72
73
  },
73
- artifactsTracked: () => (builder) => {
74
+ "it tracks artifacts": () => (builder) => {
74
75
  if (!Array.isArray(builder.artifacts)) {
75
76
  throw new Error("Artifacts array not initialized");
76
77
  }
@@ -4,14 +4,14 @@ exports.specification = void 0;
4
4
  const specification = (Suite, Given, When, Then) => {
5
5
  return [
6
6
  Suite.Default("Testing BaseBuilder functionality", {
7
- testInitialization: Given.Default(["BaseBuilder should initialize correctly"], [], [
8
- Then.initializedProperly(),
9
- Then.artifactsTracked(),
10
- Then.jobsCreated(),
11
- Then.specsGenerated(),
7
+ testInitialization: Given["the default BaseBuilder"](["BaseBuilder should initialize correctly"], [], [
8
+ Then["it is initialized"](),
9
+ Then["it tracks artifacts"](),
10
+ // Then["it creates jobs"](),
11
+ // Then["it generates TestSpecifications"](),
12
12
  ]),
13
- testSpecsGeneration: Given.Default(["BaseBuilder should generate specs from test specification"], [], [Then.specsGenerated()]),
14
- testJobsCreation: Given.Default(["BaseBuilder should create test jobs"], [], [Then.jobsCreated()]),
13
+ testSpecsGeneration: Given["the default BaseBuilder"](["BaseBuilder should generate specs from test specification"], [], [Then["it generates TestSpecifications"]()]),
14
+ testJobsCreation: Given["the default BaseBuilder"](["BaseBuilder should create test jobs"], [], [Then["it creates jobs"]()]),
15
15
  }),
16
16
  ];
17
17
  };
@@ -18,9 +18,11 @@ class BaseBuilder {
18
18
  this.specs = testSpecification(this.Suites(), this.Given(), this.When(), this.Then());
19
19
  this.testJobs = this.specs.map((suite) => {
20
20
  const suiteRunner = (suite) => async (puppetMaster, tLog) => {
21
+ console.log("mark17");
21
22
  const x = await suite.run(input, puppetMaster.testResourceConfiguration, (fPath, value) => puppetMaster.testArtiFactoryfileWriter(tLog, (p) => {
22
23
  this.artifacts.push(p);
23
24
  })(puppetMaster.testResourceConfiguration.fs + "/" + fPath, value), tLog, puppetMaster);
25
+ console.log("mark18");
24
26
  return x;
25
27
  };
26
28
  const runner = suiteRunner(suite);
@@ -39,14 +41,23 @@ class BaseBuilder {
39
41
  const tLog = async (...l) => {
40
42
  //
41
43
  };
44
+ console.log("mark14");
42
45
  const suiteDone = await runner(puppetMaster, tLog);
46
+ console.log("mark15");
43
47
  // const logPromise = new Promise(async (res) => {
44
48
  // await puppetMaster.end(access);
45
49
  // res(true);
46
50
  // });
47
51
  const fails = suiteDone.fails;
48
- await puppetMaster.writeFileSync(`bdd_errors.txt`, fails.toString());
49
- await puppetMaster.writeFileSync(`tests.json`, JSON.stringify(this.toObj(), null, 2));
52
+ await puppetMaster.writeFileSync([
53
+ `bdd_errors.txt`,
54
+ fails.toString(),
55
+ ]);
56
+ await puppetMaster.writeFileSync([
57
+ `tests.json`,
58
+ JSON.stringify(this.toObj(), null, 2),
59
+ ]);
60
+ console.log("mark13");
50
61
  return {
51
62
  failed: fails > 0,
52
63
  fails,
@@ -28,6 +28,7 @@ class TesterantoCore extends classBuilder_js_1.ClassBuilder {
28
28
  this.uberCatcher = uberCatcher;
29
29
  }
30
30
  async givenThat(subject, testResource, artifactory, initializer, initialValues, pm) {
31
+ console.log("mark800");
31
32
  return fullAdapter.beforeEach(subject, initializer, testResource, initialValues, pm);
32
33
  }
33
34
  afterEach(store, key, artifactory, pm) {