testeranto 0.79.69 → 0.80.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/README.md +7 -108
- 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/{PM → src/PM}/main.js +9 -3
- package/dist/common/{Puppeteer.js → src/Puppeteer.js} +8 -4
- package/dist/common/{SubPackages → src/SubPackages}/react-dom/jsx/web.js +37 -38
- package/dist/common/{esbuildConfigs → src/esbuildConfigs}/inputFilesPlugin.js +5 -2
- package/dist/common/{esbuildConfigs → src/esbuildConfigs}/node.js +5 -3
- package/dist/common/{esbuildConfigs → src/esbuildConfigs}/web.js +1 -1
- package/dist/common/{lib → src/lib}/abstractBase.js +41 -13
- package/dist/common/{lib → src/lib}/basebuilder.js +8 -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/{PM → src/PM}/main.js +9 -3
- package/dist/module/{Puppeteer.js → src/Puppeteer.js} +8 -4
- package/dist/module/{SubPackages → src/SubPackages}/react-dom/jsx/web.js +37 -38
- package/dist/module/{esbuildConfigs → src/esbuildConfigs}/inputFilesPlugin.js +5 -2
- package/dist/module/{esbuildConfigs → src/esbuildConfigs}/node.js +4 -2
- package/dist/module/{esbuildConfigs → src/esbuildConfigs}/web.js +1 -1
- package/dist/module/{lib → src/lib}/abstractBase.js +41 -13
- package/dist/module/{lib → src/lib}/basebuilder.js +8 -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/{PM → src/PM}/index.d.ts +1 -1
- package/dist/types/{Types.d.ts → src/Types.d.ts} +3 -2
- package/dist/types/testeranto.d.ts +16 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/init-docs.ts +5 -0
- package/package.json +49 -20
- package/run-tests.ts +9 -0
- package/src/Aider.ts +125 -0
- package/src/Init.ts +0 -31
- package/src/PM/index.ts +1 -1
- package/src/PM/main.ts +11 -5
- package/src/Puppeteer.ts +11 -4
- package/src/SubPackages/react-dom/jsx/web.ts +46 -49
- package/src/Types.ts +3 -1
- package/src/esbuildConfigs/inputFilesPlugin.ts +32 -30
- package/src/esbuildConfigs/node.ts +2 -2
- package/src/esbuildConfigs/web.ts +1 -1
- package/src/lib/abstractBase.ts +42 -15
- package/src/lib/basebuilder.ts +9 -0
- package/testeranto.ts +13 -0
- package/tsconfig.common.json +12 -4
- package/tsconfig.json +9 -2
- package/tsconfig.module.json +2 -2
- package/tsconfig.types.json +1 -1
- package/Report.Dockerfile +0 -44
- package/dist/common/Features.js +0 -51
- package/dist/common/Init.js +0 -30
- package/dist/common/Reporter.js +0 -112
- package/dist/common/Scheduler.js +0 -1
- package/dist/common/TaskManBackEnd.js +0 -167
- package/dist/common/mongooseSchemas.js +0 -56
- package/dist/common/preload.js +0 -15
- package/dist/common/report.html.js +0 -31
- package/dist/module/ExampleTab.js +0 -112
- package/dist/module/Features.js +0 -41
- package/dist/module/Init.js +0 -25
- package/dist/module/Reporter.js +0 -107
- package/dist/module/Scheduler.js +0 -1
- package/dist/module/TaskManBackEnd.js +0 -162
- package/dist/module/TaskManFrontEnd.js +0 -605
- package/dist/module/mongooseSchemas.js +0 -50
- package/dist/module/preload.js +0 -15
- package/dist/module/report.html.js +0 -29
- package/dist/prebuild/TaskManBackEnd.mjs +0 -170
- package/dist/prebuild/TaskManFrontEnd.css +0 -12301
- package/dist/prebuild/TaskManFrontEnd.js +0 -81262
- package/dist/types/Features.d.ts +0 -35
- package/dist/types/Reporter.d.ts +0 -1
- package/dist/types/Scheduler.d.ts +0 -0
- package/dist/types/TaskManBackEnd.d.ts +0 -3
- package/dist/types/mongooseSchemas.d.ts +0 -124
- package/dist/types/preload.d.ts +0 -0
- package/dist/types/report.html.d.ts +0 -2
- package/src/ExampleTab.tsx +0 -219
- package/src/Features.ts +0 -64
- package/src/Reporter.ts +0 -126
- package/src/Scheduler.ts +0 -0
- package/src/TaskManBackEnd.ts +0 -226
- package/src/TaskManFrontEnd.tsx +0 -1254
- package/src/mongooseSchemas.ts +0 -105
- package/src/preload.ts +0 -17
- package/src/report.html.ts +0 -29
- package/tests/Rectangle.test.ts +0 -189
- package/trash/TaskMan.Dockerfile +0 -23
- package/trash/TaskMan1.Dockerfile +0 -43
- package/trash/devBot.dockerfile +0 -12
- package/trash/docker-compose-dev.yml +0 -9
- package/trash/docker-compose-prod.yml +0 -18
- package/trash/electronBuild.ts +0 -32
- /package/dist/common/{Node.js → src/Node.js} +0 -0
- /package/dist/common/{PM → src/PM}/index.js +0 -0
- /package/dist/common/{PM → src/PM}/node.js +0 -0
- /package/dist/common/{PM → src/PM}/web.js +0 -0
- /package/dist/common/{Project.js → src/Project.js} +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/puppeteer.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react/component/node.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react/component/web.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react/jsx/index.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react/jsx/node.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react/jsx/web.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-dom/component/node.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-dom/component/web.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-dom/jsx/index.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-dom/jsx/node.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/MemoExoticComponent/node.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/component/index.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/component/interface.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/component/node.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/component/web.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/fc/node.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/fc/web.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx/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/{Types.js → src/Types.js} +0 -0
- /package/dist/common/{Web.js → src/Web.js} +0 -0
- /package/dist/common/{esbuildConfigs → src/esbuildConfigs}/features.js +0 -0
- /package/dist/common/{esbuildConfigs → src/esbuildConfigs}/index.js +0 -0
- /package/dist/common/{esbuildConfigs → src/esbuildConfigs}/report.js +0 -0
- /package/dist/common/{esbuildConfigs → src/esbuildConfigs}/tests.js +0 -0
- /package/dist/common/{lib → src/lib}/classBuilder.js +0 -0
- /package/dist/common/{lib → src/lib}/core.js +0 -0
- /package/dist/common/{lib → src/lib}/index.js +0 -0
- /package/dist/common/{lib → src/lib}/types.js +0 -0
- /package/dist/common/{puppeteerConfiger.js → src/puppeteerConfiger.js} +0 -0
- /package/dist/common/{utils.js → src/utils.js} +0 -0
- /package/dist/common/{web.html.js → src/web.html.js} +0 -0
- /package/dist/module/{Node.js → src/Node.js} +0 -0
- /package/dist/module/{PM → src/PM}/index.js +0 -0
- /package/dist/module/{PM → src/PM}/node.js +0 -0
- /package/dist/module/{PM → src/PM}/web.js +0 -0
- /package/dist/module/{Project.js → src/Project.js} +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/puppeteer.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react/component/node.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react/component/web.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react/jsx/index.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react/jsx/node.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react/jsx/web.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-dom/component/node.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-dom/component/web.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-dom/jsx/index.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-dom/jsx/node.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/MemoExoticComponent/node.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/component/index.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/component/interface.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/component/node.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/component/web.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/fc/node.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/fc/web.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx/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/module/{Types.js → src/Types.js} +0 -0
- /package/dist/module/{Web.js → src/Web.js} +0 -0
- /package/dist/module/{esbuildConfigs → src/esbuildConfigs}/features.js +0 -0
- /package/dist/module/{esbuildConfigs → src/esbuildConfigs}/index.js +0 -0
- /package/dist/module/{esbuildConfigs → src/esbuildConfigs}/report.js +0 -0
- /package/dist/module/{esbuildConfigs → src/esbuildConfigs}/tests.js +0 -0
- /package/dist/module/{lib → src/lib}/classBuilder.js +0 -0
- /package/dist/module/{lib → src/lib}/core.js +0 -0
- /package/dist/module/{lib → src/lib}/index.js +0 -0
- /package/dist/module/{lib → src/lib}/types.js +0 -0
- /package/dist/module/{puppeteerConfiger.js → src/puppeteerConfiger.js} +0 -0
- /package/dist/module/{utils.js → src/utils.js} +0 -0
- /package/dist/module/{web.html.js → src/web.html.js} +0 -0
- /package/dist/types/{Init.d.ts → src/Init.d.ts} +0 -0
- /package/dist/types/{Node.d.ts → src/Node.d.ts} +0 -0
- /package/dist/types/{PM → src/PM}/main.d.ts +0 -0
- /package/dist/types/{PM → src/PM}/node.d.ts +0 -0
- /package/dist/types/{PM → src/PM}/web.d.ts +0 -0
- /package/dist/types/{Project.d.ts → src/Project.d.ts} +0 -0
- /package/dist/types/{Puppeteer.d.ts → src/Puppeteer.d.ts} +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/puppeteer.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react/component/node.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react/component/web.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react/jsx/index.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react/jsx/node.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react/jsx/web.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-dom/component/node.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-dom/component/web.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-dom/jsx/index.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-dom/jsx/node.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-dom/jsx/web.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/MemoExoticComponent/node.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/component/index.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/component/interface.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/component/node.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/component/web.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/fc/node.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/fc/web.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx/index.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx/node.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx/web.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/index.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/node.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/web.d.ts +0 -0
- /package/dist/types/{Web.d.ts → src/Web.d.ts} +0 -0
- /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/features.d.ts +0 -0
- /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/index.d.ts +0 -0
- /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/inputFilesPlugin.d.ts +0 -0
- /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/node.d.ts +0 -0
- /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/report.d.ts +0 -0
- /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/tests.d.ts +0 -0
- /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/web.d.ts +0 -0
- /package/dist/types/{lib → src/lib}/abstractBase.d.ts +0 -0
- /package/dist/types/{lib → src/lib}/basebuilder.d.ts +0 -0
- /package/dist/types/{lib → src/lib}/classBuilder.d.ts +0 -0
- /package/dist/types/{lib → src/lib}/core.d.ts +0 -0
- /package/dist/types/{lib → src/lib}/index.d.ts +0 -0
- /package/dist/types/{lib → src/lib}/types.d.ts +0 -0
- /package/dist/types/{puppeteerConfiger.d.ts → src/puppeteerConfiger.d.ts} +0 -0
- /package/dist/types/{utils.d.ts → src/utils.d.ts} +0 -0
- /package/dist/types/{web.html.d.ts → src/web.html.d.ts} +0 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// import { ITProject } from "./src/Project.js";
|
|
2
|
+
// import Project from "./testeranto.js";
|
|
3
|
+
import process from "process";
|
|
4
|
+
import { ITProject } from "./src/Project";
|
|
5
|
+
// import { ITProject } from "testeranto/src/Project";
|
|
6
|
+
// process.chdir(__dirname);
|
|
7
|
+
// import Puppeteer from "./src/Puppeteer.js";
|
|
8
|
+
console.log(process.argv);
|
|
9
|
+
const Project = await import(process.argv[2]);
|
|
10
|
+
export default new ITProject(Project);
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import { spawn } from "child_process";
|
|
3
|
+
export const execCommand = async (command) => {
|
|
4
|
+
return new Promise((resolve, reject) => {
|
|
5
|
+
const [cmd, ...args] = command.split(" ");
|
|
6
|
+
const childProcess = spawn(cmd, args);
|
|
7
|
+
childProcess.stdout.on("data", (data) => {
|
|
8
|
+
process.stdout.write(data.toString());
|
|
9
|
+
});
|
|
10
|
+
childProcess.stderr.on("data", (data) => {
|
|
11
|
+
process.stderr.write(data.toString());
|
|
12
|
+
});
|
|
13
|
+
childProcess.on("error", (error) => {
|
|
14
|
+
reject(error);
|
|
15
|
+
});
|
|
16
|
+
childProcess.on("exit", (code) => {
|
|
17
|
+
if (code === 0) {
|
|
18
|
+
resolve();
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
reject(new Error(`Command exited with code ${code}.`));
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
const key = process.argv[2];
|
|
27
|
+
console.log(key);
|
|
28
|
+
const exitcode = fs.readFileSync(`${key}/exitcode`).toString();
|
|
29
|
+
console.log("exitcode", exitcode);
|
|
30
|
+
// if (exitcode != "0") {
|
|
31
|
+
if (exitcode != "0") {
|
|
32
|
+
const inputFiles = JSON.parse(fs.readFileSync(`${key}/inputFiles.json`).toString());
|
|
33
|
+
inputFiles.push(`${key}/tests.json`);
|
|
34
|
+
const features = await (await Promise.all(Array.from(new Set(JSON.parse(fs.readFileSync(`${key}/tests.json`).toString())
|
|
35
|
+
.givens.reduce((mm, lm) => {
|
|
36
|
+
mm.push(lm.features.reduce((mm2, lm2) => {
|
|
37
|
+
mm2.push(lm2);
|
|
38
|
+
return mm2;
|
|
39
|
+
}, []));
|
|
40
|
+
return mm;
|
|
41
|
+
}, [])
|
|
42
|
+
.flat()
|
|
43
|
+
.flat()))))
|
|
44
|
+
.reduce(async (mm, feature) => {
|
|
45
|
+
const req = await octokit.request(`GET /repos/adamwong246/kokomobay-taskman/contents/Task/${feature}.json`, {
|
|
46
|
+
owner: "adamwong246",
|
|
47
|
+
repo: "kokomoBay-taskman",
|
|
48
|
+
path: `Task/${feature}.json`,
|
|
49
|
+
headers: {
|
|
50
|
+
"X-GitHub-Api-Version": "2022-11-28",
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
const j = JSON.parse(atob(req.data.content));
|
|
54
|
+
(await mm).push([
|
|
55
|
+
feature,
|
|
56
|
+
JSON.stringify({
|
|
57
|
+
name: j.name,
|
|
58
|
+
body: j.body,
|
|
59
|
+
}),
|
|
60
|
+
]);
|
|
61
|
+
return mm;
|
|
62
|
+
}, Promise.resolve([]))
|
|
63
|
+
.then((z) => {
|
|
64
|
+
const final = z.reduce((mm, [k, v], ndx) => {
|
|
65
|
+
mm[k] = v;
|
|
66
|
+
return mm;
|
|
67
|
+
}, {});
|
|
68
|
+
const as = JSON.stringify(final);
|
|
69
|
+
fs.writeFile(`./${key}/features.json`, as, () => {
|
|
70
|
+
inputFiles.push(`./${key}/features.json`);
|
|
71
|
+
const scriptCommand = `aider --model deepseek --api-key deepseek=${process.env.DEEPSEEK_KEY} --message "Fix the failing tests" ${inputFiles.join(" ")}`;
|
|
72
|
+
console.log("scriptCommand", scriptCommand);
|
|
73
|
+
execCommand(scriptCommand);
|
|
74
|
+
// itermTab(scriptCommand).then(() => console.log("yay"));
|
|
75
|
+
// const child = spawn("xterm -e", scriptCommand.split(" "), {
|
|
76
|
+
// detached: true,
|
|
77
|
+
// stdio: "ignore",
|
|
78
|
+
// });
|
|
79
|
+
// runCommandInITerm(scriptCommand);
|
|
80
|
+
});
|
|
81
|
+
//
|
|
82
|
+
});
|
|
83
|
+
// features.then((x) => {
|
|
84
|
+
// console.log("done", x);
|
|
85
|
+
// });
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
console.log("that test is not failing");
|
|
89
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
export default async (partialConfig) => {
|
|
3
|
+
const config = Object.assign(Object.assign({}, partialConfig), { buildDir: process.cwd() + "/" + partialConfig.outdir });
|
|
4
|
+
fs.writeFileSync(`${config.outdir}/testeranto.json`, JSON.stringify(Object.assign(Object.assign({}, config), { buildDir: process.cwd() + "/" + config.outdir }), null, 2));
|
|
5
|
+
};
|
|
@@ -408,7 +408,7 @@ export class PM_Main extends PM {
|
|
|
408
408
|
delete files[testName];
|
|
409
409
|
Promise.all(screenshots[testName] || []).then(() => {
|
|
410
410
|
delete screenshots[testName];
|
|
411
|
-
page.close();
|
|
411
|
+
// page.close();
|
|
412
412
|
});
|
|
413
413
|
// globalThis["writeFileSync"](
|
|
414
414
|
// p + "/manifest.json",
|
|
@@ -434,8 +434,14 @@ export class PM_Main extends PM {
|
|
|
434
434
|
.then(async (page) => {
|
|
435
435
|
page.on("console", (log) => console.debug(`Log from client: [${log.text()}] `));
|
|
436
436
|
await page.goto(`file://${`${dest}.html`}`, {});
|
|
437
|
-
page
|
|
437
|
+
page
|
|
438
|
+
.evaluate(evaluation)
|
|
439
|
+
.catch((e) => {
|
|
438
440
|
console.log("evaluation failed.", dest);
|
|
441
|
+
console.log(e);
|
|
442
|
+
})
|
|
443
|
+
.finally(() => {
|
|
444
|
+
console.log("evaluation complete.", dest);
|
|
439
445
|
});
|
|
440
446
|
return page;
|
|
441
447
|
});
|
|
@@ -544,7 +550,7 @@ export class PM_Main extends PM {
|
|
|
544
550
|
throw new Error("Method not implemented.");
|
|
545
551
|
}
|
|
546
552
|
async startPuppeteer(options, destfolder) {
|
|
547
|
-
this.browser = await puppeteer.launch(options);
|
|
553
|
+
this.browser = (await puppeteer.launch(options));
|
|
548
554
|
return this.browser;
|
|
549
555
|
}
|
|
550
556
|
end(accessObject) {
|
|
@@ -10,7 +10,7 @@ const childProcesses = {};
|
|
|
10
10
|
readline.emitKeypressEvents(process.stdin);
|
|
11
11
|
if (process.stdin.isTTY)
|
|
12
12
|
process.stdin.setRawMode(true);
|
|
13
|
-
console.log("hello Puppeteer", process.env);
|
|
13
|
+
// console.log("hello Puppeteer", process.env);
|
|
14
14
|
console.log("\n Puppeteer is running. Press 'q' to quit\n");
|
|
15
15
|
process.stdin.on("keypress", (str, key) => {
|
|
16
16
|
if (key.name === "q") {
|
|
@@ -22,17 +22,21 @@ export default async (partialConfig) => {
|
|
|
22
22
|
fs.writeFileSync(`${config.outdir}/testeranto.json`, JSON.stringify(Object.assign(Object.assign({}, config), { buildDir: process.cwd() + "/" + config.outdir }), null, 2));
|
|
23
23
|
const pm = new PM_Main(config);
|
|
24
24
|
await pm.startPuppeteer({
|
|
25
|
+
// timeout: 1,
|
|
25
26
|
waitForInitialPage: false,
|
|
26
|
-
executablePath:
|
|
27
|
+
executablePath:
|
|
28
|
+
// process.env.CHROMIUM_PATH || "/opt/homebrew/bin/chromium",
|
|
29
|
+
"/opt/homebrew/bin/chromium",
|
|
27
30
|
headless: true,
|
|
28
|
-
|
|
31
|
+
dumpio: true,
|
|
32
|
+
// timeout: 0,
|
|
29
33
|
args: [
|
|
34
|
+
// "--auto-open-devtools-for-tabs",
|
|
30
35
|
"--disable-features=IsolateOrigins,site-per-process",
|
|
31
36
|
"--disable-site-isolation-trials",
|
|
32
37
|
"--allow-insecure-localhost",
|
|
33
38
|
"--allow-file-access-from-files",
|
|
34
39
|
"--allow-running-insecure-content",
|
|
35
|
-
// "--auto-open-devtools-for-tabs",
|
|
36
40
|
"--disable-dev-shm-usage",
|
|
37
41
|
"--disable-extensions",
|
|
38
42
|
"--disable-gpu",
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from "react";
|
|
2
2
|
import { createElement } from "react";
|
|
3
3
|
import ReactDom from "react-dom/client";
|
|
4
|
-
import { createPortal } from "react-dom";
|
|
5
4
|
import Testeranto from "../../../Web.js";
|
|
5
|
+
const TesterantoComponent = ({ done, innerComp, }) => {
|
|
6
|
+
const myContainer = useRef(null);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
console.log("useEffect called!", myContainer.current);
|
|
9
|
+
done(myContainer.current);
|
|
10
|
+
}, []);
|
|
11
|
+
return React.createElement("div", { ref: myContainer }, innerComp());
|
|
12
|
+
};
|
|
6
13
|
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
14
|
const t = Testeranto(testInput, testSpecifications, testImplementations, {
|
|
18
15
|
beforeAll: async (reactElement, itr) => {
|
|
19
16
|
return await new Promise((resolve, rej) => {
|
|
@@ -37,47 +34,49 @@ export default (testImplementations, testSpecifications, testInput) => {
|
|
|
37
34
|
},
|
|
38
35
|
beforeEach: async (subject, initializer, artificer, testResource, pm) => {
|
|
39
36
|
return new Promise((resolve, rej) => {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
37
|
+
resolve(subject);
|
|
38
|
+
// const tc = TesterantoComponent({
|
|
39
|
+
// innerComp: () =>
|
|
40
|
+
// testInput({
|
|
41
|
+
// port: 3003,
|
|
42
|
+
// address: "some-address",
|
|
43
|
+
// secretKey: "someSecretKey",
|
|
44
|
+
// abi: "foo",
|
|
45
|
+
// }),
|
|
46
|
+
// done: (reactElement: any) => {
|
|
47
|
+
// console.log("mark9");
|
|
48
|
+
// resolve(reactElement);
|
|
49
|
+
// // process.nextTick(() => {
|
|
50
|
+
// // resolve(reactElement);
|
|
51
|
+
// // });
|
|
52
|
+
// },
|
|
53
|
+
// });
|
|
54
|
+
// console.log("mark9", tc);
|
|
55
|
+
// createPortal(tc, subject.domRoot);
|
|
53
56
|
});
|
|
54
57
|
},
|
|
55
|
-
andWhen: function (s, whenCB) {
|
|
58
|
+
andWhen: function (s, whenCB, tr, utils) {
|
|
56
59
|
return new Promise((resolve, rej) => {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
console.log("mark9", s, whenCB);
|
|
61
|
+
resolve(whenCB(s, utils));
|
|
62
|
+
// process.nextTick(() => {
|
|
63
|
+
// resolve(whenCB()(s));
|
|
64
|
+
// });
|
|
60
65
|
});
|
|
61
66
|
},
|
|
62
|
-
butThen: async function (s) {
|
|
67
|
+
butThen: async function (s, thenCB) {
|
|
63
68
|
return new Promise((resolve, rej) => {
|
|
64
|
-
|
|
65
|
-
resolve(s);
|
|
66
|
-
});
|
|
69
|
+
resolve(thenCB(s));
|
|
67
70
|
});
|
|
68
71
|
},
|
|
69
72
|
afterEach: async function (store, ndx, artificer) {
|
|
70
73
|
return new Promise((resolve, rej) => {
|
|
71
|
-
|
|
72
|
-
resolve({});
|
|
73
|
-
});
|
|
74
|
+
resolve({});
|
|
74
75
|
});
|
|
75
76
|
},
|
|
76
77
|
afterAll: (store, artificer) => {
|
|
77
78
|
return new Promise((resolve, rej) => {
|
|
78
|
-
|
|
79
|
-
resolve({});
|
|
80
|
-
});
|
|
79
|
+
resolve({});
|
|
81
80
|
});
|
|
82
81
|
},
|
|
83
82
|
});
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import path from "path";
|
|
3
3
|
export default (platform, entryPoints) => {
|
|
4
|
+
console.log("mark3", platform);
|
|
4
5
|
return {
|
|
5
6
|
name: "metafileWriter",
|
|
6
7
|
setup(build) {
|
|
7
8
|
build.onEnd((result) => {
|
|
8
9
|
if (result.errors.length === 0) {
|
|
9
10
|
entryPoints.forEach((entryPoint) => {
|
|
11
|
+
console.log("mark1", entryPoint);
|
|
10
12
|
const filePath = path.join("./docs/", platform, entryPoint.split(".").slice(0, -1).join("."), `inputFiles.json`);
|
|
11
13
|
const dirName = path.dirname(filePath);
|
|
12
14
|
if (!fs.existsSync(dirName)) {
|
|
13
15
|
fs.mkdirSync(dirName, { recursive: true });
|
|
14
16
|
}
|
|
15
|
-
|
|
17
|
+
const jsonContent = JSON.stringify(Object.keys(Object.keys(result.metafile.outputs)
|
|
16
18
|
.filter((s) => {
|
|
17
19
|
if (!result.metafile.outputs[s].entryPoint) {
|
|
18
20
|
return false;
|
|
@@ -35,7 +37,8 @@ export default (platform, entryPoints) => {
|
|
|
35
37
|
const matches = f.match(regex);
|
|
36
38
|
const passes = (matches === null || matches === void 0 ? void 0 : matches.length) === 1;
|
|
37
39
|
return !passes;
|
|
38
|
-
}))
|
|
40
|
+
}));
|
|
41
|
+
fs.writeFileSync(filePath, jsonContent);
|
|
39
42
|
});
|
|
40
43
|
}
|
|
41
44
|
});
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import baseEsBuildConfig from "./index.js";
|
|
2
|
-
import inputFilesPlugin from "./inputFilesPlugin";
|
|
2
|
+
import inputFilesPlugin from "./inputFilesPlugin.js";
|
|
3
3
|
export default (config, entryPoints) => {
|
|
4
|
-
return Object.assign(Object.assign({}, baseEsBuildConfig(config)), { splitting: true, outdir: config.outdir + "/node",
|
|
4
|
+
return Object.assign(Object.assign({}, baseEsBuildConfig(config)), { splitting: true, outdir: config.outdir + "/node",
|
|
5
|
+
// inject: [`./node_modules/testeranto/dist/cjs-shim.js`],
|
|
6
|
+
metafile: true, supported: {
|
|
5
7
|
"dynamic-import": true,
|
|
6
8
|
}, define: {
|
|
7
9
|
"process.env.FLUENTFFMPEG_COV": "0",
|
|
@@ -34,7 +34,7 @@ export default (config, entryPoints) => {
|
|
|
34
34
|
"dns",
|
|
35
35
|
], platform: "browser", entryPoints: [...entryPoints], plugins: [
|
|
36
36
|
...(config.webPlugins || []),
|
|
37
|
-
inputFilesPlugin("
|
|
37
|
+
inputFilesPlugin("web", entryPoints),
|
|
38
38
|
{
|
|
39
39
|
name: "rebuild-notify",
|
|
40
40
|
setup(build) {
|
|
@@ -226,6 +226,7 @@ export class BaseGiven {
|
|
|
226
226
|
},
|
|
227
227
|
});
|
|
228
228
|
this.store = await this.givenThat(subject, testResourceConfiguration, givenArtifactory, this.givenCB, beforeEachProxy);
|
|
229
|
+
console.log("mark6", this.store);
|
|
229
230
|
for (const [whenNdx, whenStep] of this.whens.entries()) {
|
|
230
231
|
await whenStep.test(this.store, testResourceConfiguration, tLog, pm, `suite-${suiteNdx}/given-${key}/when/${whenNdx}`);
|
|
231
232
|
}
|
|
@@ -235,9 +236,10 @@ export class BaseGiven {
|
|
|
235
236
|
}
|
|
236
237
|
}
|
|
237
238
|
catch (e) {
|
|
239
|
+
console.error(e);
|
|
238
240
|
this.error = e;
|
|
239
|
-
tLog(e);
|
|
240
|
-
tLog("\u0007"); // bell
|
|
241
|
+
tLog(e.stack);
|
|
242
|
+
// tLog("\u0007"); // bell
|
|
241
243
|
// throw e;
|
|
242
244
|
}
|
|
243
245
|
finally {
|
|
@@ -323,6 +325,7 @@ export class BaseGiven {
|
|
|
323
325
|
return Reflect.get(...arguments);
|
|
324
326
|
},
|
|
325
327
|
});
|
|
328
|
+
console.log("mark5", this.store, key);
|
|
326
329
|
await this.afterEach(this.store, key, givenArtifactory, afterEachProxy);
|
|
327
330
|
}
|
|
328
331
|
catch (e) {
|
|
@@ -347,6 +350,14 @@ export class BaseWhen {
|
|
|
347
350
|
tLog(" When:", this.name);
|
|
348
351
|
const name = this.name;
|
|
349
352
|
const andWhenProxy = new Proxy(pm, {
|
|
353
|
+
// set(obj, prop, value) {
|
|
354
|
+
// return Reflect.set(...arguments);
|
|
355
|
+
// // if (prop === "eyeCount" && value % 2 !== 0) {
|
|
356
|
+
// // console.log("Monsters must have an even number of eyes");
|
|
357
|
+
// // } else {
|
|
358
|
+
// // return Reflect.set(...arguments);
|
|
359
|
+
// // }
|
|
360
|
+
// },
|
|
350
361
|
get(target, prop, receiver) {
|
|
351
362
|
if (prop === "writeFileSync") {
|
|
352
363
|
return (fp, contents) =>
|
|
@@ -363,22 +374,12 @@ export class BaseWhen {
|
|
|
363
374
|
return pages.map((page) => {
|
|
364
375
|
return new Proxy(page, {
|
|
365
376
|
get(pTarget, pProp, pReciever) {
|
|
377
|
+
// console.log("mark get", pTarget, pProp, pReciever);
|
|
366
378
|
if (pProp === "screenshot") {
|
|
367
379
|
return async (x) => {
|
|
368
|
-
// console.log(
|
|
369
|
-
// "custom-screenshot-MARK-afterEachProxy",
|
|
370
|
-
// window["custom-screenshot"].toString()
|
|
371
|
-
// );
|
|
372
380
|
return pm.customScreenShot(Object.assign(Object.assign({}, x), { path: `${testResourceConfiguration.fs}/${key}/afterEach` +
|
|
373
381
|
"/" +
|
|
374
382
|
x.path }), page);
|
|
375
|
-
// return await pTarget[pProp]({
|
|
376
|
-
// ...x,
|
|
377
|
-
// path:
|
|
378
|
-
// `${testResourceConfiguration.fs}/suite-${suiteNdx}/given-${key}/afterEach` +
|
|
379
|
-
// "/" +
|
|
380
|
-
// x.path,
|
|
381
|
-
// });
|
|
382
383
|
};
|
|
383
384
|
}
|
|
384
385
|
else if (pProp === "mainFrame") {
|
|
@@ -396,6 +397,33 @@ export class BaseWhen {
|
|
|
396
397
|
return pTarget[pProp].bind(pTarget);
|
|
397
398
|
// return target[pProp];
|
|
398
399
|
}
|
|
400
|
+
else if (pProp === "click") {
|
|
401
|
+
// console.log("mark12", arguments);
|
|
402
|
+
// return Reflect.get(target, prop, receiver);
|
|
403
|
+
// return pTarget[pProp].bind(pTarget);
|
|
404
|
+
// return target[pProp];
|
|
405
|
+
return (selector, options) => {
|
|
406
|
+
// console.log("mark13", selector, options);
|
|
407
|
+
// debugger;
|
|
408
|
+
pTarget[pProp](selector, options);
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
else if (pProp === "$") {
|
|
412
|
+
return Reflect.get(...arguments);
|
|
413
|
+
// return Reflect.get(target, prop, receiver);
|
|
414
|
+
// return pTarget[pProp].bind(pTarget);
|
|
415
|
+
// return target[pProp];
|
|
416
|
+
// return pTarget[pProp].bind(pTarget);
|
|
417
|
+
// return async (s) => {
|
|
418
|
+
// console.log("mark17", s);
|
|
419
|
+
// console.log("pTarget", pTarget);
|
|
420
|
+
// console.log("pProp", pProp);
|
|
421
|
+
// console.log("pReciever", pReciever);
|
|
422
|
+
// // return "XXX";
|
|
423
|
+
// // debugger;
|
|
424
|
+
// return await pTarget[pProp](s);
|
|
425
|
+
// };
|
|
426
|
+
}
|
|
399
427
|
else {
|
|
400
428
|
return Reflect.get(...arguments);
|
|
401
429
|
}
|
|
@@ -43,6 +43,14 @@ export class BaseBuilder {
|
|
|
43
43
|
return suiteDone.givens[k].error;
|
|
44
44
|
}).length;
|
|
45
45
|
puppetMaster.writeFileSync(`exitcode`, numberOfFailures.toString());
|
|
46
|
+
// if (numberOfFailures > 0) {
|
|
47
|
+
// puppetMaster.writeFileSync(
|
|
48
|
+
// `prompt`,
|
|
49
|
+
// `
|
|
50
|
+
// aider --message "make a script that prints hello" hello.js
|
|
51
|
+
// `
|
|
52
|
+
// );
|
|
53
|
+
// }
|
|
46
54
|
puppetMaster.writeFileSync(`tests.json`, JSON.stringify(this.toObj(), null, 2));
|
|
47
55
|
console.log(`exiting gracefully with ${numberOfFailures} failures.`);
|
|
48
56
|
return {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
botEmail: "adamwong246@gmail.com",
|
|
3
|
+
taskman: "adamwong246/kokomobay-taskman",
|
|
4
|
+
outdir: "docs",
|
|
5
|
+
tests: [["./src/LoginButton.test.tsx", "web", { ports: 0 }, []]],
|
|
6
|
+
debugger: true,
|
|
7
|
+
clearScreen: false,
|
|
8
|
+
devMode: true,
|
|
9
|
+
minify: false,
|
|
10
|
+
outbase: ".",
|
|
11
|
+
ports: [],
|
|
12
|
+
externals: [],
|
|
13
|
+
};
|