testeranto 0.111.0 → 0.112.1

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 (178) hide show
  1. package/README.md +6 -5
  2. package/dist/common/Init.js +68 -0
  3. package/dist/common/Node.js +27 -0
  4. package/dist/common/PM/index.js +7 -0
  5. package/dist/common/PM/main.js +1176 -0
  6. package/dist/common/PM/node.js +128 -0
  7. package/dist/common/PM/web.js +121 -0
  8. package/dist/common/ReportServer.js +22 -0
  9. package/dist/common/SubPackages/react/component/node.js +19 -0
  10. package/dist/common/SubPackages/react/component/web.js +19 -0
  11. package/dist/common/SubPackages/react/jsx/index.js +21 -0
  12. package/dist/common/SubPackages/react/jsx/node.js +10 -0
  13. package/dist/common/SubPackages/react/jsx/web.js +10 -0
  14. package/dist/common/SubPackages/react-dom/component/node.js +88 -0
  15. package/dist/common/SubPackages/react-dom/component/web.js +67 -0
  16. package/dist/common/SubPackages/react-dom/jsx/index.js +2 -0
  17. package/dist/common/SubPackages/react-dom/jsx/node.js +39 -0
  18. package/dist/common/SubPackages/react-dom/jsx/web.js +128 -0
  19. package/dist/common/SubPackages/react-test-renderer/MemoExoticComponent/node.js +54 -0
  20. package/dist/common/SubPackages/react-test-renderer/component/index.js +2 -0
  21. package/dist/common/SubPackages/react-test-renderer/component/interface.js +70 -0
  22. package/dist/common/SubPackages/react-test-renderer/component/node.js +8 -0
  23. package/dist/common/SubPackages/react-test-renderer/component/web.js +8 -0
  24. package/dist/common/SubPackages/react-test-renderer/fc/node.js +60 -0
  25. package/dist/common/SubPackages/react-test-renderer/fc/web.js +60 -0
  26. package/dist/common/SubPackages/react-test-renderer/jsx/index.js +67 -0
  27. package/dist/common/SubPackages/react-test-renderer/jsx/node.js +10 -0
  28. package/dist/common/SubPackages/react-test-renderer/jsx/web.js +10 -0
  29. package/dist/common/SubPackages/react-test-renderer/jsx-promised/index.js +52 -0
  30. package/dist/common/SubPackages/react-test-renderer/jsx-promised/node.js +10 -0
  31. package/dist/common/SubPackages/react-test-renderer/jsx-promised/web.js +10 -0
  32. package/dist/common/Types.js +2 -0
  33. package/dist/common/Web.js +49 -0
  34. package/dist/common/build.js +222 -0
  35. package/dist/common/defaultConfig.js +20 -0
  36. package/dist/common/esbuildConfigs/eslint-formatter-testeranto.js +6 -0
  37. package/dist/common/esbuildConfigs/featuresPlugin.js +39 -0
  38. package/dist/common/esbuildConfigs/index.js +21 -0
  39. package/dist/common/esbuildConfigs/inputFilesPlugin.js +27 -0
  40. package/dist/common/esbuildConfigs/node.js +37 -0
  41. package/dist/common/esbuildConfigs/web.js +50 -0
  42. package/dist/common/init-docs.js +53 -0
  43. package/dist/common/lib/abstractBase.js +329 -0
  44. package/dist/common/lib/basebuilder.js +98 -0
  45. package/dist/common/lib/classBuilder.js +40 -0
  46. package/dist/common/lib/core.js +117 -0
  47. package/dist/common/lib/index.js +21 -0
  48. package/dist/common/lib/types.js +2 -0
  49. package/dist/common/package.json +3 -0
  50. package/dist/common/puppeteerConfiger.js +24 -0
  51. package/dist/common/run.js +62 -0
  52. package/dist/common/tsconfig.common.tsbuildinfo +1 -0
  53. package/dist/common/utils.js +43 -0
  54. package/dist/common/web.html.js +22 -0
  55. package/dist/module/Footer.js +4 -0
  56. package/dist/module/Init.js +63 -0
  57. package/dist/module/Node.js +20 -0
  58. package/dist/module/PM/index.js +3 -0
  59. package/dist/module/PM/main.js +1136 -0
  60. package/dist/module/PM/node.js +121 -0
  61. package/dist/module/PM/web.js +117 -0
  62. package/dist/module/ReportClient.js +97 -0
  63. package/dist/module/ReportServer.js +17 -0
  64. package/dist/module/SubPackages/react/component/node.js +14 -0
  65. package/dist/module/SubPackages/react/component/web.js +14 -0
  66. package/dist/module/SubPackages/react/jsx/index.js +15 -0
  67. package/dist/module/SubPackages/react/jsx/node.js +5 -0
  68. package/dist/module/SubPackages/react/jsx/web.js +5 -0
  69. package/dist/module/SubPackages/react-dom/component/node.js +80 -0
  70. package/dist/module/SubPackages/react-dom/component/web.js +62 -0
  71. package/dist/module/SubPackages/react-dom/jsx/index.js +1 -0
  72. package/dist/module/SubPackages/react-dom/jsx/node.js +31 -0
  73. package/dist/module/SubPackages/react-dom/jsx/web.js +90 -0
  74. package/dist/module/SubPackages/react-test-renderer/MemoExoticComponent/node.js +16 -0
  75. package/dist/module/SubPackages/react-test-renderer/component/index.js +1 -0
  76. package/dist/module/SubPackages/react-test-renderer/component/interface.js +31 -0
  77. package/dist/module/SubPackages/react-test-renderer/component/node.js +3 -0
  78. package/dist/module/SubPackages/react-test-renderer/component/web.js +3 -0
  79. package/dist/module/SubPackages/react-test-renderer/fc/node.js +22 -0
  80. package/dist/module/SubPackages/react-test-renderer/fc/web.js +22 -0
  81. package/dist/module/SubPackages/react-test-renderer/jsx/index.js +28 -0
  82. package/dist/module/SubPackages/react-test-renderer/jsx/node.js +5 -0
  83. package/dist/module/SubPackages/react-test-renderer/jsx/web.js +5 -0
  84. package/dist/module/SubPackages/react-test-renderer/jsx-promised/index.js +16 -0
  85. package/dist/module/SubPackages/react-test-renderer/jsx-promised/node.js +5 -0
  86. package/dist/module/SubPackages/react-test-renderer/jsx-promised/web.js +5 -0
  87. package/dist/module/TestReport.js +91 -0
  88. package/dist/module/Types.js +1 -0
  89. package/dist/module/Web.js +42 -0
  90. package/dist/module/build.js +184 -0
  91. package/dist/module/defaultConfig.js +18 -0
  92. package/dist/module/esbuildConfigs/eslint-formatter-testeranto.js +3 -0
  93. package/dist/module/esbuildConfigs/featuresPlugin.js +34 -0
  94. package/dist/module/esbuildConfigs/index.js +19 -0
  95. package/dist/module/esbuildConfigs/inputFilesPlugin.js +22 -0
  96. package/dist/module/esbuildConfigs/node.js +32 -0
  97. package/dist/module/esbuildConfigs/web.js +45 -0
  98. package/dist/module/init-docs.js +15 -0
  99. package/dist/module/lib/abstractBase.js +321 -0
  100. package/dist/module/lib/basebuilder.js +94 -0
  101. package/dist/module/lib/classBuilder.js +36 -0
  102. package/dist/module/lib/core.js +114 -0
  103. package/dist/module/lib/index.js +17 -0
  104. package/dist/module/lib/types.js +1 -0
  105. package/dist/module/package.json +3 -0
  106. package/dist/module/puppeteerConfiger.js +19 -0
  107. package/dist/module/run.js +24 -0
  108. package/dist/module/tsconfig.module.tsbuildinfo +1 -0
  109. package/dist/module/utils.js +29 -0
  110. package/dist/module/web.html.js +20 -0
  111. package/dist/prebuild/ReportClient.css +11367 -0
  112. package/dist/prebuild/ReportClient.js +24641 -0
  113. package/dist/prebuild/ReportServer.mjs +16 -0
  114. package/dist/prebuild/TestReport.css +11367 -0
  115. package/dist/prebuild/TestReport.js +27484 -0
  116. package/dist/prebuild/build.mjs +376 -0
  117. package/dist/prebuild/esbuildConfigs/eslint-formatter-testeranto.mjs +9 -0
  118. package/dist/prebuild/init-docs.mjs +104 -0
  119. package/dist/prebuild/run.mjs +1153 -0
  120. package/dist/tsconfig.tsbuildinfo +1 -0
  121. package/dist/types/Init.d.ts +2 -0
  122. package/dist/types/Node.d.ts +12 -0
  123. package/dist/types/PM/index.d.ts +34 -0
  124. package/dist/types/PM/main.d.ts +66 -0
  125. package/dist/types/PM/node.d.ts +40 -0
  126. package/dist/types/PM/web.d.ts +38 -0
  127. package/dist/types/ReportServer.d.ts +1 -0
  128. package/dist/types/SubPackages/react/component/node.d.ts +7 -0
  129. package/dist/types/SubPackages/react/component/web.d.ts +7 -0
  130. package/dist/types/SubPackages/react/jsx/index.d.ts +12 -0
  131. package/dist/types/SubPackages/react/jsx/node.d.ts +4 -0
  132. package/dist/types/SubPackages/react/jsx/web.d.ts +4 -0
  133. package/dist/types/SubPackages/react-dom/component/node.d.ts +11 -0
  134. package/dist/types/SubPackages/react-dom/component/web.d.ts +20 -0
  135. package/dist/types/SubPackages/react-dom/jsx/index.d.ts +6 -0
  136. package/dist/types/SubPackages/react-dom/jsx/node.d.ts +7 -0
  137. package/dist/types/SubPackages/react-dom/jsx/web.d.ts +5 -0
  138. package/dist/types/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +6 -0
  139. package/dist/types/SubPackages/react-test-renderer/component/index.d.ts +13 -0
  140. package/dist/types/SubPackages/react-test-renderer/component/interface.d.ts +9 -0
  141. package/dist/types/SubPackages/react-test-renderer/component/node.d.ts +4 -0
  142. package/dist/types/SubPackages/react-test-renderer/component/web.d.ts +4 -0
  143. package/dist/types/SubPackages/react-test-renderer/fc/node.d.ts +8 -0
  144. package/dist/types/SubPackages/react-test-renderer/fc/web.d.ts +9 -0
  145. package/dist/types/SubPackages/react-test-renderer/jsx/index.d.ts +16 -0
  146. package/dist/types/SubPackages/react-test-renderer/jsx/node.d.ts +9 -0
  147. package/dist/types/SubPackages/react-test-renderer/jsx/web.d.ts +9 -0
  148. package/dist/types/SubPackages/react-test-renderer/jsx-promised/index.d.ts +15 -0
  149. package/dist/types/SubPackages/react-test-renderer/jsx-promised/node.d.ts +5 -0
  150. package/dist/types/SubPackages/react-test-renderer/jsx-promised/web.d.ts +5 -0
  151. package/dist/types/Types.d.ts +61 -0
  152. package/dist/types/Web.d.ts +9 -0
  153. package/dist/types/build.d.ts +1 -0
  154. package/dist/types/defaultConfig.d.ts +3 -0
  155. package/dist/types/esbuildConfigs/eslint-formatter-testeranto.d.ts +2 -0
  156. package/dist/types/esbuildConfigs/featuresPlugin.d.ts +5 -0
  157. package/dist/types/esbuildConfigs/index.d.ts +4 -0
  158. package/dist/types/esbuildConfigs/inputFilesPlugin.d.ts +6 -0
  159. package/dist/types/esbuildConfigs/node.d.ts +4 -0
  160. package/dist/types/esbuildConfigs/web.d.ts +4 -0
  161. package/dist/types/init-docs.d.ts +1 -0
  162. package/dist/types/lib/abstractBase.d.ts +110 -0
  163. package/dist/types/lib/basebuilder.d.ts +27 -0
  164. package/dist/types/lib/classBuilder.d.ts +7 -0
  165. package/dist/types/lib/core.d.ts +7 -0
  166. package/dist/types/lib/index.d.ts +83 -0
  167. package/dist/types/lib/types.d.ts +14 -0
  168. package/dist/types/puppeteerConfiger.d.ts +4 -0
  169. package/dist/types/run.d.ts +1 -0
  170. package/dist/types/tsconfig.types.tsbuildinfo +1 -0
  171. package/dist/types/utils.d.ts +15 -0
  172. package/dist/types/web.html.d.ts +2 -0
  173. package/package.json +1 -1
  174. package/src/PM/main.ts +25 -57
  175. package/src/ReportClient.tsx +43 -41
  176. package/src/run.ts +8 -5
  177. package/src/utils.ts +10 -0
  178. package/tsc.log +8 -8
