testeranto 0.172.0 → 0.177.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/README.md +2 -4
- package/dist/common/src/PM/base.js +5 -1
- package/dist/common/src/PM/main.js +57 -54
- package/dist/common/src/PM/node.js +4 -1
- package/dist/common/src/PM/pure.js +4 -1
- package/dist/common/src/PM/web.js +6 -3
- package/dist/common/src/Pure.js +0 -4
- package/dist/common/src/Pure.test.js +1 -1
- package/dist/common/src/ReportServer.js +2 -126
- package/dist/common/src/ReportServer.test.ts/index.js +78 -0
- package/dist/common/src/ReportServerLib.js +141 -0
- package/dist/common/src/components/pure/ProjectPageView.test/implementation.js +1 -1
- package/dist/common/src/esbuildConfigs/node.js +1 -3
- package/dist/common/src/lib/BaseSuite.js +13 -11
- package/dist/common/src/lib/abstractBase.js +39 -40
- package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.implementation.js +10 -9
- package/dist/common/src/lib/baseBuilder.test/baseBuilder.test.specification.js +7 -7
- package/dist/common/src/lib/basebuilder.js +13 -2
- package/dist/common/src/lib/core.js +1 -0
- package/dist/common/src/lib/pmProxy.js +215 -201
- package/dist/common/src/lib/pmProxy.test/adapter.js +2 -2
- package/dist/common/src/lib/pmProxy.test/implementation.js +1 -1
- package/dist/common/testeranto.config.js +47 -32
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/src/PM/base.js +5 -1
- package/dist/module/src/PM/main.js +22 -19
- package/dist/module/src/PM/node.js +4 -1
- package/dist/module/src/PM/pure.js +4 -1
- package/dist/module/src/PM/web.js +6 -3
- package/dist/module/src/Pure.js +0 -4
- package/dist/module/src/Pure.test.js +1 -1
- package/dist/module/src/ReportServer.js +2 -123
- package/dist/module/src/ReportServer.test.ts/index.js +73 -0
- package/dist/module/src/ReportServerLib.js +134 -0
- package/dist/module/src/TestPage.js +29 -17
- package/dist/module/src/components/pure/ProjectPageView.test/implementation.js +1 -1
- package/dist/module/src/components/pure/TestPageView.js +29 -17
- package/dist/module/src/esbuildConfigs/node.js +1 -3
- package/dist/module/src/lib/BaseSuite.js +13 -11
- package/dist/module/src/lib/abstractBase.js +39 -40
- package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.implementation.js +10 -9
- package/dist/module/src/lib/baseBuilder.test/baseBuilder.test.specification.js +7 -7
- package/dist/module/src/lib/basebuilder.js +13 -2
- package/dist/module/src/lib/core.js +1 -0
- package/dist/module/src/lib/pmProxy.js +215 -201
- package/dist/module/src/lib/pmProxy.test/adapter.js +2 -2
- package/dist/module/src/lib/pmProxy.test/implementation.js +1 -1
- package/dist/module/testeranto.config.js +47 -32
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/prebuild/App.js +3 -3
- package/dist/prebuild/ReportServer.mjs +21 -9
- package/dist/prebuild/build.mjs +1 -1
- package/dist/prebuild/run.mjs +27 -20
- package/dist/types/src/PM/base.d.ts +1 -1
- package/dist/types/src/PM/node.d.ts +1 -1
- package/dist/types/src/PM/pure.d.ts +1 -1
- package/dist/types/src/PM/web.d.ts +1 -1
- package/dist/types/src/ReportServer.test.ts/index.d.ts +29 -0
- package/dist/types/src/ReportServerLib.d.ts +1 -0
- package/dist/types/src/Types.d.ts +0 -1
- package/dist/types/src/components/pure/ProjectPageView.test/index.d.ts +2 -1
- package/dist/types/src/lib/BaseSuite.d.ts +2 -0
- package/dist/types/src/lib/abstractBase.d.ts +5 -7
- package/dist/types/src/lib/baseBuilder.test/baseBuilder.test.types.d.ts +7 -4
- package/dist/types/src/lib/pmProxy.d.ts +3 -3
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/PM/base.ts +7 -5
- package/src/PM/main.ts +26 -21
- package/src/PM/node.ts +6 -1
- package/src/PM/pure.ts +6 -1
- package/src/PM/web.ts +7 -3
- package/src/Pure.test.ts +6 -6
- package/src/Pure.ts +0 -8
- package/src/ReportServer.test.ts/index.ts +194 -0
- package/src/ReportServer.ts +2 -132
- package/src/ReportServerLib.ts +147 -0
- package/src/TestPage.tsx +65 -5
- package/src/Types.ts +0 -1
- package/src/components/pure/ProjectPageView.test/implementation.tsx +1 -1
- package/src/components/pure/TestPageView.tsx +65 -5
- package/src/esbuildConfigs/node.ts +1 -1
- package/src/lib/BaseSuite.ts +16 -21
- package/src/lib/abstractBase.ts +59 -48
- package/src/lib/baseBuilder.test/baseBuilder.test.implementation.ts +22 -10
- package/src/lib/baseBuilder.test/baseBuilder.test.specification.ts +9 -9
- package/src/lib/baseBuilder.test/baseBuilder.test.types.ts +7 -4
- package/src/lib/basebuilder.ts +13 -4
- package/src/lib/core.ts +1 -0
- package/src/lib/pmProxy.test/adapter.ts +2 -2
- package/src/lib/pmProxy.test/implementation.ts +3 -3
- package/src/lib/pmProxy.test/types.ts +0 -2
- package/src/lib/pmProxy.ts +135 -80
- package/testeranto/App.js +3 -3
- package/testeranto/bundles/node/core/metafile.json +8 -0
- package/testeranto/bundles/pure/core/metafile.json +8 -0
- package/testeranto/bundles/web/core/metafile.json +15086 -0
- package/testeranto/bundles/web/{allTests → core}/src/components/pure/ProjectPageView.test/index.html +1 -1
- package/testeranto/bundles/web/{allTests → core}/src/components/pure/ProjectPageView.test/index.mjs +4109 -1642
- package/testeranto/projects.json +1 -1
- package/testeranto/reports/core/config.json +24 -0
- package/testeranto/reports/{allTests → core}/src/components/pure/ProjectPageView.test/index/web/lint_errors.txt +6 -1
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/logs.txt +59 -0
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/message.txt +2 -0
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/prompt.txt +27 -0
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/suite-0/given-basicRender/then-0/butThen/happyPath.png +0 -0
- package/testeranto/reports/{allTests → core}/src/components/pure/ProjectPageView.test/index/web/type_errors.txt +15 -33
- package/testeranto/reports/core/summary.json +9 -0
- package/testeranto.config.ts +49 -32
- package/tsc.log +78 -92
- package/testeranto/bundles/node/allTests/chunk-3EUGBAOM.mjs +0 -113
- package/testeranto/bundles/node/allTests/chunk-E75CSRER.mjs +0 -800
- package/testeranto/bundles/node/allTests/chunk-M6DO7VMB.mjs +0 -252
- package/testeranto/bundles/node/allTests/metafile.json +0 -1229
- package/testeranto/bundles/node/allTests/src/lib/BaseSuite.test/node.test.mjs +0 -323
- package/testeranto/bundles/node/allTests/src/lib/baseBuilder.test/baseBuilder.test.node.mjs +0 -223
- package/testeranto/bundles/node/allTests/src/lib/classBuilder.test/classBuilder.test.mjs +0 -411
- package/testeranto/bundles/node/allTests/src/lib/core.test/core.test.mjs +0 -528
- package/testeranto/bundles/node/allTests/src/lib/pmProxy.test/index.mjs +0 -4752
- package/testeranto/bundles/pure/allTests/chunk-KHDVEHF7.mjs +0 -185
- package/testeranto/bundles/pure/allTests/chunk-VMUSFSZM.mjs +0 -797
- package/testeranto/bundles/pure/allTests/metafile.json +0 -1054
- package/testeranto/bundles/pure/allTests/src/Pure.test.mjs +0 -429
- package/testeranto/bundles/pure/allTests/src/lib/BaseSuite.test/pure.test.mjs +0 -425
- package/testeranto/bundles/pure/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure.mjs +0 -381
- package/testeranto/bundles/web/allTests/chunk-HPYA4YZC.mjs +0 -2283
- package/testeranto/bundles/web/allTests/chunk-U7AW26HL.mjs +0 -997
- package/testeranto/bundles/web/allTests/metafile.json +0 -25
- package/testeranto/bundles/web/allTests/src/lib/BaseSuite.test/web.test.html +0 -19
- package/testeranto/bundles/web/allTests/src/lib/BaseSuite.test/web.test.mjs +0 -440
- package/testeranto/bundles/web/allTests/src/lib/baseBuilder.test/baseBuilder.test.web.html +0 -19
- package/testeranto/bundles/web/allTests/src/lib/baseBuilder.test/baseBuilder.test.web.mjs +0 -244
- package/testeranto/reports/allTests/config.json +0 -104
- package/testeranto/reports/allTests/src/Pure.test/pure/lint_errors.txt +0 -0
- package/testeranto/reports/allTests/src/Pure.test/pure/message.txt +0 -2
- package/testeranto/reports/allTests/src/Pure.test/pure/prompt.txt +0 -13
- package/testeranto/reports/allTests/src/Pure.test/pure/type_errors.txt +0 -101
- package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/bdd_errors.txt +0 -1
- package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/logs.txt +0 -50
- package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/message.txt +0 -2
- package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/prompt.txt +0 -17
- package/testeranto/reports/allTests/src/components/pure/ProjectPageView.test/index/web/tests.json +0 -32
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/bdd_errors.txt +0 -1
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/lint_errors.txt +0 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/logs.txt +0 -52
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/message.txt +0 -2
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/prompt.txt +0 -13
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/tests.json +0 -31
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/node.test/node/type_errors.txt +0 -111
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/bdd_errors.txt +0 -1
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/lint_errors.txt +0 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/message.txt +0 -2
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/prompt.txt +0 -14
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/tests.json +0 -31
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/pure.test/pure/type_errors.txt +0 -111
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/bdd_errors.txt +0 -1
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/lint_errors.txt +0 -0
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/logs.txt +0 -108
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/message.txt +0 -2
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/prompt.txt +0 -14
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/tests.json +0 -31
- package/testeranto/reports/allTests/src/lib/BaseSuite.test/web.test/web/type_errors.txt +0 -111
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/bdd_errors.txt +0 -1
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/lint_errors.txt +0 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/logs.txt +0 -35
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/message.txt +0 -2
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/prompt.txt +0 -16
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/tests.json +0 -77
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.node/node/type_errors.txt +0 -62
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/lint_errors.txt +0 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/message.txt +0 -2
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/prompt.txt +0 -18
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.pure/pure/type_errors.txt +0 -62
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/bdd_errors.txt +0 -1
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/lint_errors.txt +0 -0
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/logs.txt +0 -69
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/message.txt +0 -2
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/prompt.txt +0 -16
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/tests.json +0 -77
- package/testeranto/reports/allTests/src/lib/baseBuilder.test/baseBuilder.test.web/web/type_errors.txt +0 -62
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/bdd_errors.txt +0 -1
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/lint_errors.txt +0 -0
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/logs.txt +0 -700
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/message.txt +0 -2
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/prompt.txt +0 -16
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/tests.json +0 -164
- package/testeranto/reports/allTests/src/lib/classBuilder.test/classBuilder.test/node/type_errors.txt +0 -138
- package/testeranto/reports/allTests/src/lib/core.test/core.test/node/lint_errors.txt +0 -21
- package/testeranto/reports/allTests/src/lib/core.test/core.test/node/logs.txt +0 -7
- package/testeranto/reports/allTests/src/lib/core.test/core.test/node/message.txt +0 -2
- package/testeranto/reports/allTests/src/lib/core.test/core.test/node/prompt.txt +0 -18
- package/testeranto/reports/allTests/src/lib/core.test/core.test/node/type_errors.txt +0 -63
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/bdd_errors.txt +0 -1
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/lint_errors.txt +0 -20
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/logs.txt +0 -31
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/message.txt +0 -2
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/prompt.txt +0 -16
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/tests.json +0 -134
- package/testeranto/reports/allTests/src/lib/pmProxy.test/index/node/type_errors.txt +0 -76
- package/testeranto/reports/allTests/summary.json +0 -79
- package/testeranto/reportsnode_build_errors +0 -20
- package/testeranto/reportspure_build_errors +0 -343
- package/testeranto/reportsweb_build_errors +0 -25
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"errors": [
|
|
3
|
-
{
|
|
4
|
-
"id": "",
|
|
5
|
-
"location": {
|
|
6
|
-
"column": 23,
|
|
7
|
-
"file": "node_modules/testeranto-react/src/react-dom/component/web.ts",
|
|
8
|
-
"length": 20,
|
|
9
|
-
"line": 2,
|
|
10
|
-
"lineText": "import Testeranto from \"testeranto/src/Web\";",
|
|
11
|
-
"namespace": "",
|
|
12
|
-
"suggestion": ""
|
|
13
|
-
},
|
|
14
|
-
"notes": [
|
|
15
|
-
{
|
|
16
|
-
"location": null,
|
|
17
|
-
"text": "You can mark the path \"testeranto/src/Web\" as external to exclude it from the bundle, which will remove this error."
|
|
18
|
-
}
|
|
19
|
-
],
|
|
20
|
-
"pluginName": "",
|
|
21
|
-
"text": "Could not resolve \"testeranto/src/Web\""
|
|
22
|
-
}
|
|
23
|
-
],
|
|
24
|
-
"warnings": []
|
|
25
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!DOCTYPE html>
|
|
3
|
-
<html lang="en">
|
|
4
|
-
|
|
5
|
-
<head>
|
|
6
|
-
<script type="module" src="./web.test.mjs"></script>
|
|
7
|
-
|
|
8
|
-
</head>
|
|
9
|
-
|
|
10
|
-
<body>
|
|
11
|
-
<h1>/Users/adam/Code/testeranto/testeranto/bundles/web/allTests/src/lib/BaseSuite.test/web.test.html</h1>
|
|
12
|
-
<div id="root">
|
|
13
|
-
|
|
14
|
-
</div>
|
|
15
|
-
</body>
|
|
16
|
-
|
|
17
|
-
<footer></footer>
|
|
18
|
-
|
|
19
|
-
</html>
|
|
@@ -1,440 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BaseGiven,
|
|
3
|
-
BaseSuite,
|
|
4
|
-
BaseThen,
|
|
5
|
-
BaseWhen,
|
|
6
|
-
Web_default
|
|
7
|
-
} from "../../../chunk-U7AW26HL.mjs";
|
|
8
|
-
import {
|
|
9
|
-
init_buffer,
|
|
10
|
-
init_dirname,
|
|
11
|
-
init_process
|
|
12
|
-
} from "../../../chunk-HPYA4YZC.mjs";
|
|
13
|
-
|
|
14
|
-
// src/lib/BaseSuite.test/web.test.ts
|
|
15
|
-
init_dirname();
|
|
16
|
-
init_buffer();
|
|
17
|
-
init_process();
|
|
18
|
-
|
|
19
|
-
// src/lib/BaseSuite.test/test.ts
|
|
20
|
-
init_dirname();
|
|
21
|
-
init_buffer();
|
|
22
|
-
init_process();
|
|
23
|
-
|
|
24
|
-
// src/lib/BaseSuite.test/mock.ts
|
|
25
|
-
init_dirname();
|
|
26
|
-
init_buffer();
|
|
27
|
-
init_process();
|
|
28
|
-
var MockGiven = class extends BaseGiven {
|
|
29
|
-
constructor(name, features, whens, thens) {
|
|
30
|
-
super(
|
|
31
|
-
name,
|
|
32
|
-
features,
|
|
33
|
-
whens,
|
|
34
|
-
thens,
|
|
35
|
-
async () => ({ testStore: true, testSelection: false }),
|
|
36
|
-
// givenCB
|
|
37
|
-
{}
|
|
38
|
-
// initialValues
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
async givenThat() {
|
|
42
|
-
return { testStore: true, testSelection: false };
|
|
43
|
-
}
|
|
44
|
-
uberCatcher(e) {
|
|
45
|
-
console.error("Given error 2:", e);
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
var MockWhen = class extends BaseWhen {
|
|
49
|
-
async andWhen(store, whenCB, testResource, pm) {
|
|
50
|
-
console.log(
|
|
51
|
-
"[DEBUG] MockWhen - andWhen - input store:",
|
|
52
|
-
JSON.stringify(store)
|
|
53
|
-
);
|
|
54
|
-
const newStore = {
|
|
55
|
-
...store,
|
|
56
|
-
testSelection: true
|
|
57
|
-
// Ensure testSelection is set for assertions
|
|
58
|
-
};
|
|
59
|
-
console.log("[DEBUG] MockWhen - andWhen - calling whenCB");
|
|
60
|
-
const result = await whenCB(newStore);
|
|
61
|
-
console.log("[DEBUG] MockWhen - andWhen - result:", JSON.stringify(result));
|
|
62
|
-
return result;
|
|
63
|
-
}
|
|
64
|
-
addArtifact(name, content) {
|
|
65
|
-
return this;
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
var MockThen = class extends BaseThen {
|
|
69
|
-
async butThen(store, thenCB, testResourceConfiguration, pm) {
|
|
70
|
-
console.log(
|
|
71
|
-
"[DEBUG] MockThen - butThen - input store:",
|
|
72
|
-
JSON.stringify(store)
|
|
73
|
-
);
|
|
74
|
-
if (!store) {
|
|
75
|
-
throw new Error("Store is undefined in butThen");
|
|
76
|
-
}
|
|
77
|
-
const testSelection = {
|
|
78
|
-
name: store.name,
|
|
79
|
-
index: store.index,
|
|
80
|
-
testSelection: store.testSelection || false,
|
|
81
|
-
error: store.error ? true : void 0
|
|
82
|
-
};
|
|
83
|
-
console.log(
|
|
84
|
-
"[DEBUG] MockThen - passing testSelection:",
|
|
85
|
-
JSON.stringify(testSelection)
|
|
86
|
-
);
|
|
87
|
-
try {
|
|
88
|
-
const result = await thenCB(testSelection);
|
|
89
|
-
console.log(
|
|
90
|
-
"[DEBUG] MockThen - received result:",
|
|
91
|
-
JSON.stringify(result)
|
|
92
|
-
);
|
|
93
|
-
if (!result || typeof result.testSelection === "undefined") {
|
|
94
|
-
throw new Error(
|
|
95
|
-
`Invalid test selection result: ${JSON.stringify(result)}`
|
|
96
|
-
);
|
|
97
|
-
}
|
|
98
|
-
return result;
|
|
99
|
-
} catch (e) {
|
|
100
|
-
console.error("[ERROR] MockThen - butThen failed:", e);
|
|
101
|
-
throw e;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
var MockSuite = class extends BaseSuite {
|
|
106
|
-
constructor(name, index) {
|
|
107
|
-
if (!name) {
|
|
108
|
-
throw new Error("MockSuite requires a non-empty name");
|
|
109
|
-
}
|
|
110
|
-
console.log("[DEBUG] Creating MockSuite with name:", name, "index:", index);
|
|
111
|
-
const suiteName = name || "testSuite";
|
|
112
|
-
super(suiteName, index, {
|
|
113
|
-
testGiven: new MockGiven(
|
|
114
|
-
"testGiven",
|
|
115
|
-
["testFeature"],
|
|
116
|
-
[new MockWhen("testWhen", () => Promise.resolve({ testStore: true }))],
|
|
117
|
-
[
|
|
118
|
-
new MockThen(
|
|
119
|
-
"testThen",
|
|
120
|
-
async () => Promise.resolve({ testSelection: true })
|
|
121
|
-
)
|
|
122
|
-
]
|
|
123
|
-
)
|
|
124
|
-
});
|
|
125
|
-
console.log("[DEBUG] MockSuite created:", this.name, this.index);
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
// src/lib/BaseSuite.test/test.ts
|
|
130
|
-
var specification = (Suite, Given, When, Then) => [
|
|
131
|
-
Suite.Default("BaseSuite Core Functionality Tests", {
|
|
132
|
-
// Test initialization and basic properties
|
|
133
|
-
initialization: Given.Default(
|
|
134
|
-
["BaseSuite should initialize with correct name and index"],
|
|
135
|
-
[],
|
|
136
|
-
[Then.SuiteNameMatches("testSuite"), Then.SuiteIndexMatches(0)]
|
|
137
|
-
)
|
|
138
|
-
// // Test execution flow
|
|
139
|
-
// execution: Given.Default(
|
|
140
|
-
// ["BaseSuite should execute all phases successfully"],
|
|
141
|
-
// [When.RunSuite()],
|
|
142
|
-
// [Then.StoreValid()]
|
|
143
|
-
// ),
|
|
144
|
-
// // Test multiple features
|
|
145
|
-
// multipleFeatures: Given.Default(
|
|
146
|
-
// ["BaseSuite should handle multiple features"],
|
|
147
|
-
// [When.AddFeature("additionalFeature")],
|
|
148
|
-
// [
|
|
149
|
-
// Then.FeaturesIncludes("testFeature"),
|
|
150
|
-
// Then.FeaturesIncludes("additionalFeature"),
|
|
151
|
-
// Then.FeatureCountMatches(2),
|
|
152
|
-
// ]
|
|
153
|
-
// ),
|
|
154
|
-
// // Test error handling
|
|
155
|
-
// errorHandling: Given.Default(
|
|
156
|
-
// ["BaseSuite should handle errors gracefully"],
|
|
157
|
-
// [When.RunSuiteWithError()],
|
|
158
|
-
// [Then.ErrorCountMatches(1), Then.FailedFlagSet()]
|
|
159
|
-
// ),
|
|
160
|
-
})
|
|
161
|
-
// Suite.Default("Comprehensive Integration", {
|
|
162
|
-
// fullStackTest: Given.Default(
|
|
163
|
-
// ["All components should work together"],
|
|
164
|
-
// [
|
|
165
|
-
// When.addArtifact(Promise.resolve("test")),
|
|
166
|
-
// When.modifySpecs((specs) => [...specs, "extra"]),
|
|
167
|
-
// When.modifyJobs((jobs) => [...jobs, {}]),
|
|
168
|
-
// ],
|
|
169
|
-
// [
|
|
170
|
-
// Then.specsModified(1),
|
|
171
|
-
// Then.jobsModified(1),
|
|
172
|
-
// Then.artifactsTracked(),
|
|
173
|
-
// Then.testRunSuccessful(),
|
|
174
|
-
// ]
|
|
175
|
-
// ),
|
|
176
|
-
// }),
|
|
177
|
-
];
|
|
178
|
-
var implementation = {
|
|
179
|
-
suites: {
|
|
180
|
-
Default: "BaseSuite Comprehensive Test Suite"
|
|
181
|
-
},
|
|
182
|
-
givens: {
|
|
183
|
-
Default: () => {
|
|
184
|
-
const suite = new MockSuite("testSuite", 0);
|
|
185
|
-
console.log("[DEBUG] Created test suite:", suite.name, suite.index);
|
|
186
|
-
return suite;
|
|
187
|
-
}
|
|
188
|
-
},
|
|
189
|
-
whens: {
|
|
190
|
-
addArtifact: (artifact) => (suite) => {
|
|
191
|
-
suite.artifacts.push(artifact);
|
|
192
|
-
return suite;
|
|
193
|
-
},
|
|
194
|
-
modifySpecs: (modifier) => (suite) => {
|
|
195
|
-
suite.specs = modifier(suite.specs);
|
|
196
|
-
return suite;
|
|
197
|
-
},
|
|
198
|
-
modifyJobs: (modifier) => (suite) => {
|
|
199
|
-
suite.testJobs = modifier(suite.testJobs);
|
|
200
|
-
return suite;
|
|
201
|
-
},
|
|
202
|
-
RunSuite: () => async (suite) => {
|
|
203
|
-
console.log("[DEBUG] Running RunSuite");
|
|
204
|
-
const mockConfig = {
|
|
205
|
-
name: "test",
|
|
206
|
-
fs: "/tmp",
|
|
207
|
-
ports: [3e3],
|
|
208
|
-
environment: {},
|
|
209
|
-
timeout: 5e3,
|
|
210
|
-
retries: 3
|
|
211
|
-
};
|
|
212
|
-
const mockArtifactory = (key, value) => {
|
|
213
|
-
};
|
|
214
|
-
const mockTLog = (...args) => {
|
|
215
|
-
};
|
|
216
|
-
const mockPM = {
|
|
217
|
-
server: null,
|
|
218
|
-
testResourceConfiguration: mockConfig,
|
|
219
|
-
start: async () => {
|
|
220
|
-
},
|
|
221
|
-
stop: async () => {
|
|
222
|
-
},
|
|
223
|
-
testArtiFactoryfileWriter: () => {
|
|
224
|
-
},
|
|
225
|
-
$: () => {
|
|
226
|
-
},
|
|
227
|
-
click: () => {
|
|
228
|
-
},
|
|
229
|
-
closePage: () => {
|
|
230
|
-
},
|
|
231
|
-
createWriteStream: async () => ""
|
|
232
|
-
};
|
|
233
|
-
return await suite.run(
|
|
234
|
-
null,
|
|
235
|
-
mockConfig,
|
|
236
|
-
mockArtifactory,
|
|
237
|
-
mockTLog,
|
|
238
|
-
mockPM
|
|
239
|
-
);
|
|
240
|
-
},
|
|
241
|
-
RunSuiteWithError: () => async (suite) => {
|
|
242
|
-
try {
|
|
243
|
-
await suite.run(
|
|
244
|
-
null,
|
|
245
|
-
{},
|
|
246
|
-
// Invalid config
|
|
247
|
-
() => {
|
|
248
|
-
},
|
|
249
|
-
() => {
|
|
250
|
-
},
|
|
251
|
-
{}
|
|
252
|
-
);
|
|
253
|
-
} catch (e) {
|
|
254
|
-
}
|
|
255
|
-
return suite;
|
|
256
|
-
},
|
|
257
|
-
AddFeature: (feature) => (suite) => {
|
|
258
|
-
const firstGivenKey = Object.keys(suite.givens)[0];
|
|
259
|
-
if (firstGivenKey) {
|
|
260
|
-
suite.givens[firstGivenKey].features.push(feature);
|
|
261
|
-
}
|
|
262
|
-
return suite;
|
|
263
|
-
}
|
|
264
|
-
},
|
|
265
|
-
thens: {
|
|
266
|
-
SuiteNameMatches: (expectedName) => (suite) => {
|
|
267
|
-
console.log(
|
|
268
|
-
"[DEBUG] SuiteNameMatches - expected:",
|
|
269
|
-
expectedName,
|
|
270
|
-
"actual:",
|
|
271
|
-
suite?.name
|
|
272
|
-
);
|
|
273
|
-
if (!suite?.name) {
|
|
274
|
-
throw new Error(`Suite name is undefined. Expected: ${expectedName}`);
|
|
275
|
-
}
|
|
276
|
-
if (suite.name !== expectedName) {
|
|
277
|
-
throw new Error(
|
|
278
|
-
`Expected suite name '${expectedName}', got '${suite.name}'`
|
|
279
|
-
);
|
|
280
|
-
}
|
|
281
|
-
return suite;
|
|
282
|
-
},
|
|
283
|
-
SuiteIndexMatches: (expectedIndex) => (suite) => {
|
|
284
|
-
if (suite.index !== expectedIndex) {
|
|
285
|
-
throw new Error(
|
|
286
|
-
`Expected suite index ${expectedIndex}, got ${suite.index}`
|
|
287
|
-
);
|
|
288
|
-
}
|
|
289
|
-
return suite;
|
|
290
|
-
},
|
|
291
|
-
FeaturesIncludes: (feature) => (suite) => {
|
|
292
|
-
if (!suite.features().includes(feature)) {
|
|
293
|
-
throw new Error(`Expected features to include ${feature}`);
|
|
294
|
-
}
|
|
295
|
-
return suite;
|
|
296
|
-
},
|
|
297
|
-
FeatureCountMatches: (expectedCount) => (suite) => {
|
|
298
|
-
const actualCount = suite.features().length;
|
|
299
|
-
if (actualCount !== expectedCount) {
|
|
300
|
-
throw new Error(
|
|
301
|
-
`Expected ${expectedCount} features, got ${actualCount}`
|
|
302
|
-
);
|
|
303
|
-
}
|
|
304
|
-
return suite;
|
|
305
|
-
},
|
|
306
|
-
StoreValid: () => (suite) => {
|
|
307
|
-
if (!suite.store?.testStore) {
|
|
308
|
-
throw new Error("Expected valid store after execution");
|
|
309
|
-
}
|
|
310
|
-
return suite;
|
|
311
|
-
},
|
|
312
|
-
NoErrorsOccurred: () => (suite) => {
|
|
313
|
-
if (suite.failed || suite.fails > 0) {
|
|
314
|
-
throw new Error("Expected no errors to occur during execution");
|
|
315
|
-
}
|
|
316
|
-
return suite;
|
|
317
|
-
},
|
|
318
|
-
ErrorCountMatches: (expectedCount) => (suite) => {
|
|
319
|
-
if (suite.fails !== expectedCount) {
|
|
320
|
-
throw new Error(
|
|
321
|
-
`Expected ${expectedCount} errors, got ${suite.fails}`
|
|
322
|
-
);
|
|
323
|
-
}
|
|
324
|
-
return suite;
|
|
325
|
-
},
|
|
326
|
-
FailedFlagSet: () => (suite) => {
|
|
327
|
-
if (!suite.failed) {
|
|
328
|
-
throw new Error("Expected failed flag to be set after error");
|
|
329
|
-
}
|
|
330
|
-
return suite;
|
|
331
|
-
},
|
|
332
|
-
AllTestsCompleted: () => (suite) => {
|
|
333
|
-
if (!suite.store) {
|
|
334
|
-
throw new Error("Expected all tests to be completed");
|
|
335
|
-
}
|
|
336
|
-
return suite;
|
|
337
|
-
},
|
|
338
|
-
CleanExit: () => (suite) => {
|
|
339
|
-
if (suite.failed && suite.fails === 0) {
|
|
340
|
-
throw new Error("Expected clean exit state");
|
|
341
|
-
}
|
|
342
|
-
return suite;
|
|
343
|
-
},
|
|
344
|
-
specsModified: (expectedCount) => (suite) => {
|
|
345
|
-
if (suite.specs.length !== expectedCount) {
|
|
346
|
-
throw new Error(`Expected ${expectedCount} modified specs`);
|
|
347
|
-
}
|
|
348
|
-
return suite;
|
|
349
|
-
},
|
|
350
|
-
jobsModified: (expectedCount) => (suite) => {
|
|
351
|
-
if (suite.testJobs.length !== expectedCount) {
|
|
352
|
-
throw new Error(`Expected ${expectedCount} modified jobs`);
|
|
353
|
-
}
|
|
354
|
-
return suite;
|
|
355
|
-
},
|
|
356
|
-
artifactsTracked: () => (suite) => {
|
|
357
|
-
if (suite.artifacts.length === 0) {
|
|
358
|
-
throw new Error("Expected artifacts to be tracked");
|
|
359
|
-
}
|
|
360
|
-
return suite;
|
|
361
|
-
},
|
|
362
|
-
testRunSuccessful: () => (suite) => {
|
|
363
|
-
if (suite.failed) {
|
|
364
|
-
throw new Error("Expected test run to be successful");
|
|
365
|
-
}
|
|
366
|
-
return suite;
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
};
|
|
370
|
-
var testAdapter = {
|
|
371
|
-
beforeEach: async (subject, initializer, testResource, initialValues, pm) => {
|
|
372
|
-
console.log("[DEBUG] Running beforeEach with subject:", subject);
|
|
373
|
-
try {
|
|
374
|
-
const suite = await initializer();
|
|
375
|
-
if (!suite) {
|
|
376
|
-
throw new Error("Initializer returned undefined suite");
|
|
377
|
-
}
|
|
378
|
-
console.log("[DEBUG] beforeEach result:", {
|
|
379
|
-
name: suite.name,
|
|
380
|
-
index: suite.index,
|
|
381
|
-
store: suite.store
|
|
382
|
-
});
|
|
383
|
-
return {
|
|
384
|
-
name: suite.name,
|
|
385
|
-
index: suite.index,
|
|
386
|
-
testStore: true,
|
|
387
|
-
testSelection: false,
|
|
388
|
-
...suite.store || {}
|
|
389
|
-
};
|
|
390
|
-
} catch (e) {
|
|
391
|
-
console.error("Given error:", e);
|
|
392
|
-
throw e;
|
|
393
|
-
}
|
|
394
|
-
},
|
|
395
|
-
andWhen: async (store, whenCB, testResource, pm) => whenCB(store, pm),
|
|
396
|
-
butThen: async (store, thenCB, testResource, pm) => {
|
|
397
|
-
console.log(
|
|
398
|
-
"[DEBUG] butThen - input store:",
|
|
399
|
-
JSON.stringify(store, null, 2)
|
|
400
|
-
);
|
|
401
|
-
const testSelection = {
|
|
402
|
-
testSelection: store.testSelection || false,
|
|
403
|
-
error: store.error ? true : void 0
|
|
404
|
-
};
|
|
405
|
-
console.log(
|
|
406
|
-
"[DEBUG] butThen - created testSelection:",
|
|
407
|
-
JSON.stringify(testSelection, null, 2)
|
|
408
|
-
);
|
|
409
|
-
try {
|
|
410
|
-
const result = await thenCB(testSelection);
|
|
411
|
-
console.log("[DEBUG] butThen - result:", JSON.stringify(result, null, 2));
|
|
412
|
-
if (!result || typeof result.testSelection === "undefined") {
|
|
413
|
-
throw new Error(
|
|
414
|
-
`Invalid test selection result: ${JSON.stringify(result)}`
|
|
415
|
-
);
|
|
416
|
-
}
|
|
417
|
-
return result;
|
|
418
|
-
} catch (e) {
|
|
419
|
-
console.error("Then error:", e.toString());
|
|
420
|
-
console.error("Full store state:", JSON.stringify(store, null, 2));
|
|
421
|
-
throw e;
|
|
422
|
-
}
|
|
423
|
-
},
|
|
424
|
-
afterEach: (store) => store,
|
|
425
|
-
afterAll: (store, pm) => {
|
|
426
|
-
},
|
|
427
|
-
assertThis: (result) => !!result,
|
|
428
|
-
beforeAll: async (input, testResource, pm) => input
|
|
429
|
-
};
|
|
430
|
-
|
|
431
|
-
// src/lib/BaseSuite.test/web.test.ts
|
|
432
|
-
var web_test_default = Web_default(
|
|
433
|
-
BaseSuite,
|
|
434
|
-
specification,
|
|
435
|
-
implementation,
|
|
436
|
-
testAdapter
|
|
437
|
-
);
|
|
438
|
-
export {
|
|
439
|
-
web_test_default as default
|
|
440
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!DOCTYPE html>
|
|
3
|
-
<html lang="en">
|
|
4
|
-
|
|
5
|
-
<head>
|
|
6
|
-
<script type="module" src="./baseBuilder.test.web.mjs"></script>
|
|
7
|
-
|
|
8
|
-
</head>
|
|
9
|
-
|
|
10
|
-
<body>
|
|
11
|
-
<h1>/Users/adam/Code/testeranto/testeranto/bundles/web/allTests/src/lib/baseBuilder.test/baseBuilder.test.web.html</h1>
|
|
12
|
-
<div id="root">
|
|
13
|
-
|
|
14
|
-
</div>
|
|
15
|
-
</body>
|
|
16
|
-
|
|
17
|
-
<footer></footer>
|
|
18
|
-
|
|
19
|
-
</html>
|