testeranto 0.94.0 → 0.100.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.
Files changed (103) hide show
  1. package/bundle.js +4 -7
  2. package/dist/common/src/PM/main.js +160 -42
  3. package/dist/common/src/PM/node.js +20 -5
  4. package/dist/common/src/PM/web.js +19 -4
  5. package/dist/common/src/SubPackages/react/jsx/node.js +1 -6
  6. package/dist/common/src/cli.js +439 -0
  7. package/dist/common/src/cli2.js +144 -0
  8. package/dist/common/src/esbuildConfigs/inputFilesPlugin.js +18 -6
  9. package/dist/common/src/esbuildConfigs/node.js +1 -4
  10. package/dist/common/src/esbuildConfigs/web.js +1 -1
  11. package/dist/common/src/lib/abstractBase.js +14 -91
  12. package/dist/common/src/lib/types.js +1 -0
  13. package/dist/common/tsconfig.common.tsbuildinfo +1 -1
  14. package/dist/module/src/PM/main.js +160 -42
  15. package/dist/module/src/PM/node.js +20 -5
  16. package/dist/module/src/PM/web.js +19 -4
  17. package/dist/module/src/SubPackages/react/jsx/node.js +1 -6
  18. package/dist/module/src/cli.js +411 -0
  19. package/dist/module/src/cli2.js +116 -0
  20. package/dist/module/src/esbuildConfigs/inputFilesPlugin.js +18 -6
  21. package/dist/module/src/esbuildConfigs/node.js +1 -4
  22. package/dist/module/src/esbuildConfigs/web.js +1 -1
  23. package/dist/module/src/lib/abstractBase.js +14 -91
  24. package/dist/module/src/lib/types.js +1 -0
  25. package/dist/module/tsconfig.module.tsbuildinfo +1 -1
  26. package/dist/prebuild/cli.mjs +1491 -0
  27. package/dist/prebuild/{run-tests.mjs → cli2.mjs} +203 -156
  28. package/dist/types/src/Node.d.ts +2 -2
  29. package/dist/types/src/PM/index.d.ts +10 -2
  30. package/dist/types/src/PM/main.d.ts +13 -7
  31. package/dist/types/src/PM/node.d.ts +9 -2
  32. package/dist/types/src/PM/web.d.ts +9 -3
  33. package/dist/types/src/SubPackages/puppeteer.d.ts +1 -1
  34. package/dist/types/src/SubPackages/react/component/node.d.ts +1 -1
  35. package/dist/types/src/SubPackages/react/component/web.d.ts +1 -1
  36. package/dist/types/src/SubPackages/react/jsx/node.d.ts +3 -3
  37. package/dist/types/src/SubPackages/react/jsx/web.d.ts +2 -2
  38. package/dist/types/src/SubPackages/react-dom/component/node.d.ts +2 -2
  39. package/dist/types/src/SubPackages/react-dom/component/web.d.ts +1 -1
  40. package/dist/types/src/SubPackages/react-dom/jsx/node.d.ts +1 -1
  41. package/dist/types/src/SubPackages/react-dom/jsx/web.d.ts +2 -2
  42. package/dist/types/src/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +2 -2
  43. package/dist/types/src/SubPackages/react-test-renderer/component/node.d.ts +2 -2
  44. package/dist/types/src/SubPackages/react-test-renderer/component/web.d.ts +2 -2
  45. package/dist/types/src/SubPackages/react-test-renderer/fc/node.d.ts +2 -2
  46. package/dist/types/src/SubPackages/react-test-renderer/fc/web.d.ts +2 -2
  47. package/dist/types/src/SubPackages/react-test-renderer/jsx/node.d.ts +3 -2
  48. package/dist/types/src/SubPackages/react-test-renderer/jsx/web.d.ts +2 -2
  49. package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/node.d.ts +2 -2
  50. package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/web.d.ts +2 -2
  51. package/dist/types/src/Types.d.ts +60 -21
  52. package/dist/types/src/Web.d.ts +2 -2
  53. package/dist/types/src/lib/index.d.ts +1 -1
  54. package/dist/types/src/lib/types.d.ts +2 -30
  55. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  56. package/package.json +11 -8
  57. package/src/PM/index.ts +12 -8
  58. package/src/PM/main.ts +218 -62
  59. package/src/PM/node.ts +42 -7
  60. package/src/PM/web.ts +33 -5
  61. package/src/SubPackages/react/jsx/node.ts +16 -5
  62. package/src/SubPackages/react-test-renderer/jsx/node.ts +16 -1
  63. package/src/Types.ts +362 -114
  64. package/src/cli.ts +535 -0
  65. package/src/cli2.ts +157 -0
  66. package/src/esbuildConfigs/inputFilesPlugin.ts +27 -6
  67. package/src/esbuildConfigs/node.ts +4 -7
  68. package/src/esbuildConfigs/web.ts +4 -3
  69. package/src/lib/abstractBase.ts +58 -115
  70. package/src/lib/types.ts +3 -177
  71. package/dist/common/src/Aider.js +0 -143
  72. package/dist/common/src/Project.js +0 -227
  73. package/dist/common/src/Puppeteer.js +0 -111
  74. package/dist/common/src/build-tests.js +0 -39
  75. package/dist/common/src/esbuildConfigs/features.js +0 -14
  76. package/dist/common/src/esbuildConfigs/report.js +0 -14
  77. package/dist/common/src/esbuildConfigs/tests.js +0 -13
  78. package/dist/common/src/run-tests.js +0 -39
  79. package/dist/module/src/Aider.js +0 -136
  80. package/dist/module/src/Project.js +0 -220
  81. package/dist/module/src/Puppeteer.js +0 -106
  82. package/dist/module/src/build-tests.js +0 -11
  83. package/dist/module/src/esbuildConfigs/features.js +0 -12
  84. package/dist/module/src/esbuildConfigs/report.js +0 -14
  85. package/dist/module/src/esbuildConfigs/tests.js +0 -11
  86. package/dist/module/src/run-tests.js +0 -11
  87. package/dist/prebuild/build-tests.mjs +0 -553
  88. package/dist/types/src/Aider.d.ts +0 -1
  89. package/dist/types/src/Project.d.ts +0 -12
  90. package/dist/types/src/Puppeteer.d.ts +0 -2
  91. package/dist/types/src/esbuildConfigs/features.d.ts +0 -4
  92. package/dist/types/src/esbuildConfigs/report.d.ts +0 -0
  93. package/dist/types/src/esbuildConfigs/tests.d.ts +0 -4
  94. package/src/Aider.ts +0 -168
  95. package/src/Project.ts +0 -292
  96. package/src/Puppeteer.ts +0 -143
  97. package/src/build-tests.ts +0 -12
  98. package/src/esbuildConfigs/features.ts +0 -17
  99. package/src/esbuildConfigs/report.ts +0 -15
  100. package/src/esbuildConfigs/tests.ts +0 -14
  101. package/src/run-tests.ts +0 -12
  102. /package/dist/types/src/{build-tests.d.ts → cli.d.ts} +0 -0
  103. /package/dist/types/src/{run-tests.d.ts → cli2.d.ts} +0 -0