@@ -0,0 +1,128 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.PM_Node = void 0;
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const path_1 = __importDefault(require("path"));
9
+ const index_js_1 = require("./index.js");
10
+ const fPaths = [];
11
+ class PM_Node extends index_js_1.PM {
12
+ constructor(t) {
13
+ super();
14
+ this.server = {};
15
+ this.testResourceConfiguration = t;
16
+ }
17
+ waitForSelector(p, s) {
18
+ return globalThis["waitForSelector"](p, s);
19
+ }
20
+ closePage(p) {
21
+ return globalThis["closePage"](p);
22
+ }
23
+ goto(cdpPage, url) {
24
+ return globalThis["goto"](cdpPage.mainFrame()._id, url);
25
+ }
26
+ newPage() {
27
+ return globalThis["newPage"]();
28
+ }
29
+ $(selector) {
30
+ throw new Error("Method not implemented.");
31
+ }
32
+ isDisabled(selector) {
33
+ throw new Error("Method not implemented.");
34
+ }
35
+ getAttribute(selector, attribute) {
36
+ throw new Error("Method not implemented.");
37
+ }
38
+ getValue(selector) {
39
+ throw new Error("Method not implemented.");
40
+ }
41
+ focusOn(selector) {
42
+ throw new Error("Method not implemented.");
43
+ }
44
+ typeInto(value) {
45
+ throw new Error("Method not implemented.");
46
+ }
47
+ page() {
48
+ return globalThis["page"]();
49
+ }
50
+ click(selector) {
51
+ return globalThis["click"](selector);
52
+ }
53
+ screencast(opts, page) {
54
+ return globalThis["screencast"](Object.assign(Object.assign({}, opts), { path: this.testResourceConfiguration.fs + "/" + opts.path }), page.mainFrame()._id, this.testResourceConfiguration.name);
55
+ }
56
+ screencastStop(p) {
57
+ return globalThis["screencastStop"](p);
58
+ }
59
+ customScreenShot(opts, cdpPage) {
60
+ return globalThis["customScreenShot"](Object.assign(Object.assign({}, opts), { path: this.testResourceConfiguration.fs + "/" + opts.path }), cdpPage.mainFrame()._id, this.testResourceConfiguration.name);
61
+ }
62
+ existsSync(destFolder) {
63
+ return globalThis["existsSync"](this.testResourceConfiguration.fs + "/" + destFolder);
64
+ }
65
+ mkdirSync() {
66
+ return globalThis["mkdirSync"](this.testResourceConfiguration.fs + "/");
67
+ }
68
+ write(writeObject, contents) {
69
+ return globalThis["write"](writeObject.uid, contents);
70
+ }
71
+ writeFileSync(filepath, contents) {
72
+ return globalThis["writeFileSync"](this.testResourceConfiguration.fs + "/" + filepath, contents, this.testResourceConfiguration.name);
73
+ }
74
+ createWriteStream(filepath) {
75
+ return globalThis["createWriteStream"](this.testResourceConfiguration.fs + "/" + filepath, this.testResourceConfiguration.name);
76
+ }
77
+ end(writeObject) {
78
+ return globalThis["end"](writeObject.uid);
79
+ }
80
+ customclose() {
81
+ globalThis["customclose"](this.testResourceConfiguration.fs, this.testResourceConfiguration.name);
82
+ }
83
+ testArtiFactoryfileWriter(tLog, callback) {
84
+ return (fPath, value) => {
85
+ callback(new Promise((res, rej) => {
86
+ tLog("testArtiFactory =>", fPath);
87
+ const cleanPath = path_1.default.resolve(fPath);
88
+ fPaths.push(cleanPath.replace(process.cwd(), ``));
89
+ const targetDir = cleanPath.split("/").slice(0, -1).join("/");
90
+ fs_1.default.mkdir(targetDir, { recursive: true }, async (error) => {
91
+ if (error) {
92
+ console.error(`❗️testArtiFactory failed`, targetDir, error);
93
+ }
94
+ fs_1.default.writeFileSync(path_1.default.resolve(targetDir.split("/").slice(0, -1).join("/"), "manifest"), fPaths.join(`\n`), {
95
+ encoding: "utf-8",
96
+ });
97
+ if (Buffer.isBuffer(value)) {
98
+ fs_1.default.writeFileSync(fPath, value, "binary");
99
+ res();
100
+ }
101
+ else if (`string` === typeof value) {
102
+ fs_1.default.writeFileSync(fPath, value.toString(), {
103
+ encoding: "utf-8",
104
+ });
105
+ res();
106
+ }
107
+ else {
108
+ /* @ts-ignore:next-line */
109
+ const pipeStream = value;
110
+ const myFile = fs_1.default.createWriteStream(fPath);
111
+ pipeStream.pipe(myFile);
112
+ pipeStream.on("close", () => {
113
+ myFile.close();
114
+ res();
115
+ });
116
+ }
117
+ });
118
+ }));
119
+ };
120
+ }
121
+ // launch(options?: PuppeteerLaunchOptions): Promise<Browser>;
122
+ startPuppeteer(options) {
123
+ // return puppeteer.connect(options).then((b) => {
124
+ // this.browser = b;
125
+ // });
126
+ }
127
+ }
128
+ exports.PM_Node = PM_Node;
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PM_Web = void 0;
4
+ const index_js_1 = require("./index.js");
5
+ class PM_Web extends index_js_1.PM {
6
+ constructor(t) {
7
+ super();
8
+ this.server = {};
9
+ this.testResourceConfiguration = t;
10
+ }
11
+ waitForSelector(p, s) {
12
+ return window["waitForSelector"](p, s);
13
+ }
14
+ screencast(opts) {
15
+ return window["screencast"](Object.assign(Object.assign({}, opts), { path: this.testResourceConfiguration.fs + "/" + opts.path }), this.testResourceConfiguration.name);
16
+ }
17
+ screencastStop(recorder) {
18
+ return window["screencastStop"](recorder);
19
+ }
20
+ closePage(p) {
21
+ return window["closePage"](p);
22
+ }
23
+ goto(p, url) {
24
+ return window["goto"](p, url);
25
+ }
26
+ newPage() {
27
+ return window["newPage"]();
28
+ }
29
+ $(selector) {
30
+ return window["$"](selector);
31
+ }
32
+ isDisabled(selector) {
33
+ return window["isDisabled"](selector);
34
+ }
35
+ getAttribute(selector, attribute) {
36
+ return window["getValue"](selector, attribute);
37
+ }
38
+ getValue(selector) {
39
+ return window["getValue"](selector);
40
+ }
41
+ focusOn(selector) {
42
+ return window["focusOn"](selector);
43
+ }
44
+ typeInto(value) {
45
+ return window["typeInto"](value);
46
+ }
47
+ page() {
48
+ return window["page"]();
49
+ }
50
+ click(selector) {
51
+ return window["click"](selector);
52
+ }
53
+ customScreenShot(opts) {
54
+ return window["customScreenShot"](Object.assign(Object.assign({}, opts), { path: this.testResourceConfiguration.fs + "/" + opts.path }), this.testResourceConfiguration.name);
55
+ }
56
+ existsSync(destFolder) {
57
+ return window["existsSync"](destFolder);
58
+ }
59
+ mkdirSync(x) {
60
+ return window["mkdirSync"](this.testResourceConfiguration.fs + "/");
61
+ }
62
+ write(writeObject, contents) {
63
+ return window["write"](writeObject.uid, contents);
64
+ }
65
+ writeFileSync(filepath, contents) {
66
+ return window["writeFileSync"](this.testResourceConfiguration.fs + "/" + filepath, contents, this.testResourceConfiguration.name);
67
+ }
68
+ createWriteStream(filepath) {
69
+ return window["createWriteStream"](this.testResourceConfiguration.fs + "/" + filepath, this.testResourceConfiguration.name);
70
+ }
71
+ end(writeObject) {
72
+ return window["end"](writeObject.uid);
73
+ }
74
+ customclose() {
75
+ window["customclose"](this.testResourceConfiguration.fs, this.testResourceConfiguration.name);
76
+ }
77
+ testArtiFactoryfileWriter(tLog, callback) {
78
+ return (fPath, value) => {
79
+ callback(new Promise((res, rej) => {
80
+ tLog("testArtiFactory =>", fPath);
81
+ // const cleanPath = path.resolve(fPath);
82
+ // fPaths.push(cleanPath.replace(process.cwd(), ``));
83
+ // const targetDir = cleanPath.split("/").slice(0, -1).join("/");
84
+ // fs.mkdir(targetDir, { recursive: true }, async (error) => {
85
+ // if (error) {
86
+ // console.error(`❗️testArtiFactory failed`, targetDir, error);
87
+ // }
88
+ // fs.writeFileSync(
89
+ // path.resolve(
90
+ // targetDir.split("/").slice(0, -1).join("/"),
91
+ // "manifest"
92
+ // ),
93
+ // fPaths.join(`\n`),
94
+ // {
95
+ // encoding: "utf-8",
96
+ // }
97
+ // );
98
+ // if (Buffer.isBuffer(value)) {
99
+ // fs.writeFileSync(fPath, value, "binary");
100
+ // res();
101
+ // } else if (`string` === typeof value) {
102
+ // fs.writeFileSync(fPath, value.toString(), {
103
+ // encoding: "utf-8",
104
+ // });
105
+ // res();
106
+ // } else {
107
+ // /* @ts-ignore:next-line */
108
+ // const pipeStream: PassThrough = value;
109
+ // const myFile = fs.createWriteStream(fPath);
110
+ // pipeStream.pipe(myFile);
111
+ // pipeStream.on("close", () => {
112
+ // myFile.close();
113
+ // res();
114
+ // });
115
+ // }
116
+ // });
117
+ }));
118
+ };
119
+ }
120
+ }
121
+ exports.PM_Web = PM_Web;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const node_static_1 = __importDefault(require("node-static"));
7
+ const http_1 = __importDefault(require("http"));
8
+ const main = async () => {
9
+ process.chdir("../"); // Navigate one level up
10
+ const fileServer = new node_static_1.default.Server(".", {});
11
+ http_1.default
12
+ .createServer(function (request, response) {
13
+ request
14
+ .addListener("end", function () {
15
+ fileServer.serve(request, response);
16
+ })
17
+ .resume();
18
+ })
19
+ .listen(8080);
20
+ console.log("Server running on port 8080");
21
+ };
22
+ main();
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const react_1 = __importDefault(require("react"));
7
+ const Node_js_1 = __importDefault(require("../../../Node.js"));
8
+ exports.default = (testImplementations, testSpecifications, testInput) => {
9
+ return (0, Node_js_1.default)(testInput, testSpecifications, testImplementations, {
10
+ beforeEach: async () => {
11
+ return new Promise((resolve, rej) => {
12
+ resolve(react_1.default.createElement(testInput, {}, []));
13
+ });
14
+ },
15
+ andWhen: function (s, whenCB) {
16
+ return whenCB()(s);
17
+ },
18
+ });
19
+ };
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const react_1 = __importDefault(require("react"));
7
+ const Web_js_1 = __importDefault(require("../../../Web.js"));
8
+ exports.default = (testImplementations, testSpecifications, testInput) => {
9
+ return (0, Web_js_1.default)(testInput, testSpecifications, testImplementations, {
10
+ beforeEach: async () => {
11
+ return new Promise((resolve, rej) => {
12
+ resolve(react_1.default.createElement(testInput, {}, []));
13
+ });
14
+ },
15
+ andWhen: function (s, whenCB) {
16
+ return whenCB()(s);
17
+ },
18
+ });
19
+ };
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.testInterface = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ exports.testInterface = {
9
+ andWhen: async (s, whenCB) => {
10
+ await whenCB(s());
11
+ return new Promise((resolve, rej) => {
12
+ resolve(react_1.default.createElement(s));
13
+ });
14
+ },
15
+ butThen: async (subject, thenCB) => {
16
+ await thenCB(subject());
17
+ return new Promise((resolve, rej) => {
18
+ resolve(react_1.default.createElement(subject));
19
+ });
20
+ },
21
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const Node_js_1 = __importDefault(require("../../../Node.js"));
7
+ const index_js_1 = require("./index.js");
8
+ exports.default = (testImplementations, testSpecifications, testInput, testInterface = index_js_1.testInterface) => {
9
+ return (0, Node_js_1.default)(testInput, testSpecifications, testImplementations, testInterface);
10
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const Web_js_1 = __importDefault(require("../../../Web.js"));
7
+ const index_js_1 = require("./index.js");
8
+ exports.default = (testImplementations, testSpecifications, testInput, testInterface) => {
9
+ return (0, Web_js_1.default)(testInput, testSpecifications, testImplementations, Object.assign(Object.assign({}, index_js_1.testInterface), testInterface));
10
+ };
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Stream = exports.renderToStaticNodeStream = exports.renderToStaticMarkup = void 0;
7
+ const react_1 = require("react");
8
+ const server_1 = require("react-dom/server");
9
+ Object.defineProperty(exports, "renderToStaticMarkup", { enumerable: true, get: function () { return server_1.renderToStaticMarkup; } });
10
+ Object.defineProperty(exports, "renderToStaticNodeStream", { enumerable: true, get: function () { return server_1.renderToStaticNodeStream; } });
11
+ const stream_1 = __importDefault(require("stream"));
12
+ exports.Stream = stream_1.default;
13
+ const Node_js_1 = __importDefault(require("../../../Node.js"));
14
+ exports.default = (testImplementations, testSpecifications, testInput) => {
15
+ return (0, Node_js_1.default)(testInput, testSpecifications, testImplementations, {
16
+ beforeEach: async () => {
17
+ return new Promise((resolve, rej) => {
18
+ resolve((0, react_1.createElement)(testInput));
19
+ });
20
+ },
21
+ andWhen: async function (s, whenCB) {
22
+ return whenCB(s);
23
+ },
24
+ butThen: async function (s) {
25
+ return s;
26
+ },
27
+ afterEach: async function () {
28
+ return {};
29
+ },
30
+ afterAll: () => {
31
+ return;
32
+ },
33
+ });
34
+ };
35
+ // type IInput = typeof React.Component;
36
+ // type InitialState = unknown;
37
+ // type IWhenShape = any;
38
+ // type IThenShape = any;
39
+ // type ISelection = string;
40
+ // type IStore = string;
41
+ // type ISubject = string
42
+ // export default <ITestShape extends ITTestShape>(
43
+ // testImplementations: ITestImplementation<
44
+ // InitialState,
45
+ // ISelection,
46
+ // IWhenShape,
47
+ // IThenShape,
48
+ // ITestShape
49
+ // >,
50
+ // testSpecifications: ITestSpecification<
51
+ // ITestShape,
52
+ // ISubject,
53
+ // IStore,
54
+ // ISelection,
55
+ // IThenShape
56
+ // >,
57
+ // testInput: IInput
58
+ // ) => {
59
+ // return Testeranto<
60
+ // ITestShape,
61
+ // IInput,
62
+ // ISubject,
63
+ // IStore,
64
+ // ISelection,
65
+ // IThenShape,
66
+ // IWhenShape,
67
+ // InitialState
68
+ // >(
69
+ // testInput,
70
+ // testSpecifications,
71
+ // testImplementations,
72
+ // {
73
+ // beforeEach: async (
74
+ // element,
75
+ // ndx,
76
+ // testResource,
77
+ // artificer
78
+ // ): Promise<IStore> => {
79
+ // return new Promise((resolve, rej) => {
80
+ // resolve(ReactDOMServer.renderToStaticMarkup(element));
81
+ // });
82
+ // },
83
+ // andWhen: function (s: IStore, whenCB): Promise<ISelection> {
84
+ // throw new Error(`"andWhens" are not permitted`);
85
+ // }
86
+ // },
87
+ // )
88
+ // };
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const react_1 = require("react");
7
+ const client_1 = __importDefault(require("react-dom/client"));
8
+ const Web_js_1 = __importDefault(require("../../../Web.js"));
9
+ exports.default = (testInput, testSpecifications, testImplementations, testInterface) => {
10
+ class TesterantoComponent extends testInput {
11
+ constructor(props) {
12
+ super(props);
13
+ this.done = props.done;
14
+ }
15
+ componentDidMount() {
16
+ super.componentDidMount && super.componentDidMount();
17
+ return this.done(this);
18
+ }
19
+ }
20
+ const t = (0, Web_js_1.default)(testInput, testSpecifications, testImplementations, {
21
+ beforeAll: async (subject, artificer) => {
22
+ return await new Promise((resolve, rej) => {
23
+ const htmlElement = document.getElementById("root");
24
+ if (htmlElement) {
25
+ const domRoot = client_1.default.createRoot(htmlElement);
26
+ resolve({ domRoot, htmlElement });
27
+ }
28
+ });
29
+ },
30
+ beforeEach: async ({ domRoot, htmlElement }, initialValues, testResource, artificer) => {
31
+ return new Promise(async (resolve, rej) => {
32
+ domRoot.render((0, react_1.createElement)(TesterantoComponent, Object.assign(Object.assign({}, initialValues), { done: (reactElement) => {
33
+ resolve({
34
+ htmlElement,
35
+ reactElement,
36
+ domRoot,
37
+ });
38
+ } }), []));
39
+ });
40
+ },
41
+ andWhen: async function (s, whenCB) {
42
+ return whenCB(s);
43
+ },
44
+ butThen: async function (s, thenCB) {
45
+ return thenCB(s);
46
+ },
47
+ afterEach: (testInterface === null || testInterface === void 0 ? void 0 : testInterface.afterEach) ||
48
+ async function (store, ndx, utils) {
49
+ return store;
50
+ },
51
+ afterAll: async (store, utils) => {
52
+ // setTimeout(() => {
53
+ // console.log("This will run after 1 second");
54
+ // }, 1000); // 1000 milliseconds = 1 second
55
+ // store.htmlElement.remove();
56
+ // store.htmlElement = document.createElement("root");
57
+ return store;
58
+ },
59
+ });
60
+ document.addEventListener("DOMContentLoaded", function () {
61
+ const elem = document.getElementById("root");
62
+ if (elem) {
63
+ return t;
64
+ }
65
+ });
66
+ return t;
67
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Stream = exports.renderToStaticNodeStream = exports.renderToStaticMarkup = void 0;
7
+ const react_1 = require("react");
8
+ const server_1 = require("react-dom/server");
9
+ Object.defineProperty(exports, "renderToStaticMarkup", { enumerable: true, get: function () { return server_1.renderToStaticMarkup; } });
10
+ Object.defineProperty(exports, "renderToStaticNodeStream", { enumerable: true, get: function () { return server_1.renderToStaticNodeStream; } });
11
+ const stream_1 = __importDefault(require("stream"));
12
+ exports.Stream = stream_1.default;
13
+ const Node_js_1 = __importDefault(require("../../../Node.js"));
14
+ exports.default = (testImplementations, testSpecifications, testInput) => {
15
+ return (0, Node_js_1.default)(testInput, testSpecifications, testImplementations, {
16
+ beforeAll: async (prototype, artificer) => {
17
+ return await new Promise((resolve, rej) => {
18
+ resolve(null);
19
+ });
20
+ },
21
+ beforeEach: async () => {
22
+ return new Promise((resolve, rej) => {
23
+ resolve((0, react_1.createElement)(testInput));
24
+ });
25
+ },
26
+ andWhen: async function (s, whenCB) {
27
+ return s;
28
+ },
29
+ butThen: async function (s) {
30
+ return s;
31
+ },
32
+ afterEach: async function (store, ndx, artificer) {
33
+ return {};
34
+ },
35
+ afterAll: (store, artificer) => {
36
+ return;
37
+ },
38
+ });
39
+ };