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
@@ -1,136 +0,0 @@
1
- import fs from "fs";
2
- import { spawn } from "child_process";
3
- export const execCommand = async (command) => {
4
- const ls = spawn(command.split(" ")[0], command.split(" ").slice(1, -1));
5
- process.stdin.pipe(ls.stdin);
6
- ls.stdout.pipe(process.stdout);
7
- ls.stderr.pipe(process.stdout);
8
- // ls.stdout.on("data", function (data) {
9
- // console.log("stdout: " + data.toString());
10
- // });
11
- // ls.stderr.on("data", function (data) {
12
- // console.log("stderr: " + data.toString());
13
- // });
14
- ls.on("exit", function (code) {
15
- console.log("child process exited with code " + (code === null || code === void 0 ? void 0 : code.toString()) || -1);
16
- });
17
- // return new Promise<void>((resolve, reject) => {
18
- // const [cmd, ...args] = command.split(" ");
19
- // const childProcess = spawn(cmd, args);
20
- // childProcess.stdout.on("data", (data) => {
21
- // process.stdout.write(data.toString());
22
- // });
23
- // childProcess.stderr.on("data", (data) => {
24
- // process.stderr.write(data.toString());
25
- // });
26
- // childProcess.on("error", (error) => {
27
- // reject(error);
28
- // });
29
- // childProcess.on("exit", (code) => {
30
- // if (code === 0) {
31
- // resolve();
32
- // } else {
33
- // reject(new Error(`Command exited with code ${code}.`));
34
- // }
35
- // });
36
- // });
37
- };
38
- const key = process.argv[2];
39
- console.log(key);
40
- const exitcode = fs.readFileSync(`${key}/exitcode`).toString();
41
- console.log("exitcode", exitcode);
42
- // if (exitcode != "0") {
43
- if (exitcode != "0") {
44
- const inputFiles = JSON.parse(fs.readFileSync(`${key}/inputFiles.json`).toString());
45
- inputFiles.push(`${key}/tests.json`);
46
- // const features = await await Promise.all(
47
- // Array.from(
48
- // new Set(
49
- // JSON.parse(fs.readFileSync(`${key}/tests.json`).toString())
50
- // .givens.reduce((mm: any[], lm: { features: any[] }) => {
51
- // mm.push(
52
- // lm.features.reduce((mm2: any[], lm2: any) => {
53
- // mm2.push(lm2);
54
- // return mm2;
55
- // }, [])
56
- // );
57
- // return mm;
58
- // }, [])
59
- // .flat()
60
- // .flat()
61
- // )
62
- // ) as string[]
63
- // );
64
- // const final = features.reduce((mm, [k, v], ndx) => {
65
- // mm[k] = v;
66
- // return mm;
67
- // }, {});
68
- // const as = JSON.stringify(final);
69
- // const scriptCommand = `aider --model deepseek --api-key deepseek=${
70
- // process.env.DEEPSEEK_KEY
71
- // } --message "Fix the failing tests" --read ${key}/inputFiles.json ${inputFiles
72
- // .map((i) => `--file ${i}`)
73
- // .join(" ")}`;
74
- const scriptCommand = `aider --message "Fix the failing tests" --model deepseek --api-key deepseek=${process.env.DEEPSEEK_KEY} --file ./${inputFiles.join(" ./")}`;
75
- console.log("scriptCommand", scriptCommand);
76
- execCommand(scriptCommand);
77
- // fs.writeFile(`./${key}/features.json`, as, () => {
78
- // inputFiles.push(`./${key}/features.json`);
79
- // // itermTab(scriptCommand).then(() => console.log("yay"));
80
- // // const child = spawn("xterm -e", scriptCommand.split(" "), {
81
- // // detached: true,
82
- // // stdio: "ignore",
83
- // // });
84
- // // runCommandInITerm(scriptCommand);
85
- // });
86
- // .reduce(async (mm, feature) => {
87
- // const req = await octokit.request(
88
- // `GET /repos/adamwong246/kokomobay-taskman/contents/Task/${feature}.json`,
89
- // {
90
- // owner: "adamwong246",
91
- // repo: "kokomoBay-taskman",
92
- // path: `Task/${feature}.json`,
93
- // headers: {
94
- // "X-GitHub-Api-Version": "2022-11-28",
95
- // },
96
- // }
97
- // );
98
- // const j = JSON.parse(atob(req.data.content));
99
- // (await mm).push([
100
- // feature,
101
- // JSON.stringify({
102
- // name: j.name,
103
- // body: j.body,
104
- // }),
105
- // ]);
106
- // return mm;
107
- // }, Promise.resolve<[string, string][]>([]))
108
- // .then((z) => {
109
- // const final = z.reduce((mm, [k, v], ndx) => {
110
- // mm[k] = v;
111
- // return mm;
112
- // }, {});
113
- // const as = JSON.stringify(final);
114
- // fs.writeFile(`./${key}/features.json`, as, () => {
115
- // inputFiles.push(`./${key}/features.json`);
116
- // const scriptCommand = `aider --model deepseek --api-key deepseek=${
117
- // process.env.DEEPSEEK_KEY
118
- // } --message "Fix the failing tests" ${inputFiles.join(" ")}`;
119
- // console.log("scriptCommand", scriptCommand);
120
- // execCommand(scriptCommand);
121
- // // itermTab(scriptCommand).then(() => console.log("yay"));
122
- // // const child = spawn("xterm -e", scriptCommand.split(" "), {
123
- // // detached: true,
124
- // // stdio: "ignore",
125
- // // });
126
- // // runCommandInITerm(scriptCommand);
127
- // });
128
- // //
129
- // });
130
- // features.then((x) => {
131
- // console.log("done", x);
132
- // });
133
- }
134
- else {
135
- console.log("that test is not failing");
136
- }
@@ -1,220 +0,0 @@
1
- import { spawn } from "child_process";
2
- import esbuild from "esbuild";
3
- import fs from "fs";
4
- import path from "path";
5
- import readline from "readline";
6
- import { glob } from "glob";
7
- import esbuildNodeConfiger from "./esbuildConfigs/node.js";
8
- import esbuildWebConfiger from "./esbuildConfigs/web.js";
9
- import webHtmlFrame from "./web.html.js";
10
- readline.emitKeypressEvents(process.stdin);
11
- if (process.stdin.isTTY)
12
- process.stdin.setRawMode(true);
13
- const logContent = [];
14
- function parseTsErrors() {
15
- try {
16
- // const logContent = fs.readFileSync(logPath, "utf-8").split("\n");
17
- const regex = /(^src(.*?))\(\d*,\d*\): error/gm;
18
- const brokenFilesToLines = {};
19
- for (let i = 0; i < logContent.length - 1; i++) {
20
- let m;
21
- while ((m = regex.exec(logContent[i])) !== null) {
22
- // This is necessary to avoid infinite loops with zero-width matches
23
- if (m.index === regex.lastIndex) {
24
- regex.lastIndex++;
25
- }
26
- if (!brokenFilesToLines[m[1]]) {
27
- brokenFilesToLines[m[1]] = new Set();
28
- }
29
- brokenFilesToLines[m[1]].add(i);
30
- }
31
- }
32
- const final = Object.keys(brokenFilesToLines).reduce((mm, lm, ndx) => {
33
- mm[lm] = Array.from(brokenFilesToLines[lm]).map((l, ndx3) => {
34
- const a = Array.from(brokenFilesToLines[lm]);
35
- return Object.keys(a).reduce((mm2, lm2, ndx2) => {
36
- const acc = [];
37
- let j = a[lm2] + 1;
38
- let working = true;
39
- while (j < logContent.length - 1 && working) {
40
- if (!logContent[j].match(regex) &&
41
- working &&
42
- !logContent[j].match(/^..\/(.*?)\(\d*,\d*\)/)) {
43
- acc.push(logContent[j]);
44
- }
45
- else {
46
- working = false;
47
- }
48
- j++;
49
- }
50
- mm2[lm] = [logContent[l], ...acc];
51
- return mm2;
52
- }, {})[lm];
53
- });
54
- return mm;
55
- }, {});
56
- Object.keys(final).forEach((k) => {
57
- fs.mkdirSync(`./docs/types/${k.split("/").slice(0, -1).join("/")}`, {
58
- recursive: true,
59
- });
60
- fs.writeFileSync(`./docs/types/${k}.type_errors.txt`, final[k].flat().flat().join("\r\n"));
61
- });
62
- }
63
- catch (error) {
64
- console.error("Error reading or parsing the log file:", error);
65
- process.exit(1);
66
- }
67
- }
68
- const compile = () => {
69
- return new Promise((resolve, reject) => {
70
- const tsc = spawn("tsc", ["-noEmit"]);
71
- tsc.stdout.on("data", (data) => {
72
- // console.log(`tsc stdout: ${data}`);
73
- const lines = data.toString().split("\n");
74
- logContent.push(...lines);
75
- });
76
- tsc.stderr.on("data", (data) => {
77
- console.error(`stderr: ${data}`);
78
- process.exit(-1);
79
- });
80
- tsc.on("close", (code) => {
81
- parseTsErrors();
82
- console.log("tsc done");
83
- resolve(`tsc process exited with code ${code}`);
84
- // if (code !== 0) {
85
- // resolve(`tsc process exited with code ${code}`);
86
- // // reject(`tsc process exited with code ${code}`);
87
- // } else {
88
- // resolve({});
89
- // }
90
- });
91
- });
92
- };
93
- export class ITProject {
94
- constructor(configs) {
95
- this.nodeDone = false;
96
- this.webDone = false;
97
- this.onNodeDone = () => {
98
- this.nodeDone = true;
99
- this.onDone();
100
- };
101
- this.onWebDone = () => {
102
- this.webDone = true;
103
- this.onDone();
104
- };
105
- this.onDone = () => {
106
- // console.log(this.nodeDone && this.webDone && this.mode === "PROD");
107
- if (this.nodeDone && this.webDone && this.mode === "PROD") {
108
- console.log("Testeranto-EsBuild is all done. Goodbye!");
109
- process.exit();
110
- }
111
- else {
112
- if (this.mode === "PROD") {
113
- console.log("waiting for tests to finish");
114
- console.log(JSON.stringify({
115
- nodeDone: this.nodeDone,
116
- webDone: this.webDone,
117
- mode: this.mode,
118
- }, null, 2));
119
- }
120
- else {
121
- console.log("waiting for tests to change");
122
- }
123
- console.log("press 'q' to quit");
124
- }
125
- };
126
- this.config = configs;
127
- this.mode = this.config.devMode ? "DEV" : "PROD";
128
- process.stdin.on("keypress", (str, key) => {
129
- if (key.name === "q") {
130
- console.log("Testeranto-EsBuild is shutting down...");
131
- this.mode = "PROD";
132
- this.onDone();
133
- }
134
- });
135
- fs.writeFileSync(`${this.config.outdir}/testeranto.json`, JSON.stringify(Object.assign(Object.assign({}, this.config), { buildDir: process.cwd() + "/" + this.config.outdir }), null, 2));
136
- Promise.resolve(Promise.all([...this.getSecondaryEndpointsPoints("web")].map(async (sourceFilePath) => {
137
- const sourceFileSplit = sourceFilePath.split("/");
138
- const sourceDir = sourceFileSplit.slice(0, -1);
139
- const sourceFileName = sourceFileSplit[sourceFileSplit.length - 1];
140
- const sourceFileNameMinusJs = sourceFileName
141
- .split(".")
142
- .slice(0, -1)
143
- .join(".");
144
- const htmlFilePath = path.normalize(`${process.cwd()}/${this.config.outdir}/web/${sourceDir.join("/")}/${sourceFileNameMinusJs}.html`);
145
- const jsfilePath = `./${sourceFileNameMinusJs}.mjs`;
146
- return fs.promises
147
- .mkdir(path.dirname(htmlFilePath), { recursive: true })
148
- .then((x) => fs.writeFileSync(htmlFilePath, webHtmlFrame(jsfilePath, htmlFilePath)));
149
- })));
150
- const [nodeEntryPoints, webEntryPoints] = getRunnables(this.config.tests);
151
- glob(`./${this.config.outdir}/chunk-*.mjs`, {
152
- ignore: "node_modules/**",
153
- }).then((chunks) => {
154
- chunks.forEach((chunk) => {
155
- fs.unlinkSync(chunk);
156
- });
157
- });
158
- Promise.all([
159
- compile(),
160
- esbuild
161
- .context(esbuildNodeConfiger(this.config, nodeEntryPoints))
162
- .then(async (nodeContext) => {
163
- if (this.config.devMode) {
164
- await nodeContext.watch().then((v) => {
165
- this.onNodeDone();
166
- });
167
- }
168
- else {
169
- nodeContext.rebuild().then((v) => {
170
- this.onNodeDone();
171
- });
172
- }
173
- return nodeContext;
174
- }),
175
- esbuild
176
- .context(esbuildWebConfiger(this.config, webEntryPoints))
177
- .then(async (webContext) => {
178
- if (this.config.devMode) {
179
- await webContext.watch().then((v) => {
180
- this.onWebDone();
181
- });
182
- }
183
- else {
184
- webContext.rebuild().then((v) => {
185
- this.onWebDone();
186
- });
187
- }
188
- return webContext;
189
- }),
190
- ]);
191
- }
192
- getSecondaryEndpointsPoints(runtime) {
193
- const meta = (ts, st) => {
194
- ts.forEach((t) => {
195
- if (t[1] === runtime) {
196
- st.add(t[0]);
197
- }
198
- if (Array.isArray(t[3])) {
199
- meta(t[3], st);
200
- }
201
- });
202
- return st;
203
- };
204
- return Array.from(meta(this.config.tests, new Set()));
205
- }
206
- }
207
- const getRunnables = (tests, payload = [new Set(), new Set()]) => {
208
- return tests.reduce((pt, cv, cndx, cry) => {
209
- if (cv[1] === "node") {
210
- pt[0].add(cv[0]);
211
- }
212
- else if (cv[1] === "web") {
213
- pt[1].add(cv[0]);
214
- }
215
- if (cv[3].length) {
216
- getRunnables(cv[3], payload);
217
- }
218
- return pt;
219
- }, payload);
220
- };
@@ -1,106 +0,0 @@
1
- import readline from "readline";
2
- import fs from "fs";
3
- import watch from "recursive-watch";
4
- import { PM_Main } from "./PM/main.js";
5
- import { destinationOfRuntime } from "./utils.js";
6
- readline.emitKeypressEvents(process.stdin);
7
- if (process.stdin.isTTY)
8
- process.stdin.setRawMode(true);
9
- export default async (partialConfig) => {
10
- const config = Object.assign(Object.assign({}, partialConfig), { buildDir: process.cwd() + "/" + partialConfig.outdir });
11
- fs.writeFileSync(`${config.outdir}/testeranto.json`, JSON.stringify(Object.assign(Object.assign({}, config), { buildDir: process.cwd() + "/" + config.outdir }), null, 2));
12
- const pm = new PM_Main(config);
13
- await pm.startPuppeteer({
14
- // timeout: 1,
15
- waitForInitialPage: false,
16
- executablePath:
17
- // process.env.CHROMIUM_PATH || "/opt/homebrew/bin/chromium",
18
- "/opt/homebrew/bin/chromium",
19
- headless: true,
20
- dumpio: true,
21
- // timeout: 0,
22
- devtools: true,
23
- args: [
24
- "--auto-open-devtools-for-tabs",
25
- `--remote-debugging-port=3234`,
26
- // "--disable-features=IsolateOrigins,site-per-process",
27
- "--disable-site-isolation-trials",
28
- "--allow-insecure-localhost",
29
- "--allow-file-access-from-files",
30
- "--allow-running-insecure-content",
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
- "--no-first-run",
38
- "--no-sandbox",
39
- "--no-startup-window",
40
- // "--no-zygote",
41
- "--reduce-security-for-testing",
42
- "--remote-allow-origins=*",
43
- "--unsafely-treat-insecure-origin-as-secure=*",
44
- // "--disable-features=IsolateOrigins",
45
- // "--remote-allow-origins=ws://localhost:3234",
46
- // "--single-process",
47
- // "--unsafely-treat-insecure-origin-as-secure",
48
- // "--unsafely-treat-insecure-origin-as-secure=ws://192.168.0.101:3234",
49
- // "--disk-cache-dir=/dev/null",
50
- // "--disk-cache-size=1",
51
- // "--start-maximized",
52
- ],
53
- }, ".");
54
- console.log("\n Puppeteer is running. Press 'q' to shutdown softly. Press 'x' to shutdown forcefully.\n");
55
- process.stdin.on("keypress", (str, key) => {
56
- if (key.name === "q") {
57
- pm.shutDown();
58
- }
59
- if (key.name === "x") {
60
- process.exit(-1);
61
- }
62
- });
63
- config.tests.forEach(([test, runtime, tr, sidecars]) => {
64
- if (runtime === "node") {
65
- pm.launchNode(test, destinationOfRuntime(test, "node", config));
66
- }
67
- else if (runtime === "web") {
68
- pm.launchWeb(test, destinationOfRuntime(test, "web", config), sidecars);
69
- }
70
- else {
71
- console.error("runtime makes no sense", runtime);
72
- }
73
- });
74
- if (config.devMode) {
75
- console.log("ready and watching for changes...", config.buildDir);
76
- watch(config.buildDir, (eventType, changedFile) => {
77
- if (changedFile) {
78
- config.tests.forEach(([test, runtime, tr, sidecars]) => {
79
- if (eventType === "change" || eventType === "rename") {
80
- if (changedFile ===
81
- test
82
- .replace("./", "node/")
83
- .split(".")
84
- .slice(0, -1)
85
- .concat("mjs")
86
- .join(".")) {
87
- pm.launchNode(test, destinationOfRuntime(test, "node", config));
88
- }
89
- if (changedFile ===
90
- test
91
- .replace("./", "web/")
92
- .split(".")
93
- .slice(0, -1)
94
- .concat("mjs")
95
- .join(".")) {
96
- pm.launchWeb(test, destinationOfRuntime(test, "web", config), sidecars);
97
- }
98
- }
99
- });
100
- }
101
- });
102
- }
103
- else {
104
- pm.shutDown();
105
- }
106
- };
@@ -1,11 +0,0 @@
1
- import process from "process";
2
- import { ITProject } from "./Project";
3
- if (!process.argv[2]) {
4
- console.log("You didn't pass a config file");
5
- process.exit(-1);
6
- }
7
- else {
8
- import(process.cwd() + "/" + process.argv[2]).then((module) => {
9
- new ITProject(module.default);
10
- });
11
- }
@@ -1,12 +0,0 @@
1
- export default (config) => {
2
- return {
3
- bundle: true,
4
- entryPoints: [config.features],
5
- minify: config.minify === true,
6
- outbase: config.outbase,
7
- write: true,
8
- outfile: `${config.outdir}/features.test.js`,
9
- // external: ["graphology"],
10
- format: "esm",
11
- };
12
- };
@@ -1,14 +0,0 @@
1
- "use strict";
2
- // import { BuildOptions } from "esbuild";
3
- // import { IBaseConfig } from "../lib/types";
4
- // export default (config: IBaseConfig): BuildOptions => {
5
- // return {
6
- // bundle: true,
7
- // entryPoints: ["./node_modules/testeranto/dist/module/report.js"],
8
- // minify: config.minify === true,
9
- // outbase: config.outbase,
10
- // write: true,
11
- // outfile: `${config.outdir}/report.js`,
12
- // external: ["tests.json", "features.test.js"],
13
- // };
14
- // };
@@ -1,11 +0,0 @@
1
- export default (config) => {
2
- return {
3
- bundle: true,
4
- entryPoints: [config.features],
5
- minify: config.minify === true,
6
- outbase: config.outbase,
7
- write: true,
8
- outfile: `${config.outdir}/tests.test.js`,
9
- // external: ["graphology"]
10
- };
11
- };
@@ -1,11 +0,0 @@
1
- import Puppeteer from "./Puppeteer.js";
2
- import process from "process";
3
- if (!process.argv[2]) {
4
- console.log("You didn't pass a config file");
5
- process.exit(-1);
6
- }
7
- else {
8
- import(process.cwd() + "/" + process.argv[2]).then((module) => {
9
- Puppeteer(module.default);
10
- });
11
- }