testeranto 0.143.0 → 0.146.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.aider.chat.history.md +1833 -0
- package/.aider.input.history +105 -0
- package/.aider.tags.cache.v3/{be/72/19ee8e656d160afe9b31523245fe.val → 06/1a/1ec9fd1f595d4b36094caef45894.val} +0 -0
- package/.aider.tags.cache.v3/{63/f1/138061b0aadb868173d197c2a0e0.val → 0f/f6/f42b5108253d75de3cb6286df7f6.val} +0 -0
- package/.aider.tags.cache.v3/cache.db +0 -0
- package/README.md +22 -23
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docs/index.md +45 -33
- package/package.json +1 -1
- package/src/Node.ts +17 -13
- package/src/PM/PM_WithEslintAndTsc.ts +71 -69
- package/src/PM/main.ts +182 -92
- package/src/PM/node.ts +1 -15
- package/src/PM/nodeSidecar.ts +0 -1
- package/src/Pure.ts +20 -2
- package/src/Types.ts +5 -5
- package/src/Web.ts +1 -1
- package/src/build.ts +0 -1
- package/src/esbuildConfigs/consoleDetectorPlugin.ts +28 -14
- package/src/esbuildConfigs/nativeImportDetectorPlugin.ts +26 -0
- package/src/esbuildConfigs/pure.ts +3 -1
- package/src/esbuildConfigs/rebuildPlugin.ts +1 -4
- package/src/lib/BaseSuite.test/node.test.ts +12 -0
- package/src/lib/BaseSuite.test/pure.test.ts +12 -0
- package/src/lib/{BaseSuite.test.ts → BaseSuite.test/test.ts} +20 -30
- package/src/lib/BaseSuite.test/web.test.ts +12 -0
- package/src/lib/BaseSuite.ts +17 -15
- package/src/lib/abstractBase.ts +0 -2
- package/src/lib/baseBuilder.test/baseBuilder.test.implementation.ts +2 -1
- package/src/lib/baseBuilder.test/baseBuilder.test.node.ts +14 -0
- package/src/lib/baseBuilder.test/baseBuilder.test.pure.ts +14 -0
- package/src/lib/baseBuilder.test/{baseBuilder.test.ts → baseBuilder.test.web.ts} +2 -1
- package/src/lib/basebuilder.ts +2 -1
- package/src/lib/classBuilder.test/classBuilder.test.implementation.ts +6 -2
- package/src/lib/classBuilder.test/classBuilder.test.interface.ts +1 -0
- package/src/lib/classBuilder.test/classBuilder.test.specification.ts +5 -4
- package/src/lib/classBuilder.test/classBuilder.test.types.ts +17 -5
- package/src/lib/core.ts +0 -10
- package/src/lib/pmProxy.test/interface.ts +0 -1
- package/src/run.ts +7 -7
- package/testeranto/bundles/node/allTests/{chunk-RX4SUFXQ.mjs → chunk-NQBTLMSG.mjs} +15 -12
- package/testeranto/bundles/node/allTests/{chunk-UED26IMH.mjs → chunk-RF3LIUSG.mjs} +196 -233
- package/testeranto/bundles/node/allTests/{chunk-KYSOR62N.mjs → chunk-YZWFKYY3.mjs} +6 -2
- package/testeranto/bundles/node/allTests/metafile.json +294 -4083
- package/testeranto/bundles/node/allTests/src/lib/{BaseSuite.test.mjs → BaseSuite.test/node.test.mjs} +9 -7
- package/testeranto/bundles/node/allTests/src/lib/baseBuilder.test/{baseBuilder.test.mjs → baseBuilder.test.node.mjs} +8 -8
- package/testeranto/bundles/node/allTests/src/lib/classBuilder.test/classBuilder.test.mjs +8 -6
- package/testeranto/bundles/node/allTests/src/lib/core.test/core.test.mjs +2 -2
- package/testeranto/bundles/node/allTests/src/lib/pmProxy.test/index.mjs +114 -6
- package/testeranto/bundles/{node/allTests/chunk-2FXOXAKZ.mjs → pure/allTests/chunk-W22WOQNK.mjs} +377 -256
- package/testeranto/bundles/pure/allTests/metafile.json +732 -3
- package/testeranto/bundles/{node → pure}/allTests/src/Pure.test.mjs +113 -5
- package/testeranto/bundles/pure/allTests/src/lib/BaseSuite.test/pure.test.mjs +323 -0
- package/testeranto/bundles/pure/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure.mjs +224 -0
- package/testeranto/bundles/{node/allTests/chunk-DWKHII32.mjs → web/allTests/chunk-FIZ3WLUB.mjs} +439 -296
- package/testeranto/bundles/web/allTests/metafile.json +1133 -2
- package/testeranto/bundles/web/allTests/src/lib/BaseSuite.test/web.test.html +19 -0
- package/testeranto/bundles/web/allTests/src/lib/BaseSuite.test/web.test.mjs +322 -0
- package/testeranto/bundles/web/allTests/src/lib/baseBuilder.test/baseBuilder.test.web.html +19 -0
- package/testeranto/bundles/web/allTests/src/lib/baseBuilder.test/baseBuilder.test.web.mjs +10964 -0
- package/testeranto/index.html +1 -1
- package/testeranto/reports/allTests/config.json +25 -25
- package/testeranto/reports/allTests/index.html +1 -1
- package/testeranto/reports/allTests/src/{PM/__tests__/webSidecar.testeranto/node → Pure.test/pure}/index.html +1 -1
- package/testeranto/reports/allTests/src/Pure.test/pure/lint_errors.json +1539 -0
- package/testeranto/reports/allTests/src/Pure.test/pure/logs.txt +11 -0
- package/testeranto/reports/allTests/src/Pure.test/pure/message +1 -0
- package/testeranto/reports/allTests/src/Pure.test/pure/prompt.txt +8 -0
- package/testeranto/reports/allTests/src/Pure.test/{node → pure}/type_errors.txt +15 -5
- package/testeranto/reports/allTests/src/{Pure.test → lib/BaseSuite.test/node.test}/node/index.html +1 -1
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/lint_errors.json +620 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/logs.txt +12 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/message +1 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/prompt.txt +8 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/type_errors.txt +94 -0
- package/testeranto/reports/allTests/src/{PM/__tests__/nodeSidecar.testeranto/node → lib/BaseSuite.test/pure.test/pure}/index.html +1 -1
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/lint_errors.json +620 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/logs.txt +11 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/message +1 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/prompt.txt +8 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/type_errors.txt +104 -0
- package/testeranto/reports/allTests/src/{PM/__tests__/pureSidecar.testeranto/node → lib/BaseSuite.test/web.test/web}/index.html +1 -1
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/{node → web.test/web}/lint_errors.json +119 -107
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/logs.txt +10 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/message +1 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/prompt.txt +8 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/type_errors.txt +95 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/index.html +21 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/lint_errors.json +966 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/message +1 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/prompt.txt +11 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/{baseBuilder.test → baseBuilder.test.node}/node/type_errors.txt +22 -17
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/bdd_errors.txt +1 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/index.html +21 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/lint_errors.json +966 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/message +1 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/prompt.txt +11 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/tests.json +57 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/type_errors.txt +57 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/bdd_errors.txt +1 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/index.html +21 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/{baseBuilder.test/node → baseBuilder.test.web/web}/lint_errors.json +61 -61
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/message +1 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/{baseBuilder.test/node → baseBuilder.test.web/web}/prompt.txt +6 -6
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/tests.json +57 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/type_errors.txt +48 -0
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/index.html +1 -1
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/lint_errors.json +106 -86
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/logs.txt +12 -0
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/message +1 -1
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/prompt.txt +2 -2
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/type_errors.txt +26 -38
- package/testeranto/reports/allTests/src/lib/core.test/core.test/node/index.html +1 -1
- package/testeranto/reports/allTests/src/lib/core.test/core.test/node/{console_log.txt → logs.txt} +8 -8
- package/testeranto/reports/allTests/src/lib/core.test/core.test/node/message +1 -1
- package/testeranto/reports/allTests/src/lib/core.test/core.test/node/prompt.txt +1 -1
- package/testeranto/reports/allTests/src/lib/core.test/core.test/node/type_errors.txt +12 -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/lint_errors.json +1413 -8
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/logs.txt +30 -0
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/message +1 -1
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/prompt.txt +2 -1
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/type_errors.txt +5 -5
- package/testeranto/reports/allTests/summary.json +48 -83
- package/testeranto.config.ts +32 -24
- package/tsc.log +273 -27
- package/.aider.tags.cache.v3/cache.db-shm +0 -0
- package/.aider.tags.cache.v3/cache.db-wal +0 -0
- package/testeranto/bundles/node/allTests/chunk-4PJCC2XT.mjs +0 -1039
- package/testeranto/bundles/node/allTests/chunk-5MQGD4WC.mjs +0 -251
- package/testeranto/bundles/node/allTests/chunk-6CGAD2FD.mjs +0 -800
- package/testeranto/bundles/node/allTests/chunk-PG6KUKNP.mjs +0 -44
- package/testeranto/bundles/node/allTests/chunk-PRPFVO6G.mjs +0 -251
- package/testeranto/bundles/node/allTests/chunk-VAAIAWXC.mjs +0 -117
- package/testeranto/bundles/node/allTests/chunk-W44DUDBK.mjs +0 -251
- package/testeranto/bundles/node/allTests/chunk-YI3EGRMQ.mjs +0 -167
- package/testeranto/bundles/node/allTests/src/PM/__tests__/nodeSidecar.testeranto.mjs +0 -188
- package/testeranto/bundles/node/allTests/src/PM/__tests__/pureSidecar.testeranto.mjs +0 -157
- package/testeranto/bundles/node/allTests/src/PM/__tests__/webSidecar.testeranto.mjs +0 -157
- package/testeranto/bundles/node/allTests/src/mothership/test.mjs +0 -24413
- package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/lint_errors.json +0 -80
- package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/message +0 -1
- package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/prompt.txt +0 -8
- package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/type_errors.txt +0 -28
- package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/lint_errors.json +0 -80
- package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/message +0 -1
- package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/prompt.txt +0 -8
- package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/type_errors.txt +0 -32
- package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/lint_errors.json +0 -80
- package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/message +0 -1
- package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/prompt.txt +0 -8
- package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/type_errors.txt +0 -32
- package/testeranto/reports/allTests/src/Pure.test/node/console_log.txt +0 -17
- package/testeranto/reports/allTests/src/Pure.test/node/lint_errors.json +0 -134
- package/testeranto/reports/allTests/src/Pure.test/node/message +0 -1
- package/testeranto/reports/allTests/src/Pure.test/node/prompt.txt +0 -7
- package/testeranto/reports/allTests/src/lib/BaseGiven.test/node/index.html +0 -21
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/console_log.txt +0 -35
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/index.html +0 -21
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/message +0 -1
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/prompt.txt +0 -7
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/type_errors.txt +0 -93
- package/testeranto/reports/allTests/src/lib/BaseThen.test/node/index.html +0 -21
- package/testeranto/reports/allTests/src/lib/BaseWhen.test/node/dev.html +0 -21
- package/testeranto/reports/allTests/src/lib/BaseWhen.test/node/index.html +0 -21
- package/testeranto/reports/allTests/src/lib/abstractBase/index/node/dev.html +0 -21
- package/testeranto/reports/allTests/src/lib/abstractBase/index/node/index.html +0 -21
- package/testeranto/reports/allTests/src/lib/baseBuilder/baseBuilder.test/node/dev.html +0 -21
- package/testeranto/reports/allTests/src/lib/baseBuilder/baseBuilder.test/node/index.html +0 -21
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test/node/console_log.txt +0 -12
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test/node/dev.html +0 -21
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test/node/index.html +0 -21
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test/node/message +0 -1
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/console_log.txt +0 -17
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/console_log.txt +0 -43
- package/testeranto/reports/allTests/src/mothership/test/node/console_log.txt +0 -44
- package/testeranto/reports/allTests/src/mothership/test/node/dev.html +0 -21
- package/testeranto/reports/allTests/src/mothership/test/node/index.html +0 -21
- package/testeranto/reports/allTests/src/mothership/test/node/lint_errors.json +0 -1
- package/testeranto/reports/allTests/src/mothership/test/node/message +0 -1
- package/testeranto/reports/allTests/src/mothership/test/node/prompt.txt +0 -8
- package/testeranto/reports/allTests/src/mothership/test/node/type_errors.txt +0 -24
- package/testeranto/reportsnode_build_errors +0 -12
- /package/testeranto/reports/allTests/src/{PM/__tests__/nodeSidecar.testeranto/node → Pure.test/pure}/dev.html +0 -0
- /package/testeranto/reports/allTests/src/{PM/__tests__/pureSidecar.testeranto → lib/BaseSuite.test/node.test}/node/dev.html +0 -0
- /package/testeranto/reports/allTests/src/{PM/__tests__/webSidecar.testeranto/node → lib/BaseSuite.test/pure.test/pure}/dev.html +0 -0
- /package/testeranto/reports/allTests/src/{Pure.test/node → lib/BaseSuite.test/web.test/web}/dev.html +0 -0
- /package/testeranto/reports/allTests/src/lib/{BaseGiven.test → baseBuilder.test/baseBuilder.test.node}/node/dev.html +0 -0
- /package/testeranto/reports/allTests/src/{PM/__tests__/nodeSidecar.testeranto/node/console_log.txt → lib/baseBuilder.test/baseBuilder.test.node/node/logs.txt} +0 -0
- /package/testeranto/reports/allTests/src/lib/{BaseSuite.test/node → baseBuilder.test/baseBuilder.test.pure/pure}/dev.html +0 -0
- /package/testeranto/reports/allTests/src/{PM/__tests__/nodeSidecar.testeranto/node → lib/baseBuilder.test/baseBuilder.test.pure/pure}/log.txt +0 -0
- /package/testeranto/reports/allTests/src/lib/{BaseThen.test/node → baseBuilder.test/baseBuilder.test.web/web}/dev.html +0 -0
- /package/testeranto/reports/allTests/src/lib/{BaseSuite.test/node → baseBuilder.test/baseBuilder.test.web/web}/log.txt +0 -0
- /package/testeranto/reports/allTests/src/{mothership/test/node/log.txt → lib/baseBuilder.test/baseBuilder.test.web/web/logs.txt} +0 -0
package/src/Pure.ts
CHANGED
|
@@ -41,7 +41,13 @@ export class PureTesteranto<
|
|
|
41
41
|
async receiveTestResourceConfig(partialTestResource: string) {
|
|
42
42
|
const t: ITTestResourceConfiguration = JSON.parse(partialTestResource);
|
|
43
43
|
const pm = new PM_Pure(t);
|
|
44
|
-
|
|
44
|
+
|
|
45
|
+
try {
|
|
46
|
+
return await this.testJobs[0].receiveTestResourceConfig(pm);
|
|
47
|
+
} catch (e) {
|
|
48
|
+
return -2;
|
|
49
|
+
}
|
|
50
|
+
|
|
45
51
|
// const { failed, artifacts, logPromise, features, fails } =
|
|
46
52
|
// await this.testJobs[0].receiveTestResourceConfig(pm);
|
|
47
53
|
// // pm.customclose();
|
|
@@ -55,7 +61,7 @@ export default async <I extends Ibdd_in_any, O extends Ibdd_out, M>(
|
|
|
55
61
|
testImplementation: ITestImplementation<I, O, M>,
|
|
56
62
|
testInterface: Partial<ITestInterface<I>>,
|
|
57
63
|
testResourceRequirement: ITTestResourceRequest = defaultTestResourceRequirement
|
|
58
|
-
): Promise<Testeranto<I, O, M>> => {
|
|
64
|
+
): Promise<number | Testeranto<I, O, M>> => {
|
|
59
65
|
return new PureTesteranto<I, O, M>(
|
|
60
66
|
input,
|
|
61
67
|
testSpecification,
|
|
@@ -63,4 +69,16 @@ export default async <I extends Ibdd_in_any, O extends Ibdd_out, M>(
|
|
|
63
69
|
testResourceRequirement,
|
|
64
70
|
testInterface
|
|
65
71
|
);
|
|
72
|
+
|
|
73
|
+
// try {
|
|
74
|
+
// return new PureTesteranto<I, O, M>(
|
|
75
|
+
// input,
|
|
76
|
+
// testSpecification,
|
|
77
|
+
// testImplementation,
|
|
78
|
+
// testResourceRequirement,
|
|
79
|
+
// testInterface
|
|
80
|
+
// );
|
|
81
|
+
// } catch (e) {
|
|
82
|
+
// return -1;
|
|
83
|
+
// }
|
|
66
84
|
};
|
package/src/Types.ts
CHANGED
|
@@ -17,11 +17,11 @@ import { BaseSuite } from "./lib/BaseSuite.js";
|
|
|
17
17
|
export type ISummary = Record<
|
|
18
18
|
string,
|
|
19
19
|
{
|
|
20
|
-
|
|
21
|
-
typeErrors: number;
|
|
22
|
-
staticErrors: number;
|
|
23
|
-
prompt: string;
|
|
24
|
-
failingFeatures: object;
|
|
20
|
+
runTimeErrors: number | "?" | undefined;
|
|
21
|
+
typeErrors: number | "?" | undefined;
|
|
22
|
+
staticErrors: number | "?" | undefined;
|
|
23
|
+
prompt: string | "?" | undefined;
|
|
24
|
+
failingFeatures: object | undefined;
|
|
25
25
|
}
|
|
26
26
|
>;
|
|
27
27
|
|
package/src/Web.ts
CHANGED
|
@@ -87,7 +87,7 @@ export default async <I extends Ibdd_in_any, O extends Ibdd_out, M>(
|
|
|
87
87
|
input: I["iinput"],
|
|
88
88
|
testSpecification: ITestSpecification<I, O>,
|
|
89
89
|
testImplementation: ITestImplementation<I, O, M>,
|
|
90
|
-
testInterface: Partial<
|
|
90
|
+
testInterface: Partial<ITestInterface<I>>,
|
|
91
91
|
testResourceRequirement: ITTestResourceRequest = defaultTestResourceRequirement
|
|
92
92
|
): Promise<Testeranto<I, O, M>> => {
|
|
93
93
|
return new WebTesteranto<I, O, M>(
|
package/src/build.ts
CHANGED
|
@@ -238,7 +238,6 @@ import(process.cwd() + "/" + "testeranto.config.ts").then(async (module) => {
|
|
|
238
238
|
];
|
|
239
239
|
|
|
240
240
|
x.forEach(async ([runtime, keys]) => {
|
|
241
|
-
console.log(runtime, keys);
|
|
242
241
|
keys.forEach(async (k) => {
|
|
243
242
|
const folder = `testeranto/reports/${testName}/${k
|
|
244
243
|
.split(".")
|
|
@@ -1,29 +1,43 @@
|
|
|
1
|
-
import type { Plugin } from
|
|
1
|
+
import type { Plugin } from "esbuild";
|
|
2
|
+
|
|
3
|
+
import fs from "fs";
|
|
2
4
|
|
|
3
5
|
export const consoleDetectorPlugin: Plugin = {
|
|
4
|
-
name:
|
|
6
|
+
name: "console-detector",
|
|
5
7
|
setup(build) {
|
|
6
8
|
build.onLoad({ filter: /\.(js|ts)$/ }, async (args) => {
|
|
7
|
-
const contents = await
|
|
8
|
-
|
|
9
|
-
const consolePattern =
|
|
9
|
+
const contents = await fs.promises.readFile(args.path, "utf8");
|
|
10
|
+
|
|
11
|
+
const consolePattern =
|
|
12
|
+
/console\.(log|error|warn|info|debug|trace|dir|dirxml|table|group|groupEnd|clear|count|countReset|assert|profile|profileEnd|time|timeLog|timeEnd|timeStamp|context|memory)/g;
|
|
10
13
|
const matches = contents.match(consolePattern);
|
|
11
14
|
|
|
12
15
|
if (matches) {
|
|
13
16
|
const uniqueMethods = [...new Set(matches)];
|
|
14
17
|
return {
|
|
15
|
-
warnings: uniqueMethods.map(method => ({
|
|
16
|
-
text: `
|
|
17
|
-
location: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
warnings: uniqueMethods.map((method) => ({
|
|
19
|
+
text: `call of "${method}" was detected, which is not supported in the pure runtime.`,
|
|
20
|
+
// location: {
|
|
21
|
+
// file: args.path,
|
|
22
|
+
// line:
|
|
23
|
+
// contents
|
|
24
|
+
// .split("\n")
|
|
25
|
+
// .findIndex((line) => line.includes(method)) + 1,
|
|
26
|
+
// column: 0,
|
|
27
|
+
// },
|
|
28
|
+
})),
|
|
23
29
|
};
|
|
24
30
|
}
|
|
25
31
|
|
|
26
32
|
return null;
|
|
27
33
|
});
|
|
28
|
-
|
|
34
|
+
build.onEnd((buildResult) => {
|
|
35
|
+
if (
|
|
36
|
+
buildResult.warnings.find((br) => br.pluginName === "console-detector")
|
|
37
|
+
)
|
|
38
|
+
console.warn(
|
|
39
|
+
`Warning: An unsupported method call was detected in a source file used to build for the pure runtime. It is possible that this method call is in a comment block. If you really want to use this function, change this test to the "node" runtime.`
|
|
40
|
+
);
|
|
41
|
+
});
|
|
42
|
+
},
|
|
29
43
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Plugin } from "esbuild";
|
|
2
|
+
|
|
3
|
+
import { isBuiltin } from "node:module";
|
|
4
|
+
|
|
5
|
+
export const nativeImportDetectorPlugin: Plugin = {
|
|
6
|
+
name: "native-node-import-filter",
|
|
7
|
+
setup(build) {
|
|
8
|
+
build.onResolve({ filter: /fs/ }, (args) => {
|
|
9
|
+
if (isBuiltin(args.path)) {
|
|
10
|
+
return {
|
|
11
|
+
warnings: [
|
|
12
|
+
{
|
|
13
|
+
text: `cannot use native node package "${args.path}" in a "pure" test. If you really want to use this package, convert this test from "pure" to "node"`,
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// throw new Error(
|
|
19
|
+
// `cannot use native node package "${args.path}" in a "pure" test. If you really want to use this package, convert this test from "pure" to "node"`
|
|
20
|
+
// );
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return { path: args.path };
|
|
24
|
+
});
|
|
25
|
+
},
|
|
26
|
+
};
|
|
@@ -9,6 +9,7 @@ import featuresPlugin from "./featuresPlugin.js";
|
|
|
9
9
|
import { isBuiltin } from "node:module";
|
|
10
10
|
import { consoleDetectorPlugin } from "./consoleDetectorPlugin.js";
|
|
11
11
|
import rebuildPlugin from "./rebuildPlugin.js";
|
|
12
|
+
import { nativeImportDetectorPlugin } from "./nativeImportDetectorPlugin.js";
|
|
12
13
|
|
|
13
14
|
export default (
|
|
14
15
|
config: ITestconfig,
|
|
@@ -53,13 +54,14 @@ export default (
|
|
|
53
54
|
|
|
54
55
|
consoleDetectorPlugin,
|
|
55
56
|
|
|
57
|
+
// nativeImportDetectorPlugin,
|
|
56
58
|
{
|
|
57
59
|
name: "native-node-import-filter",
|
|
58
60
|
setup(build) {
|
|
59
61
|
build.onResolve({ filter: /fs/ }, (args) => {
|
|
60
62
|
if (isBuiltin(args.path)) {
|
|
61
63
|
throw new Error(
|
|
62
|
-
`
|
|
64
|
+
`You attempted to import a node module "${args.path}" into a "pure" test, which is not allowed. If you really want to use this package, convert this test from "pure" to "node"`
|
|
63
65
|
);
|
|
64
66
|
}
|
|
65
67
|
|
|
@@ -6,11 +6,8 @@ export default (r: IRunTime) => {
|
|
|
6
6
|
return {
|
|
7
7
|
name: "rebuild-notify",
|
|
8
8
|
setup: (build) => {
|
|
9
|
-
build.onStart(() => {
|
|
10
|
-
console.log(`> web build starting...`);
|
|
11
|
-
});
|
|
12
9
|
build.onEnd((result) => {
|
|
13
|
-
console.log(
|
|
10
|
+
console.log(`${r} > build ended with ${result.errors.length} errors`);
|
|
14
11
|
if (result.errors.length > 0) {
|
|
15
12
|
fs.writeFileSync(
|
|
16
13
|
`./testeranto/reports${r}_build_errors`,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import Testeranto from "../../Node";
|
|
2
|
+
|
|
3
|
+
import { BaseSuite } from "../BaseSuite";
|
|
4
|
+
|
|
5
|
+
import { I, implementation, O, specification, testInterface } from "./test";
|
|
6
|
+
|
|
7
|
+
export default Testeranto<I, O, {}>(
|
|
8
|
+
BaseSuite,
|
|
9
|
+
specification,
|
|
10
|
+
implementation,
|
|
11
|
+
testInterface
|
|
12
|
+
);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import Testeranto from "../../Pure";
|
|
2
|
+
|
|
3
|
+
import { BaseSuite } from "../BaseSuite";
|
|
4
|
+
|
|
5
|
+
import { I, implementation, O, specification, testInterface } from "./test";
|
|
6
|
+
|
|
7
|
+
export default Testeranto<I, O, {}>(
|
|
8
|
+
BaseSuite,
|
|
9
|
+
specification,
|
|
10
|
+
implementation,
|
|
11
|
+
testInterface
|
|
12
|
+
);
|
|
@@ -1,32 +1,30 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { BaseSuite } from "./BaseSuite";
|
|
4
|
-
import { BaseGiven, BaseWhen, BaseThen, BaseCheck } from "./abstractBase";
|
|
5
|
-
import { ITTestResourceConfiguration, ITestArtifactory, ITLog } from ".";
|
|
6
|
-
import { IPM, ITestCheckCallback } from "./types";
|
|
1
|
+
import { ITTestResourceConfiguration, ITestArtifactory, ITLog } from "..";
|
|
7
2
|
import {
|
|
8
3
|
Ibdd_in,
|
|
9
4
|
Ibdd_out,
|
|
10
5
|
ITestSpecification,
|
|
11
6
|
ITestImplementation,
|
|
12
7
|
ITestInterface,
|
|
13
|
-
} from "
|
|
14
|
-
import { WhenSpecification } from "
|
|
8
|
+
} from "../../CoreTypes";
|
|
9
|
+
import { WhenSpecification } from "../../Types";
|
|
10
|
+
import { BaseGiven, BaseWhen, BaseThen, BaseCheck } from "../abstractBase";
|
|
11
|
+
import { BaseSuite } from "../BaseSuite";
|
|
12
|
+
import { IPM, ITestCheckCallback } from "../types";
|
|
15
13
|
|
|
16
14
|
// 1. Define our test types with full type safety
|
|
17
|
-
type TestStore = {
|
|
15
|
+
export type TestStore = {
|
|
18
16
|
testStore: boolean;
|
|
19
17
|
testSelection?: boolean;
|
|
20
18
|
error?: Error;
|
|
21
19
|
};
|
|
22
20
|
|
|
23
|
-
type TestSelection = {
|
|
21
|
+
export type TestSelection = {
|
|
24
22
|
testSelection: boolean;
|
|
25
23
|
error?: boolean;
|
|
26
24
|
};
|
|
27
25
|
|
|
28
|
-
type I = Ibdd_in<
|
|
29
|
-
|
|
26
|
+
export type I = Ibdd_in<
|
|
27
|
+
typeof BaseSuite,
|
|
30
28
|
BaseSuite<any, any>, // isubject
|
|
31
29
|
TestStore, // istore
|
|
32
30
|
TestSelection, // iselection
|
|
@@ -35,7 +33,7 @@ type I = Ibdd_in<
|
|
|
35
33
|
(store: TestStore) => Promise<TestSelection> // then
|
|
36
34
|
>;
|
|
37
35
|
|
|
38
|
-
type O = Ibdd_out<
|
|
36
|
+
export type O = Ibdd_out<
|
|
39
37
|
{
|
|
40
38
|
Default: [string]; // Suite names
|
|
41
39
|
},
|
|
@@ -57,7 +55,7 @@ type O = Ibdd_out<
|
|
|
57
55
|
>;
|
|
58
56
|
|
|
59
57
|
// 2. Mock implementations with proper typing
|
|
60
|
-
class MockGiven extends BaseGiven<I> {
|
|
58
|
+
export class MockGiven extends BaseGiven<I> {
|
|
61
59
|
constructor(
|
|
62
60
|
name: string,
|
|
63
61
|
features: string[],
|
|
@@ -86,7 +84,7 @@ class MockGiven extends BaseGiven<I> {
|
|
|
86
84
|
}
|
|
87
85
|
|
|
88
86
|
uberCatcher(e: Error): void {
|
|
89
|
-
console.error("Given error:", e);
|
|
87
|
+
console.error("Given error 2:", e);
|
|
90
88
|
}
|
|
91
89
|
}
|
|
92
90
|
|
|
@@ -160,7 +158,7 @@ class TestableSuite extends BaseSuite<I, O> {
|
|
|
160
158
|
}
|
|
161
159
|
|
|
162
160
|
// 3. Enhanced Test Specification with more test cases
|
|
163
|
-
const specification: ITestSpecification<I, O> = (
|
|
161
|
+
export const specification: ITestSpecification<I, O> = (
|
|
164
162
|
Suite: ITestSpecification<I, O>,
|
|
165
163
|
Given: WhenSpecification<I, O>,
|
|
166
164
|
When: WhenSpecification<I, O>,
|
|
@@ -228,20 +226,20 @@ const specification: ITestSpecification<I, O> = (
|
|
|
228
226
|
[
|
|
229
227
|
When.addArtifact(Promise.resolve("test")),
|
|
230
228
|
When.modifySpecs((specs) => [...specs, "extra"]),
|
|
231
|
-
When.modifyJobs((jobs) => [...jobs, {}])
|
|
229
|
+
When.modifyJobs((jobs) => [...jobs, {}]),
|
|
232
230
|
],
|
|
233
231
|
[
|
|
234
232
|
Then.specsModified(1),
|
|
235
233
|
Then.jobsModified(1),
|
|
236
234
|
Then.artifactsTracked(),
|
|
237
|
-
Then.testRunSuccessful()
|
|
235
|
+
Then.testRunSuccessful(),
|
|
238
236
|
]
|
|
239
|
-
)
|
|
240
|
-
})
|
|
237
|
+
),
|
|
238
|
+
}),
|
|
241
239
|
];
|
|
242
240
|
|
|
243
241
|
// 4. Enhanced Test Implementation with more operations
|
|
244
|
-
const implementation: ITestImplementation<I, O> = {
|
|
242
|
+
export const implementation: ITestImplementation<I, O> = {
|
|
245
243
|
suites: {
|
|
246
244
|
Default: "BaseSuite Comprehensive Test Suite" as const,
|
|
247
245
|
},
|
|
@@ -434,7 +432,7 @@ const implementation: ITestImplementation<I, O> = {
|
|
|
434
432
|
};
|
|
435
433
|
|
|
436
434
|
// 5. Fully typed Test Interface
|
|
437
|
-
const testInterface: ITestInterface<I> = {
|
|
435
|
+
export const testInterface: ITestInterface<I> = {
|
|
438
436
|
beforeEach: async (
|
|
439
437
|
subject: I["isubject"],
|
|
440
438
|
initializer: (context?: any) => I["given"]
|
|
@@ -466,11 +464,3 @@ const testInterface: ITestInterface<I> = {
|
|
|
466
464
|
pm: IPM
|
|
467
465
|
): Promise<I["isubject"]> => input as unknown as I["isubject"],
|
|
468
466
|
};
|
|
469
|
-
|
|
470
|
-
// 6. Run the tests
|
|
471
|
-
export default Testeranto<I, O, {}>(
|
|
472
|
-
BaseSuite.prototype,
|
|
473
|
-
specification,
|
|
474
|
-
implementation,
|
|
475
|
-
testInterface
|
|
476
|
-
);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import Testeranto from "../../Web";
|
|
2
|
+
|
|
3
|
+
import { BaseSuite } from "../BaseSuite";
|
|
4
|
+
|
|
5
|
+
import { I, implementation, O, specification, testInterface } from "./test";
|
|
6
|
+
|
|
7
|
+
export default Testeranto<I, O, {}>(
|
|
8
|
+
BaseSuite,
|
|
9
|
+
specification,
|
|
10
|
+
implementation,
|
|
11
|
+
testInterface
|
|
12
|
+
);
|
package/src/lib/BaseSuite.ts
CHANGED
|
@@ -95,21 +95,23 @@ export abstract class BaseSuite<I extends Ibdd_in_any, O extends Ibdd_out_any> {
|
|
|
95
95
|
|
|
96
96
|
for (const [gKey, g] of Object.entries(this.givens)) {
|
|
97
97
|
const giver = this.givens[gKey];
|
|
98
|
-
this.store = await giver
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
98
|
+
this.store = await giver
|
|
99
|
+
.give(
|
|
100
|
+
subject,
|
|
101
|
+
gKey,
|
|
102
|
+
testResourceConfiguration,
|
|
103
|
+
this.assertThat,
|
|
104
|
+
suiteArtifactory,
|
|
105
|
+
tLog,
|
|
106
|
+
pm,
|
|
107
|
+
sNdx
|
|
108
|
+
)
|
|
109
|
+
.catch((e) => {
|
|
110
|
+
this.failed = true;
|
|
111
|
+
this.fails = this.fails + 1;
|
|
112
|
+
console.error("Given error 1:", e);
|
|
113
|
+
throw e;
|
|
114
|
+
});
|
|
113
115
|
}
|
|
114
116
|
|
|
115
117
|
for (const [ndx, thater] of this.checks.entries()) {
|
package/src/lib/abstractBase.ts
CHANGED
|
@@ -214,7 +214,6 @@ export abstract class BaseWhen<I extends Ibdd_in_any> {
|
|
|
214
214
|
testResourceConfiguration,
|
|
215
215
|
andWhenProxy(pm, filepath)
|
|
216
216
|
).catch((e: Error) => {
|
|
217
|
-
console.log("MARK9", e);
|
|
218
217
|
this.error = e;
|
|
219
218
|
throw e;
|
|
220
219
|
});
|
|
@@ -271,7 +270,6 @@ export abstract class BaseThen<I extends Ibdd_in_any> {
|
|
|
271
270
|
testResourceConfiguration,
|
|
272
271
|
butThenProxy(pm, filepath)
|
|
273
272
|
).catch((e) => {
|
|
274
|
-
console.log("test failed 3", e);
|
|
275
273
|
this.error = e;
|
|
276
274
|
throw e;
|
|
277
275
|
});
|
|
@@ -4,7 +4,8 @@ import { ITestImplementation } from "../../CoreTypes";
|
|
|
4
4
|
import { TestBaseBuilder } from "./TestBaseBuilder";
|
|
5
5
|
|
|
6
6
|
import { I, O } from "./baseBuilder.test.types";
|
|
7
|
-
import {
|
|
7
|
+
import { ITTestResourceRequest } from "..";
|
|
8
|
+
import { BaseBuilder } from "../basebuilder";
|
|
8
9
|
|
|
9
10
|
// Define our test subject type
|
|
10
11
|
type TestSubject = TestBaseBuilder<any, any, any, any, any, any>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Testeranto from "../../Pure";
|
|
2
|
+
|
|
3
|
+
import { specification } from "./baseBuilder.test.specification";
|
|
4
|
+
import { implementation } from "./baseBuilder.test.implementation";
|
|
5
|
+
import { testInterface } from "./baseBuilder.test.interface";
|
|
6
|
+
import { I, O } from "./baseBuilder.test.types";
|
|
7
|
+
import { BaseBuilder } from "../basebuilder";
|
|
8
|
+
|
|
9
|
+
export default Testeranto<I, O, {}>(
|
|
10
|
+
BaseBuilder.prototype,
|
|
11
|
+
specification,
|
|
12
|
+
implementation,
|
|
13
|
+
testInterface
|
|
14
|
+
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Testeranto from "../../Pure";
|
|
2
|
+
|
|
3
|
+
import { specification } from "./baseBuilder.test.specification";
|
|
4
|
+
import { implementation } from "./baseBuilder.test.implementation";
|
|
5
|
+
import { testInterface } from "./baseBuilder.test.interface";
|
|
6
|
+
import { I, O } from "./baseBuilder.test.types";
|
|
7
|
+
import { BaseBuilder } from "../basebuilder";
|
|
8
|
+
|
|
9
|
+
export default Testeranto<I, O, {}>(
|
|
10
|
+
BaseBuilder.prototype,
|
|
11
|
+
specification,
|
|
12
|
+
implementation,
|
|
13
|
+
testInterface
|
|
14
|
+
);
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import Testeranto from "../../
|
|
1
|
+
import Testeranto from "../../Web";
|
|
2
2
|
|
|
3
3
|
import { specification } from "./baseBuilder.test.specification";
|
|
4
4
|
import { implementation } from "./baseBuilder.test.implementation";
|
|
5
5
|
import { testInterface } from "./baseBuilder.test.interface";
|
|
6
6
|
import { I, O } from "./baseBuilder.test.types";
|
|
7
|
+
import { BaseBuilder } from "../basebuilder";
|
|
7
8
|
|
|
8
9
|
export default Testeranto<I, O, {}>(
|
|
9
10
|
BaseBuilder.prototype,
|
package/src/lib/basebuilder.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
+
import { PassThrough } from "stream";
|
|
3
|
+
|
|
4
|
+
import { ITestImplementation, ITestSpecification } from "../../CoreTypes";
|
|
2
5
|
import { TestClassBuilder } from "./TestClassBuilder";
|
|
3
6
|
import { I, O, M } from "./classBuilder.test.types";
|
|
4
|
-
|
|
7
|
+
|
|
5
8
|
import { ITTestResourceRequest } from "..";
|
|
9
|
+
import { specification } from "./classBuilder.test.specification";
|
|
6
10
|
|
|
7
11
|
export const implementation: ITestImplementation<I, O, M> = {
|
|
8
12
|
suites: {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ITestJob } from "..";
|
|
1
2
|
import { ITestSpecification } from "../../CoreTypes";
|
|
2
3
|
import { I, O } from "./classBuilder.test.types";
|
|
3
4
|
|
|
@@ -55,7 +56,7 @@ export const specification: ITestSpecification<I, O> = (
|
|
|
55
56
|
Then.givensOverridesConfigured(),
|
|
56
57
|
Then.whensOverridesConfigured(),
|
|
57
58
|
Then.thensOverridesConfigured(),
|
|
58
|
-
Then.checksOverridesConfigured()
|
|
59
|
+
Then.checksOverridesConfigured(),
|
|
59
60
|
]
|
|
60
61
|
),
|
|
61
62
|
},
|
|
@@ -101,12 +102,12 @@ export const specification: ITestSpecification<I, O> = (
|
|
|
101
102
|
["Should complete a full test run successfully"],
|
|
102
103
|
[],
|
|
103
104
|
[Then.testRunSuccessful()]
|
|
104
|
-
)
|
|
105
|
+
),
|
|
105
106
|
},
|
|
106
107
|
[
|
|
107
108
|
Check.ImplementationCheck((impl) => impl !== null),
|
|
108
|
-
Check.SpecificationCheck((spec) => spec !== null)
|
|
109
|
+
Check.SpecificationCheck((spec) => spec !== null),
|
|
109
110
|
]
|
|
110
|
-
)
|
|
111
|
+
),
|
|
111
112
|
];
|
|
112
113
|
};
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import {
|
|
3
|
+
Ibdd_in,
|
|
4
|
+
Ibdd_out,
|
|
5
|
+
ITestImplementation,
|
|
6
|
+
ITestSpecification,
|
|
7
|
+
} from "../../CoreTypes";
|
|
2
8
|
import { ClassBuilder } from "../classBuilder";
|
|
3
|
-
import { ITTestResourceRequest } from "..";
|
|
9
|
+
import { ITestJob, ITTestResourceRequest } from "..";
|
|
4
10
|
|
|
5
11
|
export type I = Ibdd_in<
|
|
6
12
|
{}, // iinput
|
|
@@ -61,12 +67,18 @@ export type O = Ibdd_out<
|
|
|
61
67
|
|
|
62
68
|
export type M = {
|
|
63
69
|
givens: {
|
|
64
|
-
[K in keyof O["givens"]]: (
|
|
70
|
+
[K in keyof O["givens"]]: (
|
|
71
|
+
...args: O["givens"][K]
|
|
72
|
+
) => ClassBuilder<any, any, any>;
|
|
65
73
|
};
|
|
66
74
|
whens: {
|
|
67
|
-
[K in keyof O["whens"]]: (
|
|
75
|
+
[K in keyof O["whens"]]: (
|
|
76
|
+
...args: O["whens"][K]
|
|
77
|
+
) => (builder: ClassBuilder<any, any, any>) => ClassBuilder<any, any, any>;
|
|
68
78
|
};
|
|
69
79
|
thens: {
|
|
70
|
-
[K in keyof O["thens"]]: (
|
|
80
|
+
[K in keyof O["thens"]]: (
|
|
81
|
+
...args: O["thens"][K]
|
|
82
|
+
) => (builder: ClassBuilder<any, any, any>) => ClassBuilder<any, any, any>;
|
|
71
83
|
};
|
|
72
84
|
};
|
package/src/lib/core.ts
CHANGED
|
@@ -120,16 +120,6 @@ export default abstract class TesterantoCore<
|
|
|
120
120
|
testResource,
|
|
121
121
|
pm
|
|
122
122
|
);
|
|
123
|
-
// try {
|
|
124
|
-
// return await fullTestInterface.andWhen(
|
|
125
|
-
// store,
|
|
126
|
-
// whenCB,
|
|
127
|
-
// testResource,
|
|
128
|
-
// pm
|
|
129
|
-
// );
|
|
130
|
-
// } catch (e) {
|
|
131
|
-
// console.log("mark22", e);
|
|
132
|
-
// }
|
|
133
123
|
}
|
|
134
124
|
} as any,
|
|
135
125
|
|
|
@@ -25,7 +25,6 @@ export const testInterface: ITestInterface<I> = {
|
|
|
25
25
|
},
|
|
26
26
|
|
|
27
27
|
butThen: async (store, thenCB, testResource, pm) => {
|
|
28
|
-
console.log("mark2 butThen", store, thenCB.toString());
|
|
29
28
|
const proxiedPM = butThenProxy(pm, "some/path");
|
|
30
29
|
return thenCB(store, proxiedPM);
|
|
31
30
|
},
|
package/src/run.ts
CHANGED
|
@@ -7,7 +7,9 @@ import { ITestconfig, IBuiltConfig, IProject } from "./Types";
|
|
|
7
7
|
readline.emitKeypressEvents(process.stdin);
|
|
8
8
|
if (process.stdin.isTTY) process.stdin.setRawMode(true);
|
|
9
9
|
|
|
10
|
-
console.log(ansiC.inverse("Press '
|
|
10
|
+
console.log(ansiC.inverse("Press 'q' to initiate a graceful shutdown."));
|
|
11
|
+
console.log(ansiC.inverse("Press 'x' to quit forcefully."));
|
|
12
|
+
|
|
11
13
|
process.stdin.on("keypress", (str, key) => {
|
|
12
14
|
if (key.name === "x") {
|
|
13
15
|
console.log(ansiC.inverse("Shutting down forcefully..."));
|
|
@@ -15,7 +17,7 @@ process.stdin.on("keypress", (str, key) => {
|
|
|
15
17
|
}
|
|
16
18
|
});
|
|
17
19
|
|
|
18
|
-
const
|
|
20
|
+
const projectName = process.argv[2];
|
|
19
21
|
|
|
20
22
|
const mode = process.argv[3] as "once" | "dev";
|
|
21
23
|
if (mode !== "once" && mode !== "dev") {
|
|
@@ -23,19 +25,17 @@ if (mode !== "once" && mode !== "dev") {
|
|
|
23
25
|
process.exit(-1);
|
|
24
26
|
}
|
|
25
27
|
|
|
26
|
-
console.log("testeranto is running", testName, mode);
|
|
27
|
-
|
|
28
28
|
import(process.cwd() + "/" + "testeranto.config.ts").then(async (module) => {
|
|
29
29
|
const bigConfig: IProject = module.default;
|
|
30
30
|
|
|
31
|
-
const rawConfig: ITestconfig = bigConfig.projects[
|
|
31
|
+
const rawConfig: ITestconfig = bigConfig.projects[projectName];
|
|
32
32
|
|
|
33
33
|
const config: IBuiltConfig = {
|
|
34
34
|
...rawConfig,
|
|
35
|
-
buildDir: process.cwd() + "/" + `testeranto/${
|
|
35
|
+
buildDir: process.cwd() + "/" + `testeranto/${projectName}.json`,
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
const pm = new PM_Main(config,
|
|
38
|
+
const pm = new PM_Main(config, projectName, mode);
|
|
39
39
|
pm.start();
|
|
40
40
|
|
|
41
41
|
process.stdin.on("keypress", (str, key) => {
|