testeranto 0.146.1 → 0.146.4
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 +3 -1
- package/dist/common/src/Node.js +9 -6
- package/dist/common/src/PM/PM_WithEslintAndTsc.js +75 -58
- package/dist/common/src/PM/main.js +131 -79
- package/dist/common/src/PM/node.js +1 -14
- package/dist/common/src/PM/nodeSidecar.js +0 -1
- package/dist/common/src/Pure.js +17 -1
- package/dist/common/src/Pure.test.js +172 -0
- package/dist/common/src/build.js +0 -1
- package/dist/common/src/esbuildConfigs/consoleDetectorPlugin.js +22 -11
- package/dist/common/src/esbuildConfigs/nativeImportDetectorPlugin.js +24 -0
- package/dist/common/src/esbuildConfigs/pure.js +2 -1
- package/dist/common/src/esbuildConfigs/rebuildPlugin.js +1 -4
- package/dist/common/src/lib/BaseSuite.js +89 -0
- package/dist/common/src/lib/BaseSuite.test/node.test.js +9 -0
- package/dist/common/src/lib/BaseSuite.test/pure.test.js +9 -0
- package/dist/common/src/lib/BaseSuite.test/test.js +232 -0
- package/dist/common/src/lib/BaseSuite.test/web.test.js +9 -0
- package/dist/common/src/lib/abstractBase.js +1 -90
- package/dist/common/src/lib/abstractBase.test/MockGiven.js +17 -0
- package/dist/common/src/lib/abstractBase.test/MockThen.js +13 -0
- package/dist/common/src/lib/abstractBase.test/MockWhen.js +13 -0
- package/dist/common/src/lib/abstractBase.test/implementation.js +42 -0
- package/dist/common/src/lib/abstractBase.test/index.js +17 -0
- package/dist/common/src/lib/abstractBase.test/interface.js +12 -0
- package/dist/common/src/lib/abstractBase.test/specification.js +19 -0
- package/dist/common/src/lib/abstractBase.test/types.js +2 -0
- package/dist/common/src/lib/baseBuilder.test/TestBaseBuilder.js +36 -0
- package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.implementation.js +97 -0
- package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.interface.js +17 -0
- package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.node.js +11 -0
- package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.pure.js +11 -0
- package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.specification.js +13 -0
- package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.types.js +2 -0
- package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.web.js +11 -0
- package/dist/common/src/lib/basebuilder.js +2 -1
- package/dist/common/src/lib/classBuilder.test/TestClassBuilder.js +41 -0
- package/dist/common/src/lib/classBuilder.test/classBuilder.test.implementation.js +182 -0
- package/dist/common/src/lib/classBuilder.test/classBuilder.test.interface.js +17 -0
- package/dist/common/src/lib/classBuilder.test/classBuilder.test.js +11 -0
- package/dist/common/src/lib/classBuilder.test/classBuilder.test.specification.js +41 -0
- package/dist/common/src/lib/classBuilder.test/classBuilder.test.types.js +2 -0
- package/dist/common/src/lib/core.js +4 -13
- package/dist/common/src/lib/core.test/MockCore.js +25 -0
- package/dist/common/src/lib/core.test/core.test.implementation.js +102 -0
- package/dist/common/src/lib/core.test/core.test.interface.js +18 -0
- package/dist/common/src/lib/core.test/core.test.js +17 -0
- package/dist/common/src/lib/core.test/core.test.specification.js +33 -0
- package/dist/common/src/lib/core.test/core.test.types.js +2 -0
- package/dist/common/src/lib/pmProxy.js +9 -166
- package/dist/common/src/lib/pmProxy.test/implementation.js +76 -0
- package/dist/common/src/lib/pmProxy.test/index.js +15 -0
- package/dist/common/src/lib/pmProxy.test/interface.js +37 -0
- package/dist/common/src/lib/pmProxy.test/mockPM.js +34 -0
- package/dist/common/src/lib/pmProxy.test/mockPMBase.js +115 -0
- package/dist/common/src/lib/pmProxy.test/specification.js +39 -0
- package/dist/common/src/lib/pmProxy.test/types.js +2 -0
- package/dist/common/src/run.js +6 -6
- package/dist/common/testeranto.config.js +33 -18
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/src/Node.js +9 -6
- package/dist/module/src/PM/PM_WithEslintAndTsc.js +75 -58
- package/dist/module/src/PM/main.js +131 -79
- package/dist/module/src/PM/node.js +1 -14
- package/dist/module/src/PM/nodeSidecar.js +0 -1
- package/dist/module/src/Pure.js +17 -1
- package/dist/module/src/Pure.test.js +167 -0
- package/dist/module/src/build.js +0 -1
- package/dist/module/src/esbuildConfigs/consoleDetectorPlugin.js +19 -11
- package/dist/module/src/esbuildConfigs/nativeImportDetectorPlugin.js +21 -0
- package/dist/module/src/esbuildConfigs/pure.js +2 -1
- package/dist/module/src/esbuildConfigs/rebuildPlugin.js +1 -4
- package/dist/module/src/lib/BaseSuite.js +85 -0
- package/dist/module/src/lib/BaseSuite.test/node.test.js +4 -0
- package/dist/module/src/lib/BaseSuite.test/pure.test.js +4 -0
- package/dist/module/src/lib/BaseSuite.test/test.js +227 -0
- package/dist/module/src/lib/BaseSuite.test/web.test.js +4 -0
- package/dist/module/src/lib/abstractBase.js +1 -89
- package/dist/module/src/lib/abstractBase.test/MockGiven.js +13 -0
- package/dist/module/src/lib/abstractBase.test/MockThen.js +9 -0
- package/dist/module/src/lib/abstractBase.test/MockWhen.js +9 -0
- package/dist/module/src/lib/abstractBase.test/implementation.js +39 -0
- package/dist/module/src/lib/abstractBase.test/index.js +12 -0
- package/dist/module/src/lib/abstractBase.test/interface.js +9 -0
- package/dist/module/src/lib/abstractBase.test/specification.js +15 -0
- package/dist/module/src/lib/abstractBase.test/types.js +1 -0
- package/dist/module/src/lib/baseBuilder.test/TestBaseBuilder.js +32 -0
- package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.implementation.js +94 -0
- package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.interface.js +14 -0
- package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.node.js +6 -0
- package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.pure.js +6 -0
- package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.specification.js +9 -0
- package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.types.js +1 -0
- package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.web.js +6 -0
- package/dist/module/src/lib/basebuilder.js +2 -1
- package/dist/module/src/lib/classBuilder.test/TestClassBuilder.js +37 -0
- package/dist/module/src/lib/classBuilder.test/classBuilder.test.implementation.js +179 -0
- package/dist/module/src/lib/classBuilder.test/classBuilder.test.interface.js +14 -0
- package/dist/module/src/lib/classBuilder.test/classBuilder.test.js +6 -0
- package/dist/module/src/lib/classBuilder.test/classBuilder.test.specification.js +37 -0
- package/dist/module/src/lib/classBuilder.test/classBuilder.test.types.js +1 -0
- package/dist/module/src/lib/core.js +3 -12
- package/dist/module/src/lib/core.test/MockCore.js +18 -0
- package/dist/module/src/lib/core.test/core.test.implementation.js +99 -0
- package/dist/module/src/lib/core.test/core.test.interface.js +15 -0
- package/dist/module/src/lib/core.test/core.test.js +12 -0
- package/dist/module/src/lib/core.test/core.test.specification.js +29 -0
- package/dist/module/src/lib/core.test/core.test.types.js +1 -0
- package/dist/module/src/lib/pmProxy.js +9 -166
- package/dist/module/src/lib/pmProxy.test/implementation.js +73 -0
- package/dist/module/src/lib/pmProxy.test/index.js +10 -0
- package/dist/module/src/lib/pmProxy.test/interface.js +34 -0
- package/dist/module/src/lib/pmProxy.test/mockPM.js +30 -0
- package/dist/module/src/lib/pmProxy.test/mockPMBase.js +111 -0
- package/dist/module/src/lib/pmProxy.test/specification.js +35 -0
- package/dist/module/src/lib/pmProxy.test/types.js +1 -0
- package/dist/module/src/run.js +6 -6
- package/dist/module/testeranto.config.js +33 -18
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/prebuild/Project.js +16 -15
- package/dist/prebuild/TestReport.js +14 -12
- package/dist/prebuild/build.mjs +34 -34
- package/dist/prebuild/run.mjs +259 -173
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/src/PM/PM_WithEslintAndTsc.d.ts +2 -1
- package/dist/types/src/PM/main.d.ts +5 -2
- package/dist/types/src/Pure.d.ts +2 -2
- package/dist/types/src/Pure.test.d.ts +36 -0
- package/dist/types/src/Types.d.ts +7 -6
- package/dist/types/src/Web.d.ts +1 -1
- package/dist/types/src/esbuildConfigs/consoleDetectorPlugin.d.ts +1 -1
- package/dist/types/src/esbuildConfigs/nativeImportDetectorPlugin.d.ts +2 -0
- package/dist/types/src/lib/BaseSuite.d.ts +39 -0
- package/dist/types/src/lib/BaseSuite.test/node.test.d.ts +3 -0
- package/dist/types/src/lib/BaseSuite.test/pure.test.d.ts +3 -0
- package/dist/types/src/lib/BaseSuite.test/test.d.ts +42 -0
- package/dist/types/src/lib/BaseSuite.test/web.test.d.ts +3 -0
- package/dist/types/src/lib/abstractBase.d.ts +1 -36
- package/dist/types/src/lib/abstractBase.test/MockGiven.d.ts +7 -0
- package/dist/types/src/lib/abstractBase.test/MockThen.d.ts +6 -0
- package/dist/types/src/lib/abstractBase.test/MockWhen.d.ts +6 -0
- package/dist/types/src/lib/abstractBase.test/implementation.d.ts +3 -0
- package/dist/types/src/lib/abstractBase.test/index.d.ts +3 -0
- package/dist/types/src/lib/abstractBase.test/interface.d.ts +3 -0
- package/dist/types/src/lib/abstractBase.test/specification.d.ts +3 -0
- package/dist/types/src/lib/abstractBase.test/types.d.ts +39 -0
- package/dist/types/src/lib/baseBuilder.test/TestBaseBuilder.d.ts +15 -0
- package/dist/types/src/lib/baseBuilder.test/baseBuilder.test.implementation.d.ts +3 -0
- package/dist/types/src/lib/baseBuilder.test/baseBuilder.test.interface.d.ts +3 -0
- package/dist/types/src/lib/baseBuilder.test/baseBuilder.test.node.d.ts +3 -0
- package/dist/types/src/lib/baseBuilder.test/baseBuilder.test.pure.d.ts +3 -0
- package/dist/types/src/lib/baseBuilder.test/baseBuilder.test.specification.d.ts +3 -0
- package/dist/types/src/lib/baseBuilder.test/baseBuilder.test.types.d.ts +20 -0
- package/dist/types/src/lib/baseBuilder.test/baseBuilder.test.web.d.ts +3 -0
- package/dist/types/src/lib/classBuilder.test/TestClassBuilder.d.ts +21 -0
- package/dist/types/src/lib/classBuilder.test/classBuilder.test.d.ts +3 -0
- package/dist/types/src/lib/classBuilder.test/classBuilder.test.implementation.d.ts +3 -0
- package/dist/types/src/lib/classBuilder.test/classBuilder.test.interface.d.ts +3 -0
- package/dist/types/src/lib/classBuilder.test/classBuilder.test.specification.d.ts +3 -0
- package/dist/types/src/lib/classBuilder.test/classBuilder.test.types.d.ts +56 -0
- package/dist/types/src/lib/core.d.ts +1 -1
- package/dist/types/src/lib/core.test/MockCore.d.ts +10 -0
- package/dist/types/src/lib/core.test/core.test.d.ts +3 -0
- package/dist/types/src/lib/core.test/core.test.implementation.d.ts +3 -0
- package/dist/types/src/lib/core.test/core.test.interface.d.ts +3 -0
- package/dist/types/src/lib/core.test/core.test.specification.d.ts +3 -0
- package/dist/types/src/lib/core.test/core.test.types.d.ts +46 -0
- package/dist/types/src/lib/index.d.ts +2 -1
- package/dist/types/src/lib/pmProxy.d.ts +11 -6
- package/dist/types/src/lib/pmProxy.test/implementation.d.ts +3 -0
- package/dist/types/src/lib/pmProxy.test/index.d.ts +7 -0
- package/dist/types/src/lib/pmProxy.test/interface.d.ts +3 -0
- package/dist/types/src/lib/pmProxy.test/mockPM.d.ts +10 -0
- package/dist/types/src/lib/pmProxy.test/mockPMBase.d.ts +39 -0
- package/dist/types/src/lib/pmProxy.test/specification.d.ts +3 -0
- package/dist/types/src/lib/pmProxy.test/types.d.ts +42 -0
- package/dist/types/src/lib/types.d.ts +2 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/docs.html +35 -33
- package/index.html +23 -30
- package/package.json +3 -2
- package/testeranto/index.html +1 -1
- package/testeranto/reports/allTests/index.html +1 -1
- package/testeranto/reports/allTests/src/Pure.test/pure/index.html +1 -1
- package/testeranto/reports/allTests/src/Pure.test/pure/logs.txt +2 -2
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/index.html +1 -1
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/index.html +1 -1
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/logs.txt +2 -2
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/index.html +1 -1
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/index.html +1 -1
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/index.html +1 -1
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/index.html +1 -1
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/index.html +1 -1
- package/testeranto/reports/allTests/src/lib/core.test/core.test/node/index.html +1 -1
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/index.html +1 -1
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/logs.txt +3 -3
- package/testeranto.config.ts +1 -1
- package/tsc.log +36 -38
package/dist/module/src/Node.js
CHANGED
|
@@ -2,6 +2,7 @@ import Testeranto from "./lib/core.js";
|
|
|
2
2
|
import { defaultTestResourceRequirement, } from "./lib/index.js";
|
|
3
3
|
import { PM_Node } from "./PM/node.js";
|
|
4
4
|
let ipcfile;
|
|
5
|
+
console.log("mark4");
|
|
5
6
|
export class NodeTesteranto extends Testeranto {
|
|
6
7
|
constructor(input, testSpecification, testImplementation, testResourceRequirement, testInterface) {
|
|
7
8
|
super(input, testSpecification, testImplementation, testResourceRequirement, testInterface, () => {
|
|
@@ -9,6 +10,7 @@ export class NodeTesteranto extends Testeranto {
|
|
|
9
10
|
});
|
|
10
11
|
}
|
|
11
12
|
async receiveTestResourceConfig(partialTestResource) {
|
|
13
|
+
console.log("receiveTestResourceConfig", partialTestResource);
|
|
12
14
|
const t = JSON.parse(partialTestResource);
|
|
13
15
|
const pm = new PM_Node(t, ipcfile);
|
|
14
16
|
return await this.testJobs[0].receiveTestResourceConfig(pm);
|
|
@@ -19,13 +21,14 @@ export class NodeTesteranto extends Testeranto {
|
|
|
19
21
|
}
|
|
20
22
|
}
|
|
21
23
|
const testeranto = async (input, testSpecification, testImplementation, testInterface, testResourceRequirement = defaultTestResourceRequirement) => {
|
|
22
|
-
const t = new NodeTesteranto(input, testSpecification, testImplementation, testResourceRequirement, testInterface);
|
|
23
|
-
process.on("unhandledRejection", (reason, promise) => {
|
|
24
|
-
console.error("Unhandled Rejection at:", promise, "reason:", reason);
|
|
25
|
-
// Optionally, terminate the process or perform cleanup
|
|
26
|
-
// t.registerUncaughtPromise(reason, promise);
|
|
27
|
-
});
|
|
28
24
|
try {
|
|
25
|
+
const t = new NodeTesteranto(input, testSpecification, testImplementation, testResourceRequirement, testInterface);
|
|
26
|
+
console.log("args", process.argv);
|
|
27
|
+
process.on("unhandledRejection", (reason, promise) => {
|
|
28
|
+
console.error("Unhandled Rejection at:", promise, "reason:", reason);
|
|
29
|
+
// Optionally, terminate the process or perform cleanup
|
|
30
|
+
// t.registerUncaughtPromise(reason, promise);
|
|
31
|
+
});
|
|
29
32
|
ipcfile = process.argv[3];
|
|
30
33
|
const f = await t.receiveTestResourceConfig(process.argv[2]);
|
|
31
34
|
console.error("goodbye node with failures", f.fails);
|
|
@@ -18,7 +18,16 @@ export class PM_WithEslintAndTsc extends PM_Base {
|
|
|
18
18
|
this.summary = {};
|
|
19
19
|
this.tscCheck = async ({ entrypoint, addableFiles, platform, }) => {
|
|
20
20
|
console.log(ansiC.green(ansiC.inverse(`tsc < ${entrypoint}`)));
|
|
21
|
-
|
|
21
|
+
try {
|
|
22
|
+
this.typeCheckIsRunning(entrypoint);
|
|
23
|
+
}
|
|
24
|
+
catch (e) {
|
|
25
|
+
console.error("error in tscCheck");
|
|
26
|
+
console.error(e);
|
|
27
|
+
console.error(entrypoint);
|
|
28
|
+
console.error(JSON.stringify(this.summary, null, 2));
|
|
29
|
+
process.exit(-1);
|
|
30
|
+
}
|
|
22
31
|
const program = tsc.createProgramFromConfig({
|
|
23
32
|
basePath: process.cwd(), // always required, used for relative paths
|
|
24
33
|
configFilePath: "tsconfig.json", // config to inherit from (optional)
|
|
@@ -50,7 +59,16 @@ export class PM_WithEslintAndTsc extends PM_Base {
|
|
|
50
59
|
};
|
|
51
60
|
this.eslintCheck = async (entrypoint, platform, addableFiles) => {
|
|
52
61
|
console.log(ansiC.green(ansiC.inverse(`eslint < ${entrypoint}`)));
|
|
53
|
-
|
|
62
|
+
try {
|
|
63
|
+
this.lintIsRunning(entrypoint);
|
|
64
|
+
}
|
|
65
|
+
catch (e) {
|
|
66
|
+
console.error("error in eslintCheck");
|
|
67
|
+
console.error(e);
|
|
68
|
+
console.error(entrypoint);
|
|
69
|
+
console.error(JSON.stringify(this.summary, null, 2));
|
|
70
|
+
process.exit(-1);
|
|
71
|
+
}
|
|
54
72
|
const results = (await eslint.lintFiles(addableFiles))
|
|
55
73
|
.filter((r) => r.messages.length)
|
|
56
74
|
.filter((r) => {
|
|
@@ -68,7 +86,7 @@ export class PM_WithEslintAndTsc extends PM_Base {
|
|
|
68
86
|
const promptPath = promptPather(entryPoint, platform, this.name);
|
|
69
87
|
const testPaths = path.join("testeranto", "reports", this.name, entryPoint.split(".").slice(0, -1).join("."), platform, `tests.json`);
|
|
70
88
|
const featuresPath = path.join("testeranto", "reports", this.name, platform, entryPoint.split(".").slice(0, -1).join("."), `featurePrompt.txt`);
|
|
71
|
-
const logPath = path.join("testeranto", "reports", this.name, entryPoint.split(".").slice(0, -1).join("."), platform, `
|
|
89
|
+
const logPath = path.join("testeranto", "reports", this.name, entryPoint.split(".").slice(0, -1).join("."), platform, `logs.txt`);
|
|
72
90
|
const lintPath = path.join("testeranto", "reports", this.name, entryPoint.split(".").slice(0, -1).join("."), platform, `lint_errors.json`);
|
|
73
91
|
const typePath = path.join("testeranto", "reports", this.name, entryPoint.split(".").slice(0, -1).join("."), platform, `type_errors.txt`);
|
|
74
92
|
const messagePath = path.join("testeranto", "reports", this.name, entryPoint.split(".").slice(0, -1).join("."), platform, `message`);
|
|
@@ -92,91 +110,90 @@ ${addableFiles
|
|
|
92
110
|
this.checkForShutdown();
|
|
93
111
|
};
|
|
94
112
|
this.typeCheckIsRunning = (src) => {
|
|
113
|
+
if (!this.summary[src]) {
|
|
114
|
+
throw `this.summary[${src}] is undefined`;
|
|
115
|
+
}
|
|
95
116
|
this.summary[src].typeErrors = "?";
|
|
96
117
|
};
|
|
97
118
|
this.typeCheckIsNowDone = (src, failures) => {
|
|
119
|
+
if (!this.summary[src]) {
|
|
120
|
+
throw `this.summary[${src}] is undefined`;
|
|
121
|
+
}
|
|
122
|
+
if (failures === 0) {
|
|
123
|
+
console.log(ansiC.green(ansiC.inverse(`tsc > ${src}`)));
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
console.log(ansiC.red(ansiC.inverse(`tsc > ${src} failed ${failures} times`)));
|
|
127
|
+
}
|
|
98
128
|
this.summary[src].typeErrors = failures;
|
|
99
129
|
this.writeBigBoard();
|
|
100
130
|
this.checkForShutdown();
|
|
101
131
|
};
|
|
102
132
|
this.lintIsRunning = (src) => {
|
|
133
|
+
if (!this.summary[src]) {
|
|
134
|
+
throw `this.summary[${src}] is undefined`;
|
|
135
|
+
}
|
|
103
136
|
this.summary[src].staticErrors = "?";
|
|
104
137
|
this.writeBigBoard();
|
|
105
138
|
};
|
|
106
139
|
this.lintIsNowDone = (src, failures) => {
|
|
140
|
+
if (!this.summary[src]) {
|
|
141
|
+
throw `this.summary[${src}] is undefined`;
|
|
142
|
+
}
|
|
143
|
+
if (failures === 0) {
|
|
144
|
+
console.log(ansiC.green(ansiC.inverse(`eslint > ${src}`)));
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
console.log(ansiC.red(ansiC.inverse(`eslint > ${src} failed ${failures} times`)));
|
|
148
|
+
}
|
|
107
149
|
this.summary[src].staticErrors = failures;
|
|
108
150
|
this.writeBigBoard();
|
|
109
151
|
this.checkForShutdown();
|
|
110
152
|
};
|
|
111
153
|
this.bddTestIsRunning = (src) => {
|
|
112
|
-
this.summary[src]
|
|
154
|
+
if (!this.summary[src]) {
|
|
155
|
+
throw `this.summary[${src}] is undefined`;
|
|
156
|
+
}
|
|
157
|
+
this.summary[src].runTimeErrors = "?";
|
|
113
158
|
this.writeBigBoard();
|
|
114
159
|
};
|
|
115
160
|
this.bddTestIsNowDone = (src, failures) => {
|
|
116
|
-
this.summary[src]
|
|
161
|
+
if (!this.summary[src]) {
|
|
162
|
+
throw `this.summary[${src}] is undefined`;
|
|
163
|
+
}
|
|
164
|
+
this.summary[src].runTimeErrors = failures;
|
|
117
165
|
this.writeBigBoard();
|
|
118
166
|
this.checkForShutdown();
|
|
119
167
|
};
|
|
120
168
|
this.writeBigBoard = () => {
|
|
121
169
|
fs.writeFileSync(`./testeranto/reports/${this.name}/summary.json`, JSON.stringify(this.summary, null, 2));
|
|
122
170
|
};
|
|
123
|
-
this.checkForShutdown = () => {
|
|
124
|
-
console.log(ansiC.inverse(`checkForShutdown`));
|
|
125
|
-
this.writeBigBoard();
|
|
126
|
-
if (this.mode === "dev")
|
|
127
|
-
return;
|
|
128
|
-
let inflight = false;
|
|
129
|
-
Object.keys(this.summary).forEach((k) => {
|
|
130
|
-
if (this.summary[k].prompt === "?") {
|
|
131
|
-
console.log(ansiC.blue(ansiC.inverse(`🕕 prompt ${k}`)));
|
|
132
|
-
inflight = true;
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
Object.keys(this.summary).forEach((k) => {
|
|
136
|
-
if (this.summary[k].runTimeError === "?") {
|
|
137
|
-
console.log(ansiC.blue(ansiC.inverse(`🕕 runTimeError ${k}`)));
|
|
138
|
-
inflight = true;
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
Object.keys(this.summary).forEach((k) => {
|
|
142
|
-
if (this.summary[k].staticErrors === "?") {
|
|
143
|
-
console.log(ansiC.blue(ansiC.inverse(`🕕 staticErrors ${k}`)));
|
|
144
|
-
inflight = true;
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
Object.keys(this.summary).forEach((k) => {
|
|
148
|
-
if (this.summary[k].typeErrors === "?") {
|
|
149
|
-
console.log(ansiC.blue(ansiC.inverse(`🕕 typeErrors ${k}`)));
|
|
150
|
-
inflight = true;
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
this.writeBigBoard();
|
|
154
|
-
if (!inflight) {
|
|
155
|
-
this.browser.disconnect().then(() => {
|
|
156
|
-
console.log(ansiC.inverse(`${this.name} has been tested. Goodbye.`));
|
|
157
|
-
process.exit();
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
};
|
|
161
171
|
this.name = name;
|
|
162
172
|
this.mode = mode;
|
|
173
|
+
this.summary = {};
|
|
174
|
+
// Initialize all test entries first
|
|
163
175
|
this.configs.tests.forEach(([t, rt, tr, sidecars]) => {
|
|
164
|
-
this.
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
staticErrors: "?",
|
|
168
|
-
prompt: "?",
|
|
169
|
-
failingFeatures: {},
|
|
170
|
-
};
|
|
171
|
-
sidecars.forEach(([t]) => {
|
|
172
|
-
this.summary[t] = {
|
|
173
|
-
// runTimeError: "?",
|
|
174
|
-
typeErrors: "?",
|
|
175
|
-
staticErrors: "?",
|
|
176
|
-
// prompt: "?",
|
|
177
|
-
// failingFeatures: {},
|
|
178
|
-
};
|
|
176
|
+
this.ensureSummaryEntry(t);
|
|
177
|
+
sidecars.forEach(([sidecarName]) => {
|
|
178
|
+
this.ensureSummaryEntry(sidecarName, true);
|
|
179
179
|
});
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
|
+
ensureSummaryEntry(src, isSidecar = false) {
|
|
183
|
+
if (!this.summary[src]) {
|
|
184
|
+
this.summary[src] = {
|
|
185
|
+
typeErrors: undefined,
|
|
186
|
+
staticErrors: undefined,
|
|
187
|
+
runTimeErrors: undefined,
|
|
188
|
+
prompt: undefined,
|
|
189
|
+
failingFeatures: {},
|
|
190
|
+
};
|
|
191
|
+
if (isSidecar) {
|
|
192
|
+
// Sidecars don't need all fields
|
|
193
|
+
// delete this.summary[src].runTimeError;
|
|
194
|
+
// delete this.summary[src].prompt;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
return this.summary[src];
|
|
198
|
+
}
|
|
182
199
|
}
|