testeranto 0.47.34 → 0.47.52
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/.nvmrc +1 -0
- package/Bundle.Dockerfile +45 -0
- package/README.md +86 -11
- package/Report.Dockerfile +43 -0
- package/dist/cjs-shim.js +12 -0
- package/dist/common/Features.js +3 -37
- package/dist/common/Init.js +30 -0
- package/dist/common/Node.js +15 -66
- package/dist/common/PM/index.js +7 -0
- package/dist/common/PM/main.js +641 -0
- package/dist/common/PM/node.js +88 -0
- package/dist/common/PM/web.js +132 -0
- package/dist/common/Project.js +109 -637
- package/dist/common/Puppeteer.js +103 -0
- package/dist/common/Reporter.js +112 -0
- package/dist/common/Scheduler.js +1 -0
- package/dist/common/SubPackages/puppeteer.js +21 -0
- package/dist/common/{subPackages → SubPackages}/react/component/node.js +4 -4
- package/dist/common/{subPackages → SubPackages}/react/component/web.js +4 -4
- package/dist/common/SubPackages/react/jsx/index.js +25 -0
- package/dist/common/SubPackages/react/jsx/node.js +10 -0
- package/dist/common/SubPackages/react/jsx/web.js +10 -0
- package/dist/common/{subPackages/react-dom/jsx → SubPackages/react-dom/component}/node.js +6 -6
- package/dist/common/SubPackages/react-dom/component/web.js +93 -0
- package/dist/common/SubPackages/react-dom/jsx/index.js +2 -0
- package/dist/common/SubPackages/react-dom/jsx/node.js +39 -0
- package/dist/common/SubPackages/react-dom/jsx/web.js +118 -0
- package/dist/common/SubPackages/react-test-renderer/MemoExoticComponent/node.js +44 -0
- package/dist/common/SubPackages/react-test-renderer/component/index.js +2 -0
- package/dist/common/{subPackages/react-test-renderer/component/index.js → SubPackages/react-test-renderer/component/interface.js} +23 -33
- package/dist/common/{subPackages/react-test-renderer/jsx → SubPackages/react-test-renderer/component}/node.js +3 -5
- package/dist/common/{subPackages/react/jsx → SubPackages/react-test-renderer/component}/web.js +3 -5
- package/dist/common/SubPackages/react-test-renderer/fc/node.js +50 -0
- package/dist/common/SubPackages/react-test-renderer/fc/web.js +50 -0
- package/dist/common/{subPackages → SubPackages}/react-test-renderer/jsx/index.js +7 -3
- package/dist/common/SubPackages/react-test-renderer/jsx/node.js +10 -0
- package/dist/common/SubPackages/react-test-renderer/jsx/web.js +10 -0
- package/dist/common/SubPackages/react-test-renderer/jsx-promised/index.js +42 -0
- package/dist/common/{subPackages/react/jsx → SubPackages/react-test-renderer/jsx-promised}/node.js +2 -2
- package/dist/common/TaskManBackEnd.js +174 -0
- package/dist/common/Web.js +31 -108
- package/dist/common/esbuildConfigs/features.js +14 -0
- package/dist/common/esbuildConfigs/index.js +21 -0
- package/dist/common/esbuildConfigs/inputFilesPlugin.js +49 -0
- package/dist/common/esbuildConfigs/node.js +39 -0
- package/dist/common/esbuildConfigs/report.js +14 -0
- package/dist/common/esbuildConfigs/tests.js +13 -0
- package/dist/common/esbuildConfigs/web.js +57 -0
- package/dist/common/lib/abstractBase.js +553 -0
- package/dist/common/lib/basebuilder.js +79 -0
- package/dist/common/lib/classBuilder.js +42 -0
- package/dist/common/lib/core.js +75 -0
- package/dist/common/lib/index.js +22 -0
- package/dist/common/lib/types.js +2 -0
- package/dist/common/mongooseSchemas.js +56 -0
- package/dist/common/preload.js +14 -27
- package/dist/common/puppeteerConfiger.js +24 -0
- package/dist/common/report.html.js +31 -0
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/common/utils.js +16 -0
- package/dist/common/web.html.js +22 -0
- package/dist/module/ExampleTab.js +112 -0
- package/dist/module/Features.js +2 -35
- package/dist/module/Init.js +25 -0
- package/dist/module/Node.js +15 -66
- package/dist/module/PM/index.js +3 -0
- package/dist/module/PM/main.js +611 -0
- package/dist/module/PM/node.js +81 -0
- package/dist/module/PM/web.js +125 -0
- package/dist/module/Project.js +110 -615
- package/dist/module/Puppeteer.js +98 -0
- package/dist/module/Reporter.js +107 -0
- package/dist/module/Scheduler.js +1 -0
- package/dist/module/SubPackages/puppeteer.js +16 -0
- package/dist/module/{subPackages → SubPackages}/react/component/node.js +3 -3
- package/dist/module/{subPackages → SubPackages}/react/component/web.js +3 -3
- package/dist/module/SubPackages/react/jsx/index.js +19 -0
- package/dist/module/SubPackages/react/jsx/node.js +5 -0
- package/dist/module/SubPackages/react/jsx/web.js +5 -0
- package/dist/module/{subPackages → SubPackages}/react-dom/component/node.js +7 -7
- package/dist/module/SubPackages/react-dom/component/web.js +88 -0
- package/dist/module/SubPackages/react-dom/jsx/node.js +31 -0
- package/dist/module/SubPackages/react-dom/jsx/web.js +90 -0
- package/dist/module/SubPackages/react-test-renderer/MemoExoticComponent/node.js +16 -0
- package/dist/module/SubPackages/react-test-renderer/component/index.js +1 -0
- package/dist/module/SubPackages/react-test-renderer/component/interface.js +39 -0
- package/dist/module/{subPackages → SubPackages}/react-test-renderer/component/node.js +2 -2
- package/dist/module/{subPackages → SubPackages}/react-test-renderer/component/web.js +2 -2
- package/dist/module/{subPackages → SubPackages}/react-test-renderer/fc/node.js +3 -3
- package/dist/module/SubPackages/react-test-renderer/fc/web.js +22 -0
- package/dist/module/{subPackages → SubPackages}/react-test-renderer/jsx/index.js +7 -3
- package/dist/module/SubPackages/react-test-renderer/jsx/node.js +5 -0
- package/dist/module/SubPackages/react-test-renderer/jsx/web.js +5 -0
- package/dist/module/SubPackages/react-test-renderer/jsx-promised/index.js +16 -0
- package/dist/module/{subPackages/react-test-renderer/jsx → SubPackages/react-test-renderer/jsx-promised}/node.js +1 -1
- package/dist/module/TaskManBackEnd.js +169 -0
- package/dist/module/TaskManFrontEnd.js +600 -0
- package/dist/module/Web.js +31 -108
- package/dist/module/esbuildConfigs/features.js +12 -0
- package/dist/module/esbuildConfigs/index.js +19 -0
- package/dist/module/esbuildConfigs/inputFilesPlugin.js +44 -0
- package/dist/module/esbuildConfigs/node.js +34 -0
- package/dist/module/esbuildConfigs/report.js +14 -0
- package/dist/module/esbuildConfigs/tests.js +11 -0
- package/dist/module/esbuildConfigs/web.js +52 -0
- package/dist/module/lib/abstractBase.js +545 -0
- package/dist/module/lib/basebuilder.js +75 -0
- package/dist/module/lib/classBuilder.js +38 -0
- package/dist/module/lib/core.js +72 -0
- package/dist/module/lib/index.js +18 -0
- package/dist/module/lib/types.js +1 -0
- package/dist/module/mongooseSchemas.js +50 -0
- package/dist/module/preload.js +15 -26
- package/dist/module/puppeteerConfiger.js +19 -0
- package/dist/module/report.html.js +29 -0
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/module/utils.js +9 -0
- package/dist/module/web.html.js +20 -0
- package/dist/prebuild/TaskManBackEnd.mjs +174 -0
- package/dist/prebuild/TaskManFrontEnd.css +12301 -0
- package/dist/prebuild/TaskManFrontEnd.js +81264 -0
- package/dist/types/Features.d.ts +1 -34
- package/dist/types/Init.d.ts +2 -0
- package/dist/types/Node.d.ts +5 -11
- package/dist/types/PM/index.d.ts +20 -0
- package/dist/types/PM/main.d.ts +31 -0
- package/dist/types/PM/node.d.ts +27 -0
- package/dist/types/PM/web.d.ts +25 -0
- package/dist/types/Project.d.ts +3 -29
- package/dist/types/Puppeteer.d.ts +2 -0
- package/dist/types/Reporter.d.ts +1 -0
- package/dist/types/Scheduler.d.ts +0 -0
- package/dist/types/SubPackages/puppeteer.d.ts +6 -0
- package/dist/types/SubPackages/react/component/node.d.ts +7 -0
- package/dist/types/SubPackages/react/component/web.d.ts +7 -0
- package/dist/types/SubPackages/react/jsx/index.d.ts +12 -0
- package/dist/types/SubPackages/react/jsx/node.d.ts +4 -0
- package/dist/types/SubPackages/react/jsx/web.d.ts +4 -0
- package/dist/types/SubPackages/react-dom/component/node.d.ts +12 -0
- package/dist/types/SubPackages/react-dom/component/web.d.ts +11 -0
- package/dist/types/SubPackages/react-dom/jsx/index.d.ts +6 -0
- package/dist/types/SubPackages/react-dom/jsx/node.d.ts +6 -0
- package/dist/types/SubPackages/react-dom/jsx/web.d.ts +5 -0
- package/dist/types/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +5 -0
- package/dist/types/SubPackages/react-test-renderer/component/index.d.ts +13 -0
- package/dist/types/SubPackages/react-test-renderer/component/interface.d.ts +9 -0
- package/dist/types/SubPackages/react-test-renderer/component/node.d.ts +8 -0
- package/dist/types/SubPackages/react-test-renderer/component/web.d.ts +3 -0
- package/dist/types/SubPackages/react-test-renderer/fc/node.d.ts +8 -0
- package/dist/types/SubPackages/react-test-renderer/fc/web.d.ts +8 -0
- package/dist/types/{subPackages → SubPackages}/react-test-renderer/jsx/index.d.ts +5 -4
- package/dist/types/SubPackages/react-test-renderer/jsx/node.d.ts +8 -0
- package/dist/types/SubPackages/react-test-renderer/jsx/web.d.ts +8 -0
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/index.d.ts +15 -0
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/node.d.ts +4 -0
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/web.d.ts +4 -0
- package/dist/types/TaskManBackEnd.d.ts +3 -0
- package/dist/types/Types.d.ts +49 -16
- package/dist/types/Web.d.ts +5 -11
- package/dist/types/esbuildConfigs/features.d.ts +4 -0
- package/dist/types/esbuildConfigs/index.d.ts +4 -0
- package/dist/types/esbuildConfigs/inputFilesPlugin.d.ts +5 -0
- package/dist/types/esbuildConfigs/node.d.ts +4 -0
- package/dist/types/esbuildConfigs/report.d.ts +0 -0
- package/dist/types/esbuildConfigs/tests.d.ts +4 -0
- package/dist/types/esbuildConfigs/web.d.ts +4 -0
- package/dist/types/lib/abstractBase.d.ts +104 -0
- package/dist/types/lib/basebuilder.d.ts +27 -0
- package/dist/types/lib/classBuilder.d.ts +7 -0
- package/dist/types/lib/core.d.ts +8 -0
- package/dist/types/lib/index.d.ts +59 -0
- package/dist/types/lib/types.d.ts +62 -0
- package/dist/types/mongooseSchemas.d.ts +124 -0
- package/dist/types/preload.d.ts +0 -1
- package/dist/types/puppeteerConfiger.d.ts +4 -0
- package/dist/types/report.html.d.ts +2 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/utils.d.ts +2 -0
- package/dist/types/web.html.d.ts +2 -0
- package/index.html +30 -0
- package/package.json +151 -79
- package/src/ExampleTab.tsx +219 -0
- package/src/Features.ts +2 -58
- package/src/Init.ts +51 -0
- package/src/Node.ts +71 -157
- package/src/PM/index.ts +25 -0
- package/src/PM/main.ts +830 -0
- package/src/PM/node.ts +128 -0
- package/src/PM/web.ts +166 -0
- package/src/Project.ts +158 -797
- package/src/Puppeteer.ts +141 -0
- package/src/Reporter.ts +126 -0
- package/src/Scheduler.ts +0 -0
- package/src/SubPackages/puppeteer.ts +51 -0
- package/src/SubPackages/react/component/node.ts +43 -0
- package/src/SubPackages/react/component/web.ts +43 -0
- package/src/SubPackages/react/jsx/index.ts +42 -0
- package/src/SubPackages/react/jsx/node.ts +26 -0
- package/src/SubPackages/react/jsx/web.ts +30 -0
- package/src/{subPackages → SubPackages}/react-dom/component/node.ts +24 -44
- package/src/SubPackages/react-dom/component/web.ts +143 -0
- package/src/SubPackages/react-dom/jsx/index.ts +6 -0
- package/src/SubPackages/react-dom/jsx/node.ts +68 -0
- package/src/SubPackages/react-dom/jsx/web.ts +139 -0
- package/src/SubPackages/react-test-renderer/MemoExoticComponent/node.ts +38 -0
- package/src/SubPackages/react-test-renderer/component/index.ts +23 -0
- package/src/SubPackages/react-test-renderer/component/interface.ts +48 -0
- package/src/SubPackages/react-test-renderer/component/node.ts +17 -0
- package/src/SubPackages/react-test-renderer/component/web.ts +17 -0
- package/src/SubPackages/react-test-renderer/fc/node.ts +49 -0
- package/src/SubPackages/react-test-renderer/fc/web.ts +48 -0
- package/src/SubPackages/react-test-renderer/jsx/index.ts +48 -0
- package/src/SubPackages/react-test-renderer/jsx/node.ts +20 -0
- package/src/SubPackages/react-test-renderer/jsx/web.ts +20 -0
- package/src/SubPackages/react-test-renderer/jsx-promised/index.ts +40 -0
- package/src/SubPackages/react-test-renderer/jsx-promised/node.ts +19 -0
- package/src/SubPackages/react-test-renderer/jsx-promised/web.ts +22 -0
- package/src/TaskManBackEnd.ts +228 -0
- package/src/TaskManFrontEnd.tsx +1222 -0
- package/src/Types.ts +222 -17
- package/src/Web.ts +86 -217
- package/src/cjs-shim.js +12 -0
- package/src/esbuildConfigs/features.ts +17 -0
- package/src/esbuildConfigs/index.ts +23 -0
- package/src/esbuildConfigs/inputFilesPlugin.ts +65 -0
- package/src/esbuildConfigs/node.ts +62 -0
- package/src/esbuildConfigs/report.ts +15 -0
- package/src/esbuildConfigs/tests.ts +14 -0
- package/src/esbuildConfigs/web.ts +79 -0
- package/src/lib/abstractBase.ts +910 -0
- package/src/lib/basebuilder.ts +214 -0
- package/src/lib/classBuilder.ts +131 -0
- package/src/lib/core.ts +224 -0
- package/src/lib/index.ts +226 -0
- package/src/lib/types.ts +303 -0
- package/src/mongooseSchemas.ts +105 -0
- package/src/preload.ts +14 -28
- package/src/puppeteerConfiger.ts +26 -0
- package/src/report.html.ts +29 -0
- package/src/utils.ts +15 -0
- package/src/web.html.ts +20 -0
- package/tests/Rectangle.test.ts +189 -0
- package/trash/TaskMan.Dockerfile +23 -0
- package/trash/TaskMan1.Dockerfile +43 -0
- package/trash/devBot.dockerfile +12 -0
- package/trash/docker-compose-dev.yml +9 -0
- package/trash/docker-compose-prod.yml +18 -0
- package/trash/electronBuild.ts +32 -0
- package/tsconfig.json +18 -6
- package/tsconfig.module.json +14 -4
- package/tsconfig.types.json +13 -4
- package/dist/common/NodeWriter.js +0 -56
- package/dist/common/core.js +0 -396
- package/dist/common/electron.js +0 -52
- package/dist/common/subPackages/react/jsx/index.js +0 -26
- package/dist/common/subPackages/react-dom/component/node.js +0 -101
- package/dist/common/subPackages/react-dom/component/web.js +0 -61
- package/dist/common/subPackages/react-dom/jsx/web.js +0 -76
- package/dist/common/subPackages/react-test-renderer/component/node.js +0 -8
- package/dist/common/subPackages/react-test-renderer/component/web.js +0 -8
- package/dist/module/NodeWriter.js +0 -50
- package/dist/module/Report.js +0 -186
- package/dist/module/core.js +0 -387
- package/dist/module/electron.js +0 -47
- package/dist/module/subPackages/react/jsx/index.js +0 -22
- package/dist/module/subPackages/react/jsx/node.js +0 -5
- package/dist/module/subPackages/react/jsx/web.js +0 -5
- package/dist/module/subPackages/react-dom/component/web.js +0 -56
- package/dist/module/subPackages/react-dom/jsx/node.js +0 -93
- package/dist/module/subPackages/react-dom/jsx/web.js +0 -48
- package/dist/module/subPackages/react-test-renderer/component/index.js +0 -52
- package/dist/types/NodeWriter.d.ts +0 -2
- package/dist/types/core.d.ts +0 -220
- package/dist/types/subPackages/react/component/node.d.ts +0 -12
- package/dist/types/subPackages/react/component/web.d.ts +0 -12
- package/dist/types/subPackages/react/jsx/index.d.ts +0 -15
- package/dist/types/subPackages/react/jsx/node.d.ts +0 -4
- package/dist/types/subPackages/react/jsx/web.d.ts +0 -4
- package/dist/types/subPackages/react-dom/component/node.d.ts +0 -14
- package/dist/types/subPackages/react-dom/component/web.d.ts +0 -19
- package/dist/types/subPackages/react-dom/jsx/node.d.ts +0 -14
- package/dist/types/subPackages/react-dom/jsx/web.d.ts +0 -15
- package/dist/types/subPackages/react-test-renderer/component/index.d.ts +0 -20
- package/dist/types/subPackages/react-test-renderer/component/node.d.ts +0 -9
- package/dist/types/subPackages/react-test-renderer/component/web.d.ts +0 -9
- package/dist/types/subPackages/react-test-renderer/jsx/node.d.ts +0 -4
- package/dist/types/subPackages/react-test-renderer/jsx/web.d.ts +0 -4
- package/src/NodeWriter.ts +0 -72
- package/src/Report.tsx +0 -392
- package/src/core.ts +0 -1396
- package/src/electron.ts +0 -59
- package/src/subPackages/react/component/node.ts +0 -75
- package/src/subPackages/react/component/web.ts +0 -80
- package/src/subPackages/react/jsx/index.ts +0 -64
- package/src/subPackages/react/jsx/node.ts +0 -29
- package/src/subPackages/react/jsx/web.ts +0 -29
- package/src/subPackages/react-dom/component/web.ts +0 -129
- package/src/subPackages/react-dom/jsx/node.ts +0 -150
- package/src/subPackages/react-dom/jsx/web.ts +0 -117
- package/src/subPackages/react-test-renderer/component/index.ts +0 -101
- package/src/subPackages/react-test-renderer/component/node.ts +0 -30
- package/src/subPackages/react-test-renderer/component/web.ts +0 -30
- package/src/subPackages/react-test-renderer/fc/node.tsx +0 -77
- package/src/subPackages/react-test-renderer/jsx/index.ts +0 -51
- package/src/subPackages/react-test-renderer/jsx/node.ts +0 -31
- package/src/subPackages/react-test-renderer/jsx/web.ts +0 -31
- /package/dist/common/{subPackages/react-test-renderer/jsx → SubPackages/react-test-renderer/jsx-promised}/web.js +0 -0
- /package/dist/{types/electron.d.ts → module/SubPackages/react-dom/jsx/index.js} +0 -0
- /package/dist/module/{subPackages/react-test-renderer/jsx → SubPackages/react-test-renderer/jsx-promised}/web.js +0 -0
|
@@ -0,0 +1,103 @@
|
|
|
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 readline_1 = __importDefault(require("readline"));
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const main_js_1 = require("./PM/main.js");
|
|
9
|
+
const utils_js_1 = require("./utils.js");
|
|
10
|
+
var mode = process.argv[2] === "-dev" ? "DEV" : "PROD";
|
|
11
|
+
const node2web = {};
|
|
12
|
+
const web2node = {};
|
|
13
|
+
const childProcesses = {};
|
|
14
|
+
readline_1.default.emitKeypressEvents(process.stdin);
|
|
15
|
+
if (process.stdin.isTTY)
|
|
16
|
+
process.stdin.setRawMode(true);
|
|
17
|
+
console.log("\n Puppeteer is running. Press 'q' to quit\n");
|
|
18
|
+
process.stdin.on("keypress", (str, key) => {
|
|
19
|
+
if (key.name === "q") {
|
|
20
|
+
process.exit();
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
exports.default = async (partialConfig) => {
|
|
24
|
+
const config = Object.assign(Object.assign({}, partialConfig), { buildDir: process.cwd() + "/" + partialConfig.outdir });
|
|
25
|
+
fs_1.default.writeFileSync(`${config.outdir}/testeranto.json`, JSON.stringify(Object.assign(Object.assign({}, config), { buildDir: process.cwd() + "/" + config.outdir }), null, 2));
|
|
26
|
+
const pm = new main_js_1.PM_Main(config);
|
|
27
|
+
await pm.startPuppeteer({
|
|
28
|
+
waitForInitialPage: false,
|
|
29
|
+
executablePath: "/opt/homebrew/bin/chromium",
|
|
30
|
+
headless: true,
|
|
31
|
+
// dumpio: true,
|
|
32
|
+
args: [
|
|
33
|
+
"--disable-features=IsolateOrigins,site-per-process",
|
|
34
|
+
"--disable-site-isolation-trials",
|
|
35
|
+
"--allow-insecure-localhost",
|
|
36
|
+
"--allow-file-access-from-files",
|
|
37
|
+
"--allow-running-insecure-content",
|
|
38
|
+
// "--auto-open-devtools-for-tabs",
|
|
39
|
+
"--disable-dev-shm-usage",
|
|
40
|
+
"--disable-extensions",
|
|
41
|
+
"--disable-gpu",
|
|
42
|
+
"--disable-setuid-sandbox",
|
|
43
|
+
"--disable-site-isolation-trials",
|
|
44
|
+
"--disable-web-security",
|
|
45
|
+
"--no-first-run",
|
|
46
|
+
"--no-sandbox",
|
|
47
|
+
"--no-startup-window",
|
|
48
|
+
// "--no-zygote",
|
|
49
|
+
"--reduce-security-for-testing",
|
|
50
|
+
"--remote-allow-origins=*",
|
|
51
|
+
"--unsafely-treat-insecure-origin-as-secure=*",
|
|
52
|
+
// "--disable-features=IsolateOrigins",
|
|
53
|
+
// "--remote-allow-origins=ws://localhost:3234",
|
|
54
|
+
// "--single-process",
|
|
55
|
+
// "--unsafely-treat-insecure-origin-as-secure",
|
|
56
|
+
// "--unsafely-treat-insecure-origin-as-secure=ws://192.168.0.101:3234",
|
|
57
|
+
`--remote-debugging-port=3234`,
|
|
58
|
+
// "--disk-cache-dir=/dev/null",
|
|
59
|
+
// "--disk-cache-size=1",
|
|
60
|
+
// "--start-maximized",
|
|
61
|
+
],
|
|
62
|
+
}, ".");
|
|
63
|
+
config.tests.forEach(([test, runtime, tr, sidecars]) => {
|
|
64
|
+
if (runtime === "node") {
|
|
65
|
+
pm.launchNode(test, (0, utils_js_1.destinationOfRuntime)(test, "node", config));
|
|
66
|
+
}
|
|
67
|
+
else if (runtime === "web") {
|
|
68
|
+
pm.launchWeb(test, (0, utils_js_1.destinationOfRuntime)(test, "web", config), sidecars);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
console.error("runtime makes no sense", runtime);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
console.log("ready and watching for changes...", config.buildDir);
|
|
75
|
+
fs_1.default.watch(config.buildDir, {
|
|
76
|
+
recursive: true,
|
|
77
|
+
}, (eventType, changedFile) => {
|
|
78
|
+
if (changedFile) {
|
|
79
|
+
config.tests.forEach(([test, runtime, tr, sidecars]) => {
|
|
80
|
+
if (eventType === "change" || eventType === "rename") {
|
|
81
|
+
if (changedFile ===
|
|
82
|
+
test
|
|
83
|
+
.replace("./", "node/")
|
|
84
|
+
.split(".")
|
|
85
|
+
.slice(0, -1)
|
|
86
|
+
.concat("mjs")
|
|
87
|
+
.join(".")) {
|
|
88
|
+
pm.launchNode(test, (0, utils_js_1.destinationOfRuntime)(test, "node", config));
|
|
89
|
+
}
|
|
90
|
+
if (changedFile ===
|
|
91
|
+
test
|
|
92
|
+
.replace("./", "web/")
|
|
93
|
+
.split(".")
|
|
94
|
+
.slice(0, -1)
|
|
95
|
+
.concat("mjs")
|
|
96
|
+
.join(".")) {
|
|
97
|
+
pm.launchWeb(test, (0, utils_js_1.destinationOfRuntime)(test, "web", config), sidecars);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
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 readline_1 = __importDefault(require("readline"));
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const jsonc_1 = require("jsonc");
|
|
9
|
+
const puppeteer_core_1 = __importDefault(require("puppeteer-core"));
|
|
10
|
+
// import { PM_Main } from "./PM/main.js";
|
|
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
|
+
readline_1.default.emitKeypressEvents(process.stdin);
|
|
16
|
+
if (process.stdin.isTTY)
|
|
17
|
+
process.stdin.setRawMode(true);
|
|
18
|
+
console.log("\n Puppeteer is running. Press 'q' to quit\n");
|
|
19
|
+
process.stdin.on("keypress", (str, key) => {
|
|
20
|
+
if (key.name === "q") {
|
|
21
|
+
process.exit();
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
const main = async () => {
|
|
25
|
+
const configs = jsonc_1.jsonc.parse((await fs_1.default.readFileSync("./docs/testeranto.json")).toString());
|
|
26
|
+
// const pm = new PM_Main(configs);
|
|
27
|
+
// await puppeteer.launch(options);
|
|
28
|
+
const browser = await puppeteer_core_1.default.launch({
|
|
29
|
+
waitForInitialPage: false,
|
|
30
|
+
executablePath: "/opt/homebrew/bin/chromium",
|
|
31
|
+
headless: false,
|
|
32
|
+
args: [
|
|
33
|
+
"--allow-file-access-from-files",
|
|
34
|
+
"--allow-running-insecure-content",
|
|
35
|
+
// "--auto-open-devtools-for-tabs",
|
|
36
|
+
"--disable-dev-shm-usage",
|
|
37
|
+
"--disable-extensions",
|
|
38
|
+
"--disable-gpu",
|
|
39
|
+
"--disable-setuid-sandbox",
|
|
40
|
+
"--disable-site-isolation-trials",
|
|
41
|
+
"--disable-web-security",
|
|
42
|
+
"--disable-web-security",
|
|
43
|
+
"--no-first-run",
|
|
44
|
+
"--no-sandbox",
|
|
45
|
+
"--no-startup-window",
|
|
46
|
+
"--no-zygote",
|
|
47
|
+
"--reduce-security-for-testing",
|
|
48
|
+
"--remote-allow-origins=*",
|
|
49
|
+
// "--remote-allow-origins=ws://localhost:3234",
|
|
50
|
+
"--unsafely-treat-insecure-origin-as-secure=*",
|
|
51
|
+
// "--disable-features=IsolateOrigins",
|
|
52
|
+
// "--single-process",
|
|
53
|
+
// "--unsafely-treat-insecure-origin-as-secure",
|
|
54
|
+
// "--unsafely-treat-insecure-origin-as-secure=ws://192.168.0.101:3234",
|
|
55
|
+
// `--remote-debugging-port=3234`,
|
|
56
|
+
],
|
|
57
|
+
}
|
|
58
|
+
// "."
|
|
59
|
+
);
|
|
60
|
+
console.log("Creating new page...");
|
|
61
|
+
const page = await browser.newPage();
|
|
62
|
+
await page.setViewport({ width: 0, height: 0 });
|
|
63
|
+
console.log("Requesting url...");
|
|
64
|
+
await page.goto(`file://${process.cwd()}/docs/report.html?local=true`);
|
|
65
|
+
// configs.tests.forEach(([test, runtime, secondaryArtifacts]) => {
|
|
66
|
+
// if (runtime === "node") {
|
|
67
|
+
// pm.launchNode(test, destinationOfRuntime(test, "node"));
|
|
68
|
+
// } else if (runtime === "web") {
|
|
69
|
+
// pm.launchWeb(test, destinationOfRuntime(test, "web"));
|
|
70
|
+
// } else {
|
|
71
|
+
// console.error("runtime makes no sense", runtime);
|
|
72
|
+
// }
|
|
73
|
+
// });
|
|
74
|
+
// console.log("ready and watching for changes...", configs.buildDir);
|
|
75
|
+
// fs.watch(
|
|
76
|
+
// configs.buildDir,
|
|
77
|
+
// {
|
|
78
|
+
// recursive: true,
|
|
79
|
+
// },
|
|
80
|
+
// (eventType, changedFile) => {
|
|
81
|
+
// if (changedFile) {
|
|
82
|
+
// configs.tests.forEach(([test, runtime, secondaryArtifacts]) => {
|
|
83
|
+
// if (eventType === "change" || eventType === "rename") {
|
|
84
|
+
// if (
|
|
85
|
+
// changedFile ===
|
|
86
|
+
// test
|
|
87
|
+
// .replace("./", "node/")
|
|
88
|
+
// .split(".")
|
|
89
|
+
// .slice(0, -1)
|
|
90
|
+
// .concat("mjs")
|
|
91
|
+
// .join(".")
|
|
92
|
+
// ) {
|
|
93
|
+
// pm.launchNode(test, destinationOfRuntime(test, "node"));
|
|
94
|
+
// }
|
|
95
|
+
// if (
|
|
96
|
+
// changedFile ===
|
|
97
|
+
// test
|
|
98
|
+
// .replace("./", "web/")
|
|
99
|
+
// .split(".")
|
|
100
|
+
// .slice(0, -1)
|
|
101
|
+
// .concat("mjs")
|
|
102
|
+
// .join(".")
|
|
103
|
+
// ) {
|
|
104
|
+
// pm.launchWeb(test, destinationOfRuntime(test, "web"));
|
|
105
|
+
// }
|
|
106
|
+
// }
|
|
107
|
+
// });
|
|
108
|
+
// }
|
|
109
|
+
// }
|
|
110
|
+
// );
|
|
111
|
+
};
|
|
112
|
+
main();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -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
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const Node_js_1 = __importDefault(require("../Node.js"));
|
|
8
|
+
exports.default = (testInput, testSpecifications, testImplementations, testInterface) => {
|
|
9
|
+
return (0, Node_js_1.default)(testInput, testSpecifications, testImplementations, Object.assign({ beforeAll(x) {
|
|
10
|
+
// process.parentPort.postMessage(
|
|
11
|
+
// `/docs/web/src/ClassicalComponent/test.html`
|
|
12
|
+
// );
|
|
13
|
+
return x;
|
|
14
|
+
}, beforeEach: async () => {
|
|
15
|
+
return new Promise((resolve, rej) => {
|
|
16
|
+
resolve(react_1.default.createElement(testInput, {}, []));
|
|
17
|
+
});
|
|
18
|
+
}, andWhen: function (s, whenCB) {
|
|
19
|
+
return whenCB()(s);
|
|
20
|
+
} }, testInterface));
|
|
21
|
+
};
|
|
@@ -4,16 +4,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const
|
|
7
|
+
const Node_js_1 = __importDefault(require("../../../Node.js"));
|
|
8
8
|
exports.default = (testImplementations, testSpecifications, testInput) => {
|
|
9
|
-
return (0,
|
|
9
|
+
return (0, Node_js_1.default)(testInput, testSpecifications, testImplementations, {
|
|
10
10
|
beforeEach: async () => {
|
|
11
11
|
return new Promise((resolve, rej) => {
|
|
12
12
|
resolve(react_1.default.createElement(testInput, {}, []));
|
|
13
13
|
});
|
|
14
14
|
},
|
|
15
|
-
andWhen: function (s,
|
|
16
|
-
return
|
|
15
|
+
andWhen: function (s, whenCB) {
|
|
16
|
+
return whenCB()(s);
|
|
17
17
|
},
|
|
18
18
|
});
|
|
19
19
|
};
|
|
@@ -4,16 +4,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const
|
|
7
|
+
const Web_js_1 = __importDefault(require("../../../Web.js"));
|
|
8
8
|
exports.default = (testImplementations, testSpecifications, testInput) => {
|
|
9
|
-
return (0,
|
|
9
|
+
return (0, Web_js_1.default)(testInput, testSpecifications, testImplementations, {
|
|
10
10
|
beforeEach: async () => {
|
|
11
11
|
return new Promise((resolve, rej) => {
|
|
12
12
|
resolve(react_1.default.createElement(testInput, {}, []));
|
|
13
13
|
});
|
|
14
14
|
},
|
|
15
|
-
andWhen: function (s,
|
|
16
|
-
return
|
|
15
|
+
andWhen: function (s, whenCB) {
|
|
16
|
+
return whenCB()(s);
|
|
17
17
|
},
|
|
18
18
|
});
|
|
19
19
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
// beforeAll: async (proto, testResource, artificer, pm): Promise<IStore> => {
|
|
10
|
+
// return React.createElement(proto);
|
|
11
|
+
// // return new Promise((resolve, rej) => {
|
|
12
|
+
// // resolve(x());
|
|
13
|
+
// // });
|
|
14
|
+
// },
|
|
15
|
+
beforeEach: async (subject, initializer, artificer) => {
|
|
16
|
+
return new Promise((resolve, rej) => {
|
|
17
|
+
const x = react_1.default.createElement(subject);
|
|
18
|
+
console.log("react-element", x);
|
|
19
|
+
resolve(x);
|
|
20
|
+
});
|
|
21
|
+
},
|
|
22
|
+
andWhen: function (s, whenCB) {
|
|
23
|
+
return whenCB(s);
|
|
24
|
+
},
|
|
25
|
+
};
|
|
@@ -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) => {
|
|
9
|
+
return (0, Node_js_1.default)(testInput, testSpecifications, testImplementations, Object.assign(Object.assign({}, index_js_1.testInterface), 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
|
+
};
|
|
@@ -10,9 +10,9 @@ Object.defineProperty(exports, "renderToStaticMarkup", { enumerable: true, get:
|
|
|
10
10
|
Object.defineProperty(exports, "renderToStaticNodeStream", { enumerable: true, get: function () { return server_1.renderToStaticNodeStream; } });
|
|
11
11
|
const stream_1 = __importDefault(require("stream"));
|
|
12
12
|
exports.Stream = stream_1.default;
|
|
13
|
-
const
|
|
13
|
+
const Node_js_1 = __importDefault(require("../../../Node.js"));
|
|
14
14
|
exports.default = (testImplementations, testSpecifications, testInput) => {
|
|
15
|
-
return (0,
|
|
15
|
+
return (0, Node_js_1.default)(testInput, testSpecifications, testImplementations, {
|
|
16
16
|
// beforeAll: async (
|
|
17
17
|
// prototype,
|
|
18
18
|
// artificer
|
|
@@ -30,9 +30,9 @@ exports.default = (testImplementations, testSpecifications, testInput) => {
|
|
|
30
30
|
resolve((0, react_1.createElement)(testInput));
|
|
31
31
|
});
|
|
32
32
|
},
|
|
33
|
-
andWhen: async function (s,
|
|
34
|
-
|
|
35
|
-
return s
|
|
33
|
+
andWhen: async function (s, whenCB) {
|
|
34
|
+
return whenCB(s);
|
|
35
|
+
// return s
|
|
36
36
|
},
|
|
37
37
|
butThen: async function (s) {
|
|
38
38
|
return s;
|
|
@@ -93,7 +93,7 @@ exports.default = (testImplementations, testSpecifications, testInput) => {
|
|
|
93
93
|
// resolve(ReactDOMServer.renderToStaticMarkup(element));
|
|
94
94
|
// });
|
|
95
95
|
// },
|
|
96
|
-
// andWhen: function (s: IStore,
|
|
96
|
+
// andWhen: function (s: IStore, whenCB): Promise<ISelection> {
|
|
97
97
|
// throw new Error(`"andWhens" are not permitted`);
|
|
98
98
|
// }
|
|
99
99
|
// },
|
|
@@ -0,0 +1,93 @@
|
|
|
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 (initialProps, 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
|
+
// Ignore these type errors
|
|
27
|
+
domRoot.render((0, react_1.createElement)(TesterantoComponent, Object.assign(Object.assign({}, initialProps), { done: (reactElement) => {
|
|
28
|
+
resolve({
|
|
29
|
+
htmlElement,
|
|
30
|
+
reactElement,
|
|
31
|
+
domRoot,
|
|
32
|
+
});
|
|
33
|
+
} }), []));
|
|
34
|
+
// resolve({ htmlElement });
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
// beforeEach: async (
|
|
39
|
+
// s,
|
|
40
|
+
// initializer,
|
|
41
|
+
// testResource,
|
|
42
|
+
// artificer,
|
|
43
|
+
// initialValues
|
|
44
|
+
// ): Promise<IStore> => {
|
|
45
|
+
// return new Promise((resolve, rej) => {
|
|
46
|
+
// console.log("beforeEach" + TesterantoComponent);
|
|
47
|
+
// // const domRoot = ReactDom.createRoot(htmlElement);
|
|
48
|
+
// // // Ignore these type errors
|
|
49
|
+
// // domRoot.render(
|
|
50
|
+
// // createElement(
|
|
51
|
+
// // TesterantoComponent,
|
|
52
|
+
// // {
|
|
53
|
+
// // ...initializer,
|
|
54
|
+
// // done: (reactElement) => {
|
|
55
|
+
// // resolve({
|
|
56
|
+
// // htmlElement,
|
|
57
|
+
// // reactElement,
|
|
58
|
+
// // domRoot,
|
|
59
|
+
// // });
|
|
60
|
+
// // },
|
|
61
|
+
// // },
|
|
62
|
+
// // []
|
|
63
|
+
// // )
|
|
64
|
+
// // );
|
|
65
|
+
// });
|
|
66
|
+
// },
|
|
67
|
+
andWhen: function (s, whenCB) {
|
|
68
|
+
return whenCB(s);
|
|
69
|
+
},
|
|
70
|
+
butThen: async function (s, thenCB) {
|
|
71
|
+
return thenCB(s);
|
|
72
|
+
},
|
|
73
|
+
afterEach: (testInterface === null || testInterface === void 0 ? void 0 : testInterface.afterEach) ||
|
|
74
|
+
async function (store, ndx, artificer, utils) {
|
|
75
|
+
return store;
|
|
76
|
+
},
|
|
77
|
+
afterAll: async (store, artificer, utils) => {
|
|
78
|
+
// setTimeout(() => {
|
|
79
|
+
// console.log("This will run after 1 second");
|
|
80
|
+
// }, 1000); // 1000 milliseconds = 1 second
|
|
81
|
+
// store.htmlElement.remove();
|
|
82
|
+
// store.htmlElement = document.createElement("root");
|
|
83
|
+
return store;
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
document.addEventListener("DOMContentLoaded", function () {
|
|
87
|
+
const elem = document.getElementById("root");
|
|
88
|
+
if (elem) {
|
|
89
|
+
return t;
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
return t;
|
|
93
|
+
};
|
|
@@ -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 (reactComponent, ndx, testRsource, artificer) => {
|
|
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
|
+
};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const react_1 = __importStar(require("react"));
|
|
30
|
+
const react_2 = require("react");
|
|
31
|
+
const client_1 = __importDefault(require("react-dom/client"));
|
|
32
|
+
const react_dom_1 = require("react-dom");
|
|
33
|
+
const Web_js_1 = __importDefault(require("../../../Web.js"));
|
|
34
|
+
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
|
+
const t = (0, Web_js_1.default)(testInput, testSpecifications, testImplementations, {
|
|
46
|
+
beforeAll: async (reactElement, itr) => {
|
|
47
|
+
return await new Promise((resolve, rej) => {
|
|
48
|
+
const htmlElement = document.getElementById("root");
|
|
49
|
+
if (htmlElement) {
|
|
50
|
+
const domRoot = client_1.default.createRoot(htmlElement);
|
|
51
|
+
domRoot.render((0, react_2.createElement)(TesterantoComponent, {
|
|
52
|
+
// ...initialProps,
|
|
53
|
+
innerComp: reactElement,
|
|
54
|
+
done: (reactElement) => {
|
|
55
|
+
resolve({
|
|
56
|
+
htmlElement,
|
|
57
|
+
reactElement,
|
|
58
|
+
domRoot,
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
}, []));
|
|
62
|
+
// resolve({ htmlElement });
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
beforeEach: async (subject, initializer, artificer, testResource, pm) => {
|
|
67
|
+
return new Promise((resolve, rej) => {
|
|
68
|
+
(0, react_dom_1.createPortal)(TesterantoComponent({
|
|
69
|
+
innerComp: () => testInput({
|
|
70
|
+
port: 3003,
|
|
71
|
+
address: "some-address",
|
|
72
|
+
secretKey: "someSecretKey",
|
|
73
|
+
abi: "foo",
|
|
74
|
+
}),
|
|
75
|
+
done: (reactElement) => {
|
|
76
|
+
process.nextTick(() => {
|
|
77
|
+
resolve(reactElement);
|
|
78
|
+
});
|
|
79
|
+
},
|
|
80
|
+
}), subject.domRoot);
|
|
81
|
+
});
|
|
82
|
+
},
|
|
83
|
+
andWhen: function (s, whenCB) {
|
|
84
|
+
return new Promise((resolve, rej) => {
|
|
85
|
+
process.nextTick(() => {
|
|
86
|
+
resolve(whenCB()(s));
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
},
|
|
90
|
+
butThen: async function (s) {
|
|
91
|
+
return new Promise((resolve, rej) => {
|
|
92
|
+
process.nextTick(() => {
|
|
93
|
+
resolve(s);
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
},
|
|
97
|
+
afterEach: async function (store, ndx, artificer) {
|
|
98
|
+
return new Promise((resolve, rej) => {
|
|
99
|
+
process.nextTick(() => {
|
|
100
|
+
resolve({});
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
},
|
|
104
|
+
afterAll: (store, artificer) => {
|
|
105
|
+
return new Promise((resolve, rej) => {
|
|
106
|
+
process.nextTick(() => {
|
|
107
|
+
resolve({});
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
document.addEventListener("DOMContentLoaded", function () {
|
|
113
|
+
const rootElement = document.getElementById("root");
|
|
114
|
+
if (rootElement) {
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
return t;
|
|
118
|
+
};
|