testeranto 0.134.0 → 0.140.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.aider.chat.history.md +14577 -0
- package/.aider.input.history +566 -0
- package/.aider.tags.cache.v3/{8d/fa/12860238755bcfab9af8a93c52ab.val → bd/91/b71f967fd074cf4b757081b429b7.val} +0 -0
- package/.aider.tags.cache.v3/cache.db +0 -0
- package/.aider.tags.cache.v3/{18/8b/7dfca822129dad10b5cacadf7728.val → fb/96/b0f91c7e75e08fc5a6907633cf99.val} +0 -0
- package/README.md +29 -423
- package/bundle.js +1 -1
- package/dist/common/src/CoreTypes.js +2 -0
- package/dist/common/src/Init.js +4 -1
- package/dist/common/src/Node.js +1 -1
- package/dist/common/src/PM/PM_WithEslintAndTsc.js +10 -8
- package/dist/common/src/PM/__tests__/nodeSidecar.testeranto.js +2 -2
- package/dist/common/src/PM/main.js +12 -7
- package/dist/common/src/PM/node.js +10 -3
- package/dist/common/src/Web.js +2 -2
- package/dist/common/src/build.js +7 -72
- package/dist/common/src/defaultConfig.js +0 -1
- package/dist/common/src/esbuildConfigs/eslint-formatter-testeranto.js +16 -1
- package/dist/common/src/esbuildConfigs/node.js +2 -16
- package/dist/common/src/esbuildConfigs/pure.js +2 -16
- package/dist/common/src/esbuildConfigs/rebuildPlugin.js +22 -0
- package/dist/common/src/esbuildConfigs/web.js +2 -16
- package/dist/common/src/lib/abstractBase.js +8 -1
- package/dist/common/src/lib/basebuilder.js +4 -0
- package/dist/common/src/lib/classBuilder.js +2 -3
- package/dist/common/src/lib/core.js +2 -0
- package/dist/common/src/run.js +1 -1
- package/dist/common/src/utils/buildTemplates.js +88 -0
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/src/Init.js +4 -1
- package/dist/module/src/Node.js +1 -1
- package/dist/module/src/PM/PM_WithEslintAndTsc.js +10 -8
- package/dist/module/src/PM/__tests__/nodeSidecar.testeranto.js +2 -2
- package/dist/module/src/PM/main.js +12 -7
- package/dist/module/src/PM/node.js +10 -3
- package/dist/module/src/Project.js +41 -47
- package/dist/module/src/TestReport.js +34 -31
- package/dist/module/src/Web.js +2 -2
- package/dist/module/src/build.js +7 -72
- package/dist/module/src/defaultConfig.js +0 -1
- package/dist/module/src/esbuildConfigs/eslint-formatter-testeranto.js +16 -1
- package/dist/module/src/esbuildConfigs/node.js +2 -16
- package/dist/module/src/esbuildConfigs/pure.js +2 -16
- package/dist/module/src/esbuildConfigs/rebuildPlugin.js +17 -0
- package/dist/module/src/esbuildConfigs/web.js +2 -16
- package/dist/module/src/lib/abstractBase.js +8 -1
- package/dist/module/src/lib/basebuilder.js +4 -0
- package/dist/module/src/lib/classBuilder.js +2 -3
- package/dist/module/src/lib/core.js +2 -0
- package/dist/module/src/run.js +1 -1
- package/dist/module/src/utils/buildTemplates.js +82 -0
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/prebuild/Project.js +77 -29
- package/dist/prebuild/TestReport.js +51 -32
- package/dist/prebuild/build.mjs +132 -131
- package/dist/prebuild/esbuildConfigs/eslint-formatter-testeranto.mjs +14 -1
- package/dist/prebuild/init-docs.mjs +0 -4
- package/dist/prebuild/run.mjs +50 -31
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/src/CoreTypes.d.ts +53 -0
- package/dist/types/src/Node.d.ts +3 -3
- package/dist/types/src/PM/__tests__/nodeSidecar.testeranto.d.ts +2 -4
- package/dist/types/src/PM/__tests__/pureSidecar.testeranto.d.ts +2 -4
- package/dist/types/src/PM/__tests__/webSidecar.testeranto.d.ts +2 -4
- package/dist/types/src/PM/index.d.ts +1 -1
- package/dist/types/src/PM/nodeSidecar.d.ts +2 -2
- package/dist/types/src/Pure.d.ts +3 -3
- package/dist/types/src/Types.d.ts +21 -61
- package/dist/types/src/Web.d.ts +3 -3
- package/dist/types/src/esbuildConfigs/rebuildPlugin.d.ts +6 -0
- package/dist/types/src/lib/abstractBase.d.ts +10 -16
- package/dist/types/src/lib/basebuilder.d.ts +3 -3
- package/dist/types/src/lib/classBuilder.d.ts +2 -2
- package/dist/types/src/lib/core.d.ts +2 -2
- package/dist/types/src/lib/index.d.ts +7 -6
- package/dist/types/src/lib/types.d.ts +8 -8
- package/dist/types/src/mothership/test.d.ts +2 -2
- package/dist/types/src/utils/buildTemplates.d.ts +3 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/docs/index.md +567 -0
- package/docs/style.md +116 -0
- package/docs.html +537 -0
- package/example.css +351 -0
- package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-Black.ttf +0 -0
- package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-Bold.ttf +0 -0
- package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-ExtraBold.ttf +0 -0
- package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-Light.ttf +0 -0
- package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-Medium.ttf +0 -0
- package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-Regular.ttf +0 -0
- package/fonts/M_PLUS_Rounded_1c/MPLUSRounded1c-Thin.ttf +0 -0
- package/fonts/M_PLUS_Rounded_1c/OFL.txt +91 -0
- package/index.html +245 -24
- package/logo.svg +72 -0
- package/package.json +11 -2
- package/scripts/compile-docs.js +89 -0
- package/src/CoreTypes.ts +152 -0
- package/src/Init.ts +4 -4
- package/src/Node.ts +13 -13
- package/src/PM/PM_WithEslintAndTsc.ts +46 -15
- package/src/PM/__tests__/nodeSidecar.testeranto.ts +13 -20
- package/src/PM/__tests__/pureSidecar.testeranto.ts +8 -15
- package/src/PM/__tests__/webSidecar.testeranto.ts +8 -15
- package/src/PM/index.ts +1 -1
- package/src/PM/main.ts +17 -16
- package/src/PM/node.ts +10 -10
- package/src/PM/nodeSidecar.ts +2 -2
- package/src/PM/pure.ts +0 -4
- package/src/Project.tsx +289 -292
- package/src/Pure.ts +13 -14
- package/src/PureSidecar.ts +1 -0
- package/src/TestReport.tsx +179 -165
- package/src/Types.ts +52 -151
- package/src/Web.ts +15 -14
- package/src/build.ts +22 -72
- package/src/defaultConfig.ts +2 -1
- package/src/esbuildConfigs/eslint-formatter-testeranto.ts +17 -1
- package/src/esbuildConfigs/node.ts +2 -18
- package/src/esbuildConfigs/pure.ts +2 -18
- package/src/esbuildConfigs/rebuildPlugin.ts +23 -0
- package/src/esbuildConfigs/web.ts +2 -18
- package/src/lib/BaseSuite.test.ts +457 -0
- package/src/lib/BaseSuite.ts +155 -0
- package/src/lib/abstractBase.ts +13 -163
- package/src/lib/basebuilder.ts +11 -11
- package/src/lib/classBuilder.ts +13 -7
- package/src/lib/core.ts +13 -17
- package/src/lib/index.ts +21 -24
- package/src/lib/types.ts +23 -9
- package/src/mothership/test.ts +13 -10
- package/src/run.ts +1 -1
- package/src/style.css +1 -1
- package/src/utils/buildTemplates.ts +88 -0
- package/style.css +496 -0
- package/testeranto/bundles/node/{mothership/chunk-V2EQEXU2.mjs → allTests/chunk-4PJCC2XT.mjs} +66 -59
- package/testeranto/bundles/node/allTests/metafile.json +4151 -0
- package/testeranto/bundles/node/allTests/src/PM/__tests__/nodeSidecar.testeranto.mjs +187 -0
- package/testeranto/bundles/node/{mothership → allTests}/src/PM/__tests__/pureSidecar.testeranto.mjs +1 -1
- package/testeranto/bundles/node/{mothership → allTests}/src/PM/__tests__/webSidecar.testeranto.mjs +1 -1
- package/testeranto/bundles/node/allTests/src/lib/BaseSuite.test.mjs +305 -0
- package/testeranto/bundles/node/{mothership → allTests}/src/mothership/test.mjs +1 -1
- package/testeranto/dev.html +29 -0
- package/testeranto/index.html +28 -27
- package/testeranto/reports/allTests/config.json +57 -0
- package/testeranto/reports/{mothership/index.html → allTests/dev.html} +2 -0
- package/testeranto/reports/allTests/index.html +26 -0
- package/testeranto/reports/{mothership/src/PM/__tests__/sidecar.testeranto/node/index.html → allTests/src/PM/__tests__/nodeSidecar.testeranto/node/dev.html} +4 -3
- package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/index.html +21 -0
- package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/lint_errors.json +80 -0
- package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/message +1 -0
- package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/prompt.txt +8 -0
- package/testeranto/reports/allTests/src/PM/__tests__/nodeSidecar.testeranto/node/type_errors.txt +28 -0
- package/testeranto/reports/{mothership/src/PM/__tests__/webSidecar.testeranto/node/index.html → allTests/src/PM/__tests__/pureSidecar.testeranto/node/dev.html} +4 -3
- package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/index.html +21 -0
- package/testeranto/reports/{mothership → allTests}/src/PM/__tests__/pureSidecar.testeranto/node/lint_errors.json +12 -12
- package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/message +1 -0
- package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/prompt.txt +8 -0
- package/testeranto/reports/allTests/src/PM/__tests__/pureSidecar.testeranto/node/type_errors.txt +32 -0
- package/testeranto/reports/{mothership/src/PM/__tests__/nodeSidecar.testeranto/node/index.html → allTests/src/PM/__tests__/webSidecar.testeranto/node/dev.html} +4 -3
- package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/index.html +21 -0
- package/testeranto/reports/{mothership → allTests}/src/PM/__tests__/webSidecar.testeranto/node/lint_errors.json +12 -12
- package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/message +1 -0
- package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/prompt.txt +8 -0
- package/testeranto/reports/allTests/src/PM/__tests__/webSidecar.testeranto/node/type_errors.txt +32 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/console_log.txt +35 -0
- package/testeranto/reports/{mothership/src/PM/__tests__/pureSidecar.testeranto/node/index.html → allTests/src/lib/BaseSuite.test/node/dev.html} +4 -3
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/index.html +21 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/lint_errors.json +608 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/message +1 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/prompt.txt +7 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node/type_errors.txt +68 -0
- package/testeranto/reports/allTests/src/mothership/test/node/dev.html +21 -0
- package/testeranto/reports/allTests/src/mothership/test/node/index.html +21 -0
- package/testeranto/reports/allTests/src/mothership/test/node/message +1 -0
- package/testeranto/reports/allTests/src/mothership/test/node/prompt.txt +8 -0
- package/testeranto/reports/allTests/src/mothership/test/node/type_errors.txt +24 -0
- package/testeranto/reports/allTests/summary.json +37 -0
- package/testeranto.config.ts +16 -26
- package/tsc.log +66 -69
- package/.aider.tags.cache.v3/cache.db-shm +0 -0
- package/.aider.tags.cache.v3/cache.db-wal +0 -0
- package/dist/common/src/SP__Polygon.test.js +0 -10
- package/dist/module/src/ReportClient.js +0 -132
- package/dist/module/src/SP__Polygon.test.js +0 -8
- package/dist/prebuild/ReportClient.js +0 -3
- package/src/ReportClient.tsx +0 -164
- package/src/SP__Polygon.test.ts +0 -13
- package/testeranto/ReportClient.css +0 -11367
- package/testeranto/ReportClient.js +0 -24641
- package/testeranto/bundles/node/mothership/metafile.json +0 -389
- package/testeranto/bundles/node/mothership/src/PM/__tests__/nodeSidecar.testeranto.mjs +0 -1219
- package/testeranto/bundles/node/mothership/src/PM/__tests__/sidecar.testeranto.mjs +0 -1199
- package/testeranto/reports/mothership/config.json +0 -25
- package/testeranto/reports/mothership/src/PM/__tests__/nodeSidecar.testeranto/node/console_log.txt +0 -0
- package/testeranto/reports/mothership/src/PM/__tests__/nodeSidecar.testeranto/node/lint_errors.json +0 -1564
- package/testeranto/reports/mothership/src/PM/__tests__/nodeSidecar.testeranto/node/prompt.txt +0 -22
- package/testeranto/reports/mothership/src/PM/__tests__/nodeSidecar.testeranto/node/type_errors.txt +0 -35
- package/testeranto/reports/mothership/src/PM/__tests__/pureSidecar.testeranto/node/prompt.txt +0 -12
- package/testeranto/reports/mothership/src/PM/__tests__/pureSidecar.testeranto/node/type_errors.txt +0 -26
- package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/bdd_errors.txt +0 -1
- package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/console_log.txt +0 -0
- package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/lint_errors.json +0 -1564
- package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/log.txt +0 -0
- package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/prompt.txt +0 -22
- package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/tests.json +0 -56
- package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/type_errors.txt +0 -29
- package/testeranto/reports/mothership/src/PM/__tests__/webSidecar.testeranto/node/prompt.txt +0 -12
- package/testeranto/reports/mothership/src/PM/__tests__/webSidecar.testeranto/node/type_errors.txt +0 -26
- package/testeranto/reports/mothership/src/mothership/test/node/bdd_errors.txt +0 -1
- package/testeranto/reports/mothership/src/mothership/test/node/console_log.txt +0 -4
- package/testeranto/reports/mothership/src/mothership/test/node/index.html +0 -20
- package/testeranto/reports/mothership/src/mothership/test/node/log.txt +0 -0
- package/testeranto/reports/mothership/src/mothership/test/node/prompt.txt +0 -12
- package/testeranto/reports/mothership/src/mothership/test/node/tests.json +0 -24
- package/testeranto/reports/mothership/src/mothership/test/node/type_errors.txt +0 -18
- package/testeranto/reports/mothership/summary.json +0 -9
- /package/dist/{types/src/SP__Polygon.test.d.ts → module/src/CoreTypes.js} +0 -0
- /package/testeranto/bundles/node/{mothership → allTests}/chunk-PG6KUKNP.mjs +0 -0
- /package/testeranto/bundles/pure/{mothership → allTests}/metafile.json +0 -0
- /package/testeranto/bundles/web/{mothership → allTests}/metafile.json +0 -0
- /package/testeranto/reports/{mothership/src/PM/__tests__/nodeSidecar.testeranto → allTests/src/lib/BaseSuite.test}/node/log.txt +0 -0
- /package/testeranto/reports/{mothership → allTests}/src/mothership/test/node/lint_errors.json +0 -0
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { createRequire } from 'module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
PM_sidecar
|
|
4
|
+
} from "../../../chunk-PG6KUKNP.mjs";
|
|
5
|
+
import {
|
|
6
|
+
Node_default
|
|
7
|
+
} from "../../../chunk-4PJCC2XT.mjs";
|
|
8
|
+
|
|
9
|
+
// src/PM/nodeSidecar.ts
|
|
10
|
+
import net from "net";
|
|
11
|
+
var PM_Node_Sidecar = class extends PM_sidecar {
|
|
12
|
+
constructor(t) {
|
|
13
|
+
super();
|
|
14
|
+
this.testResourceConfiguration = t;
|
|
15
|
+
this.client = {};
|
|
16
|
+
}
|
|
17
|
+
start(stopper) {
|
|
18
|
+
return new Promise((res) => {
|
|
19
|
+
process.on("message", async (message) => {
|
|
20
|
+
if (message === "stop") {
|
|
21
|
+
console.log("STOP!", stopper.toString());
|
|
22
|
+
await stopper();
|
|
23
|
+
process.exit();
|
|
24
|
+
} else if (message.path) {
|
|
25
|
+
this.client = net.createConnection(message.path, () => {
|
|
26
|
+
res();
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
stop() {
|
|
33
|
+
return new Promise((resolve) => {
|
|
34
|
+
if (this.client) {
|
|
35
|
+
this.client.end(() => resolve());
|
|
36
|
+
} else {
|
|
37
|
+
resolve();
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
testArtiFactoryfileWriter(tLog, callback) {
|
|
42
|
+
return (fPath, value) => {
|
|
43
|
+
callback(Promise.resolve());
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
send(command, ...argz) {
|
|
47
|
+
return new Promise((res) => {
|
|
48
|
+
const key = Math.random().toString();
|
|
49
|
+
const myListener = (event) => {
|
|
50
|
+
const x = JSON.parse(event);
|
|
51
|
+
if (x.key === key) {
|
|
52
|
+
process.removeListener("message", myListener);
|
|
53
|
+
res(x.payload);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
process.addListener("message", myListener);
|
|
57
|
+
this.client.write(JSON.stringify([command, ...argz, key]));
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
// src/PM/__tests__/nodeSidecar.testeranto.ts
|
|
63
|
+
var specification = (Suite, Given, When, Then) => {
|
|
64
|
+
return [
|
|
65
|
+
Suite.SidecarInitialized(
|
|
66
|
+
"Sidecar message passing works correctly",
|
|
67
|
+
{
|
|
68
|
+
basicSend: Given.SidecarReady(
|
|
69
|
+
["can send and receive messages"],
|
|
70
|
+
[When.SendTestMessage("test-message")],
|
|
71
|
+
[Then.MessageReceived("test-message")]
|
|
72
|
+
),
|
|
73
|
+
cleanup: Given.SidecarReady(
|
|
74
|
+
["cleans up listeners after message"],
|
|
75
|
+
[When.VerifyCleanup()],
|
|
76
|
+
[Then.ListenersCleaned()]
|
|
77
|
+
)
|
|
78
|
+
},
|
|
79
|
+
[]
|
|
80
|
+
)
|
|
81
|
+
];
|
|
82
|
+
};
|
|
83
|
+
var implementation = {
|
|
84
|
+
suites: { SidecarInitialized: (x) => x },
|
|
85
|
+
givens: {
|
|
86
|
+
SidecarReady: () => {
|
|
87
|
+
const config = {
|
|
88
|
+
name: "test-sidecar",
|
|
89
|
+
fs: "/tmp",
|
|
90
|
+
ports: [3001],
|
|
91
|
+
browserWSEndpoint: ""
|
|
92
|
+
};
|
|
93
|
+
return new PM_Node_Sidecar(config);
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
whens: {
|
|
97
|
+
SendTestMessage: (message) => async (sidecar) => {
|
|
98
|
+
let callbackFn;
|
|
99
|
+
const mockProcess = {
|
|
100
|
+
on: (event, callback) => {
|
|
101
|
+
if (event === "message") {
|
|
102
|
+
callbackFn = callback;
|
|
103
|
+
callback(
|
|
104
|
+
JSON.stringify({
|
|
105
|
+
key: "mock-key",
|
|
106
|
+
payload: message
|
|
107
|
+
})
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
return mockProcess;
|
|
111
|
+
},
|
|
112
|
+
addListener: () => mockProcess,
|
|
113
|
+
removeListener: () => mockProcess
|
|
114
|
+
};
|
|
115
|
+
process = mockProcess;
|
|
116
|
+
let writeCalled = false;
|
|
117
|
+
sidecar.client.write = (data) => {
|
|
118
|
+
writeCalled = true;
|
|
119
|
+
return true;
|
|
120
|
+
};
|
|
121
|
+
await sidecar.send("test-command", message);
|
|
122
|
+
return { writeCalled, callbackFn };
|
|
123
|
+
},
|
|
124
|
+
VerifyCleanup: () => async (sidecar) => {
|
|
125
|
+
let addListenerCalled = false;
|
|
126
|
+
let removeListenerCalled = false;
|
|
127
|
+
const mockProcess = {
|
|
128
|
+
addListener: () => {
|
|
129
|
+
addListenerCalled = true;
|
|
130
|
+
return mockProcess;
|
|
131
|
+
},
|
|
132
|
+
removeListener: () => {
|
|
133
|
+
removeListenerCalled = true;
|
|
134
|
+
return mockProcess;
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
process = mockProcess;
|
|
138
|
+
await sidecar.send("test-command", "test");
|
|
139
|
+
return { addListenerCalled, removeListenerCalled };
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
thens: {
|
|
143
|
+
MessageReceived: (expected) => (actual) => {
|
|
144
|
+
if (actual !== expected) {
|
|
145
|
+
throw new Error(`Expected "${expected}" but got "${actual}"`);
|
|
146
|
+
}
|
|
147
|
+
return actual;
|
|
148
|
+
},
|
|
149
|
+
ListenersCleaned: () => (result, { removeListenerCalled }) => {
|
|
150
|
+
if (!removeListenerCalled) {
|
|
151
|
+
throw new Error("Expected removeListener to be called");
|
|
152
|
+
}
|
|
153
|
+
return result;
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
checks: { SidecarState: () => "unknown" }
|
|
157
|
+
};
|
|
158
|
+
var testInterface = {
|
|
159
|
+
beforeEach: async (subject, initializer, testResource, initialValues, pm) => {
|
|
160
|
+
const sidecar = initializer();
|
|
161
|
+
sidecar.client = {
|
|
162
|
+
write: () => true,
|
|
163
|
+
end: () => {
|
|
164
|
+
},
|
|
165
|
+
on: () => {
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
return sidecar;
|
|
169
|
+
},
|
|
170
|
+
andWhen: async (store, whenCB, testResource, pm) => {
|
|
171
|
+
try {
|
|
172
|
+
await whenCB(store, testResource, pm);
|
|
173
|
+
} catch (e) {
|
|
174
|
+
console.error("Error in andWhen:", e);
|
|
175
|
+
throw e;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
var nodeSidecar_testeranto_default = Node_default(
|
|
180
|
+
() => new PM_Node_Sidecar({}),
|
|
181
|
+
specification,
|
|
182
|
+
implementation,
|
|
183
|
+
testInterface
|
|
184
|
+
);
|
|
185
|
+
export {
|
|
186
|
+
nodeSidecar_testeranto_default as default
|
|
187
|
+
};
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import { createRequire } from 'module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
BaseCheck,
|
|
4
|
+
BaseGiven,
|
|
5
|
+
BaseSuite,
|
|
6
|
+
BaseThen,
|
|
7
|
+
BaseWhen,
|
|
8
|
+
Node_default
|
|
9
|
+
} from "../../chunk-4PJCC2XT.mjs";
|
|
10
|
+
|
|
11
|
+
// src/lib/BaseSuite.test.ts
|
|
12
|
+
var MockGiven = class extends BaseGiven {
|
|
13
|
+
constructor(name, features, whens, thens) {
|
|
14
|
+
super(
|
|
15
|
+
name,
|
|
16
|
+
features,
|
|
17
|
+
whens,
|
|
18
|
+
thens,
|
|
19
|
+
async () => ({ testStore: true }),
|
|
20
|
+
// givenCB
|
|
21
|
+
{}
|
|
22
|
+
// initialValues
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
async givenThat(subject, testResourceConfiguration, artifactory, givenCB, initialValues, pm) {
|
|
26
|
+
return { testStore: true };
|
|
27
|
+
}
|
|
28
|
+
uberCatcher(e) {
|
|
29
|
+
console.error("Given error:", e);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
var MockWhen = class extends BaseWhen {
|
|
33
|
+
async andWhen(store, whenCB, testResource, pm) {
|
|
34
|
+
return { ...store, testStore: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
var MockThen = class extends BaseThen {
|
|
38
|
+
async butThen(store, thenCB, testResourceConfiguration, pm) {
|
|
39
|
+
return { testSelection: true };
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var MockCheck = class extends BaseCheck {
|
|
43
|
+
async checkThat(subject, testResourceConfiguration, artifactory, initializer, initialValues, pm) {
|
|
44
|
+
return { testStore: true };
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
var TestableSuite = class extends BaseSuite {
|
|
48
|
+
constructor(name, index) {
|
|
49
|
+
super(
|
|
50
|
+
name,
|
|
51
|
+
index,
|
|
52
|
+
{
|
|
53
|
+
testGiven: new MockGiven(
|
|
54
|
+
"testGiven",
|
|
55
|
+
["testFeature"],
|
|
56
|
+
[
|
|
57
|
+
new MockWhen(
|
|
58
|
+
"testWhen",
|
|
59
|
+
() => Promise.resolve({ testStore: true })
|
|
60
|
+
)
|
|
61
|
+
],
|
|
62
|
+
[
|
|
63
|
+
new MockThen(
|
|
64
|
+
"testThen",
|
|
65
|
+
async () => Promise.resolve({ testSelection: true })
|
|
66
|
+
)
|
|
67
|
+
]
|
|
68
|
+
)
|
|
69
|
+
},
|
|
70
|
+
[
|
|
71
|
+
new MockCheck(
|
|
72
|
+
"testCheck",
|
|
73
|
+
["testFeature"],
|
|
74
|
+
() => Promise.resolve({ testStore: true }),
|
|
75
|
+
null,
|
|
76
|
+
() => {
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
]
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
var specification = (Suite, Given, When, Then, Check) => [
|
|
84
|
+
Suite.Default(
|
|
85
|
+
"BaseSuite Core Functionality Tests",
|
|
86
|
+
{
|
|
87
|
+
// Test initialization and basic properties
|
|
88
|
+
initialization: Given.Default(
|
|
89
|
+
["BaseSuite should initialize with correct name and index"],
|
|
90
|
+
[],
|
|
91
|
+
[
|
|
92
|
+
Then.SuiteNameMatches("testSuite"),
|
|
93
|
+
Then.SuiteIndexMatches(0),
|
|
94
|
+
Then.FeaturesIncludes("testFeature")
|
|
95
|
+
]
|
|
96
|
+
),
|
|
97
|
+
// Test execution flow
|
|
98
|
+
execution: Given.Default(
|
|
99
|
+
["BaseSuite should execute all phases successfully"],
|
|
100
|
+
[When.RunSuite()],
|
|
101
|
+
[Then.StoreValid(), Then.NoErrorsOccurred(), Then.AllChecksCompleted()]
|
|
102
|
+
),
|
|
103
|
+
// Test multiple features
|
|
104
|
+
multipleFeatures: Given.Default(
|
|
105
|
+
["BaseSuite should handle multiple features"],
|
|
106
|
+
[When.AddFeature("additionalFeature")],
|
|
107
|
+
[
|
|
108
|
+
Then.FeaturesIncludes("testFeature"),
|
|
109
|
+
Then.FeaturesIncludes("additionalFeature"),
|
|
110
|
+
Then.FeatureCountMatches(2)
|
|
111
|
+
]
|
|
112
|
+
),
|
|
113
|
+
// Test error handling
|
|
114
|
+
errorHandling: Given.Default(
|
|
115
|
+
["BaseSuite should handle errors gracefully"],
|
|
116
|
+
[When.RunSuiteWithError()],
|
|
117
|
+
[
|
|
118
|
+
Then.ErrorCountMatches(1)
|
|
119
|
+
// Then.FailedFlagSet(),
|
|
120
|
+
]
|
|
121
|
+
)
|
|
122
|
+
},
|
|
123
|
+
[
|
|
124
|
+
// Additional validation checks
|
|
125
|
+
// Check.Default(
|
|
126
|
+
// ["Verify suite state after all tests"],
|
|
127
|
+
// [],
|
|
128
|
+
// [
|
|
129
|
+
// Then.AllTestsCompleted(),
|
|
130
|
+
// Then.CleanExit()
|
|
131
|
+
// ]
|
|
132
|
+
// )
|
|
133
|
+
]
|
|
134
|
+
)
|
|
135
|
+
];
|
|
136
|
+
var implementation = {
|
|
137
|
+
suites: {
|
|
138
|
+
Default: "BaseSuite Comprehensive Test Suite"
|
|
139
|
+
},
|
|
140
|
+
givens: {
|
|
141
|
+
Default: () => new TestableSuite("testSuite", 0)
|
|
142
|
+
},
|
|
143
|
+
whens: {
|
|
144
|
+
RunSuite: () => async (suite) => {
|
|
145
|
+
const mockConfig = {
|
|
146
|
+
name: "test",
|
|
147
|
+
fs: "/tmp",
|
|
148
|
+
ports: [3e3],
|
|
149
|
+
environment: {},
|
|
150
|
+
timeout: 5e3,
|
|
151
|
+
retries: 3
|
|
152
|
+
};
|
|
153
|
+
const mockArtifactory = (key, value) => {
|
|
154
|
+
};
|
|
155
|
+
const mockTLog = (...args) => {
|
|
156
|
+
};
|
|
157
|
+
const mockPM = {
|
|
158
|
+
server: null,
|
|
159
|
+
testResourceConfiguration: mockConfig,
|
|
160
|
+
start: async () => {
|
|
161
|
+
},
|
|
162
|
+
stop: async () => {
|
|
163
|
+
},
|
|
164
|
+
testArtiFactoryfileWriter: () => {
|
|
165
|
+
},
|
|
166
|
+
$: () => {
|
|
167
|
+
},
|
|
168
|
+
click: () => {
|
|
169
|
+
},
|
|
170
|
+
closePage: () => {
|
|
171
|
+
},
|
|
172
|
+
createWriteStream: async () => ""
|
|
173
|
+
};
|
|
174
|
+
return await suite.run(
|
|
175
|
+
null,
|
|
176
|
+
mockConfig,
|
|
177
|
+
mockArtifactory,
|
|
178
|
+
mockTLog,
|
|
179
|
+
mockPM
|
|
180
|
+
);
|
|
181
|
+
},
|
|
182
|
+
RunSuiteWithError: () => async (suite) => {
|
|
183
|
+
try {
|
|
184
|
+
await suite.run(
|
|
185
|
+
null,
|
|
186
|
+
{},
|
|
187
|
+
// Invalid config
|
|
188
|
+
() => {
|
|
189
|
+
},
|
|
190
|
+
() => {
|
|
191
|
+
},
|
|
192
|
+
{}
|
|
193
|
+
);
|
|
194
|
+
} catch (e) {
|
|
195
|
+
}
|
|
196
|
+
return suite;
|
|
197
|
+
},
|
|
198
|
+
AddFeature: (feature) => (suite) => {
|
|
199
|
+
const firstGivenKey = Object.keys(suite.givens)[0];
|
|
200
|
+
if (firstGivenKey) {
|
|
201
|
+
suite.givens[firstGivenKey].features.push(feature);
|
|
202
|
+
}
|
|
203
|
+
return suite;
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
thens: {
|
|
207
|
+
SuiteNameMatches: (expectedName) => (suite) => {
|
|
208
|
+
if (suite.name !== expectedName) {
|
|
209
|
+
throw new Error(
|
|
210
|
+
`Expected suite name '${expectedName}', got '${suite.name}'`
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
return suite;
|
|
214
|
+
},
|
|
215
|
+
SuiteIndexMatches: (expectedIndex) => (suite) => {
|
|
216
|
+
if (suite.index !== expectedIndex) {
|
|
217
|
+
throw new Error(
|
|
218
|
+
`Expected suite index ${expectedIndex}, got ${suite.index}`
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
return suite;
|
|
222
|
+
},
|
|
223
|
+
FeaturesIncludes: (feature) => (suite) => {
|
|
224
|
+
if (!suite.features().includes(feature)) {
|
|
225
|
+
throw new Error(`Expected features to include ${feature}`);
|
|
226
|
+
}
|
|
227
|
+
return suite;
|
|
228
|
+
},
|
|
229
|
+
FeatureCountMatches: (expectedCount) => (suite) => {
|
|
230
|
+
const actualCount = suite.features().length;
|
|
231
|
+
if (actualCount !== expectedCount) {
|
|
232
|
+
throw new Error(
|
|
233
|
+
`Expected ${expectedCount} features, got ${actualCount}`
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
return suite;
|
|
237
|
+
},
|
|
238
|
+
StoreValid: () => (suite) => {
|
|
239
|
+
if (!suite.store?.testStore) {
|
|
240
|
+
throw new Error("Expected valid store after execution");
|
|
241
|
+
}
|
|
242
|
+
return suite;
|
|
243
|
+
},
|
|
244
|
+
NoErrorsOccurred: () => (suite) => {
|
|
245
|
+
if (suite.failed || suite.fails > 0) {
|
|
246
|
+
throw new Error("Expected no errors to occur during execution");
|
|
247
|
+
}
|
|
248
|
+
return suite;
|
|
249
|
+
},
|
|
250
|
+
ErrorCountMatches: (expectedCount) => (suite) => {
|
|
251
|
+
if (suite.fails !== expectedCount) {
|
|
252
|
+
throw new Error(
|
|
253
|
+
`Expected ${expectedCount} errors, got ${suite.fails}`
|
|
254
|
+
);
|
|
255
|
+
}
|
|
256
|
+
return suite;
|
|
257
|
+
},
|
|
258
|
+
FailedFlagSet: () => (suite) => {
|
|
259
|
+
if (!suite.failed) {
|
|
260
|
+
throw new Error("Expected failed flag to be set after error");
|
|
261
|
+
}
|
|
262
|
+
return suite;
|
|
263
|
+
},
|
|
264
|
+
AllChecksCompleted: () => (suite) => {
|
|
265
|
+
if (suite.checks.some((check) => !check.key)) {
|
|
266
|
+
throw new Error("Expected all checks to be completed");
|
|
267
|
+
}
|
|
268
|
+
return suite;
|
|
269
|
+
},
|
|
270
|
+
AllTestsCompleted: () => (suite) => {
|
|
271
|
+
if (!suite.store) {
|
|
272
|
+
throw new Error("Expected all tests to be completed");
|
|
273
|
+
}
|
|
274
|
+
return suite;
|
|
275
|
+
},
|
|
276
|
+
CleanExit: () => (suite) => {
|
|
277
|
+
if (suite.failed && suite.fails === 0) {
|
|
278
|
+
throw new Error("Expected clean exit state");
|
|
279
|
+
}
|
|
280
|
+
return suite;
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
checks: {
|
|
284
|
+
Default: () => new TestableSuite("testCheck", 1)
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
var testInterface = {
|
|
288
|
+
beforeEach: async (subject, initializer) => initializer(),
|
|
289
|
+
andWhen: async (store, whenCB, testResource, pm) => whenCB(store, pm),
|
|
290
|
+
butThen: async (store, thenCB, testResource, pm) => thenCB(store, pm),
|
|
291
|
+
afterEach: (store) => store,
|
|
292
|
+
afterAll: (store, pm) => {
|
|
293
|
+
},
|
|
294
|
+
assertThis: (result) => !!result,
|
|
295
|
+
beforeAll: async (input, testResource, pm) => input
|
|
296
|
+
};
|
|
297
|
+
var BaseSuite_test_default = Node_default(
|
|
298
|
+
BaseSuite.prototype,
|
|
299
|
+
specification,
|
|
300
|
+
implementation,
|
|
301
|
+
testInterface
|
|
302
|
+
);
|
|
303
|
+
export {
|
|
304
|
+
BaseSuite_test_default as default
|
|
305
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
|
|
2
|
+
<!DOCTYPE html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
|
|
5
|
+
<head>
|
|
6
|
+
<meta name="description" content="Webpage description goes here" />
|
|
7
|
+
<meta charset="utf-8" />
|
|
8
|
+
<title>testeranto - testeranto</title>
|
|
9
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
10
|
+
<meta name="author" content="" />
|
|
11
|
+
<base href="/" target="_blank">
|
|
12
|
+
|
|
13
|
+
<script type="application/json" id="bigConfig">
|
|
14
|
+
["allTests","react"]
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<link rel="stylesheet" href="./testeranto/Project.css" />
|
|
18
|
+
<script type="module" src="./testeranto/Project.js"></script>
|
|
19
|
+
|
|
20
|
+
</head>
|
|
21
|
+
|
|
22
|
+
<body>
|
|
23
|
+
<div id="root">
|
|
24
|
+
react is loading
|
|
25
|
+
</div>
|
|
26
|
+
</body>
|
|
27
|
+
|
|
28
|
+
</html>
|
|
29
|
+
|
package/testeranto/index.html
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
2
|
+
<!DOCTYPE html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
|
|
5
|
+
<head>
|
|
6
|
+
<meta name="description" content="Webpage description goes here" />
|
|
7
|
+
<meta charset="utf-8" />
|
|
8
|
+
<title>testeranto - testeranto</title>
|
|
9
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
10
|
+
<meta name="author" content="" />
|
|
11
|
+
<base href="undefined" target="_blank">
|
|
12
|
+
|
|
13
|
+
<script type="application/json" id="bigConfig">
|
|
14
|
+
["allTests","react"]
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<link rel="stylesheet" href="./testeranto/Project.css" />
|
|
18
|
+
<script type="module" src="./testeranto/Project.js"></script>
|
|
19
|
+
|
|
20
|
+
</head>
|
|
21
|
+
|
|
22
|
+
<body>
|
|
23
|
+
<div id="root">
|
|
24
|
+
react is loading
|
|
25
|
+
</div>
|
|
26
|
+
</body>
|
|
27
|
+
|
|
28
|
+
</html>
|
|
29
|
+
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"tests": [
|
|
3
|
+
[
|
|
4
|
+
"./src/lib/BaseSuite.test.ts",
|
|
5
|
+
"node",
|
|
6
|
+
{
|
|
7
|
+
"ports": 1
|
|
8
|
+
},
|
|
9
|
+
[]
|
|
10
|
+
],
|
|
11
|
+
[
|
|
12
|
+
"./src/mothership/test.ts",
|
|
13
|
+
"node",
|
|
14
|
+
{
|
|
15
|
+
"ports": 1
|
|
16
|
+
},
|
|
17
|
+
[]
|
|
18
|
+
],
|
|
19
|
+
[
|
|
20
|
+
"./src/PM/__tests__/nodeSidecar.testeranto.ts",
|
|
21
|
+
"node",
|
|
22
|
+
{
|
|
23
|
+
"ports": 1
|
|
24
|
+
},
|
|
25
|
+
[]
|
|
26
|
+
],
|
|
27
|
+
[
|
|
28
|
+
"./src/PM/__tests__/pureSidecar.testeranto.ts",
|
|
29
|
+
"node",
|
|
30
|
+
{
|
|
31
|
+
"ports": 1
|
|
32
|
+
},
|
|
33
|
+
[]
|
|
34
|
+
],
|
|
35
|
+
[
|
|
36
|
+
"./src/PM/__tests__/webSidecar.testeranto.ts",
|
|
37
|
+
"node",
|
|
38
|
+
{
|
|
39
|
+
"ports": 1
|
|
40
|
+
},
|
|
41
|
+
[]
|
|
42
|
+
]
|
|
43
|
+
],
|
|
44
|
+
"clearScreen": false,
|
|
45
|
+
"debugger": false,
|
|
46
|
+
"externals": [],
|
|
47
|
+
"externalTests": {},
|
|
48
|
+
"importPlugins": [],
|
|
49
|
+
"minify": false,
|
|
50
|
+
"nodePlugins": [],
|
|
51
|
+
"ports": [
|
|
52
|
+
"3333"
|
|
53
|
+
],
|
|
54
|
+
"src": "",
|
|
55
|
+
"webPlugins": [],
|
|
56
|
+
"buildDir": "/Users/adam/Code/testeranto/testeranto/bundles/allTests"
|
|
57
|
+
}
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
<title>testeranto - testeranto</title>
|
|
9
9
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
10
10
|
<meta name="author" content="" />
|
|
11
|
+
|
|
12
|
+
<base href="/" target="_blank">
|
|
11
13
|
|
|
12
14
|
<link rel="stylesheet" href="../ReportClient.css" />
|
|
13
15
|
<script type="module" src="../ReportClient.js"></script>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
<!DOCTYPE html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
|
|
5
|
+
<head>
|
|
6
|
+
<meta name="description" content="Webpage description goes here" />
|
|
7
|
+
<meta charset="utf-8" />
|
|
8
|
+
<title>testeranto - testeranto</title>
|
|
9
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
10
|
+
<meta name="author" content="" />
|
|
11
|
+
|
|
12
|
+
<base href="undefined" target="_blank">
|
|
13
|
+
|
|
14
|
+
<link rel="stylesheet" href="../ReportClient.css" />
|
|
15
|
+
<script type="module" src="../ReportClient.js"></script>
|
|
16
|
+
|
|
17
|
+
</head>
|
|
18
|
+
|
|
19
|
+
<body>
|
|
20
|
+
<div id="root">
|
|
21
|
+
react is loading
|
|
22
|
+
</div>
|
|
23
|
+
</body>
|
|
24
|
+
|
|
25
|
+
</html>
|
|
26
|
+
|