package/src/Aider.ts DELETED
@@ -1,168 +0,0 @@
1
- import fs from "fs";
2
- import { exec, spawn } from "child_process";
3
-
4
- export const execCommand = async (command) => {
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);
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
- // });
42
- };
43
-
44
- const key = process.argv[2];
45
- console.log(key);
46
- const exitcode = fs.readFileSync(`${key}/exitcode`).toString();
47
-
48
- console.log("exitcode", exitcode);
49
-
50
- // if (exitcode != "0") {
51
- if (exitcode != "0") {
52
- const inputFiles = JSON.parse(
53
- fs.readFileSync(`${key}/inputFiles.json`).toString()
54
- );
55
-
56
- inputFiles.push(`${key}/tests.json`);
57
-
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
- // });
162
-
163
- // features.then((x) => {
164
- // console.log("done", x);
165
- // });
166
- } else {
167
- console.log("that test is not failing");
168
- }
package/src/Project.ts DELETED
@@ -1,292 +0,0 @@
1
- import { spawn } from "child_process";
2
-
3
- import esbuild from "esbuild";
4
- import fs from "fs";
5
- import path from "path";
6
- import readline from "readline";
7
- import { glob } from "glob";
8
-
9
- import esbuildNodeConfiger from "./esbuildConfigs/node.js";
10
- import esbuildWebConfiger from "./esbuildConfigs/web.js";
11
- import webHtmlFrame from "./web.html.js";
12
- import { ITestTypes, IBaseConfig, IRunTime } from "./lib/types.js";
13
-
14
- readline.emitKeypressEvents(process.stdin);
15
- if (process.stdin.isTTY) process.stdin.setRawMode(true);
16
-
17
- const logContent: string[] = [];
18
-
19
- function parseTsErrors(): void {
20
- try {
21
- // const logContent = fs.readFileSync(logPath, "utf-8").split("\n");
22
- const regex = /(^src(.*?))\(\d*,\d*\): error/gm;
23
- const brokenFilesToLines: Record<string, Set<number>> = {};
24
-
25
- for (let i = 0; i < logContent.length - 1; i++) {
26
- let m;
27
-
28
- while ((m = regex.exec(logContent[i])) !== null) {
29
- // This is necessary to avoid infinite loops with zero-width matches
30
- if (m.index === regex.lastIndex) {
31
- regex.lastIndex++;
32
- }
33
- if (!brokenFilesToLines[m[1]]) {
34
- brokenFilesToLines[m[1]] = new Set<number>();
35
- }
36
- brokenFilesToLines[m[1]].add(i);
37
- }
38
- }
39
-
40
- const final = Object.keys(brokenFilesToLines).reduce((mm, lm, ndx) => {
41
- mm[lm] = Array.from(brokenFilesToLines[lm]).map((l, ndx3) => {
42
- const a = Array.from(brokenFilesToLines[lm]);
43
-
44
- return Object.keys(a).reduce((mm2, lm2, ndx2) => {
45
- const acc: string[] = [];
46
-
47
- let j = a[lm2] + 1;
48
-
49
- let working = true;
50
- while (j < logContent.length - 1 && working) {
51
- if (
52
- !logContent[j].match(regex) &&
53
- working &&
54
- !logContent[j].match(/^..\/(.*?)\(\d*,\d*\)/)
55
- ) {
56
- acc.push(logContent[j]);
57
- } else {
58
- working = false;
59
- }
60
-
61
- j++;
62
- }
63
-
64
- mm2[lm] = [logContent[l], ...acc];
65
-
66
- return mm2;
67
- }, {} as any)[lm];
68
- });
69
- return mm;
70
- }, {});
71
-
72
- Object.keys(final).forEach((k) => {
73
- fs.mkdirSync(`./docs/types/${k.split("/").slice(0, -1).join("/")}`, {
74
- recursive: true,
75
- });
76
- fs.writeFileSync(
77
- `./docs/types/${k}.type_errors.txt`,
78
- final[k].flat().flat().join("\r\n")
79
- );
80
- });
81
- } catch (error) {
82
- console.error("Error reading or parsing the log file:", error);
83
- process.exit(1);
84
- }
85
- }
86
-
87
- const compile = () => {
88
- return new Promise((resolve, reject) => {
89
- const tsc = spawn("tsc", ["-noEmit"]);
90
-
91
- tsc.stdout.on("data", (data) => {
92
- // console.log(`tsc stdout: ${data}`);
93
- const lines = data.toString().split("\n");
94
- logContent.push(...lines);
95
- });
96
-
97
- tsc.stderr.on("data", (data) => {
98
- console.error(`stderr: ${data}`);
99
- process.exit(-1);
100
- });
101
-
102
- tsc.on("close", (code) => {
103
- parseTsErrors();
104
- console.log("tsc done");
105
- resolve(`tsc process exited with code ${code}`);
106
- // if (code !== 0) {
107
- // resolve(`tsc process exited with code ${code}`);
108
- // // reject(`tsc process exited with code ${code}`);
109
- // } else {
110
- // resolve({});
111
- // }
112
- });
113
- });
114
- };
115
-
116
- export class ITProject {
117
- config: IBaseConfig;
118
- mode: `DEV` | `PROD`;
119
- nodeDone: boolean = false;
120
- webDone: boolean = false;
121
-
122
- constructor(configs: IBaseConfig) {
123
- this.config = configs;
124
-
125
- this.mode = this.config.devMode ? "DEV" : "PROD";
126
-
127
- process.stdin.on("keypress", (str, key) => {
128
- if (key.name === "q") {
129
- console.log("Testeranto-EsBuild is shutting down...");
130
- this.mode = "PROD";
131
- this.onDone();
132
- }
133
- });
134
-
135
- fs.writeFileSync(
136
- `${this.config.outdir}/testeranto.json`,
137
- JSON.stringify(
138
- {
139
- ...this.config,
140
- buildDir: process.cwd() + "/" + this.config.outdir,
141
- },
142
- null,
143
- 2
144
- )
145
- );
146
-
147
- Promise.resolve(
148
- Promise.all(
149
- [...this.getSecondaryEndpointsPoints("web")].map(
150
- async (sourceFilePath) => {
151
- const sourceFileSplit = sourceFilePath.split("/");
152
- const sourceDir = sourceFileSplit.slice(0, -1);
153
- const sourceFileName = sourceFileSplit[sourceFileSplit.length - 1];
154
- const sourceFileNameMinusJs = sourceFileName
155
- .split(".")
156
- .slice(0, -1)
157
- .join(".");
158
-
159
- const htmlFilePath = path.normalize(
160
- `${process.cwd()}/${this.config.outdir}/web/${sourceDir.join(
161
- "/"
162
- )}/${sourceFileNameMinusJs}.html`
163
- );
164
- const jsfilePath = `./${sourceFileNameMinusJs}.mjs`;
165
-
166
- return fs.promises
167
- .mkdir(path.dirname(htmlFilePath), { recursive: true })
168
- .then((x) =>
169
- fs.writeFileSync(
170
- htmlFilePath,
171
- webHtmlFrame(jsfilePath, htmlFilePath)
172
- )
173
- );
174
- }
175
- )
176
- )
177
- );
178
-
179
- const [nodeEntryPoints, webEntryPoints] = getRunnables(this.config.tests);
180
-
181
- glob(`./${this.config.outdir}/chunk-*.mjs`, {
182
- ignore: "node_modules/**",
183
- }).then((chunks) => {
184
- chunks.forEach((chunk) => {
185
- fs.unlinkSync(chunk);
186
- });
187
- });
188
-
189
- Promise.all([
190
- compile(),
191
-
192
- esbuild
193
- .context(esbuildNodeConfiger(this.config, nodeEntryPoints))
194
- .then(async (nodeContext) => {
195
- if (this.config.devMode) {
196
- await nodeContext.watch().then((v) => {
197
- this.onNodeDone();
198
- });
199
- } else {
200
- nodeContext.rebuild().then((v) => {
201
- this.onNodeDone();
202
- });
203
- }
204
-
205
- return nodeContext;
206
- }),
207
- esbuild
208
- .context(esbuildWebConfiger(this.config, webEntryPoints))
209
- .then(async (webContext) => {
210
- if (this.config.devMode) {
211
- await webContext.watch().then((v) => {
212
- this.onWebDone();
213
- });
214
- } else {
215
- webContext.rebuild().then((v) => {
216
- this.onWebDone();
217
- });
218
- }
219
- return webContext;
220
- }),
221
- ]);
222
- }
223
-
224
- onNodeDone = () => {
225
- this.nodeDone = true;
226
- this.onDone();
227
- };
228
- onWebDone = () => {
229
- this.webDone = true;
230
- this.onDone();
231
- };
232
-
233
- onDone = () => {
234
- // console.log(this.nodeDone && this.webDone && this.mode === "PROD");
235
- if (this.nodeDone && this.webDone && this.mode === "PROD") {
236
- console.log("Testeranto-EsBuild is all done. Goodbye!");
237
- process.exit();
238
- } else {
239
- if (this.mode === "PROD") {
240
- console.log("waiting for tests to finish");
241
- console.log(
242
- JSON.stringify(
243
- {
244
- nodeDone: this.nodeDone,
245
- webDone: this.webDone,
246
- mode: this.mode,
247
- },
248
- null,
249
- 2
250
- )
251
- );
252
- } else {
253
- console.log("waiting for tests to change");
254
- }
255
- console.log("press 'q' to quit");
256
- }
257
- };
258
-
259
- public getSecondaryEndpointsPoints(runtime?: IRunTime): string[] {
260
- const meta = (ts: ITestTypes[], st: Set<string>): Set<string> => {
261
- ts.forEach((t) => {
262
- if (t[1] === runtime) {
263
- st.add(t[0]);
264
- }
265
- if (Array.isArray(t[3])) {
266
- meta(t[3], st);
267
- }
268
- });
269
- return st;
270
- };
271
- return Array.from(meta(this.config.tests, new Set()));
272
- }
273
- }
274
-
275
- const getRunnables = (
276
- tests: ITestTypes[],
277
- payload = [new Set<string>(), new Set<string>()]
278
- ): [Set<string>, Set<string>] => {
279
- return tests.reduce((pt, cv, cndx, cry) => {
280
- if (cv[1] === "node") {
281
- pt[0].add(cv[0]);
282
- } else if (cv[1] === "web") {
283
- pt[1].add(cv[0]);
284
- }
285
-
286
- if (cv[3].length) {
287
- getRunnables(cv[3], payload);
288
- }
289
-
290
- return pt;
291
- }, payload as [Set<string>, Set<string>]);
292
- };
package/src/Puppeteer.ts DELETED
@@ -1,143 +0,0 @@
1
- import readline from "readline";
2
- import fs from "fs";
3
- import watch from "recursive-watch";
4
-
5
- import { PM_Main } from "./PM/main.js";
6
- import { destinationOfRuntime } from "./utils.js";
7
- import { IBaseConfig, IBuiltConfig } from "./lib/types.js";
8
-
9
- readline.emitKeypressEvents(process.stdin);
10
- if (process.stdin.isTTY) process.stdin.setRawMode(true);
11
-
12
- export default async (partialConfig) => {
13
- const config: IBuiltConfig = {
14
- ...partialConfig,
15
- buildDir: process.cwd() + "/" + partialConfig.outdir,
16
- };
17
-
18
- fs.writeFileSync(
19
- `${config.outdir}/testeranto.json`,
20
- JSON.stringify(
21
- {
22
- ...config,
23
- buildDir: process.cwd() + "/" + config.outdir,
24
- },
25
- null,
26
- 2
27
- )
28
- );
29
-
30
- const pm = new PM_Main(config);
31
-
32
- await pm.startPuppeteer(
33
- {
34
- // timeout: 1,
35
- waitForInitialPage: false,
36
- executablePath:
37
- // process.env.CHROMIUM_PATH || "/opt/homebrew/bin/chromium",
38
- "/opt/homebrew/bin/chromium",
39
- headless: true,
40
- dumpio: true,
41
- // timeout: 0,
42
- devtools: true,
43
- args: [
44
- "--auto-open-devtools-for-tabs",
45
- `--remote-debugging-port=3234`,
46
-
47
- // "--disable-features=IsolateOrigins,site-per-process",
48
- "--disable-site-isolation-trials",
49
- "--allow-insecure-localhost",
50
- "--allow-file-access-from-files",
51
- "--allow-running-insecure-content",
52
-
53
- "--disable-dev-shm-usage",
54
- "--disable-extensions",
55
- "--disable-gpu",
56
- "--disable-setuid-sandbox",
57
- "--disable-site-isolation-trials",
58
- "--disable-web-security",
59
- "--no-first-run",
60
- "--no-sandbox",
61
- "--no-startup-window",
62
- // "--no-zygote",
63
- "--reduce-security-for-testing",
64
- "--remote-allow-origins=*",
65
- "--unsafely-treat-insecure-origin-as-secure=*",
66
- // "--disable-features=IsolateOrigins",
67
- // "--remote-allow-origins=ws://localhost:3234",
68
- // "--single-process",
69
- // "--unsafely-treat-insecure-origin-as-secure",
70
- // "--unsafely-treat-insecure-origin-as-secure=ws://192.168.0.101:3234",
71
-
72
- // "--disk-cache-dir=/dev/null",
73
- // "--disk-cache-size=1",
74
- // "--start-maximized",
75
- ],
76
- },
77
- "."
78
- );
79
-
80
- console.log(
81
- "\n Puppeteer is running. Press 'q' to shutdown softly. Press 'x' to shutdown forcefully.\n"
82
- );
83
- process.stdin.on("keypress", (str, key) => {
84
- if (key.name === "q") {
85
- pm.shutDown();
86
- }
87
- if (key.name === "x") {
88
- process.exit(-1);
89
- }
90
- });
91
-
92
- config.tests.forEach(([test, runtime, tr, sidecars]) => {
93
- if (runtime === "node") {
94
- pm.launchNode(test, destinationOfRuntime(test, "node", config));
95
- } else if (runtime === "web") {
96
- pm.launchWeb(test, destinationOfRuntime(test, "web", config), sidecars);
97
- } else {
98
- console.error("runtime makes no sense", runtime);
99
- }
100
- });
101
-
102
- if (config.devMode) {
103
- console.log("ready and watching for changes...", config.buildDir);
104
-
105
- watch(config.buildDir, (eventType, changedFile) => {
106
- if (changedFile) {
107
- config.tests.forEach(([test, runtime, tr, sidecars]) => {
108
- if (eventType === "change" || eventType === "rename") {
109
- if (
110
- changedFile ===
111
- test
112
- .replace("./", "node/")
113
- .split(".")
114
- .slice(0, -1)
115
- .concat("mjs")
116
- .join(".")
117
- ) {
118
- pm.launchNode(test, destinationOfRuntime(test, "node", config));
119
- }
120
-
121
- if (
122
- changedFile ===
123
- test
124
- .replace("./", "web/")
125
- .split(".")
126
- .slice(0, -1)
127
- .concat("mjs")
128
- .join(".")
129
- ) {
130
- pm.launchWeb(
131
- test,
132
- destinationOfRuntime(test, "web", config),
133
- sidecars
134
- );
135
- }
136
- }
137
- });
138
- }
139
- });
140
- } else {
141
- pm.shutDown();
142
- }
143
- };
@@ -1,12 +0,0 @@
1
- import process from "process";
2
-
3
- import { ITProject } from "./Project";
4
-
5
- if (!process.argv[2]) {
6
- console.log("You didn't pass a config file");
7
- process.exit(-1);
8
- } else {
9
- import(process.cwd() + "/" + process.argv[2]).then((module) => {
10
- new ITProject(module.default);
11
- });
12
- }
@@ -1,17 +0,0 @@
1
- import { BuildOptions } from "esbuild";
2
- import { IBaseConfig } from "../lib/types";
3
-
4
- export default (config: IBaseConfig): BuildOptions => {
5
- return {
6
- bundle: true,
7
- entryPoints: [config.features],
8
- minify: config.minify === true,
9
- outbase: config.outbase,
10
- write: true,
11
-
12
- outfile: `${config.outdir}/features.test.js`,
13
- // external: ["graphology"],
14
-
15
- format: "esm",
16
- };
17
- };
@@ -1,15 +0,0 @@
1
- // import { BuildOptions } from "esbuild";
2
-
3
- // import { IBaseConfig } from "../lib/types";
4
-
5
- // export default (config: IBaseConfig): BuildOptions => {
6
- // return {
7
- // bundle: true,
8
- // entryPoints: ["./node_modules/testeranto/dist/module/report.js"],
9
- // minify: config.minify === true,
10
- // outbase: config.outbase,
11
- // write: true,
12
- // outfile: `${config.outdir}/report.js`,
13
- // external: ["tests.json", "features.test.js"],
14
- // };
15
- // };
@@ -1,14 +0,0 @@
1
- import { BuildOptions } from "esbuild";
2
- import { IBaseConfig } from "../lib/types";
3
-
4
- export default (config: IBaseConfig): BuildOptions => {
5
- return {
6
- bundle: true,
7
- entryPoints: [config.features],
8
- minify: config.minify === true,
9
- outbase: config.outbase,
10
- write: true,
11
- outfile: `${config.outdir}/tests.test.js`,
12
- // external: ["graphology"]
13
- };
14
- };
package/src/run-tests.ts DELETED
@@ -1,12 +0,0 @@
1
- import Puppeteer from "./Puppeteer.js";
2
-
3
- import process from "process";
4
-
5
- if (!process.argv[2]) {
6
- console.log("You didn't pass a config file");
7
- process.exit(-1);
8
- } else {
9
- import(process.cwd() + "/" + process.argv[2]).then((module) => {
10
- Puppeteer(module.default);
11
- });
12
- }
File without changes
File without changes