testeranto 0.114.1 → 0.121.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/README.md +6 -1
- package/bundle.js +1 -1
- package/dist/common/Init.js +55 -61
- package/dist/common/PM/base.js +233 -0
- package/dist/common/PM/main.js +217 -434
- package/dist/common/build.js +113 -92
- package/dist/common/defaultConfig.js +2 -2
- package/dist/common/esbuildConfigs/index.js +1 -1
- package/dist/common/esbuildConfigs/inputFilesPlugin.js +7 -3
- package/dist/common/esbuildConfigs/node.js +5 -3
- package/dist/common/esbuildConfigs/web.js +3 -3
- package/dist/common/init-docs.js +2 -46
- package/dist/common/lib/abstractBase.js +60 -54
- package/dist/common/lib/basebuilder.js +7 -8
- package/dist/common/lib/classBuilder.js +8 -5
- package/dist/common/lib/core.js +6 -18
- package/dist/common/lib/index.js +6 -1
- package/dist/common/run.js +10 -2
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/common/utils.js +9 -21
- package/dist/module/Init.js +55 -61
- package/dist/module/PM/base.js +226 -0
- package/dist/module/PM/main.js +218 -435
- package/dist/module/Project.js +117 -0
- package/dist/module/TestReport.js +13 -4
- package/dist/module/build.js +113 -92
- package/dist/module/defaultConfig.js +2 -2
- package/dist/module/esbuildConfigs/index.js +1 -1
- package/dist/module/esbuildConfigs/inputFilesPlugin.js +7 -3
- package/dist/module/esbuildConfigs/node.js +5 -3
- package/dist/module/esbuildConfigs/web.js +3 -3
- package/dist/module/init-docs.js +2 -13
- package/dist/module/lib/abstractBase.js +60 -54
- package/dist/module/lib/basebuilder.js +7 -8
- package/dist/module/lib/classBuilder.js +8 -5
- package/dist/module/lib/core.js +6 -18
- package/dist/module/lib/index.js +6 -1
- package/dist/module/run.js +10 -2
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/module/utils.js +8 -17
- package/dist/prebuild/Project.css +11367 -0
- package/dist/prebuild/Project.js +24640 -0
- package/dist/prebuild/ReportClient.js +1 -1
- package/dist/prebuild/TestReport.js +9 -11
- package/dist/prebuild/build.mjs +142 -81
- package/dist/prebuild/init-docs.mjs +28 -83
- package/dist/prebuild/run.mjs +618 -537
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/Init.d.ts +1 -1
- package/dist/types/PM/base.d.ts +38 -0
- package/dist/types/PM/main.d.ts +20 -44
- package/dist/types/esbuildConfigs/inputFilesPlugin.d.ts +1 -1
- package/dist/types/esbuildConfigs/node.d.ts +1 -1
- package/dist/types/esbuildConfigs/web.d.ts +1 -1
- package/dist/types/lib/abstractBase.d.ts +19 -11
- package/dist/types/lib/basebuilder.d.ts +1 -2
- package/dist/types/lib/index.d.ts +3 -3
- package/dist/types/lib/types.d.ts +2 -5
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/utils.d.ts +4 -7
- package/package.json +6 -5
- package/src/Init.ts +60 -68
- package/src/PM/base.ts +301 -0
- package/src/PM/main.ts +276 -567
- package/src/Project.tsx +197 -0
- package/src/ReportClient.tsx +1 -1
- package/src/TestReport.tsx +30 -15
- package/src/build.ts +140 -104
- package/src/defaultConfig.ts +2 -2
- package/src/esbuildConfigs/index.ts +1 -1
- package/src/esbuildConfigs/inputFilesPlugin.ts +7 -6
- package/src/esbuildConfigs/node.ts +5 -3
- package/src/esbuildConfigs/web.ts +4 -3
- package/src/init-docs.ts +2 -15
- package/src/lib/abstractBase.ts +113 -93
- package/src/lib/basebuilder.ts +8 -9
- package/src/lib/classBuilder.ts +11 -10
- package/src/lib/core.ts +15 -27
- package/src/lib/index.ts +13 -6
- package/src/lib/types.ts +3 -8
- package/src/run.ts +21 -5
- package/src/utils.ts +27 -39
- package/tsc.log +12 -23
- package/dist/common/puppeteerConfiger.js +0 -24
- package/dist/module/puppeteerConfiger.js +0 -19
- package/dist/types/puppeteerConfiger.d.ts +0 -4
- package/src/puppeteerConfiger.ts +0 -26
|
@@ -24532,7 +24532,7 @@
|
|
|
24532
24532
|
const [configs, setConfigs] = (0, import_react3.useState)();
|
|
24533
24533
|
(0, import_react3.useEffect)(() => {
|
|
24534
24534
|
(async () => {
|
|
24535
|
-
fetch(
|
|
24535
|
+
fetch(`/kokomoBay/testeranto/reports${t}/config.json`).then((response) => response.json()).then((json) => {
|
|
24536
24536
|
setConfigs(json);
|
|
24537
24537
|
}).catch((error) => console.error(error));
|
|
24538
24538
|
})();
|
|
@@ -27365,29 +27365,27 @@
|
|
|
27365
27365
|
return /* @__PURE__ */ import_react33.default.createElement("div", null, /* @__PURE__ */ import_react33.default.createElement("pre", null, /* @__PURE__ */ import_react33.default.createElement("code", null, JSON.stringify(step, null, 2))));
|
|
27366
27366
|
};
|
|
27367
27367
|
var TestPane = ({ given }) => {
|
|
27368
|
-
return /* @__PURE__ */ import_react33.default.createElement("div", null, " ", /* @__PURE__ */ import_react33.default.createElement(Tab_default.Container, { id: "TestPane-tabs", defaultActiveKey: "first" }, /* @__PURE__ */ import_react33.default.createElement(Row_default, null, /* @__PURE__ */ import_react33.default.createElement(Col_default, { sm: 3 }, /* @__PURE__ */ import_react33.default.createElement(Nav_default2, { variant: "pills", className: "flex-column" }, /* @__PURE__ */ import_react33.default.createElement(Nav_default2.Item, null, /* @__PURE__ */ import_react33.default.createElement(Nav_default2.Link, { eventKey: `bdd-features` }, "features"), ...given.whens.map((w, ndx) => /* @__PURE__ */ import_react33.default.createElement(Nav_default2.Link, { eventKey: `bdd-when-${ndx}` }, "When ", w.name, " ", w.error && "!")), ...given.thens.map((t, ndx) => /* @__PURE__ */ import_react33.default.createElement(Nav_default2.Link, { eventKey: `bdd-then-${ndx}` }, "Then ", t.name, " ", t.error && "!")), /* @__PURE__ */ import_react33.default.createElement(Nav_default2.Link, { eventKey: `bdd-errors` }, "errors")))), /* @__PURE__ */ import_react33.default.createElement(Col_default, { sm:
|
|
27368
|
+
return /* @__PURE__ */ import_react33.default.createElement("div", null, " ", /* @__PURE__ */ import_react33.default.createElement(Tab_default.Container, { id: "TestPane-tabs", defaultActiveKey: "first" }, /* @__PURE__ */ import_react33.default.createElement(Row_default, null, /* @__PURE__ */ import_react33.default.createElement(Col_default, { sm: 3 }, /* @__PURE__ */ import_react33.default.createElement(Nav_default2, { variant: "pills", className: "flex-column" }, /* @__PURE__ */ import_react33.default.createElement(Nav_default2.Item, null, /* @__PURE__ */ import_react33.default.createElement(Nav_default2.Link, { eventKey: `bdd-features` }, "features"), ...given.whens.map((w, ndx) => /* @__PURE__ */ import_react33.default.createElement(Nav_default2.Link, { eventKey: `bdd-when-${ndx}` }, "When ", w.name, " ", w.error && "!")), ...given.thens.map((t, ndx) => /* @__PURE__ */ import_react33.default.createElement(Nav_default2.Link, { eventKey: `bdd-then-${ndx}` }, "Then ", t.name, " ", t.error && "!")), /* @__PURE__ */ import_react33.default.createElement(Nav_default2.Link, { eventKey: `bdd-errors` }, "errors")))), /* @__PURE__ */ import_react33.default.createElement(Col_default, { sm: 6 }, /* @__PURE__ */ import_react33.default.createElement(Tab_default.Content, null, /* @__PURE__ */ import_react33.default.createElement(Tab_default.Pane, { eventKey: `bdd-features` }, /* @__PURE__ */ import_react33.default.createElement("pre", null, /* @__PURE__ */ import_react33.default.createElement("code", null, JSON.stringify(given.features, null, 2)))), ...given.whens.map((w, ndx) => /* @__PURE__ */ import_react33.default.createElement(Tab_default.Pane, { eventKey: `bdd-when-${ndx}` }, /* @__PURE__ */ import_react33.default.createElement(StepPane, { step: w }))), ...given.thens.map((t, ndx) => /* @__PURE__ */ import_react33.default.createElement(Tab_default.Pane, { eventKey: `bdd-then-${ndx}` }, /* @__PURE__ */ import_react33.default.createElement(StepPane, { step: t }))), /* @__PURE__ */ import_react33.default.createElement(Tab_default.Pane, { eventKey: `bdd-errors` }, /* @__PURE__ */ import_react33.default.createElement("pre", null, /* @__PURE__ */ import_react33.default.createElement("code", null, JSON.stringify(given.error, null, 2)))))))));
|
|
27369
27369
|
};
|
|
27370
27370
|
var BddPage = () => {
|
|
27371
|
-
const [
|
|
27371
|
+
const [bddErrors, setBddErrors] = (0, import_react33.useState)();
|
|
27372
27372
|
(0, import_react33.useEffect)(() => {
|
|
27373
27373
|
(async () => {
|
|
27374
|
-
fetch(
|
|
27375
|
-
setConfigs(json);
|
|
27376
|
-
}).catch((error) => console.error(error));
|
|
27374
|
+
setBddErrors(await (await fetch(`tests.json`)).json());
|
|
27377
27375
|
})();
|
|
27378
27376
|
}, []);
|
|
27379
|
-
const [
|
|
27377
|
+
const [log, setLog] = (0, import_react33.useState)();
|
|
27380
27378
|
(0, import_react33.useEffect)(() => {
|
|
27381
27379
|
(async () => {
|
|
27382
|
-
|
|
27380
|
+
setLog(await (await fetch(`log.txt`)).text());
|
|
27383
27381
|
})();
|
|
27384
|
-
}, [
|
|
27385
|
-
if (!
|
|
27382
|
+
}, []);
|
|
27383
|
+
if (!bddErrors || !log) {
|
|
27386
27384
|
return /* @__PURE__ */ import_react33.default.createElement("div", null, "loading...");
|
|
27387
27385
|
}
|
|
27388
|
-
return /* @__PURE__ */ import_react33.default.createElement("div", null, " ", /* @__PURE__ */ import_react33.default.createElement(Row_default, null, /* @__PURE__ */ import_react33.default.createElement(Col_default, { sm: 12 }, /* @__PURE__ */ import_react33.default.createElement("h2", null, bddErrors.name))), /* @__PURE__ */ import_react33.default.createElement(Row_default, null, /* @__PURE__ */ import_react33.default.createElement(Tab_default.Container, { id: "root-tab-container", defaultActiveKey: "first" }, /* @__PURE__ */ import_react33.default.createElement(Row_default, null, /* @__PURE__ */ import_react33.default.createElement(Col_default, { sm: 3 }, /* @__PURE__ */ import_react33.default.createElement(Nav_default2, { variant: "pills", className: "flex-column" }, ...bddErrors.givens.map(
|
|
27386
|
+
return /* @__PURE__ */ import_react33.default.createElement("div", null, " ", /* @__PURE__ */ import_react33.default.createElement(Row_default, null, /* @__PURE__ */ import_react33.default.createElement(Col_default, { sm: 12 }, /* @__PURE__ */ import_react33.default.createElement("h2", null, bddErrors.name))), /* @__PURE__ */ import_react33.default.createElement(Row_default, null, /* @__PURE__ */ import_react33.default.createElement(Tab_default.Container, { id: "root-tab-container", defaultActiveKey: "first" }, /* @__PURE__ */ import_react33.default.createElement(Row_default, null, /* @__PURE__ */ import_react33.default.createElement(Col_default, { sm: 3 }, /* @__PURE__ */ import_react33.default.createElement("pre", null, /* @__PURE__ */ import_react33.default.createElement("code", null, log))), /* @__PURE__ */ import_react33.default.createElement(Col_default, { sm: 3 }, /* @__PURE__ */ import_react33.default.createElement(Nav_default2, { variant: "pills", className: "flex-column" }, ...bddErrors.givens.map(
|
|
27389
27387
|
(g) => /* @__PURE__ */ import_react33.default.createElement(Nav_default2.Item, null, /* @__PURE__ */ import_react33.default.createElement(Nav_default2.Link, { eventKey: g.key }, g.key, ": Given ", g.name))
|
|
27390
|
-
))), /* @__PURE__ */ import_react33.default.createElement(Col_default, { sm:
|
|
27388
|
+
))), /* @__PURE__ */ import_react33.default.createElement(Col_default, { sm: 6 }, /* @__PURE__ */ import_react33.default.createElement(Tab_default.Content, null, ...bddErrors.givens.map(
|
|
27391
27389
|
(g) => /* @__PURE__ */ import_react33.default.createElement(Tab_default.Pane, { eventKey: g.key }, /* @__PURE__ */ import_react33.default.createElement(TestPane, { given: g }))
|
|
27392
27390
|
)))))), /* @__PURE__ */ import_react33.default.createElement(Footer, null));
|
|
27393
27391
|
};
|
package/dist/prebuild/build.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createRequire } from 'module';const require = createRequire(import.meta.url);
|
|
2
2
|
|
|
3
3
|
// src/build.ts
|
|
4
|
+
import ansiC from "ansi-colors";
|
|
4
5
|
import fs2 from "fs";
|
|
5
6
|
import path3 from "path";
|
|
6
7
|
import readline from "readline";
|
|
@@ -15,7 +16,7 @@ var esbuildConfigs_default = (config) => {
|
|
|
15
16
|
format: "esm",
|
|
16
17
|
splitting: true,
|
|
17
18
|
outExtension: { ".js": ".mjs" },
|
|
18
|
-
outbase:
|
|
19
|
+
outbase: ".",
|
|
19
20
|
jsx: "transform",
|
|
20
21
|
bundle: true,
|
|
21
22
|
minify: config.minify === true,
|
|
@@ -37,17 +38,19 @@ var register = (entrypoint, sources) => {
|
|
|
37
38
|
}
|
|
38
39
|
sources.forEach((s) => otherInputs[entrypoint].add(s));
|
|
39
40
|
};
|
|
40
|
-
var inputFilesPlugin_default = (platform,
|
|
41
|
+
var inputFilesPlugin_default = (platform, testName2) => {
|
|
42
|
+
const d = `testeranto/bundles/${platform}/${testName2}/`;
|
|
43
|
+
const f = `testeranto/bundles/${platform}/${testName2}/metafile.json`;
|
|
44
|
+
if (!fs.existsSync(d)) {
|
|
45
|
+
fs.mkdirSync(d);
|
|
46
|
+
}
|
|
41
47
|
return {
|
|
42
48
|
register,
|
|
43
49
|
inputFilesPluginFactory: {
|
|
44
50
|
name: "metafileWriter",
|
|
45
51
|
setup(build) {
|
|
46
52
|
build.onEnd((result) => {
|
|
47
|
-
fs.writeFileSync(
|
|
48
|
-
`docs/${platform}/metafile.json`,
|
|
49
|
-
JSON.stringify(result, null, 2)
|
|
50
|
-
);
|
|
53
|
+
fs.writeFileSync(f, JSON.stringify(result, null, 2));
|
|
51
54
|
});
|
|
52
55
|
}
|
|
53
56
|
}
|
|
@@ -88,15 +91,16 @@ var featuresPlugin_default = {
|
|
|
88
91
|
};
|
|
89
92
|
|
|
90
93
|
// src/esbuildConfigs/node.ts
|
|
91
|
-
var node_default = (config, entryPoints) => {
|
|
94
|
+
var node_default = (config, entryPoints, testName2) => {
|
|
92
95
|
const { inputFilesPluginFactory, register: register2 } = inputFilesPlugin_default(
|
|
93
96
|
"node",
|
|
94
|
-
entryPoints
|
|
97
|
+
// entryPoints,
|
|
98
|
+
testName2
|
|
95
99
|
);
|
|
96
100
|
return {
|
|
97
101
|
...esbuildConfigs_default(config),
|
|
98
102
|
splitting: true,
|
|
99
|
-
outdir:
|
|
103
|
+
outdir: `testeranto/bundles/node/${testName2}/`,
|
|
100
104
|
// inject: [`./node_modules/testeranto/dist/cjs-shim.js`],
|
|
101
105
|
metafile: true,
|
|
102
106
|
supported: {
|
|
@@ -135,14 +139,14 @@ var node_default = (config, entryPoints) => {
|
|
|
135
139
|
|
|
136
140
|
// src/esbuildConfigs/web.ts
|
|
137
141
|
import path2 from "path";
|
|
138
|
-
var web_default = (config, entryPoints) => {
|
|
142
|
+
var web_default = (config, entryPoints, testName2) => {
|
|
139
143
|
const { inputFilesPluginFactory, register: register2 } = inputFilesPlugin_default(
|
|
140
144
|
"web",
|
|
141
|
-
|
|
145
|
+
testName2
|
|
142
146
|
);
|
|
143
147
|
return {
|
|
144
148
|
...esbuildConfigs_default(config),
|
|
145
|
-
outdir:
|
|
149
|
+
outdir: `testeranto/bundles/web/${testName2}`,
|
|
146
150
|
alias: {
|
|
147
151
|
react: path2.resolve("./node_modules/react")
|
|
148
152
|
},
|
|
@@ -215,28 +219,21 @@ var web_html_default = (jsfilePath, htmlFilePath) => `
|
|
|
215
219
|
readline.emitKeypressEvents(process.stdin);
|
|
216
220
|
if (process.stdin.isTTY)
|
|
217
221
|
process.stdin.setRawMode(true);
|
|
218
|
-
var
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
getRunnables(cv[3], payload);
|
|
234
|
-
}
|
|
235
|
-
return pt;
|
|
236
|
-
}, payload);
|
|
237
|
-
};
|
|
238
|
-
import(process.cwd() + "/" + process.argv[2]).then(async (module) => {
|
|
239
|
-
const rawConfig = module.default;
|
|
222
|
+
var testName = process.argv[2];
|
|
223
|
+
var mode = process.argv[3];
|
|
224
|
+
if (mode !== "once" && mode !== "dev") {
|
|
225
|
+
console.error(`The 4th argument should be 'dev' or 'once', not '${mode}'.`);
|
|
226
|
+
process.exit(-1);
|
|
227
|
+
}
|
|
228
|
+
console.log("testeranto is building", testName, mode);
|
|
229
|
+
import(process.cwd() + "/testeranto.config.ts").then(async (module) => {
|
|
230
|
+
const bigConfig = module.default;
|
|
231
|
+
const project = bigConfig.projects[testName];
|
|
232
|
+
if (!project) {
|
|
233
|
+
console.error("no project found for", testName, "in testeranto.config.ts");
|
|
234
|
+
process.exit(-1);
|
|
235
|
+
}
|
|
236
|
+
const rawConfig = bigConfig.projects[testName];
|
|
240
237
|
const getSecondaryEndpointsPoints = (runtime) => {
|
|
241
238
|
const meta = (ts, st) => {
|
|
242
239
|
ts.forEach((t) => {
|
|
@@ -253,11 +250,27 @@ import(process.cwd() + "/" + process.argv[2]).then(async (module) => {
|
|
|
253
250
|
};
|
|
254
251
|
const config = {
|
|
255
252
|
...rawConfig,
|
|
256
|
-
buildDir: process.cwd() + "/" +
|
|
253
|
+
buildDir: process.cwd() + "/testeranto/bundles/" + testName
|
|
257
254
|
};
|
|
255
|
+
console.log(
|
|
256
|
+
`Press 'q' to shutdown gracefully. Press 'x' to shutdown forcefully.`
|
|
257
|
+
);
|
|
258
|
+
process.stdin.on("keypress", (str, key) => {
|
|
259
|
+
if (key.name === "q") {
|
|
260
|
+
console.log("Testeranto-Build is shutting down...");
|
|
261
|
+
mode = "once";
|
|
262
|
+
onDone();
|
|
263
|
+
} else if (key.name === "x") {
|
|
264
|
+
console.log("Testeranto-Build is shutting down forcefully...");
|
|
265
|
+
process.exit(-1);
|
|
266
|
+
} else {
|
|
267
|
+
console.log(
|
|
268
|
+
`Press 'q' to shutdown gracefully. Press 'x' to shutdown forcefully.`
|
|
269
|
+
);
|
|
270
|
+
}
|
|
271
|
+
});
|
|
258
272
|
let nodeDone = false;
|
|
259
273
|
let webDone = false;
|
|
260
|
-
let mode = config.devMode ? "DEV" : "PROD";
|
|
261
274
|
let status = "build";
|
|
262
275
|
const { nodeEntryPoints, webEntryPoints } = getRunnables(config.tests);
|
|
263
276
|
const onNodeDone = () => {
|
|
@@ -272,52 +285,76 @@ import(process.cwd() + "/" + process.argv[2]).then(async (module) => {
|
|
|
272
285
|
if (nodeDone && webDone) {
|
|
273
286
|
status = "built";
|
|
274
287
|
}
|
|
275
|
-
if (nodeDone && webDone &&
|
|
276
|
-
|
|
277
|
-
if (nodeDone && webDone && mode === "PROD") {
|
|
278
|
-
console.log("Testeranto-EsBuild is all done. Goodbye!");
|
|
288
|
+
if (nodeDone && webDone && mode === "once") {
|
|
289
|
+
console.log(ansiC.inverse(`${testName} has been built. Goodbye.`));
|
|
279
290
|
process.exit();
|
|
280
|
-
} else {
|
|
281
|
-
if (mode === "PROD") {
|
|
282
|
-
console.log("waiting for tests to finish");
|
|
283
|
-
console.log(
|
|
284
|
-
JSON.stringify(
|
|
285
|
-
{
|
|
286
|
-
nodeDone,
|
|
287
|
-
webDone,
|
|
288
|
-
mode
|
|
289
|
-
},
|
|
290
|
-
null,
|
|
291
|
-
2
|
|
292
|
-
)
|
|
293
|
-
);
|
|
294
|
-
} else {
|
|
295
|
-
console.log("waiting for tests to change");
|
|
296
|
-
}
|
|
297
|
-
if (config.devMode) {
|
|
298
|
-
console.log("ready and watching for changes...");
|
|
299
|
-
} else {
|
|
300
|
-
}
|
|
301
291
|
}
|
|
302
292
|
};
|
|
303
|
-
|
|
304
|
-
`
|
|
293
|
+
if (!fs2.existsSync(`testeranto/reports/${testName}`)) {
|
|
294
|
+
fs2.mkdirSync(`testeranto/reports/${testName}`);
|
|
295
|
+
}
|
|
296
|
+
fs2.writeFileSync(
|
|
297
|
+
`${process.cwd()}/testeranto/reports/${testName}/index.html`,
|
|
298
|
+
`
|
|
299
|
+
<!DOCTYPE html>
|
|
300
|
+
<html lang="en">
|
|
301
|
+
|
|
302
|
+
<head>
|
|
303
|
+
<meta name="description" content="Webpage description goes here" />
|
|
304
|
+
<meta charset="utf-8" />
|
|
305
|
+
<title>kokomoBay - testeranto</title>
|
|
306
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
307
|
+
<meta name="author" content="" />
|
|
308
|
+
|
|
309
|
+
<link rel="stylesheet" href="/kokomoBay/testeranto/ReportClient.css" />
|
|
310
|
+
<script type="module" src="/kokomoBay/testeranto/ReportClient.js"></script>
|
|
311
|
+
|
|
312
|
+
</head>
|
|
313
|
+
|
|
314
|
+
<body>
|
|
315
|
+
<div id="root">
|
|
316
|
+
react is loading
|
|
317
|
+
</div>
|
|
318
|
+
</body>
|
|
319
|
+
|
|
320
|
+
</html>
|
|
321
|
+
`
|
|
305
322
|
);
|
|
306
|
-
process.stdin.on("keypress", (str, key) => {
|
|
307
|
-
if (key.name === "q") {
|
|
308
|
-
console.log("Testeranto-Build is shutting down...");
|
|
309
|
-
mode = "PROD";
|
|
310
|
-
onDone();
|
|
311
|
-
}
|
|
312
|
-
if (key.name === "x") {
|
|
313
|
-
console.log("Testeranto-Build is shutting down forcefully...");
|
|
314
|
-
process.exit(-1);
|
|
315
|
-
}
|
|
316
|
-
});
|
|
317
323
|
fs2.writeFileSync(
|
|
318
|
-
|
|
324
|
+
`testeranto/reports/${testName}/config.json`,
|
|
319
325
|
JSON.stringify(config, null, 2)
|
|
320
326
|
);
|
|
327
|
+
fs2.writeFileSync(
|
|
328
|
+
`${process.cwd()}/testeranto/index.html`,
|
|
329
|
+
`
|
|
330
|
+
<!DOCTYPE html>
|
|
331
|
+
<html lang="en">
|
|
332
|
+
|
|
333
|
+
<head>
|
|
334
|
+
<meta name="description" content="Webpage description goes here" />
|
|
335
|
+
<meta charset="utf-8" />
|
|
336
|
+
<title>kokomoBay - testeranto</title>
|
|
337
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
338
|
+
<meta name="author" content="" />
|
|
339
|
+
|
|
340
|
+
<script type="application/json" id="bigConfig">
|
|
341
|
+
${JSON.stringify(Object.keys(bigConfig.projects))}
|
|
342
|
+
</script>
|
|
343
|
+
|
|
344
|
+
<link rel="stylesheet" href="/kokomoBay/testeranto/Project.css" />
|
|
345
|
+
<script type="module" src="/kokomoBay/testeranto/Project.js"></script>
|
|
346
|
+
|
|
347
|
+
</head>
|
|
348
|
+
|
|
349
|
+
<body>
|
|
350
|
+
<div id="root">
|
|
351
|
+
react is loading
|
|
352
|
+
</div>
|
|
353
|
+
</body>
|
|
354
|
+
|
|
355
|
+
</html>
|
|
356
|
+
`
|
|
357
|
+
);
|
|
321
358
|
Promise.resolve(
|
|
322
359
|
Promise.all(
|
|
323
360
|
[...getSecondaryEndpointsPoints("web")].map(async (sourceFilePath) => {
|
|
@@ -326,7 +363,7 @@ import(process.cwd() + "/" + process.argv[2]).then(async (module) => {
|
|
|
326
363
|
const sourceFileName = sourceFileSplit[sourceFileSplit.length - 1];
|
|
327
364
|
const sourceFileNameMinusJs = sourceFileName.split(".").slice(0, -1).join(".");
|
|
328
365
|
const htmlFilePath = path3.normalize(
|
|
329
|
-
`${process.cwd()}/${
|
|
366
|
+
`${process.cwd()}/testeranto/bundles/web/${testName}/${sourceDir.join(
|
|
330
367
|
"/"
|
|
331
368
|
)}/${sourceFileNameMinusJs}.html`
|
|
332
369
|
);
|
|
@@ -340,7 +377,7 @@ import(process.cwd() + "/" + process.argv[2]).then(async (module) => {
|
|
|
340
377
|
})
|
|
341
378
|
)
|
|
342
379
|
);
|
|
343
|
-
glob(
|
|
380
|
+
glob(`${process.cwd()}/testeranto/bundles/${testName}/chunk-*.mjs`, {
|
|
344
381
|
ignore: "node_modules/**"
|
|
345
382
|
}).then((chunks) => {
|
|
346
383
|
chunks.forEach((chunk) => {
|
|
@@ -348,8 +385,10 @@ import(process.cwd() + "/" + process.argv[2]).then(async (module) => {
|
|
|
348
385
|
});
|
|
349
386
|
});
|
|
350
387
|
await Promise.all([
|
|
351
|
-
esbuild.context(
|
|
352
|
-
|
|
388
|
+
esbuild.context(
|
|
389
|
+
node_default(config, Object.keys(nodeEntryPoints), testName)
|
|
390
|
+
).then(async (nodeContext) => {
|
|
391
|
+
if (mode === "dev") {
|
|
353
392
|
await nodeContext.watch().then((v) => {
|
|
354
393
|
onNodeDone();
|
|
355
394
|
});
|
|
@@ -360,8 +399,10 @@ import(process.cwd() + "/" + process.argv[2]).then(async (module) => {
|
|
|
360
399
|
}
|
|
361
400
|
return nodeContext;
|
|
362
401
|
}),
|
|
363
|
-
esbuild.context(
|
|
364
|
-
|
|
402
|
+
esbuild.context(
|
|
403
|
+
web_default(config, Object.keys(webEntryPoints), testName)
|
|
404
|
+
).then(async (webContext) => {
|
|
405
|
+
if (mode === "dev") {
|
|
365
406
|
await webContext.watch().then((v) => {
|
|
366
407
|
onWebDone();
|
|
367
408
|
});
|
|
@@ -374,3 +415,23 @@ import(process.cwd() + "/" + process.argv[2]).then(async (module) => {
|
|
|
374
415
|
})
|
|
375
416
|
]);
|
|
376
417
|
});
|
|
418
|
+
var getRunnables = (tests, payload = {
|
|
419
|
+
nodeEntryPoints: {},
|
|
420
|
+
webEntryPoints: {}
|
|
421
|
+
}) => {
|
|
422
|
+
return tests.reduce((pt, cv, cndx, cry) => {
|
|
423
|
+
if (cv[1] === "node") {
|
|
424
|
+
pt.nodeEntryPoints[cv[0]] = path3.resolve(
|
|
425
|
+
`./docs/node/${cv[0].split(".").slice(0, -1).concat("mjs").join(".")}`
|
|
426
|
+
);
|
|
427
|
+
} else if (cv[1] === "web") {
|
|
428
|
+
pt.webEntryPoints[cv[0]] = path3.resolve(
|
|
429
|
+
`./docs/web/${cv[0].split(".").slice(0, -1).concat("mjs").join(".")}`
|
|
430
|
+
);
|
|
431
|
+
}
|
|
432
|
+
if (cv[3].length) {
|
|
433
|
+
getRunnables(cv[3], payload);
|
|
434
|
+
}
|
|
435
|
+
return pt;
|
|
436
|
+
}, payload);
|
|
437
|
+
};
|
|
@@ -1,104 +1,49 @@
|
|
|
1
1
|
import { createRequire } from 'module';const require = createRequire(import.meta.url);
|
|
2
2
|
|
|
3
|
-
// src/init-docs.ts
|
|
4
|
-
import fs2 from "fs";
|
|
5
|
-
|
|
6
3
|
// src/Init.ts
|
|
7
4
|
import fs from "fs";
|
|
8
|
-
var Init_default = async (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
<title>kokomoBay - testeranto</title>
|
|
27
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
28
|
-
<meta name="author" content="" />
|
|
29
|
-
|
|
30
|
-
<link rel="stylesheet" href="/kokomoBay/docs/ReportClient.css" />
|
|
31
|
-
<script type="module" src="/kokomoBay/docs/ReportClient.js"></script>
|
|
32
|
-
|
|
33
|
-
</head>
|
|
34
|
-
|
|
35
|
-
<body>
|
|
36
|
-
<div id="root">
|
|
37
|
-
react is loading
|
|
38
|
-
</div>
|
|
39
|
-
</body>
|
|
40
|
-
|
|
41
|
-
</html>
|
|
42
|
-
`
|
|
5
|
+
var Init_default = async () => {
|
|
6
|
+
[
|
|
7
|
+
`testeranto/`,
|
|
8
|
+
`testeranto/bundles/`,
|
|
9
|
+
`testeranto/bundles/node`,
|
|
10
|
+
`testeranto/bundles/web`,
|
|
11
|
+
`testeranto/reports`,
|
|
12
|
+
`testeranto/reports/`,
|
|
13
|
+
`testeranto/features/`
|
|
14
|
+
].forEach((f) => {
|
|
15
|
+
try {
|
|
16
|
+
fs.mkdirSync(`${process.cwd()}/${f}`);
|
|
17
|
+
} catch (e) {
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
fs.copyFileSync(
|
|
21
|
+
`node_modules/testeranto/dist/prebuild/Project.js`,
|
|
22
|
+
`testeranto/Project.js`
|
|
43
23
|
);
|
|
44
24
|
fs.copyFileSync(
|
|
45
25
|
`node_modules/testeranto/dist/prebuild/ReportClient.js`,
|
|
46
|
-
|
|
26
|
+
`testeranto/ReportClient.js`
|
|
27
|
+
);
|
|
28
|
+
fs.copyFileSync(
|
|
29
|
+
`node_modules/testeranto/dist/prebuild/Project.css`,
|
|
30
|
+
`testeranto/Project.css`
|
|
47
31
|
);
|
|
48
32
|
fs.copyFileSync(
|
|
49
33
|
`node_modules/testeranto/dist/prebuild/ReportClient.css`,
|
|
50
|
-
|
|
34
|
+
`testeranto/ReportClient.css`
|
|
51
35
|
);
|
|
52
36
|
fs.copyFileSync(
|
|
53
37
|
`node_modules/testeranto/dist/prebuild/TestReport.js`,
|
|
54
|
-
|
|
38
|
+
`testeranto/TestReport.js`
|
|
55
39
|
);
|
|
56
40
|
fs.copyFileSync(
|
|
57
41
|
`node_modules/testeranto/dist/prebuild/TestReport.css`,
|
|
58
|
-
|
|
59
|
-
);
|
|
60
|
-
fs.writeFileSync(
|
|
61
|
-
`${config.outdir}/testeranto.json`,
|
|
62
|
-
JSON.stringify(
|
|
63
|
-
{
|
|
64
|
-
...config,
|
|
65
|
-
buildDir: process.cwd() + "/" + config.outdir
|
|
66
|
-
},
|
|
67
|
-
null,
|
|
68
|
-
2
|
|
69
|
-
)
|
|
42
|
+
`testeranto/TestReport.css`
|
|
70
43
|
);
|
|
71
|
-
try {
|
|
72
|
-
fs.mkdirSync(`${process.cwd()}/${config.outdir}/node`);
|
|
73
|
-
} catch {
|
|
74
|
-
}
|
|
75
|
-
try {
|
|
76
|
-
fs.mkdirSync(`${process.cwd()}/${config.outdir}/web`);
|
|
77
|
-
} catch {
|
|
78
|
-
}
|
|
79
|
-
try {
|
|
80
|
-
fs.mkdirSync(`${process.cwd()}/${config.outdir}/features`);
|
|
81
|
-
} catch {
|
|
82
|
-
}
|
|
83
|
-
try {
|
|
84
|
-
fs.mkdirSync(`${process.cwd()}/${config.outdir}/ts`);
|
|
85
|
-
} catch {
|
|
86
|
-
}
|
|
87
44
|
};
|
|
88
45
|
|
|
89
46
|
// src/init-docs.ts
|
|
90
47
|
console.log("Initializing a testeranto project");
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
fs2.writeFileSync(
|
|
94
|
-
"testeranto.mts",
|
|
95
|
-
fs2.readFileSync("node_modules/testeranto/src/defaultConfig.ts")
|
|
96
|
-
);
|
|
97
|
-
import(process.cwd() + "/testeranto.mts").then((module) => {
|
|
98
|
-
Init_default(module.default);
|
|
99
|
-
});
|
|
100
|
-
} else {
|
|
101
|
-
import(process.cwd() + "/" + process.argv[2]).then((module) => {
|
|
102
|
-
Init_default(module.default);
|
|
103
|
-
});
|
|
104
|
-
}
|
|
48
|
+
Init_default();
|
|
49
|
+
console.log("testeranto project initialized");
|