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
|
@@ -68,14 +68,18 @@ export const TestPageView = ({ route, setRoute, navigate, projectName, testName,
|
|
|
68
68
|
React.createElement("div", { className: "mt-3" },
|
|
69
69
|
React.createElement(Button, { variant: "outline-light", onClick: () => setRoute('logs'), className: "me-2" }, "View Runtime Logs"),
|
|
70
70
|
React.createElement(Button, { variant: "outline-light", onClick: () => navigate(`/projects/${projectName}#${runtime}`) }, "View Build Logs")))) : testData ? (React.createElement("div", { className: "test-results" }, testData.givens.map((given, i) => {
|
|
71
|
-
var _a;
|
|
71
|
+
var _a, _b;
|
|
72
72
|
return (React.createElement("div", { key: i, className: "mb-4 card" },
|
|
73
73
|
React.createElement("div", { className: "card-header bg-primary text-white" },
|
|
74
74
|
React.createElement("div", { className: "d-flex justify-content-between align-items-center" },
|
|
75
|
-
React.createElement("
|
|
76
|
-
"
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
React.createElement("div", null,
|
|
76
|
+
React.createElement("h4", null,
|
|
77
|
+
"Given: ",
|
|
78
|
+
given.name),
|
|
79
|
+
((_a = given.features) === null || _a === void 0 ? void 0 : _a.length) > 0 && (React.createElement("div", { className: "mt-1" },
|
|
80
|
+
React.createElement("small", null, "Features:"),
|
|
81
|
+
React.createElement("ul", { className: "list-unstyled" }, given.features.map((feature, fi) => (React.createElement("li", { key: fi }, feature.startsWith('http') ? (React.createElement("a", { href: feature, target: "_blank", rel: "noopener noreferrer", className: "text-white" }, new URL(feature).hostname)) : (React.createElement("span", { className: "text-white" }, feature))))))))),
|
|
82
|
+
((_b = given.artifacts) === null || _b === void 0 ? void 0 : _b.length) > 0 && (React.createElement("div", { className: "dropdown" },
|
|
79
83
|
React.createElement("button", { className: "btn btn-sm btn-light dropdown-toggle", type: "button", "data-bs-toggle": "dropdown" },
|
|
80
84
|
"Artifacts (",
|
|
81
85
|
given.artifacts.length,
|
|
@@ -84,29 +88,37 @@ export const TestPageView = ({ route, setRoute, navigate, projectName, testName,
|
|
|
84
88
|
React.createElement("a", { className: "dropdown-item", href: `/testeranto/reports/${projectName}/${testName.split('.').slice(0, -1).join('.')}/${runtime}/${artifact}`, target: "_blank", rel: "noopener noreferrer" }, artifact.split('/').pop()))))))))),
|
|
85
89
|
React.createElement("div", { className: "card-body" },
|
|
86
90
|
given.whens.map((when, j) => {
|
|
87
|
-
var _a;
|
|
91
|
+
var _a, _b;
|
|
88
92
|
return (React.createElement("div", { key: `w-${j}`, className: `p-3 mb-2 ${when.error ? 'bg-danger text-white' : 'bg-success text-white'}` },
|
|
89
93
|
React.createElement("div", { className: "d-flex justify-content-between align-items-start" },
|
|
90
94
|
React.createElement("div", null,
|
|
91
|
-
React.createElement("
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
React.createElement("div", null,
|
|
96
|
+
React.createElement("strong", null, "When:"),
|
|
97
|
+
" ",
|
|
98
|
+
when.name,
|
|
99
|
+
((_a = when.features) === null || _a === void 0 ? void 0 : _a.length) > 0 && (React.createElement("div", { className: "mt-2" },
|
|
100
|
+
React.createElement("small", null, "Features:"),
|
|
101
|
+
React.createElement("ul", { className: "list-unstyled" }, when.features.map((feature, fi) => (React.createElement("li", { key: fi }, feature.startsWith('http') ? (React.createElement("a", { href: feature, target: "_blank", rel: "noopener noreferrer" }, new URL(feature).hostname)) : (feature))))))),
|
|
102
|
+
when.error && React.createElement("pre", { className: "mt-2" }, when.error))),
|
|
103
|
+
((_b = when.artifacts) === null || _b === void 0 ? void 0 : _b.length) > 0 && (React.createElement("div", { className: "ms-3" },
|
|
96
104
|
React.createElement("strong", null, "Artifacts:"),
|
|
97
105
|
React.createElement("ul", { className: "list-unstyled" }, when.artifacts.map((artifact, ai) => (React.createElement("li", { key: ai },
|
|
98
106
|
React.createElement("a", { href: `/testeranto/reports/${projectName}/${testName.split('.').slice(0, -1).join('.')}/${runtime}/${artifact}`, target: "_blank", className: "text-white", rel: "noopener noreferrer" }, artifact.split('/').pop()))))))))));
|
|
99
107
|
}),
|
|
100
108
|
given.thens.map((then, k) => {
|
|
101
|
-
var _a;
|
|
109
|
+
var _a, _b;
|
|
102
110
|
return (React.createElement("div", { key: `t-${k}`, className: `p-3 mb-2 ${then.error ? 'bg-danger text-white' : 'bg-success text-white'}` },
|
|
103
111
|
React.createElement("div", { className: "d-flex justify-content-between align-items-start" },
|
|
104
112
|
React.createElement("div", null,
|
|
105
|
-
React.createElement("
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
113
|
+
React.createElement("div", null,
|
|
114
|
+
React.createElement("strong", null, "Then:"),
|
|
115
|
+
" ",
|
|
116
|
+
then.name,
|
|
117
|
+
((_a = then.features) === null || _a === void 0 ? void 0 : _a.length) > 0 && (React.createElement("div", { className: "mt-2" },
|
|
118
|
+
React.createElement("small", null, "Features:"),
|
|
119
|
+
React.createElement("ul", { className: "list-unstyled" }, then.features.map((feature, fi) => (React.createElement("li", { key: fi }, feature.startsWith('http') ? (React.createElement("a", { href: feature, target: "_blank", rel: "noopener noreferrer" }, new URL(feature).hostname)) : (feature))))))),
|
|
120
|
+
then.error && React.createElement("pre", { className: "mt-2" }, then.error))),
|
|
121
|
+
((_b = then.artifacts) === null || _b === void 0 ? void 0 : _b.length) > 0 && (React.createElement("div", { className: "ms-3" },
|
|
110
122
|
React.createElement("strong", null, "Artifacts:"),
|
|
111
123
|
React.createElement("ul", { className: "list-unstyled" }, then.artifacts.map((artifact, ai) => (React.createElement("li", { key: ai },
|
|
112
124
|
React.createElement("a", { href: `/testeranto/reports/${projectName}/${testName.split('.').slice(0, -1).join('.')}/${runtime}/${artifact}`, target: "_blank", className: "text-white", rel: "noopener noreferrer" }, artifact.split('/').pop()))))))))));
|
|
@@ -4,9 +4,7 @@ import featuresPlugin from "./featuresPlugin";
|
|
|
4
4
|
import rebuildPlugin from "./rebuildPlugin.js";
|
|
5
5
|
export default (config, entryPoints, testName) => {
|
|
6
6
|
const { inputFilesPluginFactory, register } = inputFilesPlugin("node", testName);
|
|
7
|
-
return Object.assign(Object.assign({}, baseEsBuildConfig(config)), { splitting: true, outdir: `testeranto/bundles/node/${testName}/`,
|
|
8
|
-
// inject: [`./node_modules/testeranto/dist/cjs-shim.js`],
|
|
9
|
-
metafile: true, supported: {
|
|
7
|
+
return Object.assign(Object.assign({}, baseEsBuildConfig(config)), { splitting: true, outdir: `testeranto/bundles/node/${testName}/`, inject: [`./node_modules/testeranto/dist/cjs-shim.js`], metafile: true, supported: {
|
|
10
8
|
"dynamic-import": true,
|
|
11
9
|
}, define: {
|
|
12
10
|
"process.env.FLUENTFFMPEG_COV": "0",
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { beforeAllProxy, afterAllProxy } from "./pmProxy";
|
|
2
2
|
export class BaseSuite {
|
|
3
|
+
addArtifact(path) {
|
|
4
|
+
console.log("Suite addArtifact", path);
|
|
5
|
+
const normalizedPath = path.replace(/\\/g, "/"); // Normalize path separators
|
|
6
|
+
this.artifacts.push(normalizedPath);
|
|
7
|
+
}
|
|
3
8
|
constructor(name, index, givens = {}) {
|
|
9
|
+
this.artifacts = [];
|
|
4
10
|
const suiteName = name || "testSuite"; // Ensure name is never undefined
|
|
5
11
|
if (!suiteName) {
|
|
6
12
|
throw new Error("BaseSuite requires a non-empty name");
|
|
7
13
|
}
|
|
8
|
-
console.log("[DEBUG] BaseSuite constructor - name:", suiteName, "index:", index);
|
|
9
14
|
this.name = suiteName;
|
|
10
15
|
this.index = index;
|
|
11
16
|
this.givens = givens;
|
|
12
17
|
this.fails = 0;
|
|
13
|
-
console.log("[DEBUG] BaseSuite initialized:", this.name, this.index);
|
|
14
|
-
console.log("[DEBUG] BaseSuite givens:", Object.keys(givens).toString());
|
|
15
18
|
}
|
|
16
19
|
features() {
|
|
17
20
|
try {
|
|
@@ -21,11 +24,10 @@ export class BaseSuite {
|
|
|
21
24
|
.filter((value, index, array) => {
|
|
22
25
|
return array.indexOf(value) === index;
|
|
23
26
|
});
|
|
24
|
-
console.debug("[DEBUG] Features extracted:", features.toString());
|
|
25
27
|
return features || [];
|
|
26
28
|
}
|
|
27
29
|
catch (e) {
|
|
28
|
-
console.error("[ERROR] Failed to extract features:", e);
|
|
30
|
+
console.error("[ERROR] Failed to extract features:", JSON.stringify(e));
|
|
29
31
|
return [];
|
|
30
32
|
}
|
|
31
33
|
}
|
|
@@ -53,10 +55,10 @@ export class BaseSuite {
|
|
|
53
55
|
// tLog("test resources: ", JSON.stringify(testResourceConfiguration));
|
|
54
56
|
const suiteArtifactory = (fPath, value) => artifactory(`suite-${this.index}-${this.name}/${fPath}`, value);
|
|
55
57
|
// console.log("\nSuite:", this.index, this.name);
|
|
56
|
-
tLog("\nSuite:", this.index, this.name);
|
|
58
|
+
// tLog("\nSuite:", this.index, this.name);
|
|
57
59
|
const sNdx = this.index;
|
|
58
|
-
|
|
59
|
-
const subject = await this.setup(input, suiteArtifactory, testResourceConfiguration,
|
|
60
|
+
const proxiedPm = beforeAllProxy(pm, sNdx.toString(), this);
|
|
61
|
+
const subject = await this.setup(input, suiteArtifactory, testResourceConfiguration, proxiedPm);
|
|
60
62
|
for (const [gKey, g] of Object.entries(this.givens)) {
|
|
61
63
|
const giver = this.givens[gKey];
|
|
62
64
|
this.store = await giver
|
|
@@ -64,15 +66,15 @@ export class BaseSuite {
|
|
|
64
66
|
.catch((e) => {
|
|
65
67
|
this.failed = true;
|
|
66
68
|
this.fails = this.fails + 1;
|
|
67
|
-
// console.error("Given error 1:", e.toString());
|
|
68
69
|
throw e;
|
|
69
70
|
});
|
|
70
71
|
}
|
|
71
72
|
try {
|
|
72
|
-
|
|
73
|
+
const afterAllPm = afterAllProxy(pm, sNdx.toString(), this);
|
|
74
|
+
this.afterAll(this.store, artifactory, afterAllPm);
|
|
73
75
|
}
|
|
74
76
|
catch (e) {
|
|
75
|
-
console.error(e);
|
|
77
|
+
console.error(JSON.stringify(e));
|
|
76
78
|
// this.fails.push(this);
|
|
77
79
|
// return this;
|
|
78
80
|
}
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
import { afterEachProxy, andWhenProxy, beforeEachProxy, butThenProxy, } from "./pmProxy.js";
|
|
4
4
|
export class BaseGiven {
|
|
5
5
|
addArtifact(path) {
|
|
6
|
-
console.log(
|
|
7
|
-
|
|
6
|
+
console.log("Given addArtifact", path);
|
|
7
|
+
const normalizedPath = path.replace(/\\/g, "/"); // Normalize path separators
|
|
8
|
+
this.artifacts.push(normalizedPath);
|
|
8
9
|
}
|
|
9
10
|
constructor(name, features, whens, thens, givenCB, initialValues) {
|
|
10
11
|
this.artifacts = [];
|
|
@@ -25,7 +26,7 @@ export class BaseGiven {
|
|
|
25
26
|
whens: this.whens.map((w) => {
|
|
26
27
|
if (w && w.toObj)
|
|
27
28
|
return w.toObj();
|
|
28
|
-
console.error("w is not as expected!",
|
|
29
|
+
console.error("w is not as expected!", JSON.stringify(w));
|
|
29
30
|
return {};
|
|
30
31
|
}),
|
|
31
32
|
thens: this.thens.map((t) => t.toObj()),
|
|
@@ -49,15 +50,13 @@ export class BaseGiven {
|
|
|
49
50
|
tLog(e.stack);
|
|
50
51
|
});
|
|
51
52
|
try {
|
|
52
|
-
const proxiedPm = beforeEachProxy(pm, suiteNdx.toString());
|
|
53
|
-
console.log(`[Given] Setting currentStep for beforeEach:`, this.name);
|
|
54
|
-
proxiedPm.currentStep = this;
|
|
53
|
+
const proxiedPm = beforeEachProxy(pm, suiteNdx.toString(), this.addArtifact.bind(this));
|
|
55
54
|
this.store = await this.givenThat(subject, testResourceConfiguration, givenArtifactory, this.givenCB, this.initialValues, proxiedPm);
|
|
56
55
|
}
|
|
57
56
|
catch (e) {
|
|
58
|
-
console.error("Given failure: ", e.
|
|
59
|
-
this.error = e;
|
|
60
|
-
throw e;
|
|
57
|
+
// console.error("Given failure: ", e.stack);
|
|
58
|
+
this.error = e.stack;
|
|
59
|
+
// throw e;
|
|
61
60
|
}
|
|
62
61
|
try {
|
|
63
62
|
// tLog(`\n Given this.store`, this.store);
|
|
@@ -67,9 +66,6 @@ export class BaseGiven {
|
|
|
67
66
|
for (const [thenNdx, thenStep] of this.thens.entries()) {
|
|
68
67
|
const t = await thenStep.test(this.store, testResourceConfiguration, tLog, pm, `suite-${suiteNdx}/given-${key}/then-${thenNdx}`);
|
|
69
68
|
tester(t);
|
|
70
|
-
// ((t) => {
|
|
71
|
-
// return tester(t);
|
|
72
|
-
// })();
|
|
73
69
|
}
|
|
74
70
|
}
|
|
75
71
|
catch (e) {
|
|
@@ -79,10 +75,11 @@ export class BaseGiven {
|
|
|
79
75
|
}
|
|
80
76
|
finally {
|
|
81
77
|
try {
|
|
82
|
-
|
|
78
|
+
const proxiedPm = afterEachProxy(pm, suiteNdx.toString(), key, this.addArtifact.bind(this));
|
|
79
|
+
// (proxiedPm as any).currentStep = this;
|
|
80
|
+
await this.afterEach(this.store, this.key, givenArtifactory, proxiedPm);
|
|
83
81
|
}
|
|
84
82
|
catch (e) {
|
|
85
|
-
console.error("afterEach failed!", e.toString());
|
|
86
83
|
this.failed = e;
|
|
87
84
|
throw e;
|
|
88
85
|
// this.error = e.message;
|
|
@@ -92,36 +89,33 @@ export class BaseGiven {
|
|
|
92
89
|
}
|
|
93
90
|
}
|
|
94
91
|
export class BaseWhen {
|
|
92
|
+
addArtifact(path) {
|
|
93
|
+
console.log("When addArtifact", path);
|
|
94
|
+
const normalizedPath = path.replace(/\\/g, "/"); // Normalize path separators
|
|
95
|
+
this.artifacts.push(normalizedPath);
|
|
96
|
+
}
|
|
95
97
|
constructor(name, whenCB) {
|
|
96
98
|
this.artifacts = [];
|
|
97
99
|
this.name = name;
|
|
98
100
|
this.whenCB = whenCB;
|
|
99
101
|
}
|
|
100
102
|
toObj() {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
name: this.
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
return {
|
|
111
|
-
name: this.name,
|
|
112
|
-
artifacts: this.artifacts,
|
|
113
|
-
};
|
|
114
|
-
}
|
|
103
|
+
const obj = {
|
|
104
|
+
name: this.name,
|
|
105
|
+
error: this.error
|
|
106
|
+
? `${this.error.name}: ${this.error.message}\n${this.error.stack}`
|
|
107
|
+
: null,
|
|
108
|
+
artifacts: this.artifacts || [],
|
|
109
|
+
};
|
|
110
|
+
console.log(`[TOOBJ] Serializing ${this.constructor.name} with artifacts:`, obj.artifacts);
|
|
111
|
+
return obj;
|
|
115
112
|
}
|
|
116
113
|
async test(store, testResourceConfiguration, tLog, pm, filepath) {
|
|
117
114
|
try {
|
|
118
|
-
tLog(" When:", this.name);
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
console.log(`[When] Setting currentStep for andWhen:`, this.name);
|
|
122
|
-
proxiedPm.currentStep = this;
|
|
115
|
+
// tLog(" When:", this.name);
|
|
116
|
+
const proxiedPm = andWhenProxy(pm, filepath, this.addArtifact.bind(this));
|
|
117
|
+
// (proxiedPm as any).currentStep = this;
|
|
123
118
|
const result = await this.andWhen(store, this.whenCB, testResourceConfiguration, proxiedPm);
|
|
124
|
-
console.debug("[DEBUG] When step completed:", this.name.toString());
|
|
125
119
|
return result;
|
|
126
120
|
}
|
|
127
121
|
catch (e) {
|
|
@@ -137,18 +131,23 @@ export class BaseThen {
|
|
|
137
131
|
this.name = name;
|
|
138
132
|
this.thenCB = thenCB;
|
|
139
133
|
this.error = false;
|
|
134
|
+
this.artifacts = [];
|
|
135
|
+
}
|
|
136
|
+
addArtifact(path) {
|
|
137
|
+
console.log("Then addArtifact", path);
|
|
138
|
+
const normalizedPath = path.replace(/\\/g, "/"); // Normalize path separators
|
|
139
|
+
this.artifacts.push(normalizedPath);
|
|
140
140
|
}
|
|
141
141
|
toObj() {
|
|
142
|
-
|
|
142
|
+
const obj = {
|
|
143
143
|
name: this.name,
|
|
144
144
|
error: this.error,
|
|
145
145
|
artifacts: this.artifacts,
|
|
146
146
|
};
|
|
147
|
+
return obj;
|
|
147
148
|
}
|
|
148
149
|
async test(store, testResourceConfiguration, tLog, pm, filepath) {
|
|
149
|
-
const proxiedPm = butThenProxy(pm, filepath);
|
|
150
|
-
console.log(`[Then] Setting currentStep for butThen:`, this.name);
|
|
151
|
-
proxiedPm.currentStep = this;
|
|
150
|
+
const proxiedPm = butThenProxy(pm, filepath, this.addArtifact.bind(this));
|
|
152
151
|
return this.butThen(store, async (s) => {
|
|
153
152
|
if (typeof this.thenCB === "function") {
|
|
154
153
|
return await this.thenCB(s, proxiedPm);
|
|
@@ -156,8 +155,8 @@ export class BaseThen {
|
|
|
156
155
|
else {
|
|
157
156
|
return this.thenCB;
|
|
158
157
|
}
|
|
159
|
-
}, testResourceConfiguration,
|
|
160
|
-
this.error = e.
|
|
158
|
+
}, testResourceConfiguration, proxiedPm).catch((e) => {
|
|
159
|
+
this.error = e.stack;
|
|
161
160
|
// throw e;
|
|
162
161
|
});
|
|
163
162
|
}
|
|
@@ -5,7 +5,7 @@ export const implementation = {
|
|
|
5
5
|
Default: "BaseBuilder test suite",
|
|
6
6
|
},
|
|
7
7
|
givens: {
|
|
8
|
-
|
|
8
|
+
"the default BaseBuilder": () => {
|
|
9
9
|
return new MockBaseBuilder({}, // input
|
|
10
10
|
{}, // suitesOverrides
|
|
11
11
|
{}, // givenOverrides
|
|
@@ -15,11 +15,11 @@ export const implementation = {
|
|
|
15
15
|
() => [] // testSpecification
|
|
16
16
|
);
|
|
17
17
|
},
|
|
18
|
-
|
|
19
|
-
return new MockBaseBuilder(input, {}, {}, {}, {}, {
|
|
18
|
+
"a BaseBuilder with TestInput": (input) => {
|
|
19
|
+
return new MockBaseBuilder(input, {}, {}, {}, {}, { ports: [] }, () => []);
|
|
20
20
|
},
|
|
21
|
-
|
|
22
|
-
return new MockBaseBuilder({}, {}, {}, {}, {},
|
|
21
|
+
"a BaseBuilder with Test Resource Requirements": (requirements) => {
|
|
22
|
+
return new MockBaseBuilder({}, {}, {}, {}, {}, requirements, () => []);
|
|
23
23
|
},
|
|
24
24
|
},
|
|
25
25
|
whens: {
|
|
@@ -33,8 +33,9 @@ export const implementation = {
|
|
|
33
33
|
},
|
|
34
34
|
},
|
|
35
35
|
thens: {
|
|
36
|
-
|
|
36
|
+
"it is initialized": () => (builder, utils) => {
|
|
37
37
|
var _a;
|
|
38
|
+
utils.writeFileSync("hello.txt", "world");
|
|
38
39
|
if (!(builder instanceof BaseBuilder)) {
|
|
39
40
|
console.error("Builder instance:", builder);
|
|
40
41
|
throw new Error(`Builder was not properly initialized - expected BaseBuilder instance but got ${(_a = builder === null || builder === void 0 ? void 0 : builder.constructor) === null || _a === void 0 ? void 0 : _a.name}`);
|
|
@@ -55,19 +56,19 @@ export const implementation = {
|
|
|
55
56
|
});
|
|
56
57
|
return builder;
|
|
57
58
|
},
|
|
58
|
-
|
|
59
|
+
"it generates TestSpecifications": () => (builder) => {
|
|
59
60
|
if (!Array.isArray(builder.specs)) {
|
|
60
61
|
throw new Error("Specs were not generated");
|
|
61
62
|
}
|
|
62
63
|
return builder;
|
|
63
64
|
},
|
|
64
|
-
|
|
65
|
+
"it creates jobs": () => (builder) => {
|
|
65
66
|
if (!Array.isArray(builder.testJobs)) {
|
|
66
67
|
throw new Error("Test jobs were not created");
|
|
67
68
|
}
|
|
68
69
|
return builder;
|
|
69
70
|
},
|
|
70
|
-
|
|
71
|
+
"it tracks artifacts": () => (builder) => {
|
|
71
72
|
if (!Array.isArray(builder.artifacts)) {
|
|
72
73
|
throw new Error("Artifacts array not initialized");
|
|
73
74
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export const specification = (Suite, Given, When, Then) => {
|
|
2
2
|
return [
|
|
3
3
|
Suite.Default("Testing BaseBuilder functionality", {
|
|
4
|
-
testInitialization: Given
|
|
5
|
-
Then
|
|
6
|
-
Then
|
|
7
|
-
Then
|
|
8
|
-
Then
|
|
4
|
+
testInitialization: Given["the default BaseBuilder"](["BaseBuilder should initialize correctly"], [], [
|
|
5
|
+
Then["it is initialized"](),
|
|
6
|
+
Then["it tracks artifacts"](),
|
|
7
|
+
// Then["it creates jobs"](),
|
|
8
|
+
// Then["it generates TestSpecifications"](),
|
|
9
9
|
]),
|
|
10
|
-
testSpecsGeneration: Given
|
|
11
|
-
testJobsCreation: Given
|
|
10
|
+
testSpecsGeneration: Given["the default BaseBuilder"](["BaseBuilder should generate specs from test specification"], [], [Then["it generates TestSpecifications"]()]),
|
|
11
|
+
testJobsCreation: Given["the default BaseBuilder"](["BaseBuilder should create test jobs"], [], [Then["it creates jobs"]()]),
|
|
12
12
|
}),
|
|
13
13
|
];
|
|
14
14
|
};
|
|
@@ -15,9 +15,11 @@ export class BaseBuilder {
|
|
|
15
15
|
this.specs = testSpecification(this.Suites(), this.Given(), this.When(), this.Then());
|
|
16
16
|
this.testJobs = this.specs.map((suite) => {
|
|
17
17
|
const suiteRunner = (suite) => async (puppetMaster, tLog) => {
|
|
18
|
+
console.log("mark17");
|
|
18
19
|
const x = await suite.run(input, puppetMaster.testResourceConfiguration, (fPath, value) => puppetMaster.testArtiFactoryfileWriter(tLog, (p) => {
|
|
19
20
|
this.artifacts.push(p);
|
|
20
21
|
})(puppetMaster.testResourceConfiguration.fs + "/" + fPath, value), tLog, puppetMaster);
|
|
22
|
+
console.log("mark18");
|
|
21
23
|
return x;
|
|
22
24
|
};
|
|
23
25
|
const runner = suiteRunner(suite);
|
|
@@ -36,14 +38,23 @@ export class BaseBuilder {
|
|
|
36
38
|
const tLog = async (...l) => {
|
|
37
39
|
//
|
|
38
40
|
};
|
|
41
|
+
console.log("mark14");
|
|
39
42
|
const suiteDone = await runner(puppetMaster, tLog);
|
|
43
|
+
console.log("mark15");
|
|
40
44
|
// const logPromise = new Promise(async (res) => {
|
|
41
45
|
// await puppetMaster.end(access);
|
|
42
46
|
// res(true);
|
|
43
47
|
// });
|
|
44
48
|
const fails = suiteDone.fails;
|
|
45
|
-
await puppetMaster.writeFileSync(
|
|
46
|
-
|
|
49
|
+
await puppetMaster.writeFileSync([
|
|
50
|
+
`bdd_errors.txt`,
|
|
51
|
+
fails.toString(),
|
|
52
|
+
]);
|
|
53
|
+
await puppetMaster.writeFileSync([
|
|
54
|
+
`tests.json`,
|
|
55
|
+
JSON.stringify(this.toObj(), null, 2),
|
|
56
|
+
]);
|
|
57
|
+
console.log("mark13");
|
|
47
58
|
return {
|
|
48
59
|
failed: fails > 0,
|
|
49
60
|
fails,
|
|
@@ -26,6 +26,7 @@ export default class TesterantoCore extends ClassBuilder {
|
|
|
26
26
|
this.uberCatcher = uberCatcher;
|
|
27
27
|
}
|
|
28
28
|
async givenThat(subject, testResource, artifactory, initializer, initialValues, pm) {
|
|
29
|
+
console.log("mark800");
|
|
29
30
|
return fullAdapter.beforeEach(subject, initializer, testResource, initialValues, pm);
|
|
30
31
|
}
|
|
31
32
|
afterEach(store, key, artifactory, pm) {
|