testeranto 0.74.0 → 0.79.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/.eslintrc.js +5 -2
- package/Bundle.Dockerfile +52 -0
- package/README.md +25 -24
- 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 +96 -0
- package/dist/common/src/Init.js +10 -0
- package/dist/common/{Node.js → src/Node.js} +1 -0
- package/dist/common/src/PM/index.js +7 -0
- package/dist/common/{PM → src/PM}/main.js +287 -10
- package/dist/common/{PM → src/PM}/node.js +4 -0
- package/dist/common/{PM → src/PM}/web.js +3 -0
- package/dist/common/{Project.js → src/Project.js} +15 -57
- package/dist/common/{Puppeteer.js → src/Puppeteer.js} +65 -26
- package/dist/common/{SubPackages → src/SubPackages}/react-dom/component/web.js +5 -25
- package/dist/common/src/SubPackages/react-dom/jsx/web.js +117 -0
- package/dist/common/{SubPackages/react-test-renderer/component/index.js → src/SubPackages/react-test-renderer/component/interface.js} +0 -20
- package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/component/node.js +2 -2
- package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/component/web.js +2 -2
- package/dist/common/{Types.js → src/Types.js} +0 -2
- package/dist/common/{esbuildConfigs → src/esbuildConfigs}/index.js +1 -0
- package/dist/common/src/esbuildConfigs/inputFilesPlugin.js +52 -0
- package/dist/common/{esbuildConfigs → src/esbuildConfigs}/node.js +5 -1
- package/dist/common/src/esbuildConfigs/report.js +14 -0
- package/dist/common/{esbuildConfigs → src/esbuildConfigs}/web.js +3 -1
- package/dist/common/src/lib/abstractBase.js +581 -0
- package/dist/common/{lib → src/lib}/basebuilder.js +12 -38
- package/dist/common/{lib → src/lib}/classBuilder.js +1 -3
- package/dist/common/{lib → src/lib}/core.js +3 -5
- package/dist/common/src/lib/types.js +2 -0
- package/dist/common/src/utils.js +16 -0
- 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 +89 -0
- package/dist/module/src/Init.js +5 -0
- package/dist/module/{Node.js → src/Node.js} +1 -0
- package/dist/module/src/PM/index.js +3 -0
- package/dist/module/src/PM/main.js +617 -0
- package/dist/module/{PM → src/PM}/node.js +4 -0
- package/dist/module/{PM → src/PM}/web.js +3 -0
- package/dist/module/{Project.js → src/Project.js} +15 -57
- package/dist/module/{Puppeteer.js → src/Puppeteer.js} +65 -26
- package/dist/module/{SubPackages → src/SubPackages}/react-dom/component/web.js +5 -25
- package/dist/module/src/SubPackages/react-dom/jsx/web.js +89 -0
- package/dist/module/{SubPackages/react-test-renderer/component/index.js → src/SubPackages/react-test-renderer/component/interface.js} +0 -20
- package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/component/node.js +1 -1
- package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/component/web.js +1 -1
- package/dist/module/{esbuildConfigs → src/esbuildConfigs}/index.js +1 -0
- package/dist/module/src/esbuildConfigs/inputFilesPlugin.js +47 -0
- package/dist/module/{esbuildConfigs → src/esbuildConfigs}/node.js +5 -1
- package/dist/module/src/esbuildConfigs/report.js +14 -0
- package/dist/module/{esbuildConfigs → src/esbuildConfigs}/web.js +3 -1
- package/dist/module/src/lib/abstractBase.js +573 -0
- package/dist/module/{lib → src/lib}/basebuilder.js +12 -38
- package/dist/module/{lib → src/lib}/classBuilder.js +1 -3
- package/dist/module/{lib → src/lib}/core.js +3 -5
- package/dist/module/src/utils.js +9 -0
- 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/src/Init.d.ts +2 -0
- package/dist/types/src/Node.d.ts +6 -0
- package/dist/types/{PM → src/PM}/index.d.ts +3 -2
- package/dist/types/{PM → src/PM}/main.d.ts +8 -3
- package/dist/types/{PM → src/PM}/node.d.ts +2 -0
- package/dist/types/{PM → src/PM}/web.d.ts +1 -0
- package/dist/types/{Project.d.ts → src/Project.d.ts} +1 -1
- package/dist/types/src/Puppeteer.d.ts +2 -0
- package/dist/types/src/SubPackages/puppeteer.d.ts +6 -0
- package/dist/types/{SubPackages → src/SubPackages}/react/component/node.d.ts +1 -1
- package/dist/types/{SubPackages → src/SubPackages}/react/component/web.d.ts +1 -1
- package/dist/types/src/SubPackages/react/jsx/node.d.ts +4 -0
- package/dist/types/src/SubPackages/react/jsx/web.d.ts +4 -0
- package/dist/types/{SubPackages → src/SubPackages}/react-dom/component/node.d.ts +2 -2
- package/dist/types/src/SubPackages/react-dom/component/web.d.ts +11 -0
- package/dist/types/src/SubPackages/react-dom/jsx/node.d.ts +6 -0
- package/dist/types/src/SubPackages/react-dom/jsx/web.d.ts +5 -0
- package/dist/types/src/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +5 -0
- package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/component/index.d.ts +0 -7
- package/dist/types/src/SubPackages/react-test-renderer/component/interface.d.ts +9 -0
- package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/component/node.d.ts +1 -2
- package/dist/types/src/SubPackages/react-test-renderer/component/web.d.ts +3 -0
- package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/fc/node.d.ts +1 -1
- package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/fc/web.d.ts +1 -1
- package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx/node.d.ts +1 -2
- package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx/web.d.ts +1 -2
- package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/node.d.ts +4 -0
- package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/web.d.ts +4 -0
- package/dist/types/src/Types.d.ts +51 -0
- package/dist/types/src/Web.d.ts +6 -0
- package/dist/types/src/esbuildConfigs/inputFilesPlugin.d.ts +5 -0
- package/dist/types/{lib → src/lib}/abstractBase.d.ts +8 -8
- package/dist/types/{lib → src/lib}/basebuilder.d.ts +1 -1
- package/dist/types/{lib → src/lib}/classBuilder.d.ts +1 -1
- package/dist/types/{lib → src/lib}/core.d.ts +1 -1
- package/dist/types/{lib → src/lib}/index.d.ts +5 -5
- package/dist/types/{lib → src/lib}/types.d.ts +15 -15
- package/dist/types/src/utils.d.ts +2 -0
- package/dist/types/testeranto.d.ts +16 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/docker-compose.yml +37 -0
- package/init-docs.ts +5 -0
- package/package.json +72 -25
- package/run-tests.ts +9 -0
- package/src/Aider.ts +125 -0
- package/src/Init.ts +20 -0
- package/src/Node.ts +31 -2
- package/src/PM/index.ts +7 -84
- package/src/PM/main.ts +400 -16
- package/src/PM/node.ts +6 -0
- package/src/PM/web.ts +4 -0
- package/src/Project.ts +33 -84
- package/src/Puppeteer.ts +115 -62
- package/src/SubPackages/react-dom/component/web.ts +10 -30
- package/src/SubPackages/react-dom/jsx/web.ts +110 -76
- package/src/SubPackages/react-test-renderer/component/index.ts +0 -66
- package/src/SubPackages/react-test-renderer/component/interface.ts +48 -0
- package/src/SubPackages/react-test-renderer/component/node.ts +2 -1
- package/src/SubPackages/react-test-renderer/component/web.ts +2 -1
- package/src/Types.ts +138 -29
- package/src/Web.ts +32 -2
- package/src/esbuildConfigs/index.ts +1 -0
- package/src/esbuildConfigs/inputFilesPlugin.ts +67 -0
- package/src/esbuildConfigs/node.ts +4 -2
- package/src/esbuildConfigs/report.ts +13 -13
- package/src/esbuildConfigs/web.ts +4 -0
- package/src/lib/abstractBase.ts +366 -36
- package/src/lib/basebuilder.ts +26 -52
- package/src/lib/classBuilder.ts +14 -2
- package/src/lib/core.ts +18 -7
- package/src/lib/index.ts +115 -7
- package/src/lib/types.ts +143 -37
- package/src/utils.ts +15 -0
- package/testeranto.ts +13 -0
- package/tsconfig.common.json +12 -4
- package/tsconfig.json +9 -3
- package/tsconfig.module.json +2 -3
- package/tsconfig.types.json +1 -2
- package/dist/common/Features.js +0 -84
- package/dist/common/PM/index.js +0 -71
- package/dist/common/Reporter.js +0 -119
- package/dist/common/Scheduler.js +0 -1
- package/dist/common/SubPackages/react-dom/jsx/web.js +0 -93
- package/dist/common/esbuildConfigs/report.js +0 -13
- package/dist/common/lib/abstractBase.js +0 -348
- package/dist/common/preload.js +0 -15
- package/dist/common/report.html.js +0 -31
- package/dist/module/Features.js +0 -73
- package/dist/module/PM/index.js +0 -67
- package/dist/module/PM/main.js +0 -340
- package/dist/module/Reporter.js +0 -114
- package/dist/module/Scheduler.js +0 -1
- package/dist/module/SubPackages/react-dom/jsx/web.js +0 -65
- package/dist/module/Types.js +0 -3
- package/dist/module/esbuildConfigs/report.js +0 -11
- package/dist/module/lib/abstractBase.js +0 -340
- package/dist/module/preload.js +0 -15
- package/dist/module/report.html.js +0 -29
- package/dist/prebuild/Report.css +0 -11358
- package/dist/prebuild/Report.js +0 -37585
- package/dist/types/Features.d.ts +0 -68
- package/dist/types/Node.d.ts +0 -6
- package/dist/types/SubPackages/puppeteer.d.ts +0 -6
- 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/web.d.ts +0 -5
- package/dist/types/SubPackages/react-dom/jsx/node.d.ts +0 -6
- package/dist/types/SubPackages/react-dom/jsx/web.d.ts +0 -5
- package/dist/types/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +0 -5
- package/dist/types/SubPackages/react-test-renderer/component/web.d.ts +0 -4
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/node.d.ts +0 -5
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/web.d.ts +0 -5
- package/dist/types/Types.d.ts +0 -50
- package/dist/types/Web.d.ts +0 -6
- package/dist/types/esbuildConfigs/report.d.ts +0 -4
- package/dist/types/preload.d.ts +0 -0
- package/dist/types/report.html.d.ts +0 -2
- package/electronBuild.ts +0 -32
- package/src/Features.ts +0 -118
- package/src/Report.tsx +0 -521
- package/src/Reporter.ts +0 -134
- package/src/Scheduler.ts +0 -0
- package/src/preload.ts +0 -17
- package/src/report.html.ts +0 -29
- package/tests/Rectangle.test.ts +0 -189
- /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/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/{lib/types.js → src/SubPackages/react-test-renderer/component/index.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/index.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/{Web.js → src/Web.js} +0 -0
- /package/dist/common/{esbuildConfigs → src/esbuildConfigs}/features.js +0 -0
- /package/dist/common/{esbuildConfigs → src/esbuildConfigs}/tests.js +0 -0
- /package/dist/common/{lib → src/lib}/index.js +0 -0
- /package/dist/common/{puppeteerConfiger.js → src/puppeteerConfiger.js} +0 -0
- /package/dist/common/{web.html.js → src/web.html.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/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/{lib/types.js → src/SubPackages/react-test-renderer/component/index.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/index.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/{types/Puppeteer.d.ts → module/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}/tests.js +0 -0
- /package/dist/module/{lib → src/lib}/index.js +0 -0
- /package/dist/{types/Reporter.d.ts → module/src/lib/types.js} +0 -0
- /package/dist/module/{puppeteerConfiger.js → src/puppeteerConfiger.js} +0 -0
- /package/dist/module/{web.html.js → src/web.html.js} +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react/jsx/index.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-test-renderer/jsx/index.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/index.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}/node.d.ts +0 -0
- /package/dist/types/{Scheduler.d.ts → 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/{puppeteerConfiger.d.ts → src/puppeteerConfiger.d.ts} +0 -0
- /package/dist/types/{web.html.d.ts → src/web.html.d.ts} +0 -0
package/src/Project.ts
CHANGED
|
@@ -6,11 +6,7 @@ import { glob } from "glob";
|
|
|
6
6
|
|
|
7
7
|
import esbuildNodeConfiger from "./esbuildConfigs/node.js";
|
|
8
8
|
import esbuildWebConfiger from "./esbuildConfigs/web.js";
|
|
9
|
-
import esbuildFeaturesConfiger from "./esbuildConfigs/features.js";
|
|
10
|
-
|
|
11
9
|
import webHtmlFrame from "./web.html.js";
|
|
12
|
-
import reportHtmlFrame from "./report.html.js";
|
|
13
|
-
|
|
14
10
|
import { ITestTypes, IBaseConfig, IRunTime } from "./lib/types.js";
|
|
15
11
|
|
|
16
12
|
var mode: "DEV" | "PROD" = process.argv[2] === "-dev" ? "DEV" : "PROD";
|
|
@@ -26,18 +22,9 @@ process.stdin.on("keypress", (str, key) => {
|
|
|
26
22
|
}
|
|
27
23
|
});
|
|
28
24
|
|
|
29
|
-
|
|
30
|
-
// const memoryUsage = process.memoryUsage();
|
|
31
|
-
// console.log("Memory usage:", memoryUsage);
|
|
32
|
-
// }, 10000); // Check every 10 seconds
|
|
33
|
-
|
|
34
|
-
let featuresDone,
|
|
35
|
-
nodeDone,
|
|
25
|
+
let nodeDone,
|
|
36
26
|
webDone = false;
|
|
37
|
-
|
|
38
|
-
featuresDone = true;
|
|
39
|
-
onDone();
|
|
40
|
-
};
|
|
27
|
+
|
|
41
28
|
const onNodeDone = () => {
|
|
42
29
|
nodeDone = true;
|
|
43
30
|
onDone();
|
|
@@ -51,7 +38,6 @@ const onDone = () => {
|
|
|
51
38
|
console.log(
|
|
52
39
|
JSON.stringify(
|
|
53
40
|
{
|
|
54
|
-
featuresDone,
|
|
55
41
|
nodeDone,
|
|
56
42
|
webDone,
|
|
57
43
|
mode,
|
|
@@ -60,7 +46,7 @@ const onDone = () => {
|
|
|
60
46
|
2
|
|
61
47
|
)
|
|
62
48
|
);
|
|
63
|
-
if (
|
|
49
|
+
if (nodeDone && webDone && mode === "PROD") {
|
|
64
50
|
console.log("Testeranto-EsBuild is all done. Goodbye!");
|
|
65
51
|
process.exit();
|
|
66
52
|
} else {
|
|
@@ -72,8 +58,20 @@ export class ITProject {
|
|
|
72
58
|
config: IBaseConfig;
|
|
73
59
|
mode: `up` | `down` = `up`;
|
|
74
60
|
|
|
75
|
-
constructor(
|
|
76
|
-
this.config =
|
|
61
|
+
constructor(configs: IBaseConfig) {
|
|
62
|
+
this.config = configs;
|
|
63
|
+
|
|
64
|
+
fs.writeFileSync(
|
|
65
|
+
`${this.config.outdir}/testeranto.json`,
|
|
66
|
+
JSON.stringify(
|
|
67
|
+
{
|
|
68
|
+
...this.config,
|
|
69
|
+
buildDir: process.cwd() + "/" + this.config.outdir,
|
|
70
|
+
},
|
|
71
|
+
null,
|
|
72
|
+
2
|
|
73
|
+
)
|
|
74
|
+
);
|
|
77
75
|
|
|
78
76
|
Promise.resolve(
|
|
79
77
|
Promise.all(
|
|
@@ -88,7 +86,7 @@ export class ITProject {
|
|
|
88
86
|
.join(".");
|
|
89
87
|
|
|
90
88
|
const htmlFilePath = path.normalize(
|
|
91
|
-
`${process.cwd()}/${config.outdir}/web/${sourceDir.join(
|
|
89
|
+
`${process.cwd()}/${this.config.outdir}/web/${sourceDir.join(
|
|
92
90
|
"/"
|
|
93
91
|
)}/${sourceFileNameMinusJs}.html`
|
|
94
92
|
);
|
|
@@ -109,72 +107,22 @@ export class ITProject {
|
|
|
109
107
|
|
|
110
108
|
const [nodeEntryPoints, webEntryPoints] = getRunnables(this.config.tests);
|
|
111
109
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
// import(f).then((module) => {
|
|
116
|
-
// return module.default.then((defaultModule) => {
|
|
117
|
-
// console.log("defaultModule", defaultModule);
|
|
118
|
-
// // defaultModule
|
|
119
|
-
// // .receiveTestResourceConfig(argz)
|
|
120
|
-
// // .then((x) => {
|
|
121
|
-
// // console.log("then", x);
|
|
122
|
-
// // return x;
|
|
123
|
-
// // })
|
|
124
|
-
// // .catch((e) => {
|
|
125
|
-
// // console.log("catch", e);
|
|
126
|
-
// // });
|
|
127
|
-
// });
|
|
128
|
-
// });
|
|
129
|
-
// });
|
|
130
|
-
|
|
131
|
-
glob(`./${config.outdir}/chunk-*.mjs`, { ignore: "node_modules/**" }).then(
|
|
132
|
-
(chunks) => {
|
|
133
|
-
chunks.forEach((chunk) => {
|
|
134
|
-
fs.unlinkSync(chunk);
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
);
|
|
138
|
-
|
|
139
|
-
fs.copyFileSync(
|
|
140
|
-
"./node_modules/testeranto/dist/prebuild/Report.js",
|
|
141
|
-
"./docs/Report.js"
|
|
142
|
-
);
|
|
143
|
-
fs.copyFileSync(
|
|
144
|
-
"./node_modules/testeranto/dist/prebuild/Report.css",
|
|
145
|
-
"./docs/Report.css"
|
|
110
|
+
console.log(
|
|
111
|
+
`this.getSecondaryEndpointsPoints("web")`,
|
|
112
|
+
this.getSecondaryEndpointsPoints("web")
|
|
146
113
|
);
|
|
147
114
|
|
|
148
|
-
|
|
115
|
+
glob(`./${this.config.outdir}/chunk-*.mjs`, {
|
|
116
|
+
ignore: "node_modules/**",
|
|
117
|
+
}).then((chunks) => {
|
|
118
|
+
chunks.forEach((chunk) => {
|
|
119
|
+
fs.unlinkSync(chunk);
|
|
120
|
+
});
|
|
121
|
+
});
|
|
149
122
|
|
|
150
123
|
Promise.all([
|
|
151
|
-
fs.promises.writeFile(
|
|
152
|
-
`${config.outdir}/testeranto.json`,
|
|
153
|
-
JSON.stringify(
|
|
154
|
-
{
|
|
155
|
-
...config,
|
|
156
|
-
buildDir: process.cwd() + "/" + config.outdir,
|
|
157
|
-
},
|
|
158
|
-
null,
|
|
159
|
-
2
|
|
160
|
-
)
|
|
161
|
-
),
|
|
162
|
-
esbuild
|
|
163
|
-
.context(esbuildFeaturesConfiger(config))
|
|
164
|
-
.then(async (featuresContext) => {
|
|
165
|
-
if (mode == "DEV") {
|
|
166
|
-
await featuresContext.watch();
|
|
167
|
-
onFeaturesDone();
|
|
168
|
-
} else {
|
|
169
|
-
featuresContext.rebuild().then((v) => {
|
|
170
|
-
onFeaturesDone();
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
return featuresContext;
|
|
175
|
-
}),
|
|
176
124
|
esbuild
|
|
177
|
-
.context(esbuildNodeConfiger(config, nodeEntryPoints))
|
|
125
|
+
.context(esbuildNodeConfiger(this.config, nodeEntryPoints))
|
|
178
126
|
.then(async (nodeContext) => {
|
|
179
127
|
if (mode == "DEV") {
|
|
180
128
|
await nodeContext.watch().then((v) => {
|
|
@@ -189,7 +137,7 @@ export class ITProject {
|
|
|
189
137
|
return nodeContext;
|
|
190
138
|
}),
|
|
191
139
|
esbuild
|
|
192
|
-
.context(esbuildWebConfiger(config, webEntryPoints))
|
|
140
|
+
.context(esbuildWebConfiger(this.config, webEntryPoints))
|
|
193
141
|
.then(async (webContext) => {
|
|
194
142
|
if (mode == "DEV") {
|
|
195
143
|
await webContext.watch().then((v) => {
|
|
@@ -208,11 +156,12 @@ export class ITProject {
|
|
|
208
156
|
public getSecondaryEndpointsPoints(runtime?: IRunTime): string[] {
|
|
209
157
|
const meta = (ts: ITestTypes[], st: Set<string>): Set<string> => {
|
|
210
158
|
ts.forEach((t) => {
|
|
159
|
+
console.log("getSecondaryEndpointsPoints", t);
|
|
211
160
|
if (t[1] === runtime) {
|
|
212
161
|
st.add(t[0]);
|
|
213
162
|
}
|
|
214
|
-
if (Array.isArray(t[
|
|
215
|
-
meta(t[
|
|
163
|
+
if (Array.isArray(t[3])) {
|
|
164
|
+
meta(t[3], st);
|
|
216
165
|
}
|
|
217
166
|
});
|
|
218
167
|
return st;
|
package/src/Puppeteer.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import readline from "readline";
|
|
2
2
|
import fs from "fs";
|
|
3
|
-
import
|
|
4
|
-
import { jsonc } from "jsonc";
|
|
5
|
-
import { v4 as uuidv4 } from "uuid";
|
|
6
|
-
|
|
7
|
-
import { IBuiltConfig, IRunTime } from "./lib/types";
|
|
3
|
+
import watch from "recursive-watch";
|
|
8
4
|
|
|
9
5
|
import { PM_Main } from "./PM/main.js";
|
|
6
|
+
import { destinationOfRuntime } from "./utils.js";
|
|
7
|
+
import { timeout } from "puppeteer-core/lib/esm/puppeteer/index.js";
|
|
10
8
|
|
|
11
9
|
var mode: "DEV" | "PROD" = process.argv[2] === "-dev" ? "DEV" : "PROD";
|
|
12
10
|
|
|
@@ -17,6 +15,8 @@ const childProcesses: Record<string, "loaded" | "running" | "done"> = {};
|
|
|
17
15
|
readline.emitKeypressEvents(process.stdin);
|
|
18
16
|
if (process.stdin.isTTY) process.stdin.setRawMode(true);
|
|
19
17
|
|
|
18
|
+
// console.log("hello Puppeteer", process.env);
|
|
19
|
+
|
|
20
20
|
console.log("\n Puppeteer is running. Press 'q' to quit\n");
|
|
21
21
|
process.stdin.on("keypress", (str, key) => {
|
|
22
22
|
if (key.name === "q") {
|
|
@@ -24,30 +24,51 @@ process.stdin.on("keypress", (str, key) => {
|
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
export default async (partialConfig) => {
|
|
28
|
+
const config = {
|
|
29
|
+
...partialConfig,
|
|
30
|
+
buildDir: process.cwd() + "/" + partialConfig.outdir,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
fs.writeFileSync(
|
|
34
|
+
`${config.outdir}/testeranto.json`,
|
|
35
|
+
JSON.stringify(
|
|
36
|
+
{
|
|
37
|
+
...config,
|
|
38
|
+
buildDir: process.cwd() + "/" + config.outdir,
|
|
39
|
+
},
|
|
40
|
+
null,
|
|
41
|
+
2
|
|
42
|
+
)
|
|
43
|
+
);
|
|
31
44
|
|
|
32
|
-
const pm = new PM_Main(
|
|
45
|
+
const pm = new PM_Main(config);
|
|
33
46
|
|
|
34
47
|
await pm.startPuppeteer(
|
|
35
48
|
{
|
|
49
|
+
// timeout: 1,
|
|
36
50
|
waitForInitialPage: false,
|
|
37
|
-
executablePath:
|
|
51
|
+
executablePath:
|
|
52
|
+
// process.env.CHROMIUM_PATH || "/opt/homebrew/bin/chromium",
|
|
53
|
+
"/opt/homebrew/bin/chromium",
|
|
38
54
|
headless: true,
|
|
39
55
|
dumpio: true,
|
|
56
|
+
// timeout: 0,
|
|
40
57
|
args: [
|
|
58
|
+
// "--auto-open-devtools-for-tabs",
|
|
59
|
+
|
|
60
|
+
"--disable-features=IsolateOrigins,site-per-process",
|
|
61
|
+
"--disable-site-isolation-trials",
|
|
62
|
+
"--allow-insecure-localhost",
|
|
41
63
|
"--allow-file-access-from-files",
|
|
42
64
|
"--allow-running-insecure-content",
|
|
43
|
-
|
|
65
|
+
|
|
44
66
|
"--disable-dev-shm-usage",
|
|
45
67
|
"--disable-extensions",
|
|
46
68
|
"--disable-gpu",
|
|
47
69
|
"--disable-setuid-sandbox",
|
|
48
70
|
"--disable-site-isolation-trials",
|
|
49
71
|
"--disable-web-security",
|
|
50
|
-
"--disable-web-security",
|
|
51
72
|
"--no-first-run",
|
|
52
73
|
"--no-sandbox",
|
|
53
74
|
"--no-startup-window",
|
|
@@ -70,62 +91,94 @@ const main = async () => {
|
|
|
70
91
|
"."
|
|
71
92
|
);
|
|
72
93
|
|
|
73
|
-
|
|
74
|
-
return path
|
|
75
|
-
.normalize(`${configs.buildDir}/${r}/${f}`)
|
|
76
|
-
.split(".")
|
|
77
|
-
.slice(0, -1)
|
|
78
|
-
.join(".");
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
configs.tests.forEach(([test, runtime, secondaryArtifacts]) => {
|
|
94
|
+
config.tests.forEach(([test, runtime, tr, sidecars]) => {
|
|
82
95
|
if (runtime === "node") {
|
|
83
|
-
pm.launchNode(test, destinationOfRuntime(test, "node"));
|
|
96
|
+
pm.launchNode(test, destinationOfRuntime(test, "node", config));
|
|
84
97
|
} else if (runtime === "web") {
|
|
85
|
-
pm.launchWeb(test, destinationOfRuntime(test, "web"));
|
|
98
|
+
pm.launchWeb(test, destinationOfRuntime(test, "web", config), sidecars);
|
|
86
99
|
} else {
|
|
87
100
|
console.error("runtime makes no sense", runtime);
|
|
88
101
|
}
|
|
89
102
|
});
|
|
90
103
|
|
|
91
|
-
console.log("ready and watching for changes...",
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
{
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
104
|
+
console.log("ready and watching for changes...", config.buildDir);
|
|
105
|
+
|
|
106
|
+
watch(config.buildDir, (eventType, changedFile) => {
|
|
107
|
+
if (changedFile) {
|
|
108
|
+
config.tests.forEach(([test, runtime, tr, sidecars]) => {
|
|
109
|
+
if (eventType === "change" || eventType === "rename") {
|
|
110
|
+
if (
|
|
111
|
+
changedFile ===
|
|
112
|
+
test
|
|
113
|
+
.replace("./", "node/")
|
|
114
|
+
.split(".")
|
|
115
|
+
.slice(0, -1)
|
|
116
|
+
.concat("mjs")
|
|
117
|
+
.join(".")
|
|
118
|
+
) {
|
|
119
|
+
pm.launchNode(test, destinationOfRuntime(test, "node", config));
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (
|
|
123
|
+
changedFile ===
|
|
124
|
+
test
|
|
125
|
+
.replace("./", "web/")
|
|
126
|
+
.split(".")
|
|
127
|
+
.slice(0, -1)
|
|
128
|
+
.concat("mjs")
|
|
129
|
+
.join(".")
|
|
130
|
+
) {
|
|
131
|
+
pm.launchWeb(
|
|
132
|
+
test,
|
|
133
|
+
destinationOfRuntime(test, "web", config),
|
|
134
|
+
sidecars
|
|
135
|
+
);
|
|
124
136
|
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
137
|
+
}
|
|
138
|
+
});
|
|
127
139
|
}
|
|
128
|
-
);
|
|
129
|
-
};
|
|
140
|
+
});
|
|
130
141
|
|
|
131
|
-
|
|
142
|
+
// does not work on linux
|
|
143
|
+
// fs.watch(
|
|
144
|
+
// config.buildDir,
|
|
145
|
+
// {
|
|
146
|
+
// recursive: true,
|
|
147
|
+
// },
|
|
148
|
+
// (eventType, changedFile) => {
|
|
149
|
+
// if (changedFile) {
|
|
150
|
+
// config.tests.forEach(([test, runtime, tr, sidecars]) => {
|
|
151
|
+
// if (eventType === "change" || eventType === "rename") {
|
|
152
|
+
// if (
|
|
153
|
+
// changedFile ===
|
|
154
|
+
// test
|
|
155
|
+
// .replace("./", "node/")
|
|
156
|
+
// .split(".")
|
|
157
|
+
// .slice(0, -1)
|
|
158
|
+
// .concat("mjs")
|
|
159
|
+
// .join(".")
|
|
160
|
+
// ) {
|
|
161
|
+
// pm.launchNode(test, destinationOfRuntime(test, "node", config));
|
|
162
|
+
// }
|
|
163
|
+
|
|
164
|
+
// if (
|
|
165
|
+
// changedFile ===
|
|
166
|
+
// test
|
|
167
|
+
// .replace("./", "web/")
|
|
168
|
+
// .split(".")
|
|
169
|
+
// .slice(0, -1)
|
|
170
|
+
// .concat("mjs")
|
|
171
|
+
// .join(".")
|
|
172
|
+
// ) {
|
|
173
|
+
// pm.launchWeb(
|
|
174
|
+
// test,
|
|
175
|
+
// destinationOfRuntime(test, "web", config),
|
|
176
|
+
// sidecars
|
|
177
|
+
// );
|
|
178
|
+
// }
|
|
179
|
+
// }
|
|
180
|
+
// });
|
|
181
|
+
// }
|
|
182
|
+
// }
|
|
183
|
+
// );
|
|
184
|
+
};
|
|
@@ -4,6 +4,8 @@ import ReactDom from "react-dom/client";
|
|
|
4
4
|
import Testeranto from "../../../Web.js";
|
|
5
5
|
import {
|
|
6
6
|
IBaseTest,
|
|
7
|
+
IPartialInterface,
|
|
8
|
+
IPartialWebInterface,
|
|
7
9
|
ITestImplementation,
|
|
8
10
|
ITestSpecification,
|
|
9
11
|
} from "../../../Types";
|
|
@@ -15,7 +17,7 @@ type ISelection = {
|
|
|
15
17
|
reactElement: any; //CElement<any, any>;
|
|
16
18
|
};
|
|
17
19
|
|
|
18
|
-
type IStore = {
|
|
20
|
+
export type IStore = {
|
|
19
21
|
htmlElement: HTMLElement;
|
|
20
22
|
reactElement: any; //CElement<any, any>,
|
|
21
23
|
domRoot: ReactDom.Root;
|
|
@@ -30,7 +32,8 @@ type ISubject = {
|
|
|
30
32
|
export default <ITestShape extends IBaseTest, IWhen, IGiven>(
|
|
31
33
|
testInput: IInput,
|
|
32
34
|
testSpecifications: ITestSpecification<ITestShape>,
|
|
33
|
-
testImplementations: ITestImplementation<ITestShape, any
|
|
35
|
+
testImplementations: ITestImplementation<ITestShape, any>,
|
|
36
|
+
testInterface?: IPartialWebInterface<any>
|
|
34
37
|
) => {
|
|
35
38
|
class TesterantoComponent extends testInput {
|
|
36
39
|
done: (t: TesterantoComponent) => void;
|
|
@@ -50,7 +53,6 @@ export default <ITestShape extends IBaseTest, IWhen, IGiven>(
|
|
|
50
53
|
testImplementations,
|
|
51
54
|
{
|
|
52
55
|
beforeAll: async (initialProps, artificer): Promise<ISubject> => {
|
|
53
|
-
console.log("mark5", initialProps);
|
|
54
56
|
return await new Promise((resolve, rej) => {
|
|
55
57
|
const htmlElement = document.getElementById("root");
|
|
56
58
|
if (htmlElement) {
|
|
@@ -113,34 +115,12 @@ export default <ITestShape extends IBaseTest, IWhen, IGiven>(
|
|
|
113
115
|
butThen: async function (s: IStore, thenCB): Promise<ISelection> {
|
|
114
116
|
return thenCB(s);
|
|
115
117
|
},
|
|
116
|
-
afterEach:
|
|
117
|
-
|
|
118
|
-
|
|
118
|
+
afterEach:
|
|
119
|
+
testInterface?.afterEach ||
|
|
120
|
+
async function (store: IStore, ndx, artificer, utils) {
|
|
121
|
+
return store;
|
|
122
|
+
},
|
|
119
123
|
|
|
120
|
-
const page = (await utils.browser.pages()).filter((x) => {
|
|
121
|
-
const parsedUrl = new URL(x.url());
|
|
122
|
-
parsedUrl.search = "";
|
|
123
|
-
const strippedUrl = parsedUrl.toString();
|
|
124
|
-
|
|
125
|
-
return (
|
|
126
|
-
strippedUrl ===
|
|
127
|
-
"file:///Users/adam/Code/kokomoBay/docs/web/src/ClassicalComponent/react-dom/client.web.test.html"
|
|
128
|
-
);
|
|
129
|
-
// return true;
|
|
130
|
-
})[0];
|
|
131
|
-
|
|
132
|
-
const x = await page.screenshot({
|
|
133
|
-
path: "afterEachLog.jpg",
|
|
134
|
-
});
|
|
135
|
-
console.log("x", x);
|
|
136
|
-
// debugger;
|
|
137
|
-
// const div_root = document.getElementById("root");
|
|
138
|
-
// store.domRoot && store.domRoot.unmount(); //React 18
|
|
139
|
-
// store.remove();
|
|
140
|
-
// store.htmlElement.remove();
|
|
141
|
-
// store.htmlElement = document.createElement("root");
|
|
142
|
-
return store;
|
|
143
|
-
},
|
|
144
124
|
afterAll: async (store: IStore, artificer, utils) => {
|
|
145
125
|
// setTimeout(() => {
|
|
146
126
|
// console.log("This will run after 1 second");
|