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,98 @@
|
|
|
1
|
+
import readline from "readline";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import { PM_Main } from "./PM/main.js";
|
|
4
|
+
import { destinationOfRuntime } from "./utils.js";
|
|
5
|
+
var mode = process.argv[2] === "-dev" ? "DEV" : "PROD";
|
|
6
|
+
const node2web = {};
|
|
7
|
+
const web2node = {};
|
|
8
|
+
const childProcesses = {};
|
|
9
|
+
readline.emitKeypressEvents(process.stdin);
|
|
10
|
+
if (process.stdin.isTTY)
|
|
11
|
+
process.stdin.setRawMode(true);
|
|
12
|
+
console.log("\n Puppeteer is running. Press 'q' to quit\n");
|
|
13
|
+
process.stdin.on("keypress", (str, key) => {
|
|
14
|
+
if (key.name === "q") {
|
|
15
|
+
process.exit();
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
export default async (partialConfig) => {
|
|
19
|
+
const config = Object.assign(Object.assign({}, partialConfig), { buildDir: process.cwd() + "/" + partialConfig.outdir });
|
|
20
|
+
fs.writeFileSync(`${config.outdir}/testeranto.json`, JSON.stringify(Object.assign(Object.assign({}, config), { buildDir: process.cwd() + "/" + config.outdir }), null, 2));
|
|
21
|
+
const pm = new PM_Main(config);
|
|
22
|
+
await pm.startPuppeteer({
|
|
23
|
+
waitForInitialPage: false,
|
|
24
|
+
executablePath: "/opt/homebrew/bin/chromium",
|
|
25
|
+
headless: true,
|
|
26
|
+
// dumpio: true,
|
|
27
|
+
args: [
|
|
28
|
+
"--disable-features=IsolateOrigins,site-per-process",
|
|
29
|
+
"--disable-site-isolation-trials",
|
|
30
|
+
"--allow-insecure-localhost",
|
|
31
|
+
"--allow-file-access-from-files",
|
|
32
|
+
"--allow-running-insecure-content",
|
|
33
|
+
// "--auto-open-devtools-for-tabs",
|
|
34
|
+
"--disable-dev-shm-usage",
|
|
35
|
+
"--disable-extensions",
|
|
36
|
+
"--disable-gpu",
|
|
37
|
+
"--disable-setuid-sandbox",
|
|
38
|
+
"--disable-site-isolation-trials",
|
|
39
|
+
"--disable-web-security",
|
|
40
|
+
"--no-first-run",
|
|
41
|
+
"--no-sandbox",
|
|
42
|
+
"--no-startup-window",
|
|
43
|
+
// "--no-zygote",
|
|
44
|
+
"--reduce-security-for-testing",
|
|
45
|
+
"--remote-allow-origins=*",
|
|
46
|
+
"--unsafely-treat-insecure-origin-as-secure=*",
|
|
47
|
+
// "--disable-features=IsolateOrigins",
|
|
48
|
+
// "--remote-allow-origins=ws://localhost:3234",
|
|
49
|
+
// "--single-process",
|
|
50
|
+
// "--unsafely-treat-insecure-origin-as-secure",
|
|
51
|
+
// "--unsafely-treat-insecure-origin-as-secure=ws://192.168.0.101:3234",
|
|
52
|
+
`--remote-debugging-port=3234`,
|
|
53
|
+
// "--disk-cache-dir=/dev/null",
|
|
54
|
+
// "--disk-cache-size=1",
|
|
55
|
+
// "--start-maximized",
|
|
56
|
+
],
|
|
57
|
+
}, ".");
|
|
58
|
+
config.tests.forEach(([test, runtime, tr, sidecars]) => {
|
|
59
|
+
if (runtime === "node") {
|
|
60
|
+
pm.launchNode(test, destinationOfRuntime(test, "node", config));
|
|
61
|
+
}
|
|
62
|
+
else if (runtime === "web") {
|
|
63
|
+
pm.launchWeb(test, destinationOfRuntime(test, "web", config), sidecars);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
console.error("runtime makes no sense", runtime);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
console.log("ready and watching for changes...", config.buildDir);
|
|
70
|
+
fs.watch(config.buildDir, {
|
|
71
|
+
recursive: true,
|
|
72
|
+
}, (eventType, changedFile) => {
|
|
73
|
+
if (changedFile) {
|
|
74
|
+
config.tests.forEach(([test, runtime, tr, sidecars]) => {
|
|
75
|
+
if (eventType === "change" || eventType === "rename") {
|
|
76
|
+
if (changedFile ===
|
|
77
|
+
test
|
|
78
|
+
.replace("./", "node/")
|
|
79
|
+
.split(".")
|
|
80
|
+
.slice(0, -1)
|
|
81
|
+
.concat("mjs")
|
|
82
|
+
.join(".")) {
|
|
83
|
+
pm.launchNode(test, destinationOfRuntime(test, "node", config));
|
|
84
|
+
}
|
|
85
|
+
if (changedFile ===
|
|
86
|
+
test
|
|
87
|
+
.replace("./", "web/")
|
|
88
|
+
.split(".")
|
|
89
|
+
.slice(0, -1)
|
|
90
|
+
.concat("mjs")
|
|
91
|
+
.join(".")) {
|
|
92
|
+
pm.launchWeb(test, destinationOfRuntime(test, "web", config), sidecars);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import readline from "readline";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import { jsonc } from "jsonc";
|
|
4
|
+
import puppeteer from "puppeteer-core";
|
|
5
|
+
// import { PM_Main } from "./PM/main.js";
|
|
6
|
+
// var mode: "DEV" | "PROD" = process.argv[2] === "-dev" ? "DEV" : "PROD";
|
|
7
|
+
// const node2web: Record<string, string[]> = {};
|
|
8
|
+
// const web2node: Record<string, string[]> = {};
|
|
9
|
+
// const childProcesses: Record<string, "loaded" | "running" | "done"> = {};
|
|
10
|
+
readline.emitKeypressEvents(process.stdin);
|
|
11
|
+
if (process.stdin.isTTY)
|
|
12
|
+
process.stdin.setRawMode(true);
|
|
13
|
+
console.log("\n Puppeteer is running. Press 'q' to quit\n");
|
|
14
|
+
process.stdin.on("keypress", (str, key) => {
|
|
15
|
+
if (key.name === "q") {
|
|
16
|
+
process.exit();
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const main = async () => {
|
|
20
|
+
const configs = jsonc.parse((await fs.readFileSync("./docs/testeranto.json")).toString());
|
|
21
|
+
// const pm = new PM_Main(configs);
|
|
22
|
+
// await puppeteer.launch(options);
|
|
23
|
+
const browser = await puppeteer.launch({
|
|
24
|
+
waitForInitialPage: false,
|
|
25
|
+
executablePath: "/opt/homebrew/bin/chromium",
|
|
26
|
+
headless: false,
|
|
27
|
+
args: [
|
|
28
|
+
"--allow-file-access-from-files",
|
|
29
|
+
"--allow-running-insecure-content",
|
|
30
|
+
// "--auto-open-devtools-for-tabs",
|
|
31
|
+
"--disable-dev-shm-usage",
|
|
32
|
+
"--disable-extensions",
|
|
33
|
+
"--disable-gpu",
|
|
34
|
+
"--disable-setuid-sandbox",
|
|
35
|
+
"--disable-site-isolation-trials",
|
|
36
|
+
"--disable-web-security",
|
|
37
|
+
"--disable-web-security",
|
|
38
|
+
"--no-first-run",
|
|
39
|
+
"--no-sandbox",
|
|
40
|
+
"--no-startup-window",
|
|
41
|
+
"--no-zygote",
|
|
42
|
+
"--reduce-security-for-testing",
|
|
43
|
+
"--remote-allow-origins=*",
|
|
44
|
+
// "--remote-allow-origins=ws://localhost:3234",
|
|
45
|
+
"--unsafely-treat-insecure-origin-as-secure=*",
|
|
46
|
+
// "--disable-features=IsolateOrigins",
|
|
47
|
+
// "--single-process",
|
|
48
|
+
// "--unsafely-treat-insecure-origin-as-secure",
|
|
49
|
+
// "--unsafely-treat-insecure-origin-as-secure=ws://192.168.0.101:3234",
|
|
50
|
+
// `--remote-debugging-port=3234`,
|
|
51
|
+
],
|
|
52
|
+
}
|
|
53
|
+
// "."
|
|
54
|
+
);
|
|
55
|
+
console.log("Creating new page...");
|
|
56
|
+
const page = await browser.newPage();
|
|
57
|
+
await page.setViewport({ width: 0, height: 0 });
|
|
58
|
+
console.log("Requesting url...");
|
|
59
|
+
await page.goto(`file://${process.cwd()}/docs/report.html?local=true`);
|
|
60
|
+
// configs.tests.forEach(([test, runtime, secondaryArtifacts]) => {
|
|
61
|
+
// if (runtime === "node") {
|
|
62
|
+
// pm.launchNode(test, destinationOfRuntime(test, "node"));
|
|
63
|
+
// } else if (runtime === "web") {
|
|
64
|
+
// pm.launchWeb(test, destinationOfRuntime(test, "web"));
|
|
65
|
+
// } else {
|
|
66
|
+
// console.error("runtime makes no sense", runtime);
|
|
67
|
+
// }
|
|
68
|
+
// });
|
|
69
|
+
// console.log("ready and watching for changes...", configs.buildDir);
|
|
70
|
+
// fs.watch(
|
|
71
|
+
// configs.buildDir,
|
|
72
|
+
// {
|
|
73
|
+
// recursive: true,
|
|
74
|
+
// },
|
|
75
|
+
// (eventType, changedFile) => {
|
|
76
|
+
// if (changedFile) {
|
|
77
|
+
// configs.tests.forEach(([test, runtime, secondaryArtifacts]) => {
|
|
78
|
+
// if (eventType === "change" || eventType === "rename") {
|
|
79
|
+
// if (
|
|
80
|
+
// changedFile ===
|
|
81
|
+
// test
|
|
82
|
+
// .replace("./", "node/")
|
|
83
|
+
// .split(".")
|
|
84
|
+
// .slice(0, -1)
|
|
85
|
+
// .concat("mjs")
|
|
86
|
+
// .join(".")
|
|
87
|
+
// ) {
|
|
88
|
+
// pm.launchNode(test, destinationOfRuntime(test, "node"));
|
|
89
|
+
// }
|
|
90
|
+
// if (
|
|
91
|
+
// changedFile ===
|
|
92
|
+
// test
|
|
93
|
+
// .replace("./", "web/")
|
|
94
|
+
// .split(".")
|
|
95
|
+
// .slice(0, -1)
|
|
96
|
+
// .concat("mjs")
|
|
97
|
+
// .join(".")
|
|
98
|
+
// ) {
|
|
99
|
+
// pm.launchWeb(test, destinationOfRuntime(test, "web"));
|
|
100
|
+
// }
|
|
101
|
+
// }
|
|
102
|
+
// });
|
|
103
|
+
// }
|
|
104
|
+
// }
|
|
105
|
+
// );
|
|
106
|
+
};
|
|
107
|
+
main();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Testeranto from "../Node.js";
|
|
3
|
+
export default (testInput, testSpecifications, testImplementations, testInterface) => {
|
|
4
|
+
return Testeranto(testInput, testSpecifications, testImplementations, Object.assign({ beforeAll(x) {
|
|
5
|
+
// process.parentPort.postMessage(
|
|
6
|
+
// `/docs/web/src/ClassicalComponent/test.html`
|
|
7
|
+
// );
|
|
8
|
+
return x;
|
|
9
|
+
}, beforeEach: async () => {
|
|
10
|
+
return new Promise((resolve, rej) => {
|
|
11
|
+
resolve(React.createElement(testInput, {}, []));
|
|
12
|
+
});
|
|
13
|
+
}, andWhen: function (s, whenCB) {
|
|
14
|
+
return whenCB()(s);
|
|
15
|
+
} }, testInterface));
|
|
16
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import Testeranto from "../../../Node";
|
|
2
|
+
import Testeranto from "../../../Node.js";
|
|
3
3
|
export default (testImplementations, testSpecifications, testInput) => {
|
|
4
4
|
return Testeranto(testInput, testSpecifications, testImplementations, {
|
|
5
5
|
beforeEach: async () => {
|
|
@@ -7,8 +7,8 @@ export default (testImplementations, testSpecifications, testInput) => {
|
|
|
7
7
|
resolve(React.createElement(testInput, {}, []));
|
|
8
8
|
});
|
|
9
9
|
},
|
|
10
|
-
andWhen: function (s,
|
|
11
|
-
return
|
|
10
|
+
andWhen: function (s, whenCB) {
|
|
11
|
+
return whenCB()(s);
|
|
12
12
|
},
|
|
13
13
|
});
|
|
14
14
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import Testeranto from "../../../Web";
|
|
2
|
+
import Testeranto from "../../../Web.js";
|
|
3
3
|
export default (testImplementations, testSpecifications, testInput) => {
|
|
4
4
|
return Testeranto(testInput, testSpecifications, testImplementations, {
|
|
5
5
|
beforeEach: async () => {
|
|
@@ -7,8 +7,8 @@ export default (testImplementations, testSpecifications, testInput) => {
|
|
|
7
7
|
resolve(React.createElement(testInput, {}, []));
|
|
8
8
|
});
|
|
9
9
|
},
|
|
10
|
-
andWhen: function (s,
|
|
11
|
-
return
|
|
10
|
+
andWhen: function (s, whenCB) {
|
|
11
|
+
return whenCB()(s);
|
|
12
12
|
},
|
|
13
13
|
});
|
|
14
14
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export const testInterface = {
|
|
3
|
+
// beforeAll: async (proto, testResource, artificer, pm): Promise<IStore> => {
|
|
4
|
+
// return React.createElement(proto);
|
|
5
|
+
// // return new Promise((resolve, rej) => {
|
|
6
|
+
// // resolve(x());
|
|
7
|
+
// // });
|
|
8
|
+
// },
|
|
9
|
+
beforeEach: async (subject, initializer, artificer) => {
|
|
10
|
+
return new Promise((resolve, rej) => {
|
|
11
|
+
const x = React.createElement(subject);
|
|
12
|
+
console.log("react-element", x);
|
|
13
|
+
resolve(x);
|
|
14
|
+
});
|
|
15
|
+
},
|
|
16
|
+
andWhen: function (s, whenCB) {
|
|
17
|
+
return whenCB(s);
|
|
18
|
+
},
|
|
19
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import Testeranto from "../../../Node.js";
|
|
2
|
+
import { testInterface as baseInterface, } from "./index.js";
|
|
3
|
+
export default (testImplementations, testSpecifications, testInput, testInterface) => {
|
|
4
|
+
return Testeranto(testInput, testSpecifications, testImplementations, Object.assign(Object.assign({}, baseInterface), testInterface));
|
|
5
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import Testeranto from "../../../Web.js";
|
|
2
|
+
import { testInterface as baseInterface, } from "./index.js";
|
|
3
|
+
export default (testImplementations, testSpecifications, testInput, testInterface) => {
|
|
4
|
+
return Testeranto(testInput, testSpecifications, testImplementations, Object.assign(Object.assign({}, baseInterface), testInterface));
|
|
5
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createElement } from "react";
|
|
2
|
-
import { renderToStaticMarkup, renderToStaticNodeStream } from "react-dom/server";
|
|
3
|
-
import Stream from
|
|
4
|
-
import Testeranto from "../../../Node";
|
|
2
|
+
import { renderToStaticMarkup, renderToStaticNodeStream, } from "react-dom/server";
|
|
3
|
+
import Stream from "stream";
|
|
4
|
+
import Testeranto from "../../../Node.js";
|
|
5
5
|
export { renderToStaticMarkup, renderToStaticNodeStream, Stream };
|
|
6
6
|
export default (testImplementations, testSpecifications, testInput) => {
|
|
7
7
|
return Testeranto(testInput, testSpecifications, testImplementations, {
|
|
@@ -22,9 +22,9 @@ export default (testImplementations, testSpecifications, testInput) => {
|
|
|
22
22
|
resolve(createElement(testInput));
|
|
23
23
|
});
|
|
24
24
|
},
|
|
25
|
-
andWhen: async function (s,
|
|
26
|
-
|
|
27
|
-
return s
|
|
25
|
+
andWhen: async function (s, whenCB) {
|
|
26
|
+
return whenCB(s);
|
|
27
|
+
// return s
|
|
28
28
|
},
|
|
29
29
|
butThen: async function (s) {
|
|
30
30
|
return s;
|
|
@@ -85,7 +85,7 @@ export default (testImplementations, testSpecifications, testInput) => {
|
|
|
85
85
|
// resolve(ReactDOMServer.renderToStaticMarkup(element));
|
|
86
86
|
// });
|
|
87
87
|
// },
|
|
88
|
-
// andWhen: function (s: IStore,
|
|
88
|
+
// andWhen: function (s: IStore, whenCB): Promise<ISelection> {
|
|
89
89
|
// throw new Error(`"andWhens" are not permitted`);
|
|
90
90
|
// }
|
|
91
91
|
// },
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { createElement } from "react";
|
|
2
|
+
import ReactDom from "react-dom/client";
|
|
3
|
+
import Testeranto from "../../../Web.js";
|
|
4
|
+
export default (testInput, testSpecifications, testImplementations, testInterface) => {
|
|
5
|
+
class TesterantoComponent extends testInput {
|
|
6
|
+
constructor(props) {
|
|
7
|
+
super(props);
|
|
8
|
+
this.done = props.done;
|
|
9
|
+
}
|
|
10
|
+
componentDidMount() {
|
|
11
|
+
super.componentDidMount && super.componentDidMount();
|
|
12
|
+
return this.done(this);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
const t = Testeranto(testInput, testSpecifications, testImplementations, {
|
|
16
|
+
beforeAll: async (initialProps, artificer) => {
|
|
17
|
+
return await new Promise((resolve, rej) => {
|
|
18
|
+
const htmlElement = document.getElementById("root");
|
|
19
|
+
if (htmlElement) {
|
|
20
|
+
const domRoot = ReactDom.createRoot(htmlElement);
|
|
21
|
+
// Ignore these type errors
|
|
22
|
+
domRoot.render(createElement(TesterantoComponent, Object.assign(Object.assign({}, initialProps), { done: (reactElement) => {
|
|
23
|
+
resolve({
|
|
24
|
+
htmlElement,
|
|
25
|
+
reactElement,
|
|
26
|
+
domRoot,
|
|
27
|
+
});
|
|
28
|
+
} }), []));
|
|
29
|
+
// resolve({ htmlElement });
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
// beforeEach: async (
|
|
34
|
+
// s,
|
|
35
|
+
// initializer,
|
|
36
|
+
// testResource,
|
|
37
|
+
// artificer,
|
|
38
|
+
// initialValues
|
|
39
|
+
// ): Promise<IStore> => {
|
|
40
|
+
// return new Promise((resolve, rej) => {
|
|
41
|
+
// console.log("beforeEach" + TesterantoComponent);
|
|
42
|
+
// // const domRoot = ReactDom.createRoot(htmlElement);
|
|
43
|
+
// // // Ignore these type errors
|
|
44
|
+
// // domRoot.render(
|
|
45
|
+
// // createElement(
|
|
46
|
+
// // TesterantoComponent,
|
|
47
|
+
// // {
|
|
48
|
+
// // ...initializer,
|
|
49
|
+
// // done: (reactElement) => {
|
|
50
|
+
// // resolve({
|
|
51
|
+
// // htmlElement,
|
|
52
|
+
// // reactElement,
|
|
53
|
+
// // domRoot,
|
|
54
|
+
// // });
|
|
55
|
+
// // },
|
|
56
|
+
// // },
|
|
57
|
+
// // []
|
|
58
|
+
// // )
|
|
59
|
+
// // );
|
|
60
|
+
// });
|
|
61
|
+
// },
|
|
62
|
+
andWhen: function (s, whenCB) {
|
|
63
|
+
return whenCB(s);
|
|
64
|
+
},
|
|
65
|
+
butThen: async function (s, thenCB) {
|
|
66
|
+
return thenCB(s);
|
|
67
|
+
},
|
|
68
|
+
afterEach: (testInterface === null || testInterface === void 0 ? void 0 : testInterface.afterEach) ||
|
|
69
|
+
async function (store, ndx, artificer, utils) {
|
|
70
|
+
return store;
|
|
71
|
+
},
|
|
72
|
+
afterAll: async (store, artificer, utils) => {
|
|
73
|
+
// setTimeout(() => {
|
|
74
|
+
// console.log("This will run after 1 second");
|
|
75
|
+
// }, 1000); // 1000 milliseconds = 1 second
|
|
76
|
+
// store.htmlElement.remove();
|
|
77
|
+
// store.htmlElement = document.createElement("root");
|
|
78
|
+
return store;
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
document.addEventListener("DOMContentLoaded", function () {
|
|
82
|
+
const elem = document.getElementById("root");
|
|
83
|
+
if (elem) {
|
|
84
|
+
return t;
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
return t;
|
|
88
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createElement } from "react";
|
|
2
|
+
import { renderToStaticMarkup, renderToStaticNodeStream } from "react-dom/server";
|
|
3
|
+
import Stream from 'stream';
|
|
4
|
+
import Testeranto from "../../../Node.js";
|
|
5
|
+
export { renderToStaticMarkup, renderToStaticNodeStream, Stream };
|
|
6
|
+
export default (testImplementations, testSpecifications, testInput) => {
|
|
7
|
+
return Testeranto(testInput, testSpecifications, testImplementations, {
|
|
8
|
+
beforeAll: async (prototype, artificer) => {
|
|
9
|
+
return await new Promise((resolve, rej) => {
|
|
10
|
+
resolve(null);
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
beforeEach: async (reactComponent, ndx, testRsource, artificer) => {
|
|
14
|
+
return new Promise((resolve, rej) => {
|
|
15
|
+
resolve(createElement(testInput));
|
|
16
|
+
});
|
|
17
|
+
},
|
|
18
|
+
andWhen: async function (s, whenCB) {
|
|
19
|
+
return s;
|
|
20
|
+
},
|
|
21
|
+
butThen: async function (s) {
|
|
22
|
+
return s;
|
|
23
|
+
},
|
|
24
|
+
afterEach: async function (store, ndx, artificer) {
|
|
25
|
+
return {};
|
|
26
|
+
},
|
|
27
|
+
afterAll: (store, artificer) => {
|
|
28
|
+
return;
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from "react";
|
|
2
|
+
import { createElement } from "react";
|
|
3
|
+
import ReactDom from "react-dom/client";
|
|
4
|
+
import { createPortal } from "react-dom";
|
|
5
|
+
import Testeranto from "../../../Web.js";
|
|
6
|
+
export default (testImplementations, testSpecifications, testInput) => {
|
|
7
|
+
console.log("testInput", testInput);
|
|
8
|
+
const TesterantoComponent = function ({ done, innerComp, }) {
|
|
9
|
+
const myContainer = useRef(null);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
console.log("useEffect called!", myContainer.current);
|
|
12
|
+
done(myContainer.current);
|
|
13
|
+
}, []);
|
|
14
|
+
// debugger;
|
|
15
|
+
return React.createElement("div", { ref: myContainer }, innerComp());
|
|
16
|
+
};
|
|
17
|
+
const t = Testeranto(testInput, testSpecifications, testImplementations, {
|
|
18
|
+
beforeAll: async (reactElement, itr) => {
|
|
19
|
+
return await new Promise((resolve, rej) => {
|
|
20
|
+
const htmlElement = document.getElementById("root");
|
|
21
|
+
if (htmlElement) {
|
|
22
|
+
const domRoot = ReactDom.createRoot(htmlElement);
|
|
23
|
+
domRoot.render(createElement(TesterantoComponent, {
|
|
24
|
+
// ...initialProps,
|
|
25
|
+
innerComp: reactElement,
|
|
26
|
+
done: (reactElement) => {
|
|
27
|
+
resolve({
|
|
28
|
+
htmlElement,
|
|
29
|
+
reactElement,
|
|
30
|
+
domRoot,
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
}, []));
|
|
34
|
+
// resolve({ htmlElement });
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
beforeEach: async (subject, initializer, artificer, testResource, pm) => {
|
|
39
|
+
return new Promise((resolve, rej) => {
|
|
40
|
+
createPortal(TesterantoComponent({
|
|
41
|
+
innerComp: () => testInput({
|
|
42
|
+
port: 3003,
|
|
43
|
+
address: "some-address",
|
|
44
|
+
secretKey: "someSecretKey",
|
|
45
|
+
abi: "foo",
|
|
46
|
+
}),
|
|
47
|
+
done: (reactElement) => {
|
|
48
|
+
process.nextTick(() => {
|
|
49
|
+
resolve(reactElement);
|
|
50
|
+
});
|
|
51
|
+
},
|
|
52
|
+
}), subject.domRoot);
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
andWhen: function (s, whenCB) {
|
|
56
|
+
return new Promise((resolve, rej) => {
|
|
57
|
+
process.nextTick(() => {
|
|
58
|
+
resolve(whenCB()(s));
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
},
|
|
62
|
+
butThen: async function (s) {
|
|
63
|
+
return new Promise((resolve, rej) => {
|
|
64
|
+
process.nextTick(() => {
|
|
65
|
+
resolve(s);
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
afterEach: async function (store, ndx, artificer) {
|
|
70
|
+
return new Promise((resolve, rej) => {
|
|
71
|
+
process.nextTick(() => {
|
|
72
|
+
resolve({});
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
},
|
|
76
|
+
afterAll: (store, artificer) => {
|
|
77
|
+
return new Promise((resolve, rej) => {
|
|
78
|
+
process.nextTick(() => {
|
|
79
|
+
resolve({});
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
document.addEventListener("DOMContentLoaded", function () {
|
|
85
|
+
const rootElement = document.getElementById("root");
|
|
86
|
+
if (rootElement) {
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
return t;
|
|
90
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import renderer, { act } from "react-test-renderer";
|
|
3
|
+
import test from "../../../Node";
|
|
4
|
+
export default (testImplementations, testSpecifications, testInput) => test(testInput, testSpecifications, testImplementations, {
|
|
5
|
+
beforeEach: function (CComponent, props) {
|
|
6
|
+
let component;
|
|
7
|
+
act(() => {
|
|
8
|
+
component = renderer.create(React.createElement(CComponent, props, []));
|
|
9
|
+
});
|
|
10
|
+
return component;
|
|
11
|
+
},
|
|
12
|
+
andWhen: async function (renderer, whenCB) {
|
|
13
|
+
await act(() => whenCB()(renderer));
|
|
14
|
+
return renderer;
|
|
15
|
+
},
|
|
16
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import renderer, { act } from "react-test-renderer";
|
|
3
|
+
export const testInterface = {
|
|
4
|
+
beforeEach: function (CComponent, propsAndChildren) {
|
|
5
|
+
function Link(props) {
|
|
6
|
+
const p = props.props;
|
|
7
|
+
const c = props.children;
|
|
8
|
+
return React.createElement(CComponent, p, c);
|
|
9
|
+
}
|
|
10
|
+
return new Promise((res, rej) => {
|
|
11
|
+
act(async () => {
|
|
12
|
+
const p = propsAndChildren;
|
|
13
|
+
const y = new CComponent(p.props);
|
|
14
|
+
const testRenderer = await renderer.create(Link(propsAndChildren));
|
|
15
|
+
res(testRenderer);
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
},
|
|
19
|
+
andWhen: async function (renderer, whenCB) {
|
|
20
|
+
// console.log("andWhen", whenCB)
|
|
21
|
+
await act(() => whenCB(renderer));
|
|
22
|
+
return renderer;
|
|
23
|
+
},
|
|
24
|
+
// andWhen: function (s: Store, whenCB): Promise<Selection> {
|
|
25
|
+
// return whenCB()(s);
|
|
26
|
+
// },
|
|
27
|
+
butThen: async function (s, thenCB, tr) {
|
|
28
|
+
console.log("butThen", thenCB.toString());
|
|
29
|
+
return thenCB(s);
|
|
30
|
+
},
|
|
31
|
+
afterEach: async function (store, ndx, artificer) {
|
|
32
|
+
// console.log("afterEach", store);
|
|
33
|
+
return {};
|
|
34
|
+
},
|
|
35
|
+
afterAll: (store, artificer) => {
|
|
36
|
+
// console.log("afterAll", store);
|
|
37
|
+
return;
|
|
38
|
+
},
|
|
39
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import Testeranto from "../../../Node";
|
|
2
|
-
import { testInterface } from ".";
|
|
1
|
+
import Testeranto from "../../../Node.js";
|
|
2
|
+
import { testInterface } from "./interface.js";
|
|
3
3
|
export default (testImplementations, testSpecifications, testInput) => Testeranto(testInput, testSpecifications, testImplementations, testInterface);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import Testeranto from "../../../Web";
|
|
2
|
-
import { testInterface } from "
|
|
1
|
+
import Testeranto from "../../../Web.js";
|
|
2
|
+
import { testInterface } from "./interface";
|
|
3
3
|
export default (testImplementations, testSpecifications, testInput) => Testeranto(testInput, testSpecifications, testImplementations, testInterface);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import test from "../../../Node";
|
|
2
1
|
import React from "react";
|
|
3
2
|
import renderer, { act } from "react-test-renderer";
|
|
3
|
+
import test from "../../../Node.js";
|
|
4
4
|
export default (testImplementations, testSpecifications, testInput) => test(testInput, testSpecifications, testImplementations, {
|
|
5
5
|
beforeEach: function (CComponent, props) {
|
|
6
6
|
return new Promise((res, rej) => {
|
|
@@ -11,8 +11,8 @@ export default (testImplementations, testSpecifications, testInput) => test(test
|
|
|
11
11
|
});
|
|
12
12
|
});
|
|
13
13
|
},
|
|
14
|
-
andWhen: async function (renderer,
|
|
15
|
-
await act(() =>
|
|
14
|
+
andWhen: async function (renderer, whenCB) {
|
|
15
|
+
await act(() => whenCB()(renderer));
|
|
16
16
|
return renderer;
|
|
17
17
|
},
|
|
18
18
|
afterEach: async (store, key, artificer) => {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import renderer, { act } from "react-test-renderer";
|
|
3
|
+
import test from "../../../Web.js";
|
|
4
|
+
export default (testImplementations, testSpecifications, testInput) => test(testInput, testSpecifications, testImplementations, {
|
|
5
|
+
beforeEach: function (CComponent, props) {
|
|
6
|
+
return new Promise((res, rej) => {
|
|
7
|
+
let component;
|
|
8
|
+
act(() => {
|
|
9
|
+
component = renderer.create(React.createElement(CComponent, props, []));
|
|
10
|
+
res(component);
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
},
|
|
14
|
+
andWhen: async function (renderer, whenCB) {
|
|
15
|
+
await act(() => whenCB()(renderer));
|
|
16
|
+
return renderer;
|
|
17
|
+
},
|
|
18
|
+
afterEach: async (store, key, artificer) => {
|
|
19
|
+
console.log("afterall");
|
|
20
|
+
store.unmount();
|
|
21
|
+
},
|
|
22
|
+
});
|