testeranto 0.79.4 → 0.79.6
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/TaskMan1.Dockerfile +2 -1
- package/package.json +1 -1
- package/src/TaskManBackEnd.ts +2 -2
- package/dist/TaskMan.Dockerfile +0 -23
- package/dist/common/Features.js +0 -84
- package/dist/common/Node.js +0 -23
- package/dist/common/PM/index.js +0 -7
- package/dist/common/PM/main.js +0 -641
- package/dist/common/PM/node.js +0 -88
- package/dist/common/PM/web.js +0 -132
- package/dist/common/Project.js +0 -186
- package/dist/common/Puppeteer.js +0 -104
- package/dist/common/Reporter.js +0 -112
- package/dist/common/Scheduler.js +0 -1
- package/dist/common/SubPackages/puppeteer.js +0 -21
- package/dist/common/SubPackages/react/component/node.js +0 -19
- package/dist/common/SubPackages/react/component/web.js +0 -19
- package/dist/common/SubPackages/react/jsx/index.js +0 -25
- package/dist/common/SubPackages/react/jsx/node.js +0 -10
- package/dist/common/SubPackages/react/jsx/web.js +0 -10
- package/dist/common/SubPackages/react-dom/component/node.js +0 -101
- package/dist/common/SubPackages/react-dom/component/web.js +0 -93
- package/dist/common/SubPackages/react-dom/jsx/index.js +0 -2
- package/dist/common/SubPackages/react-dom/jsx/node.js +0 -39
- package/dist/common/SubPackages/react-dom/jsx/web.js +0 -118
- package/dist/common/SubPackages/react-test-renderer/MemoExoticComponent/node.js +0 -44
- package/dist/common/SubPackages/react-test-renderer/component/index.js +0 -2
- package/dist/common/SubPackages/react-test-renderer/component/interface.js +0 -68
- 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/common/SubPackages/react-test-renderer/fc/node.js +0 -50
- package/dist/common/SubPackages/react-test-renderer/fc/web.js +0 -50
- package/dist/common/SubPackages/react-test-renderer/jsx/index.js +0 -48
- package/dist/common/SubPackages/react-test-renderer/jsx/node.js +0 -10
- package/dist/common/SubPackages/react-test-renderer/jsx/web.js +0 -10
- package/dist/common/SubPackages/react-test-renderer/jsx-promised/index.js +0 -42
- package/dist/common/SubPackages/react-test-renderer/jsx-promised/node.js +0 -10
- package/dist/common/SubPackages/react-test-renderer/jsx-promised/web.js +0 -10
- package/dist/common/TaskManBackEnd.js +0 -174
- package/dist/common/Types.js +0 -2
- package/dist/common/Web.js +0 -39
- package/dist/common/esbuildConfigs/features.js +0 -14
- package/dist/common/esbuildConfigs/index.js +0 -21
- package/dist/common/esbuildConfigs/inputFilesPlugin.js +0 -49
- package/dist/common/esbuildConfigs/node.js +0 -39
- package/dist/common/esbuildConfigs/report.js +0 -13
- package/dist/common/esbuildConfigs/tests.js +0 -13
- package/dist/common/esbuildConfigs/web.js +0 -57
- package/dist/common/lib/abstractBase.js +0 -553
- package/dist/common/lib/basebuilder.js +0 -79
- package/dist/common/lib/classBuilder.js +0 -42
- package/dist/common/lib/core.js +0 -75
- package/dist/common/lib/index.js +0 -22
- package/dist/common/lib/types.js +0 -2
- package/dist/common/mongooseSchemas.js +0 -56
- package/dist/common/package.json +0 -3
- package/dist/common/preload.js +0 -15
- package/dist/common/puppeteerConfiger.js +0 -24
- package/dist/common/report.html.js +0 -31
- package/dist/common/tsconfig.common.tsbuildinfo +0 -1
- package/dist/common/utils.js +0 -16
- package/dist/common/web.html.js +0 -22
- package/dist/module/ExampleTab.js +0 -112
- package/dist/module/Features.js +0 -73
- package/dist/module/Node.js +0 -18
- package/dist/module/PM/index.js +0 -3
- package/dist/module/PM/main.js +0 -611
- package/dist/module/PM/node.js +0 -81
- package/dist/module/PM/web.js +0 -125
- package/dist/module/Project.js +0 -179
- package/dist/module/Puppeteer.js +0 -99
- package/dist/module/Reporter.js +0 -107
- package/dist/module/Scheduler.js +0 -1
- package/dist/module/SubPackages/puppeteer.js +0 -16
- package/dist/module/SubPackages/react/component/node.js +0 -14
- package/dist/module/SubPackages/react/component/web.js +0 -14
- package/dist/module/SubPackages/react/jsx/index.js +0 -19
- 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/node.js +0 -93
- package/dist/module/SubPackages/react-dom/component/web.js +0 -88
- package/dist/module/SubPackages/react-dom/jsx/index.js +0 -1
- package/dist/module/SubPackages/react-dom/jsx/node.js +0 -31
- package/dist/module/SubPackages/react-dom/jsx/web.js +0 -90
- package/dist/module/SubPackages/react-test-renderer/MemoExoticComponent/node.js +0 -16
- package/dist/module/SubPackages/react-test-renderer/component/index.js +0 -1
- package/dist/module/SubPackages/react-test-renderer/component/interface.js +0 -39
- package/dist/module/SubPackages/react-test-renderer/component/node.js +0 -3
- package/dist/module/SubPackages/react-test-renderer/component/web.js +0 -3
- package/dist/module/SubPackages/react-test-renderer/fc/node.js +0 -22
- package/dist/module/SubPackages/react-test-renderer/fc/web.js +0 -22
- package/dist/module/SubPackages/react-test-renderer/jsx/index.js +0 -19
- package/dist/module/SubPackages/react-test-renderer/jsx/node.js +0 -5
- package/dist/module/SubPackages/react-test-renderer/jsx/web.js +0 -5
- package/dist/module/SubPackages/react-test-renderer/jsx-promised/index.js +0 -16
- package/dist/module/SubPackages/react-test-renderer/jsx-promised/node.js +0 -5
- package/dist/module/SubPackages/react-test-renderer/jsx-promised/web.js +0 -5
- package/dist/module/TaskManBackEnd.js +0 -169
- package/dist/module/TaskManFrontEnd.js +0 -600
- package/dist/module/Types.js +0 -1
- package/dist/module/Web.js +0 -34
- package/dist/module/esbuildConfigs/features.js +0 -12
- package/dist/module/esbuildConfigs/index.js +0 -19
- package/dist/module/esbuildConfigs/inputFilesPlugin.js +0 -44
- package/dist/module/esbuildConfigs/node.js +0 -34
- package/dist/module/esbuildConfigs/report.js +0 -11
- package/dist/module/esbuildConfigs/tests.js +0 -11
- package/dist/module/esbuildConfigs/web.js +0 -52
- package/dist/module/lib/abstractBase.js +0 -545
- package/dist/module/lib/basebuilder.js +0 -75
- package/dist/module/lib/classBuilder.js +0 -38
- package/dist/module/lib/core.js +0 -72
- package/dist/module/lib/index.js +0 -18
- package/dist/module/lib/types.js +0 -1
- package/dist/module/mongooseSchemas.js +0 -50
- package/dist/module/package.json +0 -3
- package/dist/module/preload.js +0 -15
- package/dist/module/puppeteerConfiger.js +0 -19
- package/dist/module/report.html.js +0 -29
- package/dist/module/tsconfig.module.tsbuildinfo +0 -1
- package/dist/module/utils.js +0 -9
- package/dist/module/web.html.js +0 -20
- package/dist/prebuild/Report.css +0 -11358
- package/dist/prebuild/Report.js +0 -37666
- package/dist/prebuild/TaskManBackEnd.mjs +0 -180
- package/dist/prebuild/TaskManFrontEnd.css +0 -12301
- package/dist/prebuild/TaskManFrontEnd.js +0 -81737
- package/dist/types/Features.d.ts +0 -68
- package/dist/types/Node.d.ts +0 -6
- package/dist/types/PM/index.d.ts +0 -20
- package/dist/types/PM/main.d.ts +0 -31
- package/dist/types/PM/node.d.ts +0 -27
- package/dist/types/PM/web.d.ts +0 -25
- package/dist/types/Project.d.ts +0 -7
- package/dist/types/Puppeteer.d.ts +0 -1
- package/dist/types/Reporter.d.ts +0 -1
- package/dist/types/Scheduler.d.ts +0 -0
- package/dist/types/SubPackages/puppeteer.d.ts +0 -6
- package/dist/types/SubPackages/react/component/node.d.ts +0 -7
- package/dist/types/SubPackages/react/component/web.d.ts +0 -7
- package/dist/types/SubPackages/react/jsx/index.d.ts +0 -12
- 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 -12
- package/dist/types/SubPackages/react-dom/component/web.d.ts +0 -11
- package/dist/types/SubPackages/react-dom/jsx/index.d.ts +0 -6
- 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/index.d.ts +0 -13
- package/dist/types/SubPackages/react-test-renderer/component/interface.d.ts +0 -9
- package/dist/types/SubPackages/react-test-renderer/component/node.d.ts +0 -8
- package/dist/types/SubPackages/react-test-renderer/component/web.d.ts +0 -3
- package/dist/types/SubPackages/react-test-renderer/fc/node.d.ts +0 -8
- package/dist/types/SubPackages/react-test-renderer/fc/web.d.ts +0 -8
- package/dist/types/SubPackages/react-test-renderer/jsx/index.d.ts +0 -16
- package/dist/types/SubPackages/react-test-renderer/jsx/node.d.ts +0 -8
- package/dist/types/SubPackages/react-test-renderer/jsx/web.d.ts +0 -8
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/index.d.ts +0 -15
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/node.d.ts +0 -4
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/web.d.ts +0 -4
- package/dist/types/TaskManBackEnd.d.ts +0 -1
- package/dist/types/Types.d.ts +0 -50
- package/dist/types/Web.d.ts +0 -6
- package/dist/types/esbuildConfigs/features.d.ts +0 -4
- package/dist/types/esbuildConfigs/index.d.ts +0 -4
- package/dist/types/esbuildConfigs/inputFilesPlugin.d.ts +0 -5
- package/dist/types/esbuildConfigs/node.d.ts +0 -4
- package/dist/types/esbuildConfigs/report.d.ts +0 -4
- package/dist/types/esbuildConfigs/tests.d.ts +0 -4
- package/dist/types/esbuildConfigs/web.d.ts +0 -4
- package/dist/types/lib/abstractBase.d.ts +0 -104
- package/dist/types/lib/basebuilder.d.ts +0 -27
- package/dist/types/lib/classBuilder.d.ts +0 -7
- package/dist/types/lib/core.d.ts +0 -8
- package/dist/types/lib/index.d.ts +0 -59
- package/dist/types/lib/types.d.ts +0 -64
- package/dist/types/mongooseSchemas.d.ts +0 -124
- package/dist/types/preload.d.ts +0 -0
- package/dist/types/puppeteerConfiger.d.ts +0 -4
- package/dist/types/report.html.d.ts +0 -2
- package/dist/types/tsconfig.types.tsbuildinfo +0 -1
- package/dist/types/utils.d.ts +0 -2
- package/dist/types/web.html.d.ts +0 -2
package/dist/module/PM/web.js
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import puppeteer from "puppeteer-core/lib/esm/puppeteer/puppeteer-core-browser.js";
|
|
2
|
-
import { PM } from "./index.js";
|
|
3
|
-
export class PM_Web extends PM {
|
|
4
|
-
constructor(t) {
|
|
5
|
-
super();
|
|
6
|
-
this.server = {};
|
|
7
|
-
this.testResourceConfiguration = t;
|
|
8
|
-
}
|
|
9
|
-
customScreenShot(opts) {
|
|
10
|
-
window["customScreenShot"](opts);
|
|
11
|
-
}
|
|
12
|
-
existsSync(destFolder) {
|
|
13
|
-
return window["existsSync"](destFolder);
|
|
14
|
-
}
|
|
15
|
-
mkdirSync() {
|
|
16
|
-
return window["mkdirSync"](this.testResourceConfiguration.fs + "/");
|
|
17
|
-
}
|
|
18
|
-
write(writeObject, contents) {
|
|
19
|
-
return window["write"](writeObject.uid, contents);
|
|
20
|
-
}
|
|
21
|
-
writeFileSync(filepath, contents) {
|
|
22
|
-
return window["writeFileSync"](this.testResourceConfiguration.fs + "/" + filepath, contents, this.testResourceConfiguration.name);
|
|
23
|
-
}
|
|
24
|
-
createWriteStream(filepath) {
|
|
25
|
-
return window["createWriteStream"](this.testResourceConfiguration.fs + "/" + filepath, this.testResourceConfiguration.name);
|
|
26
|
-
}
|
|
27
|
-
end(writeObject) {
|
|
28
|
-
return window["end"](writeObject.uid);
|
|
29
|
-
}
|
|
30
|
-
customclose() {
|
|
31
|
-
window["customclose"](this.testResourceConfiguration.fs, this.testResourceConfiguration.name);
|
|
32
|
-
}
|
|
33
|
-
testArtiFactoryfileWriter(tLog, callback) {
|
|
34
|
-
return (fPath, value) => {
|
|
35
|
-
callback(new Promise((res, rej) => {
|
|
36
|
-
tLog("testArtiFactory =>", fPath);
|
|
37
|
-
// const cleanPath = path.resolve(fPath);
|
|
38
|
-
// fPaths.push(cleanPath.replace(process.cwd(), ``));
|
|
39
|
-
// const targetDir = cleanPath.split("/").slice(0, -1).join("/");
|
|
40
|
-
// fs.mkdir(targetDir, { recursive: true }, async (error) => {
|
|
41
|
-
// if (error) {
|
|
42
|
-
// console.error(`❗️testArtiFactory failed`, targetDir, error);
|
|
43
|
-
// }
|
|
44
|
-
// fs.writeFileSync(
|
|
45
|
-
// path.resolve(
|
|
46
|
-
// targetDir.split("/").slice(0, -1).join("/"),
|
|
47
|
-
// "manifest"
|
|
48
|
-
// ),
|
|
49
|
-
// fPaths.join(`\n`),
|
|
50
|
-
// {
|
|
51
|
-
// encoding: "utf-8",
|
|
52
|
-
// }
|
|
53
|
-
// );
|
|
54
|
-
// if (Buffer.isBuffer(value)) {
|
|
55
|
-
// fs.writeFileSync(fPath, value, "binary");
|
|
56
|
-
// res();
|
|
57
|
-
// } else if (`string` === typeof value) {
|
|
58
|
-
// fs.writeFileSync(fPath, value.toString(), {
|
|
59
|
-
// encoding: "utf-8",
|
|
60
|
-
// });
|
|
61
|
-
// res();
|
|
62
|
-
// } else {
|
|
63
|
-
// /* @ts-ignore:next-line */
|
|
64
|
-
// const pipeStream: PassThrough = value;
|
|
65
|
-
// const myFile = fs.createWriteStream(fPath);
|
|
66
|
-
// pipeStream.pipe(myFile);
|
|
67
|
-
// pipeStream.on("close", () => {
|
|
68
|
-
// myFile.close();
|
|
69
|
-
// res();
|
|
70
|
-
// });
|
|
71
|
-
// }
|
|
72
|
-
// });
|
|
73
|
-
}));
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
startPuppeteer(options, destFolder) {
|
|
77
|
-
const name = this.testResourceConfiguration.name;
|
|
78
|
-
return fetch(`http://localhost:3234/json/version`)
|
|
79
|
-
.then((v) => {
|
|
80
|
-
return v.json();
|
|
81
|
-
})
|
|
82
|
-
.then((json) => {
|
|
83
|
-
return puppeteer
|
|
84
|
-
.connect({
|
|
85
|
-
browserWSEndpoint: json.webSocketDebuggerUrl,
|
|
86
|
-
})
|
|
87
|
-
.then((b) => {
|
|
88
|
-
this.browser = b;
|
|
89
|
-
const handler2 = {
|
|
90
|
-
get(target, prop, receiver) {
|
|
91
|
-
if (prop === "screenshot") {
|
|
92
|
-
return async (x) => {
|
|
93
|
-
return await window["custom-screenshot"](Object.assign(Object.assign({}, x), {
|
|
94
|
-
// path: destFolder + "/" + x.path,
|
|
95
|
-
path: x.path }), name);
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
else if (prop === "mainFrame") {
|
|
99
|
-
return () => target[prop](...arguments);
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
return Reflect.get(...arguments);
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
};
|
|
106
|
-
const handler1 = {
|
|
107
|
-
get(target, prop, receiver) {
|
|
108
|
-
if (prop === "pages") {
|
|
109
|
-
return async () => {
|
|
110
|
-
return target.pages().then((pages) => {
|
|
111
|
-
return pages.map((p) => {
|
|
112
|
-
return new Proxy(p, handler2);
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
return Reflect.get(...arguments);
|
|
118
|
-
},
|
|
119
|
-
};
|
|
120
|
-
const proxy3 = new Proxy(this.browser, handler1);
|
|
121
|
-
this.browser = proxy3;
|
|
122
|
-
});
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
}
|
package/dist/module/Project.js
DELETED
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import esbuild from "esbuild";
|
|
2
|
-
import fs from "fs";
|
|
3
|
-
import path from "path";
|
|
4
|
-
import readline from "readline";
|
|
5
|
-
import { glob } from "glob";
|
|
6
|
-
import esbuildNodeConfiger from "./esbuildConfigs/node.js";
|
|
7
|
-
import esbuildWebConfiger from "./esbuildConfigs/web.js";
|
|
8
|
-
import esbuildFeaturesConfiger from "./esbuildConfigs/features.js";
|
|
9
|
-
import webHtmlFrame from "./web.html.js";
|
|
10
|
-
import reportHtmlFrame from "./report.html.js";
|
|
11
|
-
var mode = process.argv[2] === "-dev" ? "DEV" : "PROD";
|
|
12
|
-
readline.emitKeypressEvents(process.stdin);
|
|
13
|
-
if (process.stdin.isTTY)
|
|
14
|
-
process.stdin.setRawMode(true);
|
|
15
|
-
process.stdin.on("keypress", (str, key) => {
|
|
16
|
-
if (key.name === "q") {
|
|
17
|
-
console.log("Testeranto-EsBuild is shutting down...");
|
|
18
|
-
mode = "PROD";
|
|
19
|
-
onDone();
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
// setInterval(() => {
|
|
23
|
-
// const memoryUsage = process.memoryUsage();
|
|
24
|
-
// console.log("Memory usage:", memoryUsage);
|
|
25
|
-
// }, 10000); // Check every 10 seconds
|
|
26
|
-
let featuresDone, nodeDone, webDone = false;
|
|
27
|
-
const onFeaturesDone = () => {
|
|
28
|
-
featuresDone = true;
|
|
29
|
-
onDone();
|
|
30
|
-
};
|
|
31
|
-
const onNodeDone = () => {
|
|
32
|
-
nodeDone = true;
|
|
33
|
-
onDone();
|
|
34
|
-
};
|
|
35
|
-
const onWebDone = () => {
|
|
36
|
-
webDone = true;
|
|
37
|
-
onDone();
|
|
38
|
-
};
|
|
39
|
-
const onDone = () => {
|
|
40
|
-
console.log(JSON.stringify({
|
|
41
|
-
featuresDone,
|
|
42
|
-
nodeDone,
|
|
43
|
-
webDone,
|
|
44
|
-
mode,
|
|
45
|
-
}, null, 2));
|
|
46
|
-
if (featuresDone && nodeDone && webDone && mode === "PROD") {
|
|
47
|
-
console.log("Testeranto-EsBuild is all done. Goodbye!");
|
|
48
|
-
process.exit();
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
console.log("Testeranto-EsBuild is still working...");
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
export class ITProject {
|
|
55
|
-
constructor(config) {
|
|
56
|
-
this.mode = `up`;
|
|
57
|
-
this.config = config;
|
|
58
|
-
Promise.resolve(Promise.all([...this.getSecondaryEndpointsPoints("web")].map(async (sourceFilePath) => {
|
|
59
|
-
const sourceFileSplit = sourceFilePath.split("/");
|
|
60
|
-
const sourceDir = sourceFileSplit.slice(0, -1);
|
|
61
|
-
const sourceFileName = sourceFileSplit[sourceFileSplit.length - 1];
|
|
62
|
-
const sourceFileNameMinusJs = sourceFileName
|
|
63
|
-
.split(".")
|
|
64
|
-
.slice(0, -1)
|
|
65
|
-
.join(".");
|
|
66
|
-
const htmlFilePath = path.normalize(`${process.cwd()}/${config.outdir}/web/${sourceDir.join("/")}/${sourceFileNameMinusJs}.html`);
|
|
67
|
-
const jsfilePath = `./${sourceFileNameMinusJs}.mjs`;
|
|
68
|
-
return fs.promises
|
|
69
|
-
.mkdir(path.dirname(htmlFilePath), { recursive: true })
|
|
70
|
-
.then((x) => fs.writeFileSync(htmlFilePath, webHtmlFrame(jsfilePath, htmlFilePath)));
|
|
71
|
-
})));
|
|
72
|
-
const [nodeEntryPoints, webEntryPoints] = getRunnables(this.config.tests);
|
|
73
|
-
console.log(`this.getSecondaryEndpointsPoints("web")`, this.getSecondaryEndpointsPoints("web"));
|
|
74
|
-
// console.log("nodeEntryPoints", nodeEntryPoints);
|
|
75
|
-
// console.log("webEntryPoints", webEntryPoints);
|
|
76
|
-
// nodeEntryPoints.forEach((nep) => {
|
|
77
|
-
// const f = `${process.cwd()}/${nep}`;
|
|
78
|
-
// console.log("nep", f);
|
|
79
|
-
// import(f).then((module) => {
|
|
80
|
-
// return module.default.then((defaultModule) => {
|
|
81
|
-
// console.log("defaultModule", defaultModule);
|
|
82
|
-
// // defaultModule
|
|
83
|
-
// // .receiveTestResourceConfig(argz)
|
|
84
|
-
// // .then((x) => {
|
|
85
|
-
// // console.log("then", x);
|
|
86
|
-
// // return x;
|
|
87
|
-
// // })
|
|
88
|
-
// // .catch((e) => {
|
|
89
|
-
// // console.log("catch", e);
|
|
90
|
-
// // });
|
|
91
|
-
// });
|
|
92
|
-
// });
|
|
93
|
-
// });
|
|
94
|
-
glob(`./${config.outdir}/chunk-*.mjs`, { ignore: "node_modules/**" }).then((chunks) => {
|
|
95
|
-
chunks.forEach((chunk) => {
|
|
96
|
-
fs.unlinkSync(chunk);
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
fs.copyFileSync("./node_modules/testeranto/dist/prebuild/Report.js", "./docs/Report.js");
|
|
100
|
-
fs.copyFileSync("./node_modules/testeranto/dist/prebuild/Report.css", "./docs/Report.css");
|
|
101
|
-
fs.writeFileSync(`${config.outdir}/report.html`, reportHtmlFrame());
|
|
102
|
-
Promise.all([
|
|
103
|
-
fs.promises.writeFile(`${config.outdir}/testeranto.json`, JSON.stringify(Object.assign(Object.assign({}, config), { buildDir: process.cwd() + "/" + config.outdir }), null, 2)),
|
|
104
|
-
esbuild
|
|
105
|
-
.context(esbuildFeaturesConfiger(config))
|
|
106
|
-
.then(async (featuresContext) => {
|
|
107
|
-
if (mode == "DEV") {
|
|
108
|
-
await featuresContext.watch();
|
|
109
|
-
onFeaturesDone();
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
featuresContext.rebuild().then((v) => {
|
|
113
|
-
onFeaturesDone();
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
return featuresContext;
|
|
117
|
-
}),
|
|
118
|
-
esbuild
|
|
119
|
-
.context(esbuildNodeConfiger(config, nodeEntryPoints))
|
|
120
|
-
.then(async (nodeContext) => {
|
|
121
|
-
if (mode == "DEV") {
|
|
122
|
-
await nodeContext.watch().then((v) => {
|
|
123
|
-
onNodeDone();
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
nodeContext.rebuild().then((v) => {
|
|
128
|
-
onNodeDone();
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
return nodeContext;
|
|
132
|
-
}),
|
|
133
|
-
esbuild
|
|
134
|
-
.context(esbuildWebConfiger(config, webEntryPoints))
|
|
135
|
-
.then(async (webContext) => {
|
|
136
|
-
if (mode == "DEV") {
|
|
137
|
-
await webContext.watch().then((v) => {
|
|
138
|
-
onWebDone();
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
webContext.rebuild().then((v) => {
|
|
143
|
-
onWebDone();
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
return webContext;
|
|
147
|
-
}),
|
|
148
|
-
]);
|
|
149
|
-
}
|
|
150
|
-
getSecondaryEndpointsPoints(runtime) {
|
|
151
|
-
const meta = (ts, st) => {
|
|
152
|
-
ts.forEach((t) => {
|
|
153
|
-
console.log("getSecondaryEndpointsPoints", t);
|
|
154
|
-
if (t[1] === runtime) {
|
|
155
|
-
st.add(t[0]);
|
|
156
|
-
}
|
|
157
|
-
if (Array.isArray(t[3])) {
|
|
158
|
-
meta(t[3], st);
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
return st;
|
|
162
|
-
};
|
|
163
|
-
return Array.from(meta(this.config.tests, new Set()));
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
const getRunnables = (tests, payload = [new Set(), new Set()]) => {
|
|
167
|
-
return tests.reduce((pt, cv, cndx, cry) => {
|
|
168
|
-
if (cv[1] === "node") {
|
|
169
|
-
pt[0].add(cv[0]);
|
|
170
|
-
}
|
|
171
|
-
else if (cv[1] === "web") {
|
|
172
|
-
pt[1].add(cv[0]);
|
|
173
|
-
}
|
|
174
|
-
if (cv[3].length) {
|
|
175
|
-
getRunnables(cv[3], payload);
|
|
176
|
-
}
|
|
177
|
-
return pt;
|
|
178
|
-
}, payload);
|
|
179
|
-
};
|
package/dist/module/Puppeteer.js
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import readline from "readline";
|
|
2
|
-
import fs from "fs";
|
|
3
|
-
import { jsonc } from "jsonc";
|
|
4
|
-
import { PM_Main } from "./PM/main.js";
|
|
5
|
-
import { destinationOfRuntime } from "./utils.js";
|
|
6
|
-
var mode = process.argv[2] === "-dev" ? "DEV" : "PROD";
|
|
7
|
-
const node2web = {};
|
|
8
|
-
const web2node = {};
|
|
9
|
-
const childProcesses = {};
|
|
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 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
|
-
configs.tests.forEach(([test, runtime, tr, sidecars]) => {
|
|
59
|
-
if (runtime === "node") {
|
|
60
|
-
pm.launchNode(test, destinationOfRuntime(test, "node", configs));
|
|
61
|
-
}
|
|
62
|
-
else if (runtime === "web") {
|
|
63
|
-
pm.launchWeb(test, destinationOfRuntime(test, "web", configs), sidecars);
|
|
64
|
-
}
|
|
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(configs.buildDir, {
|
|
71
|
-
recursive: true,
|
|
72
|
-
}, (eventType, changedFile) => {
|
|
73
|
-
if (changedFile) {
|
|
74
|
-
configs.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", configs));
|
|
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", configs), sidecars);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
};
|
|
99
|
-
main();
|
package/dist/module/Reporter.js
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
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();
|
package/dist/module/Scheduler.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1,16 +0,0 @@
|
|
|
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,14 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import Testeranto from "../../../Node.js";
|
|
3
|
-
export default (testImplementations, testSpecifications, testInput) => {
|
|
4
|
-
return Testeranto(testInput, testSpecifications, testImplementations, {
|
|
5
|
-
beforeEach: async () => {
|
|
6
|
-
return new Promise((resolve, rej) => {
|
|
7
|
-
resolve(React.createElement(testInput, {}, []));
|
|
8
|
-
});
|
|
9
|
-
},
|
|
10
|
-
andWhen: function (s, whenCB) {
|
|
11
|
-
return whenCB()(s);
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import Testeranto from "../../../Web.js";
|
|
3
|
-
export default (testImplementations, testSpecifications, testInput) => {
|
|
4
|
-
return Testeranto(testInput, testSpecifications, testImplementations, {
|
|
5
|
-
beforeEach: async () => {
|
|
6
|
-
return new Promise((resolve, rej) => {
|
|
7
|
-
resolve(React.createElement(testInput, {}, []));
|
|
8
|
-
});
|
|
9
|
-
},
|
|
10
|
-
andWhen: function (s, whenCB) {
|
|
11
|
-
return whenCB()(s);
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
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
|
-
};
|