testeranto 0.80.0 → 0.81.1
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/.aider.chat.history.md +980 -0
- package/.aider.input.history +87 -0
- package/.aider.tags.cache.v3/1c/30/af1de2ad7a137afeddb1b01e0c27.val +0 -0
- package/.aider.tags.cache.v3/1d/63/88318b65ce58b6bb0487e8ce2656.val +0 -0
- package/.aider.tags.cache.v3/2e/67/16ae65530b40038e48e00d666c63.val +0 -0
- package/.aider.tags.cache.v3/6f/94/80488a232866fcce7ee657da488b.val +0 -0
- package/.aider.tags.cache.v3/cache.db +0 -0
- package/.gitattributes +1 -0
- package/README.md +10 -6
- package/dist/common/src/Aider.js +116 -69
- package/dist/common/src/PM/main.js +49 -46
- package/dist/common/src/PM/node.js +1 -1
- package/dist/common/src/Project.js +46 -38
- package/dist/common/src/Puppeteer.js +44 -37
- package/dist/common/src/SubPackages/react-test-renderer/jsx/index.js +17 -2
- package/dist/common/src/esbuildConfigs/inputFilesPlugin.js +39 -12
- package/dist/common/src/esbuildConfigs/web.js +3 -3
- package/dist/common/src/lib/abstractBase.js +41 -13
- package/dist/common/src/lib/basebuilder.js +6 -3
- package/dist/common/src/lib/core.js +47 -3
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/src/Aider.js +116 -69
- package/dist/module/src/PM/main.js +49 -46
- package/dist/module/src/PM/node.js +1 -1
- package/dist/module/src/Project.js +46 -38
- package/dist/module/src/Puppeteer.js +44 -37
- package/dist/module/src/SubPackages/react-test-renderer/jsx/index.js +17 -2
- package/dist/module/src/esbuildConfigs/inputFilesPlugin.js +39 -12
- package/dist/module/src/esbuildConfigs/web.js +3 -3
- package/dist/module/src/lib/abstractBase.js +41 -13
- package/dist/module/src/lib/basebuilder.js +6 -3
- package/dist/module/src/lib/core.js +47 -3
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/src/PM/main.d.ts +7 -1
- package/dist/types/src/Project.d.ts +6 -1
- package/dist/types/src/lib/abstractBase.d.ts +1 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +11 -15
- package/secret +1 -0
- package/secret.env +2 -0
- package/src/Aider.ts +140 -97
- package/src/PM/main.ts +60 -56
- package/src/PM/node.ts +1 -1
- package/src/Project.ts +55 -48
- package/src/Puppeteer.ts +56 -49
- package/src/SubPackages/react-test-renderer/jsx/index.ts +25 -2
- package/src/esbuildConfigs/inputFilesPlugin.ts +77 -32
- package/src/esbuildConfigs/web.ts +3 -3
- package/src/lib/abstractBase.ts +48 -17
- package/src/lib/basebuilder.ts +8 -3
- package/src/lib/core.ts +55 -13
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "testeranto",
|
|
3
3
|
"description": "teeny tiny tightly-typed typescript tests",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.81.1",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": "18.18.0"
|
|
7
7
|
},
|
|
@@ -145,10 +145,6 @@
|
|
|
145
145
|
"import": "./dist/module/src/Puppeteer.js",
|
|
146
146
|
"require": "./dist/common/src/Puppeteer.js"
|
|
147
147
|
},
|
|
148
|
-
"./src/TaskMan": {
|
|
149
|
-
"import": "./dist/module/TaskMan.js",
|
|
150
|
-
"require": "./dist/common/TaskMan.js"
|
|
151
|
-
},
|
|
152
148
|
"./src/Init": {
|
|
153
149
|
"import": "./dist/module/src/Init.js",
|
|
154
150
|
"require": "./dist/common/src/Init.js"
|
|
@@ -198,15 +194,16 @@
|
|
|
198
194
|
"build-types": "tsc -p tsconfig.types.json",
|
|
199
195
|
"build-tests": "ts-node-esm ./project.ts",
|
|
200
196
|
"run-tests": "ts-node-esm ./run-tests.ts",
|
|
201
|
-
"init-docs": "ts-node-esm init-docs.ts"
|
|
197
|
+
"init-docs": "ts-node-esm init-docs.ts",
|
|
198
|
+
"test": "yarn build-tests & yarn run-tests"
|
|
202
199
|
},
|
|
203
200
|
"peerDependencies": {
|
|
204
201
|
"@hello-pangea/dnd": ">=16",
|
|
205
|
-
"@types/react": "
|
|
206
|
-
"@types/react-dom": "18.2.
|
|
207
|
-
"@types/react-test-renderer": "
|
|
202
|
+
"@types/react": "18.2.0",
|
|
203
|
+
"@types/react-dom": "18.2.0",
|
|
204
|
+
"@types/react-test-renderer": "19.0.0",
|
|
208
205
|
"react": "18.2.0",
|
|
209
|
-
"react-dom": "
|
|
206
|
+
"react-dom": "18.2.0",
|
|
210
207
|
"ts-node": "^10.9.1",
|
|
211
208
|
"typescript": "4.8.2"
|
|
212
209
|
},
|
|
@@ -215,13 +212,11 @@
|
|
|
215
212
|
"@types/node": "^22.7.5",
|
|
216
213
|
"@types/react": "18.2.55",
|
|
217
214
|
"@types/react-bootstrap": "^0.32.32",
|
|
218
|
-
"@types/react-dom": "18.2.
|
|
219
|
-
"@types/react-test-renderer": "
|
|
215
|
+
"@types/react-dom": "18.2.0",
|
|
216
|
+
"@types/react-test-renderer": "19.0.0",
|
|
220
217
|
"@types/ws": "^8.5.10",
|
|
221
218
|
"@typescript-eslint/eslint-plugin": "^5.46.0",
|
|
222
219
|
"@typescript-eslint/parser": "^5.46.0",
|
|
223
|
-
"react": "18.2.0",
|
|
224
|
-
"react-dom": "^18.2.0",
|
|
225
220
|
"ts-node": "^10.9.1",
|
|
226
221
|
"typescript": "4.8.2"
|
|
227
222
|
},
|
|
@@ -280,7 +275,8 @@
|
|
|
280
275
|
"selenium-webdriver": "4.27.0",
|
|
281
276
|
"url": "^0.11.4",
|
|
282
277
|
"uuid": "^10.0.0",
|
|
278
|
+
"why-is-node-running": "^3.2.2",
|
|
283
279
|
"ws": "^8.16.0",
|
|
284
280
|
"zod": "^3.24.2"
|
|
285
281
|
}
|
|
286
|
-
}
|
|
282
|
+
}
|
package/secret
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
fmG,.R,^TnN7rK3
|
package/secret.env
ADDED
package/src/Aider.ts
CHANGED
|
@@ -1,33 +1,44 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import { exec, spawn } from "child_process";
|
|
3
|
-
import { features } from "process";
|
|
4
|
-
// import { octokit } from "./src/DELETEME";
|
|
5
|
-
// const itermTab = require("iterm-tab");
|
|
6
|
-
import itermTab from "iterm-tab";
|
|
7
|
-
|
|
8
|
-
import { Octokit } from "octokit";
|
|
9
3
|
|
|
10
4
|
export const execCommand = async (command) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
} else {
|
|
27
|
-
reject(new Error(`Command exited with code ${code}.`));
|
|
28
|
-
}
|
|
29
|
-
});
|
|
5
|
+
const ls = spawn(command.split(" ")[0], command.split(" ").slice(1, -1));
|
|
6
|
+
|
|
7
|
+
process.stdin.pipe(ls.stdin);
|
|
8
|
+
ls.stdout.pipe(process.stdout);
|
|
9
|
+
ls.stderr.pipe(process.stdout);
|
|
10
|
+
// ls.stdout.on("data", function (data) {
|
|
11
|
+
// console.log("stdout: " + data.toString());
|
|
12
|
+
// });
|
|
13
|
+
|
|
14
|
+
// ls.stderr.on("data", function (data) {
|
|
15
|
+
// console.log("stderr: " + data.toString());
|
|
16
|
+
// });
|
|
17
|
+
|
|
18
|
+
ls.on("exit", function (code) {
|
|
19
|
+
console.log("child process exited with code " + code?.toString() || -1);
|
|
30
20
|
});
|
|
21
|
+
|
|
22
|
+
// return new Promise<void>((resolve, reject) => {
|
|
23
|
+
// const [cmd, ...args] = command.split(" ");
|
|
24
|
+
// const childProcess = spawn(cmd, args);
|
|
25
|
+
// childProcess.stdout.on("data", (data) => {
|
|
26
|
+
// process.stdout.write(data.toString());
|
|
27
|
+
// });
|
|
28
|
+
// childProcess.stderr.on("data", (data) => {
|
|
29
|
+
// process.stderr.write(data.toString());
|
|
30
|
+
// });
|
|
31
|
+
// childProcess.on("error", (error) => {
|
|
32
|
+
// reject(error);
|
|
33
|
+
// });
|
|
34
|
+
// childProcess.on("exit", (code) => {
|
|
35
|
+
// if (code === 0) {
|
|
36
|
+
// resolve();
|
|
37
|
+
// } else {
|
|
38
|
+
// reject(new Error(`Command exited with code ${code}.`));
|
|
39
|
+
// }
|
|
40
|
+
// });
|
|
41
|
+
// });
|
|
31
42
|
};
|
|
32
43
|
|
|
33
44
|
const key = process.argv[2];
|
|
@@ -44,78 +55,110 @@ if (exitcode != "0") {
|
|
|
44
55
|
|
|
45
56
|
inputFiles.push(`${key}/tests.json`);
|
|
46
57
|
|
|
47
|
-
const features = await (
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
)
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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
|
-
|
|
58
|
+
// const features = await await Promise.all(
|
|
59
|
+
// Array.from(
|
|
60
|
+
// new Set(
|
|
61
|
+
// JSON.parse(fs.readFileSync(`${key}/tests.json`).toString())
|
|
62
|
+
// .givens.reduce((mm: any[], lm: { features: any[] }) => {
|
|
63
|
+
// mm.push(
|
|
64
|
+
// lm.features.reduce((mm2: any[], lm2: any) => {
|
|
65
|
+
// mm2.push(lm2);
|
|
66
|
+
// return mm2;
|
|
67
|
+
// }, [])
|
|
68
|
+
// );
|
|
69
|
+
// return mm;
|
|
70
|
+
// }, [])
|
|
71
|
+
// .flat()
|
|
72
|
+
// .flat()
|
|
73
|
+
// )
|
|
74
|
+
// ) as string[]
|
|
75
|
+
// );
|
|
76
|
+
|
|
77
|
+
// const final = features.reduce((mm, [k, v], ndx) => {
|
|
78
|
+
// mm[k] = v;
|
|
79
|
+
// return mm;
|
|
80
|
+
// }, {});
|
|
81
|
+
|
|
82
|
+
// const as = JSON.stringify(final);
|
|
83
|
+
|
|
84
|
+
// const scriptCommand = `aider --model deepseek --api-key deepseek=${
|
|
85
|
+
// process.env.DEEPSEEK_KEY
|
|
86
|
+
// } --message "Fix the failing tests" --read ${key}/inputFiles.json ${inputFiles
|
|
87
|
+
// .map((i) => `--file ${i}`)
|
|
88
|
+
// .join(" ")}`;
|
|
89
|
+
|
|
90
|
+
const scriptCommand = `aider --message "Fix the failing tests" --model deepseek --api-key deepseek=${
|
|
91
|
+
process.env.DEEPSEEK_KEY
|
|
92
|
+
} --file ./${inputFiles.join(" ./")}`;
|
|
93
|
+
|
|
94
|
+
console.log("scriptCommand", scriptCommand);
|
|
95
|
+
|
|
96
|
+
execCommand(scriptCommand);
|
|
97
|
+
|
|
98
|
+
// fs.writeFile(`./${key}/features.json`, as, () => {
|
|
99
|
+
// inputFiles.push(`./${key}/features.json`);
|
|
100
|
+
|
|
101
|
+
// // itermTab(scriptCommand).then(() => console.log("yay"));
|
|
102
|
+
|
|
103
|
+
// // const child = spawn("xterm -e", scriptCommand.split(" "), {
|
|
104
|
+
// // detached: true,
|
|
105
|
+
// // stdio: "ignore",
|
|
106
|
+
// // });
|
|
107
|
+
// // runCommandInITerm(scriptCommand);
|
|
108
|
+
// });
|
|
109
|
+
|
|
110
|
+
// .reduce(async (mm, feature) => {
|
|
111
|
+
// const req = await octokit.request(
|
|
112
|
+
// `GET /repos/adamwong246/kokomobay-taskman/contents/Task/${feature}.json`,
|
|
113
|
+
// {
|
|
114
|
+
// owner: "adamwong246",
|
|
115
|
+
// repo: "kokomoBay-taskman",
|
|
116
|
+
// path: `Task/${feature}.json`,
|
|
117
|
+
// headers: {
|
|
118
|
+
// "X-GitHub-Api-Version": "2022-11-28",
|
|
119
|
+
// },
|
|
120
|
+
// }
|
|
121
|
+
// );
|
|
122
|
+
|
|
123
|
+
// const j = JSON.parse(atob(req.data.content));
|
|
124
|
+
// (await mm).push([
|
|
125
|
+
// feature,
|
|
126
|
+
// JSON.stringify({
|
|
127
|
+
// name: j.name,
|
|
128
|
+
// body: j.body,
|
|
129
|
+
// }),
|
|
130
|
+
// ]);
|
|
131
|
+
|
|
132
|
+
// return mm;
|
|
133
|
+
// }, Promise.resolve<[string, string][]>([]))
|
|
134
|
+
// .then((z) => {
|
|
135
|
+
// const final = z.reduce((mm, [k, v], ndx) => {
|
|
136
|
+
// mm[k] = v;
|
|
137
|
+
// return mm;
|
|
138
|
+
// }, {});
|
|
139
|
+
|
|
140
|
+
// const as = JSON.stringify(final);
|
|
141
|
+
|
|
142
|
+
// fs.writeFile(`./${key}/features.json`, as, () => {
|
|
143
|
+
// inputFiles.push(`./${key}/features.json`);
|
|
144
|
+
|
|
145
|
+
// const scriptCommand = `aider --model deepseek --api-key deepseek=${
|
|
146
|
+
// process.env.DEEPSEEK_KEY
|
|
147
|
+
// } --message "Fix the failing tests" ${inputFiles.join(" ")}`;
|
|
148
|
+
|
|
149
|
+
// console.log("scriptCommand", scriptCommand);
|
|
150
|
+
|
|
151
|
+
// execCommand(scriptCommand);
|
|
152
|
+
// // itermTab(scriptCommand).then(() => console.log("yay"));
|
|
153
|
+
|
|
154
|
+
// // const child = spawn("xterm -e", scriptCommand.split(" "), {
|
|
155
|
+
// // detached: true,
|
|
156
|
+
// // stdio: "ignore",
|
|
157
|
+
// // });
|
|
158
|
+
// // runCommandInITerm(scriptCommand);
|
|
159
|
+
// });
|
|
160
|
+
// //
|
|
161
|
+
// });
|
|
119
162
|
|
|
120
163
|
// features.then((x) => {
|
|
121
164
|
// console.log("done", x);
|
package/src/PM/main.ts
CHANGED
|
@@ -17,18 +17,18 @@ const files: Record<string, Set<string>> = {}; // = new Set<string>();
|
|
|
17
17
|
const screenshots: Record<string, Promise<Uint8Array>[]> = {};
|
|
18
18
|
|
|
19
19
|
export class PM_Main extends PM {
|
|
20
|
-
|
|
21
|
-
throw new Error("Method not implemented.");
|
|
22
|
-
}
|
|
20
|
+
shutdownMode = false;
|
|
23
21
|
configs: IBuiltConfig;
|
|
24
22
|
ports: Record<number, boolean>;
|
|
25
23
|
queue: any[];
|
|
24
|
+
registry: Record<string, boolean>;
|
|
26
25
|
|
|
27
26
|
constructor(configs: IBuiltConfig) {
|
|
28
27
|
super();
|
|
29
28
|
this.server = {};
|
|
30
29
|
this.configs = configs;
|
|
31
30
|
this.ports = {};
|
|
31
|
+
this.registry = {};
|
|
32
32
|
this.configs.ports.forEach((element) => {
|
|
33
33
|
this.ports[element] = "true"; // set ports as open
|
|
34
34
|
});
|
|
@@ -47,7 +47,7 @@ export class PM_Main extends PM {
|
|
|
47
47
|
contents: string,
|
|
48
48
|
testName: string
|
|
49
49
|
) => {
|
|
50
|
-
console.log("globalThis-writeFileSync", filepath);
|
|
50
|
+
// console.log("globalThis-writeFileSync", filepath);
|
|
51
51
|
|
|
52
52
|
// Create directories if they don't exist
|
|
53
53
|
const dir = path.dirname(filepath.split("/").slice(0, -1).join("/"));
|
|
@@ -88,18 +88,6 @@ export class PM_Main extends PM {
|
|
|
88
88
|
opts: { path: string },
|
|
89
89
|
page: Page
|
|
90
90
|
) => {
|
|
91
|
-
// // fileStreams3[uid].write(contents);
|
|
92
|
-
// // console.log("asd", opts.path.split("/").slice(0, -1).join("/"));
|
|
93
|
-
|
|
94
|
-
// // const dir = path.dirname(opts.path.split("/").slice(0, -1).join("/"));
|
|
95
|
-
// // console.log("dir", dir);
|
|
96
|
-
// fs.mkdirSync(opts.path.split("/").slice(0, -1).join("/"), {
|
|
97
|
-
// recursive: true,
|
|
98
|
-
// });
|
|
99
|
-
|
|
100
|
-
// return page.screenshot(opts);
|
|
101
|
-
|
|
102
|
-
console.log("main.ts node custom-screenshot", page);
|
|
103
91
|
const p = opts.path as string;
|
|
104
92
|
const dir = path.dirname(p);
|
|
105
93
|
fs.mkdirSync(dir, {
|
|
@@ -134,32 +122,17 @@ export class PM_Main extends PM {
|
|
|
134
122
|
JSON.stringify(Array.from(files[testName]))
|
|
135
123
|
);
|
|
136
124
|
delete files[testName];
|
|
137
|
-
// globalThis["writeFileSync"](
|
|
138
|
-
// p + "/manifest.json",
|
|
139
|
-
// // files.entries()
|
|
140
|
-
// JSON.stringify(Array.from(files[testName]))
|
|
141
|
-
// );
|
|
142
|
-
|
|
143
|
-
// fileStreams3[uid].end();
|
|
144
125
|
};
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
// // });
|
|
156
|
-
// // setTimeout(() => {
|
|
157
|
-
// // console.log("Delayed for 1 second.");
|
|
158
|
-
// // page.close();
|
|
159
|
-
// // }, 5000);
|
|
160
|
-
|
|
161
|
-
// // return page.close();
|
|
162
|
-
// });
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
shutDown() {
|
|
129
|
+
console.log("shutting down...");
|
|
130
|
+
this.shutdownMode = true;
|
|
131
|
+
this.checkForShutdown();
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
customScreenShot(opts: object) {
|
|
135
|
+
throw new Error("Method not implemented.");
|
|
163
136
|
}
|
|
164
137
|
|
|
165
138
|
async startPuppeteer(options: any, destfolder: string): Promise<any> {
|
|
@@ -167,8 +140,35 @@ export class PM_Main extends PM {
|
|
|
167
140
|
return this.browser;
|
|
168
141
|
}
|
|
169
142
|
|
|
143
|
+
checkForShutdown = () => {
|
|
144
|
+
const anyRunning: boolean =
|
|
145
|
+
Object.values(this.registry).filter((x) => x === false).length > 0;
|
|
146
|
+
if (anyRunning) {
|
|
147
|
+
} else {
|
|
148
|
+
this.browser.disconnect().then(() => {
|
|
149
|
+
console.log("Goodbye");
|
|
150
|
+
process.exit();
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
register = (src: string) => {
|
|
156
|
+
// console.log("register", src);
|
|
157
|
+
this.registry[src] = false;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
deregister = (src: string) => {
|
|
161
|
+
// console.log("deregister", src, this.shutdownMode);
|
|
162
|
+
this.registry[src] = true;
|
|
163
|
+
|
|
164
|
+
if (this.shutdownMode) {
|
|
165
|
+
this.checkForShutdown();
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
|
|
170
169
|
launchNode = async (src: string, dest: string) => {
|
|
171
170
|
console.log("launchNode", src);
|
|
171
|
+
this.register(src);
|
|
172
172
|
|
|
173
173
|
const destFolder = dest.replace(".mjs", "");
|
|
174
174
|
|
|
@@ -197,7 +197,7 @@ export class PM_Main extends PM {
|
|
|
197
197
|
const openPorts = Object.entries(this.ports).filter(
|
|
198
198
|
([portnumber, portopen]) => portopen
|
|
199
199
|
);
|
|
200
|
-
|
|
200
|
+
|
|
201
201
|
if (openPorts.length >= testConfigResource.ports) {
|
|
202
202
|
for (let i = 0; i < testConfigResource.ports; i++) {
|
|
203
203
|
portsToUse.push(openPorts[i][0]);
|
|
@@ -250,18 +250,16 @@ export class PM_Main extends PM {
|
|
|
250
250
|
return module.default.then((defaultModule) => {
|
|
251
251
|
defaultModule
|
|
252
252
|
.receiveTestResourceConfig(argz)
|
|
253
|
-
.then((x) => {
|
|
254
|
-
console.log("then", x);
|
|
255
|
-
|
|
256
|
-
return x;
|
|
257
|
-
})
|
|
258
253
|
.catch((e) => {
|
|
259
254
|
console.log("catch", e);
|
|
255
|
+
})
|
|
256
|
+
.finally(() => {
|
|
257
|
+
this.deregister(src);
|
|
260
258
|
});
|
|
261
259
|
});
|
|
262
260
|
});
|
|
263
261
|
|
|
264
|
-
console.log("portsToUse", portsToUse);
|
|
262
|
+
// console.log("portsToUse", portsToUse);
|
|
265
263
|
for (let i = 0; i <= portsToUse.length; i++) {
|
|
266
264
|
if (portsToUse[i]) {
|
|
267
265
|
this.ports[portsToUse[i]] = "true"; //port is open again
|
|
@@ -306,7 +304,7 @@ export class PM_Main extends PM {
|
|
|
306
304
|
page.exposeFunction(
|
|
307
305
|
"custom-screenshot",
|
|
308
306
|
async (ssOpts: ScreenshotOptions, testName: string) => {
|
|
309
|
-
console.log("main.ts browser custom-screenshot", testName);
|
|
307
|
+
// console.log("main.ts browser custom-screenshot", testName);
|
|
310
308
|
const p = ssOpts.path as string;
|
|
311
309
|
const dir = path.dirname(p);
|
|
312
310
|
fs.mkdirSync(dir, {
|
|
@@ -411,7 +409,7 @@ export class PM_Main extends PM {
|
|
|
411
409
|
|
|
412
410
|
Promise.all(screenshots[testName] || []).then(() => {
|
|
413
411
|
delete screenshots[testName];
|
|
414
|
-
page.close();
|
|
412
|
+
// page.close();
|
|
415
413
|
});
|
|
416
414
|
|
|
417
415
|
// globalThis["writeFileSync"](
|
|
@@ -455,7 +453,6 @@ export class PM_Main extends PM {
|
|
|
455
453
|
});
|
|
456
454
|
};
|
|
457
455
|
|
|
458
|
-
// launchNodeSideCar = async (src: string, dest: string) => {};
|
|
459
456
|
launchNodeSideCar = async (
|
|
460
457
|
src: string,
|
|
461
458
|
dest: string,
|
|
@@ -491,7 +488,7 @@ export class PM_Main extends PM {
|
|
|
491
488
|
const openPorts = Object.entries(this.ports).filter(
|
|
492
489
|
([portnumber, portopen]) => portopen
|
|
493
490
|
);
|
|
494
|
-
console.log("openPorts", openPorts);
|
|
491
|
+
// console.log("openPorts", openPorts);
|
|
495
492
|
if (openPorts.length >= testConfigResource.ports) {
|
|
496
493
|
for (let i = 0; i < testConfigResource.ports; i++) {
|
|
497
494
|
portsToUse.push(openPorts[i][0]);
|
|
@@ -526,7 +523,7 @@ export class PM_Main extends PM {
|
|
|
526
523
|
`${builtfile}?cacheBust=${Date.now()}`
|
|
527
524
|
).then((module) => {
|
|
528
525
|
return module.default.then((defaultModule) => {
|
|
529
|
-
console.log("defaultModule", defaultModule);
|
|
526
|
+
// console.log("defaultModule", defaultModule);
|
|
530
527
|
const s = new defaultModule();
|
|
531
528
|
s.receiveTestResourceConfig(argz);
|
|
532
529
|
// Object.create(defaultModule);
|
|
@@ -543,7 +540,7 @@ export class PM_Main extends PM {
|
|
|
543
540
|
});
|
|
544
541
|
});
|
|
545
542
|
|
|
546
|
-
console.log("portsToUse", portsToUse);
|
|
543
|
+
// console.log("portsToUse", portsToUse);
|
|
547
544
|
for (let i = 0; i <= portsToUse.length; i++) {
|
|
548
545
|
if (portsToUse[i]) {
|
|
549
546
|
this.ports[portsToUse[i]] = "true"; //port is open again
|
|
@@ -553,6 +550,7 @@ export class PM_Main extends PM {
|
|
|
553
550
|
|
|
554
551
|
launchWeb = (t: string, dest: string, sidecars: ITestTypes[]) => {
|
|
555
552
|
console.log("launchWeb", t, dest);
|
|
553
|
+
this.register(t);
|
|
556
554
|
|
|
557
555
|
sidecars.map((sidecar) => {
|
|
558
556
|
if (sidecar[1] === "node") {
|
|
@@ -599,7 +597,7 @@ export class PM_Main extends PM {
|
|
|
599
597
|
page.exposeFunction(
|
|
600
598
|
"customScreenShot",
|
|
601
599
|
async (ssOpts: ScreenshotOptions, testName: string) => {
|
|
602
|
-
console.log("main.ts browser custom-screenshot", testName);
|
|
600
|
+
// console.log("main.ts browser custom-screenshot", testName);
|
|
603
601
|
const p = ssOpts.path as string;
|
|
604
602
|
const dir = path.dirname(p);
|
|
605
603
|
fs.mkdirSync(dir, {
|
|
@@ -696,7 +694,7 @@ export class PM_Main extends PM {
|
|
|
696
694
|
});
|
|
697
695
|
|
|
698
696
|
page.exposeFunction("customclose", (p: string, testName: string) => {
|
|
699
|
-
console.log("
|
|
697
|
+
// console.log("closing", p);
|
|
700
698
|
|
|
701
699
|
fs.writeFileSync(
|
|
702
700
|
p + "/manifest.json",
|
|
@@ -704,9 +702,12 @@ export class PM_Main extends PM {
|
|
|
704
702
|
);
|
|
705
703
|
delete files[testName];
|
|
706
704
|
|
|
705
|
+
// console.log("screenshots[testName]", screenshots[testName]);
|
|
707
706
|
Promise.all(screenshots[testName] || []).then(() => {
|
|
708
707
|
delete screenshots[testName];
|
|
709
708
|
// page.close();
|
|
709
|
+
// console.log("\t GOODBYE");
|
|
710
|
+
// whyIsNodeRunning();
|
|
710
711
|
});
|
|
711
712
|
|
|
712
713
|
// globalThis["writeFileSync"](
|
|
@@ -748,6 +749,9 @@ export class PM_Main extends PM {
|
|
|
748
749
|
})
|
|
749
750
|
.finally(() => {
|
|
750
751
|
console.log("evaluation complete.", dest);
|
|
752
|
+
// page.close();
|
|
753
|
+
this.deregister(t);
|
|
754
|
+
// whyIsNodeRunning();
|
|
751
755
|
});
|
|
752
756
|
|
|
753
757
|
return page;
|
package/src/PM/node.ts
CHANGED
|
@@ -42,7 +42,7 @@ export class PM_Node extends PM {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
writeFileSync(filepath: string, contents: string) {
|
|
45
|
-
console.log("pm_node-writeFileSync", this.testResourceConfiguration);
|
|
45
|
+
// console.log("pm_node-writeFileSync", this.testResourceConfiguration);
|
|
46
46
|
return globalThis["writeFileSync"](
|
|
47
47
|
this.testResourceConfiguration.fs + "/" + filepath,
|
|
48
48
|
contents,
|