testeranto 0.79.69 → 0.81.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.aider.chat.history.md +980 -0
- package/.aider.input.history +87 -0
- package/.aider.tags.cache.v3/1c/30/af1de2ad7a137afeddb1b01e0c27.val +0 -0
- package/.aider.tags.cache.v3/1d/63/88318b65ce58b6bb0487e8ce2656.val +0 -0
- package/.aider.tags.cache.v3/2e/67/16ae65530b40038e48e00d666c63.val +0 -0
- package/.aider.tags.cache.v3/6f/94/80488a232866fcce7ee657da488b.val +0 -0
- package/.aider.tags.cache.v3/cache.db +0 -0
- package/.eslintrc.js +5 -2
- package/README.md +10 -107
- package/build-tests.ts +16 -0
- package/dist/common/build-tests.js +38 -0
- package/dist/common/init-docs.js +8 -0
- package/dist/common/run-tests.js +34 -0
- package/dist/common/src/Aider.js +143 -0
- package/dist/common/src/Init.js +10 -0
- package/dist/common/{PM → src/PM}/main.js +58 -49
- package/dist/common/{PM → src/PM}/node.js +1 -1
- package/dist/common/{Project.js → src/Project.js} +46 -38
- package/dist/common/{Puppeteer.js → src/Puppeteer.js} +51 -40
- package/dist/common/{SubPackages → src/SubPackages}/react-dom/jsx/web.js +37 -38
- package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx/index.js +17 -2
- package/dist/common/src/esbuildConfigs/inputFilesPlugin.js +79 -0
- package/dist/common/{esbuildConfigs → src/esbuildConfigs}/node.js +5 -3
- package/dist/common/{esbuildConfigs → src/esbuildConfigs}/web.js +4 -4
- package/dist/common/{lib → src/lib}/abstractBase.js +80 -24
- package/dist/common/{lib → src/lib}/basebuilder.js +14 -3
- package/dist/common/{lib → src/lib}/core.js +47 -3
- package/dist/common/testeranto.js +15 -0
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/build-tests.js +10 -0
- package/dist/module/init-docs.js +3 -0
- package/dist/module/run-tests.js +6 -0
- package/dist/module/src/Aider.js +136 -0
- package/dist/module/src/Init.js +5 -0
- package/dist/module/{PM → src/PM}/main.js +58 -49
- package/dist/module/{PM → src/PM}/node.js +1 -1
- package/dist/module/{Project.js → src/Project.js} +46 -38
- package/dist/module/{Puppeteer.js → src/Puppeteer.js} +51 -40
- package/dist/module/{SubPackages → src/SubPackages}/react-dom/jsx/web.js +37 -38
- package/dist/module/src/SubPackages/react-test-renderer/jsx/index.js +34 -0
- package/dist/module/src/esbuildConfigs/inputFilesPlugin.js +74 -0
- package/dist/module/{esbuildConfigs → src/esbuildConfigs}/node.js +4 -2
- package/dist/module/{esbuildConfigs → src/esbuildConfigs}/web.js +4 -4
- package/dist/module/{lib → src/lib}/abstractBase.js +80 -24
- package/dist/module/{lib → src/lib}/basebuilder.js +14 -3
- package/dist/module/{lib → src/lib}/core.js +47 -3
- package/dist/module/testeranto.js +13 -0
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/build-tests.d.ts +3 -0
- package/dist/types/init-docs.d.ts +2 -0
- package/dist/types/run-tests.d.ts +2 -0
- package/dist/types/src/Aider.d.ts +1 -0
- package/dist/types/{PM → src/PM}/index.d.ts +1 -1
- package/dist/types/{PM → src/PM}/main.d.ts +7 -1
- package/dist/types/{Project.d.ts → src/Project.d.ts} +6 -1
- package/dist/types/{Types.d.ts → src/Types.d.ts} +3 -2
- package/dist/types/{lib → src/lib}/abstractBase.d.ts +1 -0
- package/dist/types/testeranto.d.ts +16 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/init-docs.ts +5 -0
- package/package.json +54 -29
- package/run-tests.ts +9 -0
- package/secret +1 -0
- package/secret.env +2 -0
- package/src/Aider.ts +168 -0
- package/src/Init.ts +0 -31
- package/src/PM/index.ts +1 -1
- package/src/PM/main.ts +71 -61
- package/src/PM/node.ts +1 -1
- package/src/Project.ts +55 -48
- package/src/Puppeteer.ts +66 -52
- package/src/SubPackages/react-dom/jsx/web.ts +46 -49
- package/src/SubPackages/react-test-renderer/jsx/index.ts +25 -2
- package/src/Types.ts +3 -1
- package/src/esbuildConfigs/inputFilesPlugin.ts +78 -31
- package/src/esbuildConfigs/node.ts +2 -2
- package/src/esbuildConfigs/web.ts +4 -4
- package/src/lib/abstractBase.ts +88 -30
- package/src/lib/basebuilder.ts +17 -3
- package/src/lib/core.ts +55 -13
- package/testeranto.ts +13 -0
- package/tsconfig.common.json +12 -4
- package/tsconfig.json +9 -2
- package/tsconfig.module.json +2 -2
- package/tsconfig.types.json +1 -1
- package/Report.Dockerfile +0 -44
- package/dist/common/Features.js +0 -51
- package/dist/common/Init.js +0 -30
- package/dist/common/Reporter.js +0 -112
- package/dist/common/Scheduler.js +0 -1
- package/dist/common/TaskManBackEnd.js +0 -167
- package/dist/common/esbuildConfigs/inputFilesPlugin.js +0 -49
- package/dist/common/mongooseSchemas.js +0 -56
- package/dist/common/preload.js +0 -15
- package/dist/common/report.html.js +0 -31
- package/dist/module/ExampleTab.js +0 -112
- package/dist/module/Features.js +0 -41
- package/dist/module/Init.js +0 -25
- package/dist/module/Reporter.js +0 -107
- package/dist/module/Scheduler.js +0 -1
- package/dist/module/SubPackages/react-test-renderer/jsx/index.js +0 -19
- package/dist/module/TaskManBackEnd.js +0 -162
- package/dist/module/TaskManFrontEnd.js +0 -605
- package/dist/module/esbuildConfigs/inputFilesPlugin.js +0 -44
- package/dist/module/mongooseSchemas.js +0 -50
- package/dist/module/preload.js +0 -15
- package/dist/module/report.html.js +0 -29
- package/dist/prebuild/TaskManBackEnd.mjs +0 -170
- package/dist/prebuild/TaskManFrontEnd.css +0 -12301
- package/dist/prebuild/TaskManFrontEnd.js +0 -81262
- package/dist/types/Features.d.ts +0 -35
- package/dist/types/Reporter.d.ts +0 -1
- package/dist/types/Scheduler.d.ts +0 -0
- package/dist/types/TaskManBackEnd.d.ts +0 -3
- package/dist/types/mongooseSchemas.d.ts +0 -124
- package/dist/types/preload.d.ts +0 -0
- package/dist/types/report.html.d.ts +0 -2
- package/src/ExampleTab.tsx +0 -219
- package/src/Features.ts +0 -64
- package/src/Reporter.ts +0 -126
- package/src/Scheduler.ts +0 -0
- package/src/TaskManBackEnd.ts +0 -226
- package/src/TaskManFrontEnd.tsx +0 -1254
- package/src/mongooseSchemas.ts +0 -105
- package/src/preload.ts +0 -17
- package/src/report.html.ts +0 -29
- package/tests/Rectangle.test.ts +0 -189
- package/trash/TaskMan.Dockerfile +0 -23
- package/trash/TaskMan1.Dockerfile +0 -43
- package/trash/devBot.dockerfile +0 -12
- package/trash/docker-compose-dev.yml +0 -9
- package/trash/docker-compose-prod.yml +0 -18
- package/trash/electronBuild.ts +0 -32
- /package/dist/common/{Node.js → src/Node.js} +0 -0
- /package/dist/common/{PM → src/PM}/index.js +0 -0
- /package/dist/common/{PM → src/PM}/web.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/puppeteer.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react/component/node.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react/component/web.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react/jsx/index.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react/jsx/node.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react/jsx/web.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-dom/component/node.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-dom/component/web.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-dom/jsx/index.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-dom/jsx/node.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/MemoExoticComponent/node.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/component/index.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/component/interface.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/component/node.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/component/web.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/fc/node.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/fc/web.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx/node.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx/web.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/index.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/node.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/web.js +0 -0
- /package/dist/common/{Types.js → src/Types.js} +0 -0
- /package/dist/common/{Web.js → src/Web.js} +0 -0
- /package/dist/common/{esbuildConfigs → src/esbuildConfigs}/features.js +0 -0
- /package/dist/common/{esbuildConfigs → src/esbuildConfigs}/index.js +0 -0
- /package/dist/common/{esbuildConfigs → src/esbuildConfigs}/report.js +0 -0
- /package/dist/common/{esbuildConfigs → src/esbuildConfigs}/tests.js +0 -0
- /package/dist/common/{lib → src/lib}/classBuilder.js +0 -0
- /package/dist/common/{lib → src/lib}/index.js +0 -0
- /package/dist/common/{lib → src/lib}/types.js +0 -0
- /package/dist/common/{puppeteerConfiger.js → src/puppeteerConfiger.js} +0 -0
- /package/dist/common/{utils.js → src/utils.js} +0 -0
- /package/dist/common/{web.html.js → src/web.html.js} +0 -0
- /package/dist/module/{Node.js → src/Node.js} +0 -0
- /package/dist/module/{PM → src/PM}/index.js +0 -0
- /package/dist/module/{PM → src/PM}/web.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/puppeteer.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react/component/node.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react/component/web.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react/jsx/index.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react/jsx/node.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react/jsx/web.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-dom/component/node.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-dom/component/web.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-dom/jsx/index.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-dom/jsx/node.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/MemoExoticComponent/node.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/component/index.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/component/interface.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/component/node.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/component/web.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/fc/node.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/fc/web.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx/node.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx/web.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/index.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/node.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/web.js +0 -0
- /package/dist/module/{Types.js → src/Types.js} +0 -0
- /package/dist/module/{Web.js → src/Web.js} +0 -0
- /package/dist/module/{esbuildConfigs → src/esbuildConfigs}/features.js +0 -0
- /package/dist/module/{esbuildConfigs → src/esbuildConfigs}/index.js +0 -0
- /package/dist/module/{esbuildConfigs → src/esbuildConfigs}/report.js +0 -0
- /package/dist/module/{esbuildConfigs → src/esbuildConfigs}/tests.js +0 -0
- /package/dist/module/{lib → src/lib}/classBuilder.js +0 -0
- /package/dist/module/{lib → src/lib}/index.js +0 -0
- /package/dist/module/{lib → src/lib}/types.js +0 -0
- /package/dist/module/{puppeteerConfiger.js → src/puppeteerConfiger.js} +0 -0
- /package/dist/module/{utils.js → src/utils.js} +0 -0
- /package/dist/module/{web.html.js → src/web.html.js} +0 -0
- /package/dist/types/{Init.d.ts → src/Init.d.ts} +0 -0
- /package/dist/types/{Node.d.ts → src/Node.d.ts} +0 -0
- /package/dist/types/{PM → src/PM}/node.d.ts +0 -0
- /package/dist/types/{PM → src/PM}/web.d.ts +0 -0
- /package/dist/types/{Puppeteer.d.ts → src/Puppeteer.d.ts} +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/puppeteer.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react/component/node.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react/component/web.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react/jsx/index.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react/jsx/node.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react/jsx/web.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-dom/component/node.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-dom/component/web.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-dom/jsx/index.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-dom/jsx/node.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-dom/jsx/web.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/MemoExoticComponent/node.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/component/index.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/component/interface.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/component/node.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/component/web.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/fc/node.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/fc/web.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx/index.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx/node.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx/web.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/index.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/node.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/web.d.ts +0 -0
- /package/dist/types/{Web.d.ts → src/Web.d.ts} +0 -0
- /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/features.d.ts +0 -0
- /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/index.d.ts +0 -0
- /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/inputFilesPlugin.d.ts +0 -0
- /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/node.d.ts +0 -0
- /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/report.d.ts +0 -0
- /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/tests.d.ts +0 -0
- /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/web.d.ts +0 -0
- /package/dist/types/{lib → src/lib}/basebuilder.d.ts +0 -0
- /package/dist/types/{lib → src/lib}/classBuilder.d.ts +0 -0
- /package/dist/types/{lib → src/lib}/core.d.ts +0 -0
- /package/dist/types/{lib → src/lib}/index.d.ts +0 -0
- /package/dist/types/{lib → src/lib}/types.d.ts +0 -0
- /package/dist/types/{puppeteerConfiger.d.ts → src/puppeteerConfiger.d.ts} +0 -0
- /package/dist/types/{utils.d.ts → src/utils.d.ts} +0 -0
- /package/dist/types/{web.html.d.ts → src/web.html.d.ts} +0 -0
|
@@ -39,8 +39,32 @@ const screenshots = {};
|
|
|
39
39
|
class PM_Main extends index_js_1.PM {
|
|
40
40
|
constructor(configs) {
|
|
41
41
|
super();
|
|
42
|
+
this.shutdownMode = false;
|
|
43
|
+
this.checkForShutdown = () => {
|
|
44
|
+
const anyRunning = Object.values(this.registry).filter((x) => x === false).length > 0;
|
|
45
|
+
if (anyRunning) {
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
this.browser.disconnect().then(() => {
|
|
49
|
+
console.log("Goodbye");
|
|
50
|
+
process.exit();
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
this.register = (src) => {
|
|
55
|
+
// console.log("register", src);
|
|
56
|
+
this.registry[src] = false;
|
|
57
|
+
};
|
|
58
|
+
this.deregister = (src) => {
|
|
59
|
+
// console.log("deregister", src, this.shutdownMode);
|
|
60
|
+
this.registry[src] = true;
|
|
61
|
+
if (this.shutdownMode) {
|
|
62
|
+
this.checkForShutdown();
|
|
63
|
+
}
|
|
64
|
+
};
|
|
42
65
|
this.launchNode = async (src, dest) => {
|
|
43
66
|
console.log("launchNode", src);
|
|
67
|
+
this.register(src);
|
|
44
68
|
const destFolder = dest.replace(".mjs", "");
|
|
45
69
|
let argz = "";
|
|
46
70
|
const testConfig = this.configs.tests.find((t) => {
|
|
@@ -63,7 +87,6 @@ class PM_Main extends index_js_1.PM {
|
|
|
63
87
|
}
|
|
64
88
|
else if (testConfigResource.ports > 0) {
|
|
65
89
|
const openPorts = Object.entries(this.ports).filter(([portnumber, portopen]) => portopen);
|
|
66
|
-
console.log("openPorts", openPorts);
|
|
67
90
|
if (openPorts.length >= testConfigResource.ports) {
|
|
68
91
|
for (let i = 0; i < testConfigResource.ports; i++) {
|
|
69
92
|
portsToUse.push(openPorts[i][0]);
|
|
@@ -100,16 +123,15 @@ class PM_Main extends index_js_1.PM {
|
|
|
100
123
|
return module.default.then((defaultModule) => {
|
|
101
124
|
defaultModule
|
|
102
125
|
.receiveTestResourceConfig(argz)
|
|
103
|
-
.then((x) => {
|
|
104
|
-
console.log("then", x);
|
|
105
|
-
return x;
|
|
106
|
-
})
|
|
107
126
|
.catch((e) => {
|
|
108
127
|
console.log("catch", e);
|
|
128
|
+
})
|
|
129
|
+
.finally(() => {
|
|
130
|
+
this.deregister(src);
|
|
109
131
|
});
|
|
110
132
|
});
|
|
111
133
|
});
|
|
112
|
-
console.log("portsToUse", portsToUse);
|
|
134
|
+
// console.log("portsToUse", portsToUse);
|
|
113
135
|
for (let i = 0; i <= portsToUse.length; i++) {
|
|
114
136
|
if (portsToUse[i]) {
|
|
115
137
|
this.ports[portsToUse[i]] = "true"; //port is open again
|
|
@@ -143,7 +165,7 @@ class PM_Main extends index_js_1.PM {
|
|
|
143
165
|
// console.log(`${i}: ${msg._args[i]}`);
|
|
144
166
|
});
|
|
145
167
|
page.exposeFunction("custom-screenshot", async (ssOpts, testName) => {
|
|
146
|
-
console.log("main.ts browser custom-screenshot", testName);
|
|
168
|
+
// console.log("main.ts browser custom-screenshot", testName);
|
|
147
169
|
const p = ssOpts.path;
|
|
148
170
|
const dir = path_1.default.dirname(p);
|
|
149
171
|
fs_1.default.mkdirSync(dir, {
|
|
@@ -214,7 +236,7 @@ class PM_Main extends index_js_1.PM {
|
|
|
214
236
|
delete files[testName];
|
|
215
237
|
Promise.all(screenshots[testName] || []).then(() => {
|
|
216
238
|
delete screenshots[testName];
|
|
217
|
-
page.close();
|
|
239
|
+
// page.close();
|
|
218
240
|
});
|
|
219
241
|
// globalThis["writeFileSync"](
|
|
220
242
|
// p + "/manifest.json",
|
|
@@ -248,7 +270,6 @@ class PM_Main extends index_js_1.PM {
|
|
|
248
270
|
});
|
|
249
271
|
});
|
|
250
272
|
};
|
|
251
|
-
// launchNodeSideCar = async (src: string, dest: string) => {};
|
|
252
273
|
this.launchNodeSideCar = async (src, dest, testConfig) => {
|
|
253
274
|
const d = dest + ".mjs";
|
|
254
275
|
console.log("launchNodeSideCar", src, dest, d);
|
|
@@ -274,7 +295,7 @@ class PM_Main extends index_js_1.PM {
|
|
|
274
295
|
}
|
|
275
296
|
else if (testConfigResource.ports > 0) {
|
|
276
297
|
const openPorts = Object.entries(this.ports).filter(([portnumber, portopen]) => portopen);
|
|
277
|
-
console.log("openPorts", openPorts);
|
|
298
|
+
// console.log("openPorts", openPorts);
|
|
278
299
|
if (openPorts.length >= testConfigResource.ports) {
|
|
279
300
|
for (let i = 0; i < testConfigResource.ports; i++) {
|
|
280
301
|
portsToUse.push(openPorts[i][0]);
|
|
@@ -305,7 +326,7 @@ class PM_Main extends index_js_1.PM {
|
|
|
305
326
|
// );
|
|
306
327
|
this.server[builtfile] = await Promise.resolve().then(() => __importStar(require(`${builtfile}?cacheBust=${Date.now()}`))).then((module) => {
|
|
307
328
|
return module.default.then((defaultModule) => {
|
|
308
|
-
console.log("defaultModule", defaultModule);
|
|
329
|
+
// console.log("defaultModule", defaultModule);
|
|
309
330
|
const s = new defaultModule();
|
|
310
331
|
s.receiveTestResourceConfig(argz);
|
|
311
332
|
// Object.create(defaultModule);
|
|
@@ -320,7 +341,7 @@ class PM_Main extends index_js_1.PM {
|
|
|
320
341
|
// });
|
|
321
342
|
});
|
|
322
343
|
});
|
|
323
|
-
console.log("portsToUse", portsToUse);
|
|
344
|
+
// console.log("portsToUse", portsToUse);
|
|
324
345
|
for (let i = 0; i <= portsToUse.length; i++) {
|
|
325
346
|
if (portsToUse[i]) {
|
|
326
347
|
this.ports[portsToUse[i]] = "true"; //port is open again
|
|
@@ -329,6 +350,7 @@ class PM_Main extends index_js_1.PM {
|
|
|
329
350
|
};
|
|
330
351
|
this.launchWeb = (t, dest, sidecars) => {
|
|
331
352
|
console.log("launchWeb", t, dest);
|
|
353
|
+
this.register(t);
|
|
332
354
|
sidecars.map((sidecar) => {
|
|
333
355
|
if (sidecar[1] === "node") {
|
|
334
356
|
return this.launchNodeSideCar(sidecar[0], (0, utils_js_1.destinationOfRuntime)(sidecar[0], "node", this.configs), sidecar);
|
|
@@ -362,7 +384,7 @@ class PM_Main extends index_js_1.PM {
|
|
|
362
384
|
// console.log(`${i}: ${msg._args[i]}`);
|
|
363
385
|
});
|
|
364
386
|
page.exposeFunction("customScreenShot", async (ssOpts, testName) => {
|
|
365
|
-
console.log("main.ts browser custom-screenshot", testName);
|
|
387
|
+
// console.log("main.ts browser custom-screenshot", testName);
|
|
366
388
|
const p = ssOpts.path;
|
|
367
389
|
const dir = path_1.default.dirname(p);
|
|
368
390
|
fs_1.default.mkdirSync(dir, {
|
|
@@ -432,12 +454,15 @@ class PM_Main extends index_js_1.PM {
|
|
|
432
454
|
return fileStreams2[uid].end();
|
|
433
455
|
});
|
|
434
456
|
page.exposeFunction("customclose", (p, testName) => {
|
|
435
|
-
console.log("
|
|
457
|
+
// console.log("closing", p);
|
|
436
458
|
fs_1.default.writeFileSync(p + "/manifest.json", JSON.stringify(Array.from(files[testName])));
|
|
437
459
|
delete files[testName];
|
|
460
|
+
// console.log("screenshots[testName]", screenshots[testName]);
|
|
438
461
|
Promise.all(screenshots[testName] || []).then(() => {
|
|
439
462
|
delete screenshots[testName];
|
|
440
|
-
page.close();
|
|
463
|
+
// page.close();
|
|
464
|
+
// console.log("\t GOODBYE");
|
|
465
|
+
// whyIsNodeRunning();
|
|
441
466
|
});
|
|
442
467
|
// globalThis["writeFileSync"](
|
|
443
468
|
// p + "/manifest.json",
|
|
@@ -463,8 +488,17 @@ class PM_Main extends index_js_1.PM {
|
|
|
463
488
|
.then(async (page) => {
|
|
464
489
|
page.on("console", (log) => console.debug(`Log from client: [${log.text()}] `));
|
|
465
490
|
await page.goto(`file://${`${dest}.html`}`, {});
|
|
466
|
-
page
|
|
491
|
+
page
|
|
492
|
+
.evaluate(evaluation)
|
|
493
|
+
.catch((e) => {
|
|
467
494
|
console.log("evaluation failed.", dest);
|
|
495
|
+
console.log(e);
|
|
496
|
+
})
|
|
497
|
+
.finally(() => {
|
|
498
|
+
console.log("evaluation complete.", dest);
|
|
499
|
+
// page.close();
|
|
500
|
+
this.deregister(t);
|
|
501
|
+
// whyIsNodeRunning();
|
|
468
502
|
});
|
|
469
503
|
return page;
|
|
470
504
|
});
|
|
@@ -472,6 +506,7 @@ class PM_Main extends index_js_1.PM {
|
|
|
472
506
|
this.server = {};
|
|
473
507
|
this.configs = configs;
|
|
474
508
|
this.ports = {};
|
|
509
|
+
this.registry = {};
|
|
475
510
|
this.configs.ports.forEach((element) => {
|
|
476
511
|
this.ports[element] = "true"; // set ports as open
|
|
477
512
|
});
|
|
@@ -484,7 +519,7 @@ class PM_Main extends index_js_1.PM {
|
|
|
484
519
|
return false;
|
|
485
520
|
};
|
|
486
521
|
globalThis["writeFileSync"] = (filepath, contents, testName) => {
|
|
487
|
-
console.log("globalThis-writeFileSync", filepath);
|
|
522
|
+
// console.log("globalThis-writeFileSync", filepath);
|
|
488
523
|
// Create directories if they don't exist
|
|
489
524
|
const dir = path_1.default.dirname(filepath.split("/").slice(0, -1).join("/"));
|
|
490
525
|
fs_1.default.mkdirSync(dir, {
|
|
@@ -513,15 +548,6 @@ class PM_Main extends index_js_1.PM {
|
|
|
513
548
|
fileStreams3[uid].end();
|
|
514
549
|
};
|
|
515
550
|
globalThis["customScreenShot"] = async (opts, page) => {
|
|
516
|
-
// // fileStreams3[uid].write(contents);
|
|
517
|
-
// // console.log("asd", opts.path.split("/").slice(0, -1).join("/"));
|
|
518
|
-
// // const dir = path.dirname(opts.path.split("/").slice(0, -1).join("/"));
|
|
519
|
-
// // console.log("dir", dir);
|
|
520
|
-
// fs.mkdirSync(opts.path.split("/").slice(0, -1).join("/"), {
|
|
521
|
-
// recursive: true,
|
|
522
|
-
// });
|
|
523
|
-
// return page.screenshot(opts);
|
|
524
|
-
console.log("main.ts node custom-screenshot", page);
|
|
525
551
|
const p = opts.path;
|
|
526
552
|
const dir = path_1.default.dirname(p);
|
|
527
553
|
fs_1.default.mkdirSync(dir, {
|
|
@@ -545,35 +571,18 @@ class PM_Main extends index_js_1.PM {
|
|
|
545
571
|
}
|
|
546
572
|
fs_1.default.writeFileSync(p + "/manifest.json", JSON.stringify(Array.from(files[testName])));
|
|
547
573
|
delete files[testName];
|
|
548
|
-
// globalThis["writeFileSync"](
|
|
549
|
-
// p + "/manifest.json",
|
|
550
|
-
// // files.entries()
|
|
551
|
-
// JSON.stringify(Array.from(files[testName]))
|
|
552
|
-
// );
|
|
553
|
-
// fileStreams3[uid].end();
|
|
554
574
|
};
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
// });
|
|
561
|
-
// // page.close();
|
|
562
|
-
// // Promise.all(screenshots).then(() => {
|
|
563
|
-
// // page.close();
|
|
564
|
-
// // });
|
|
565
|
-
// // setTimeout(() => {
|
|
566
|
-
// // console.log("Delayed for 1 second.");
|
|
567
|
-
// // page.close();
|
|
568
|
-
// // }, 5000);
|
|
569
|
-
// // return page.close();
|
|
570
|
-
// });
|
|
575
|
+
}
|
|
576
|
+
shutDown() {
|
|
577
|
+
console.log("shutting down...");
|
|
578
|
+
this.shutdownMode = true;
|
|
579
|
+
this.checkForShutdown();
|
|
571
580
|
}
|
|
572
581
|
customScreenShot(opts) {
|
|
573
582
|
throw new Error("Method not implemented.");
|
|
574
583
|
}
|
|
575
584
|
async startPuppeteer(options, destfolder) {
|
|
576
|
-
this.browser = await puppeteer_core_1.default.launch(options);
|
|
585
|
+
this.browser = (await puppeteer_core_1.default.launch(options));
|
|
577
586
|
return this.browser;
|
|
578
587
|
}
|
|
579
588
|
end(accessObject) {
|
|
@@ -28,7 +28,7 @@ class PM_Node extends index_js_1.PM {
|
|
|
28
28
|
return globalThis["write"](writeObject.uid, contents);
|
|
29
29
|
}
|
|
30
30
|
writeFileSync(filepath, contents) {
|
|
31
|
-
console.log("pm_node-writeFileSync", this.testResourceConfiguration);
|
|
31
|
+
// console.log("pm_node-writeFileSync", this.testResourceConfiguration);
|
|
32
32
|
return globalThis["writeFileSync"](this.testResourceConfiguration.fs + "/" + filepath, contents, this.testResourceConfiguration.name);
|
|
33
33
|
}
|
|
34
34
|
createWriteStream(filepath) {
|
|
@@ -12,44 +12,52 @@ const glob_1 = require("glob");
|
|
|
12
12
|
const node_js_1 = __importDefault(require("./esbuildConfigs/node.js"));
|
|
13
13
|
const web_js_1 = __importDefault(require("./esbuildConfigs/web.js"));
|
|
14
14
|
const web_html_js_1 = __importDefault(require("./web.html.js"));
|
|
15
|
-
var mode = process.argv[2] === "-dev" ? "DEV" : "PROD";
|
|
15
|
+
// var mode: "DEV" | "PROD" = process.argv[2] === "-dev" ? "DEV" : "PROD";
|
|
16
16
|
readline_1.default.emitKeypressEvents(process.stdin);
|
|
17
17
|
if (process.stdin.isTTY)
|
|
18
18
|
process.stdin.setRawMode(true);
|
|
19
|
-
process.stdin.on("keypress", (str, key) => {
|
|
20
|
-
if (key.name === "q") {
|
|
21
|
-
console.log("Testeranto-EsBuild is shutting down...");
|
|
22
|
-
mode = "PROD";
|
|
23
|
-
onDone();
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
let nodeDone, webDone = false;
|
|
27
|
-
const onNodeDone = () => {
|
|
28
|
-
nodeDone = true;
|
|
29
|
-
onDone();
|
|
30
|
-
};
|
|
31
|
-
const onWebDone = () => {
|
|
32
|
-
webDone = true;
|
|
33
|
-
onDone();
|
|
34
|
-
};
|
|
35
|
-
const onDone = () => {
|
|
36
|
-
console.log(JSON.stringify({
|
|
37
|
-
nodeDone,
|
|
38
|
-
webDone,
|
|
39
|
-
mode,
|
|
40
|
-
}, null, 2));
|
|
41
|
-
if (nodeDone && webDone && mode === "PROD") {
|
|
42
|
-
console.log("Testeranto-EsBuild is all done. Goodbye!");
|
|
43
|
-
process.exit();
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
console.log("Testeranto-EsBuild is still working...");
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
19
|
class ITProject {
|
|
50
20
|
constructor(configs) {
|
|
51
|
-
this.
|
|
21
|
+
this.nodeDone = false;
|
|
22
|
+
this.webDone = false;
|
|
23
|
+
this.onNodeDone = () => {
|
|
24
|
+
this.nodeDone = true;
|
|
25
|
+
this.onDone();
|
|
26
|
+
};
|
|
27
|
+
this.onWebDone = () => {
|
|
28
|
+
this.webDone = true;
|
|
29
|
+
this.onDone();
|
|
30
|
+
};
|
|
31
|
+
this.onDone = () => {
|
|
32
|
+
// console.log(this.nodeDone && this.webDone && this.mode === "PROD");
|
|
33
|
+
if (this.nodeDone && this.webDone && this.mode === "PROD") {
|
|
34
|
+
console.log("Testeranto-EsBuild is all done. Goodbye!");
|
|
35
|
+
process.exit();
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
if (this.mode === "PROD") {
|
|
39
|
+
console.log("waiting for tests to finish");
|
|
40
|
+
console.log(JSON.stringify({
|
|
41
|
+
nodeDone: this.nodeDone,
|
|
42
|
+
webDone: this.webDone,
|
|
43
|
+
mode: this.mode,
|
|
44
|
+
}, null, 2));
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
console.log("waiting for tests to change");
|
|
48
|
+
}
|
|
49
|
+
console.log("press 'q' to quit");
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
52
|
this.config = configs;
|
|
53
|
+
this.mode = this.config.devMode ? "DEV" : "PROD";
|
|
54
|
+
process.stdin.on("keypress", (str, key) => {
|
|
55
|
+
if (key.name === "q") {
|
|
56
|
+
console.log("Testeranto-EsBuild is shutting down...");
|
|
57
|
+
this.mode = "PROD";
|
|
58
|
+
this.onDone();
|
|
59
|
+
}
|
|
60
|
+
});
|
|
53
61
|
fs_1.default.writeFileSync(`${this.config.outdir}/testeranto.json`, JSON.stringify(Object.assign(Object.assign({}, this.config), { buildDir: process.cwd() + "/" + this.config.outdir }), null, 2));
|
|
54
62
|
Promise.resolve(Promise.all([...this.getSecondaryEndpointsPoints("web")].map(async (sourceFilePath) => {
|
|
55
63
|
const sourceFileSplit = sourceFilePath.split("/");
|
|
@@ -78,14 +86,14 @@ class ITProject {
|
|
|
78
86
|
esbuild_1.default
|
|
79
87
|
.context((0, node_js_1.default)(this.config, nodeEntryPoints))
|
|
80
88
|
.then(async (nodeContext) => {
|
|
81
|
-
if (
|
|
89
|
+
if (this.config.devMode) {
|
|
82
90
|
await nodeContext.watch().then((v) => {
|
|
83
|
-
onNodeDone();
|
|
91
|
+
this.onNodeDone();
|
|
84
92
|
});
|
|
85
93
|
}
|
|
86
94
|
else {
|
|
87
95
|
nodeContext.rebuild().then((v) => {
|
|
88
|
-
onNodeDone();
|
|
96
|
+
this.onNodeDone();
|
|
89
97
|
});
|
|
90
98
|
}
|
|
91
99
|
return nodeContext;
|
|
@@ -93,14 +101,14 @@ class ITProject {
|
|
|
93
101
|
esbuild_1.default
|
|
94
102
|
.context((0, web_js_1.default)(this.config, webEntryPoints))
|
|
95
103
|
.then(async (webContext) => {
|
|
96
|
-
if (
|
|
104
|
+
if (this.config.devMode) {
|
|
97
105
|
await webContext.watch().then((v) => {
|
|
98
|
-
onWebDone();
|
|
106
|
+
this.onWebDone();
|
|
99
107
|
});
|
|
100
108
|
}
|
|
101
109
|
else {
|
|
102
110
|
webContext.rebuild().then((v) => {
|
|
103
|
-
onWebDone();
|
|
111
|
+
this.onWebDone();
|
|
104
112
|
});
|
|
105
113
|
}
|
|
106
114
|
return webContext;
|
|
@@ -8,36 +8,34 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
8
8
|
const recursive_watch_1 = __importDefault(require("recursive-watch"));
|
|
9
9
|
const main_js_1 = require("./PM/main.js");
|
|
10
10
|
const utils_js_1 = require("./utils.js");
|
|
11
|
-
var mode = process.argv[2] === "-dev" ? "DEV" : "PROD";
|
|
12
|
-
const node2web = {};
|
|
13
|
-
const web2node = {};
|
|
14
|
-
const childProcesses = {};
|
|
11
|
+
// var mode: "DEV" | "PROD" = process.argv[2] === "-dev" ? "DEV" : "PROD";
|
|
12
|
+
// const node2web: Record<string, string[]> = {};
|
|
13
|
+
// const web2node: Record<string, string[]> = {};
|
|
14
|
+
// const childProcesses: Record<string, "loaded" | "running" | "done"> = {};
|
|
15
15
|
readline_1.default.emitKeypressEvents(process.stdin);
|
|
16
16
|
if (process.stdin.isTTY)
|
|
17
17
|
process.stdin.setRawMode(true);
|
|
18
|
-
|
|
19
|
-
console.log("\n Puppeteer is running. Press 'q' to quit\n");
|
|
20
|
-
process.stdin.on("keypress", (str, key) => {
|
|
21
|
-
if (key.name === "q") {
|
|
22
|
-
process.exit();
|
|
23
|
-
}
|
|
24
|
-
});
|
|
18
|
+
// let shutDownMode = false;
|
|
25
19
|
exports.default = async (partialConfig) => {
|
|
26
20
|
const config = Object.assign(Object.assign({}, partialConfig), { buildDir: process.cwd() + "/" + partialConfig.outdir });
|
|
27
21
|
fs_1.default.writeFileSync(`${config.outdir}/testeranto.json`, JSON.stringify(Object.assign(Object.assign({}, config), { buildDir: process.cwd() + "/" + config.outdir }), null, 2));
|
|
28
22
|
const pm = new main_js_1.PM_Main(config);
|
|
29
23
|
await pm.startPuppeteer({
|
|
24
|
+
// timeout: 1,
|
|
30
25
|
waitForInitialPage: false,
|
|
31
|
-
executablePath:
|
|
26
|
+
executablePath:
|
|
27
|
+
// process.env.CHROMIUM_PATH || "/opt/homebrew/bin/chromium",
|
|
28
|
+
"/opt/homebrew/bin/chromium",
|
|
32
29
|
headless: true,
|
|
33
|
-
|
|
30
|
+
dumpio: true,
|
|
31
|
+
// timeout: 0,
|
|
34
32
|
args: [
|
|
33
|
+
// "--auto-open-devtools-for-tabs",
|
|
35
34
|
"--disable-features=IsolateOrigins,site-per-process",
|
|
36
35
|
"--disable-site-isolation-trials",
|
|
37
36
|
"--allow-insecure-localhost",
|
|
38
37
|
"--allow-file-access-from-files",
|
|
39
38
|
"--allow-running-insecure-content",
|
|
40
|
-
// "--auto-open-devtools-for-tabs",
|
|
41
39
|
"--disable-dev-shm-usage",
|
|
42
40
|
"--disable-extensions",
|
|
43
41
|
"--disable-gpu",
|
|
@@ -62,6 +60,13 @@ exports.default = async (partialConfig) => {
|
|
|
62
60
|
// "--start-maximized",
|
|
63
61
|
],
|
|
64
62
|
}, ".");
|
|
63
|
+
console.log("\n Puppeteer is running. Press 'q' to quit\n");
|
|
64
|
+
process.stdin.on("keypress", (str, key) => {
|
|
65
|
+
if (key.name === "q") {
|
|
66
|
+
pm.shutDown();
|
|
67
|
+
// process.exit();
|
|
68
|
+
}
|
|
69
|
+
});
|
|
65
70
|
config.tests.forEach(([test, runtime, tr, sidecars]) => {
|
|
66
71
|
if (runtime === "node") {
|
|
67
72
|
pm.launchNode(test, (0, utils_js_1.destinationOfRuntime)(test, "node", config));
|
|
@@ -73,33 +78,39 @@ exports.default = async (partialConfig) => {
|
|
|
73
78
|
console.error("runtime makes no sense", runtime);
|
|
74
79
|
}
|
|
75
80
|
});
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
if (
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
81
|
+
if (config.devMode) {
|
|
82
|
+
console.log("ready and watching for changes...", config.buildDir);
|
|
83
|
+
(0, recursive_watch_1.default)(config.buildDir, (eventType, changedFile) => {
|
|
84
|
+
if (changedFile) {
|
|
85
|
+
config.tests.forEach(([test, runtime, tr, sidecars]) => {
|
|
86
|
+
if (eventType === "change" || eventType === "rename") {
|
|
87
|
+
if (changedFile ===
|
|
88
|
+
test
|
|
89
|
+
.replace("./", "node/")
|
|
90
|
+
.split(".")
|
|
91
|
+
.slice(0, -1)
|
|
92
|
+
.concat("mjs")
|
|
93
|
+
.join(".")) {
|
|
94
|
+
pm.launchNode(test, (0, utils_js_1.destinationOfRuntime)(test, "node", config));
|
|
95
|
+
}
|
|
96
|
+
if (changedFile ===
|
|
97
|
+
test
|
|
98
|
+
.replace("./", "web/")
|
|
99
|
+
.split(".")
|
|
100
|
+
.slice(0, -1)
|
|
101
|
+
.concat("mjs")
|
|
102
|
+
.join(".")) {
|
|
103
|
+
pm.launchWeb(test, (0, utils_js_1.destinationOfRuntime)(test, "web", config), sidecars);
|
|
104
|
+
}
|
|
89
105
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
});
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
pm.shutDown();
|
|
112
|
+
}
|
|
113
|
+
// pm.browser.close();
|
|
103
114
|
// does not work on linux
|
|
104
115
|
// fs.watch(
|
|
105
116
|
// config.buildDir,
|
|
@@ -29,19 +29,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
const react_1 = __importStar(require("react"));
|
|
30
30
|
const react_2 = require("react");
|
|
31
31
|
const client_1 = __importDefault(require("react-dom/client"));
|
|
32
|
-
const react_dom_1 = require("react-dom");
|
|
33
32
|
const Web_js_1 = __importDefault(require("../../../Web.js"));
|
|
33
|
+
const TesterantoComponent = ({ done, innerComp, }) => {
|
|
34
|
+
const myContainer = (0, react_1.useRef)(null);
|
|
35
|
+
(0, react_1.useEffect)(() => {
|
|
36
|
+
console.log("useEffect called!", myContainer.current);
|
|
37
|
+
done(myContainer.current);
|
|
38
|
+
}, []);
|
|
39
|
+
return react_1.default.createElement("div", { ref: myContainer }, innerComp());
|
|
40
|
+
};
|
|
34
41
|
exports.default = (testImplementations, testSpecifications, testInput) => {
|
|
35
|
-
console.log("testInput", testInput);
|
|
36
|
-
const TesterantoComponent = function ({ done, innerComp, }) {
|
|
37
|
-
const myContainer = (0, react_1.useRef)(null);
|
|
38
|
-
(0, react_1.useEffect)(() => {
|
|
39
|
-
console.log("useEffect called!", myContainer.current);
|
|
40
|
-
done(myContainer.current);
|
|
41
|
-
}, []);
|
|
42
|
-
// debugger;
|
|
43
|
-
return react_1.default.createElement("div", { ref: myContainer }, innerComp());
|
|
44
|
-
};
|
|
45
42
|
const t = (0, Web_js_1.default)(testInput, testSpecifications, testImplementations, {
|
|
46
43
|
beforeAll: async (reactElement, itr) => {
|
|
47
44
|
return await new Promise((resolve, rej) => {
|
|
@@ -65,47 +62,49 @@ exports.default = (testImplementations, testSpecifications, testInput) => {
|
|
|
65
62
|
},
|
|
66
63
|
beforeEach: async (subject, initializer, artificer, testResource, pm) => {
|
|
67
64
|
return new Promise((resolve, rej) => {
|
|
68
|
-
(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
65
|
+
resolve(subject);
|
|
66
|
+
// const tc = TesterantoComponent({
|
|
67
|
+
// innerComp: () =>
|
|
68
|
+
// testInput({
|
|
69
|
+
// port: 3003,
|
|
70
|
+
// address: "some-address",
|
|
71
|
+
// secretKey: "someSecretKey",
|
|
72
|
+
// abi: "foo",
|
|
73
|
+
// }),
|
|
74
|
+
// done: (reactElement: any) => {
|
|
75
|
+
// console.log("mark9");
|
|
76
|
+
// resolve(reactElement);
|
|
77
|
+
// // process.nextTick(() => {
|
|
78
|
+
// // resolve(reactElement);
|
|
79
|
+
// // });
|
|
80
|
+
// },
|
|
81
|
+
// });
|
|
82
|
+
// console.log("mark9", tc);
|
|
83
|
+
// createPortal(tc, subject.domRoot);
|
|
81
84
|
});
|
|
82
85
|
},
|
|
83
|
-
andWhen: function (s, whenCB) {
|
|
86
|
+
andWhen: function (s, whenCB, tr, utils) {
|
|
84
87
|
return new Promise((resolve, rej) => {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
+
console.log("mark9", s, whenCB);
|
|
89
|
+
resolve(whenCB(s, utils));
|
|
90
|
+
// process.nextTick(() => {
|
|
91
|
+
// resolve(whenCB()(s));
|
|
92
|
+
// });
|
|
88
93
|
});
|
|
89
94
|
},
|
|
90
|
-
butThen: async function (s) {
|
|
95
|
+
butThen: async function (s, thenCB) {
|
|
91
96
|
return new Promise((resolve, rej) => {
|
|
92
|
-
|
|
93
|
-
resolve(s);
|
|
94
|
-
});
|
|
97
|
+
resolve(thenCB(s));
|
|
95
98
|
});
|
|
96
99
|
},
|
|
97
100
|
afterEach: async function (store, ndx, artificer) {
|
|
98
101
|
return new Promise((resolve, rej) => {
|
|
99
|
-
|
|
100
|
-
resolve({});
|
|
101
|
-
});
|
|
102
|
+
resolve({});
|
|
102
103
|
});
|
|
103
104
|
},
|
|
104
105
|
afterAll: (store, artificer) => {
|
|
105
106
|
return new Promise((resolve, rej) => {
|
|
106
|
-
|
|
107
|
-
resolve({});
|
|
108
|
-
});
|
|
107
|
+
resolve({});
|
|
109
108
|
});
|
|
110
109
|
},
|
|
111
110
|
});
|
|
@@ -29,15 +29,30 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
exports.testInterface = void 0;
|
|
30
30
|
const react_1 = __importDefault(require("react"));
|
|
31
31
|
const react_test_renderer_1 = __importStar(require("react-test-renderer"));
|
|
32
|
+
const Context = react_1.default.createContext({});
|
|
33
|
+
const AppContext = react_1.default.createContext({});
|
|
34
|
+
const contextValue = {
|
|
35
|
+
ingredients: ["flour", "sugar", "eggs"],
|
|
36
|
+
temperature: "200",
|
|
37
|
+
};
|
|
32
38
|
exports.testInterface = {
|
|
33
39
|
butThen: async function (s, thenCB, tr) {
|
|
34
|
-
console.log("butThen", thenCB.toString());
|
|
40
|
+
// console.log("butThen", thenCB.toString());
|
|
35
41
|
return thenCB(s);
|
|
36
42
|
},
|
|
37
43
|
beforeEach: function (CComponent, props) {
|
|
38
44
|
let component;
|
|
39
45
|
(0, react_test_renderer_1.act)(() => {
|
|
40
|
-
component =
|
|
46
|
+
// component = renderer.create(
|
|
47
|
+
// React.createElement(
|
|
48
|
+
// AppContext.Provider,
|
|
49
|
+
// { value: contextValue },
|
|
50
|
+
// React.createElement(AppContext.Consumer, null, (context) =>
|
|
51
|
+
// React.createElement(CComponent, Object.assign({}, context, {}))
|
|
52
|
+
// )
|
|
53
|
+
// )
|
|
54
|
+
// );
|
|
55
|
+
component = react_test_renderer_1.default.create(react_1.default.createElement(CComponent, props, react_1.default.createElement(CComponent, props, [])));
|
|
41
56
|
});
|
|
42
57
|
return component;
|
|
43
58
|
},
|