testeranto 0.100.0 → 0.110.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 +1 -0
- package/bundle.js +80 -30
- package/dist/common/{dist/module/src/Init.js → Init.js} +28 -0
- package/dist/common/{src/PM → PM}/main.js +138 -95
- package/dist/common/ReportServer.js +22 -0
- package/dist/common/{src/SubPackages → SubPackages}/react/jsx/index.js +0 -12
- package/dist/common/{src/SubPackages → SubPackages}/react-dom/component/node.js +3 -16
- package/dist/common/{src/SubPackages → SubPackages}/react-dom/component/web.js +3 -3
- package/dist/common/{src/SubPackages → SubPackages}/react-dom/jsx/node.js +1 -1
- package/dist/common/{src/SubPackages → SubPackages}/react-dom/jsx/web.js +41 -30
- package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/MemoExoticComponent/node.js +17 -7
- package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/component/interface.js +17 -7
- package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/fc/node.js +17 -7
- package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/fc/web.js +17 -7
- package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/jsx/index.js +18 -14
- package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/jsx-promised/index.js +17 -7
- package/dist/common/build.js +222 -0
- package/dist/common/{src/defaultConfig.js → defaultConfig.js} +1 -0
- package/dist/common/esbuildConfigs/eslint-formatter-testeranto.js +6 -0
- package/dist/common/esbuildConfigs/inputFilesPlugin.js +27 -0
- package/dist/common/{src/esbuildConfigs → esbuildConfigs}/node.js +2 -10
- package/dist/common/{src/esbuildConfigs → esbuildConfigs}/web.js +2 -13
- package/dist/common/{src/init-docs.js → init-docs.js} +20 -10
- package/dist/common/{src/lib → lib}/abstractBase.js +6 -1
- package/dist/common/{src/lib → lib}/basebuilder.js +23 -10
- package/dist/common/{src/lib → lib}/classBuilder.js +1 -3
- package/dist/common/{src/lib → lib}/core.js +26 -10
- package/dist/common/{src/lib → lib}/index.js +0 -1
- package/dist/common/{src/lib → lib}/types.js +0 -1
- package/dist/common/run.js +297 -0
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/common/utils.js +43 -0
- package/dist/module/Footer.js +4 -0
- package/dist/module/Init.js +63 -0
- package/dist/module/{src/PM → PM}/main.js +119 -86
- package/dist/module/ReportClient.js +97 -0
- package/dist/module/ReportServer.js +17 -0
- package/dist/module/SubPackages/react/jsx/index.js +15 -0
- package/dist/module/{src/SubPackages → SubPackages}/react-dom/component/node.js +3 -16
- package/dist/module/{src/SubPackages → SubPackages}/react-dom/component/web.js +3 -3
- package/dist/module/{src/SubPackages → SubPackages}/react-dom/jsx/node.js +3 -3
- package/dist/module/{src/SubPackages → SubPackages}/react-dom/jsx/web.js +24 -23
- package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/jsx/index.js +1 -7
- package/dist/module/TestReport.js +91 -0
- package/dist/module/build.js +184 -0
- package/dist/module/{src/defaultConfig.js → defaultConfig.js} +1 -0
- package/dist/module/esbuildConfigs/eslint-formatter-testeranto.js +3 -0
- package/dist/module/esbuildConfigs/inputFilesPlugin.js +22 -0
- package/dist/module/{src/esbuildConfigs → esbuildConfigs}/node.js +2 -10
- package/dist/module/{src/esbuildConfigs → esbuildConfigs}/web.js +2 -13
- package/dist/module/{src/init-docs.js → init-docs.js} +1 -1
- package/dist/module/{src/lib → lib}/abstractBase.js +6 -1
- package/dist/module/{src/lib → lib}/basebuilder.js +23 -10
- package/dist/module/{src/lib → lib}/classBuilder.js +1 -3
- package/dist/module/{src/lib → lib}/core.js +26 -10
- package/dist/module/{src/lib → lib}/index.js +0 -1
- package/dist/module/run.js +259 -0
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/module/utils.js +29 -0
- package/dist/prebuild/ReportClient.css +11367 -0
- package/dist/prebuild/ReportClient.js +23641 -0
- package/dist/prebuild/ReportServer.mjs +16 -0
- package/dist/prebuild/TestReport.css +11367 -0
- package/dist/prebuild/TestReport.js +27484 -0
- package/dist/prebuild/build.mjs +376 -0
- package/dist/prebuild/esbuildConfigs/eslint-formatter-testeranto.mjs +9 -0
- package/dist/prebuild/init-docs.mjs +64 -8
- package/dist/prebuild/{cli2.mjs → run.mjs} +353 -81
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/Node.d.ts +12 -0
- package/dist/types/{src/PM → PM}/index.d.ts +1 -1
- package/dist/types/{src/PM → PM}/main.d.ts +12 -9
- package/dist/types/{src/PM → PM}/node.d.ts +2 -4
- package/dist/types/{src/PM → PM}/web.d.ts +2 -4
- package/dist/types/SubPackages/react/component/node.d.ts +7 -0
- package/dist/types/SubPackages/react/component/web.d.ts +7 -0
- package/dist/types/SubPackages/react/jsx/index.d.ts +12 -0
- package/dist/types/SubPackages/react/jsx/node.d.ts +4 -0
- package/dist/types/SubPackages/react/jsx/web.d.ts +4 -0
- package/dist/types/SubPackages/react-dom/component/node.d.ts +11 -0
- package/dist/types/SubPackages/react-dom/component/web.d.ts +20 -0
- package/dist/types/SubPackages/react-dom/jsx/index.d.ts +6 -0
- package/dist/types/SubPackages/react-dom/jsx/node.d.ts +7 -0
- package/dist/types/SubPackages/react-dom/jsx/web.d.ts +5 -0
- package/dist/types/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +6 -0
- package/dist/types/SubPackages/react-test-renderer/component/index.d.ts +13 -0
- package/dist/types/SubPackages/react-test-renderer/component/node.d.ts +4 -0
- package/dist/types/SubPackages/react-test-renderer/component/web.d.ts +4 -0
- package/dist/types/SubPackages/react-test-renderer/fc/node.d.ts +8 -0
- package/dist/types/SubPackages/react-test-renderer/fc/web.d.ts +9 -0
- package/dist/types/SubPackages/react-test-renderer/jsx/index.d.ts +16 -0
- package/dist/types/SubPackages/react-test-renderer/jsx/node.d.ts +9 -0
- package/dist/types/SubPackages/react-test-renderer/jsx/web.d.ts +9 -0
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/index.d.ts +15 -0
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/node.d.ts +5 -0
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/web.d.ts +5 -0
- package/dist/types/Types.d.ts +61 -0
- package/dist/types/Web.d.ts +9 -0
- package/dist/types/defaultConfig.d.ts +3 -0
- package/dist/types/esbuildConfigs/eslint-formatter-testeranto.d.ts +2 -0
- package/dist/types/{src/esbuildConfigs → esbuildConfigs}/index.d.ts +1 -1
- package/dist/types/{src/esbuildConfigs → esbuildConfigs}/inputFilesPlugin.d.ts +0 -1
- package/dist/types/{src/esbuildConfigs → esbuildConfigs}/node.d.ts +1 -1
- package/dist/types/{src/esbuildConfigs → esbuildConfigs}/web.d.ts +1 -1
- package/dist/types/init-docs.d.ts +1 -0
- package/dist/types/lib/abstractBase.d.ts +110 -0
- package/dist/types/lib/basebuilder.d.ts +27 -0
- package/dist/types/lib/classBuilder.d.ts +7 -0
- package/dist/types/lib/core.d.ts +7 -0
- package/dist/types/lib/index.d.ts +83 -0
- package/dist/types/lib/types.d.ts +14 -0
- package/dist/types/run.d.ts +1 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/utils.d.ts +9 -0
- package/package.json +40 -32
- package/src/Footer.tsx +4 -0
- package/src/Init.ts +48 -0
- package/src/Node.ts +23 -17
- package/src/PM/index.ts +1 -1
- package/src/PM/main.ts +143 -101
- package/src/PM/node.ts +2 -2
- package/src/PM/web.ts +1 -1
- package/src/ReportClient.tsx +155 -0
- package/src/ReportServer.ts +21 -0
- package/src/SubPackages/react/component/node.ts +68 -24
- package/src/SubPackages/react/component/web.ts +68 -25
- package/src/SubPackages/react/jsx/index.ts +39 -18
- package/src/SubPackages/react/jsx/node.ts +12 -10
- package/src/SubPackages/react/jsx/web.ts +27 -14
- package/src/SubPackages/react-dom/component/node.ts +42 -50
- package/src/SubPackages/react-dom/component/web.ts +28 -10
- package/src/SubPackages/react-dom/jsx/node.ts +54 -56
- package/src/SubPackages/react-dom/jsx/web.ts +55 -42
- package/src/SubPackages/react-test-renderer/MemoExoticComponent/node.ts +23 -7
- package/src/SubPackages/react-test-renderer/component/index.ts +38 -5
- package/src/SubPackages/react-test-renderer/component/node.ts +24 -5
- package/src/SubPackages/react-test-renderer/component/web.ts +22 -5
- package/src/SubPackages/react-test-renderer/fc/node.ts +41 -7
- package/src/SubPackages/react-test-renderer/fc/web.ts +43 -11
- package/src/SubPackages/react-test-renderer/jsx/index.ts +39 -16
- package/src/SubPackages/react-test-renderer/jsx/node.ts +8 -6
- package/src/SubPackages/react-test-renderer/jsx/web.ts +22 -5
- package/src/SubPackages/react-test-renderer/jsx-promised/index.ts +39 -6
- package/src/SubPackages/react-test-renderer/jsx-promised/node.ts +27 -10
- package/src/SubPackages/react-test-renderer/jsx-promised/web.ts +26 -12
- package/src/TestReport.tsx +176 -0
- package/src/Types.ts +63 -309
- package/src/Web.ts +24 -18
- package/src/build.ts +240 -0
- package/src/defaultConfig.ts +2 -1
- package/src/esbuildConfigs/eslint-formatter-testeranto.ts +5 -0
- package/src/esbuildConfigs/featuresPlugin.ts +0 -1
- package/src/esbuildConfigs/index.ts +1 -1
- package/src/esbuildConfigs/inputFilesPlugin.ts +2 -135
- package/src/esbuildConfigs/node.ts +4 -13
- package/src/esbuildConfigs/web.ts +3 -19
- package/src/init-docs.ts +2 -1
- package/src/lib/abstractBase.ts +82 -80
- package/src/lib/basebuilder.ts +57 -45
- package/src/lib/classBuilder.ts +15 -15
- package/src/lib/core.ts +44 -35
- package/src/lib/index.ts +47 -98
- package/src/lib/readme.md +12 -0
- package/src/lib/types.ts +53 -70
- package/src/run.ts +398 -0
- package/src/style.css +8 -0
- package/src/utils.ts +74 -2
- package/tsc.log +106 -0
- package/Bundle.Dockerfile +0 -52
- package/bin/init-docs.js +0 -24
- package/dist/common/src/Init.js +0 -40
- package/dist/common/src/SubPackages/puppeteer.js +0 -21
- package/dist/common/src/cli.js +0 -439
- package/dist/common/src/cli2.js +0 -144
- package/dist/common/src/esbuildConfigs/inputFilesPlugin.js +0 -99
- package/dist/common/src/utils.js +0 -16
- package/dist/common/testeranto.js +0 -15
- package/dist/module/src/Init.js +0 -35
- package/dist/module/src/SubPackages/puppeteer.js +0 -16
- package/dist/module/src/SubPackages/react/jsx/index.js +0 -27
- package/dist/module/src/cli.js +0 -411
- package/dist/module/src/cli2.js +0 -116
- package/dist/module/src/esbuildConfigs/inputFilesPlugin.js +0 -94
- package/dist/module/src/lib/types.js +0 -2
- package/dist/module/src/utils.js +0 -9
- package/dist/module/testeranto.js +0 -13
- package/dist/prebuild/cli.mjs +0 -1491
- package/dist/types/dist/module/src/Init.d.ts +0 -2
- package/dist/types/src/Node.d.ts +0 -13
- package/dist/types/src/SubPackages/puppeteer.d.ts +0 -6
- package/dist/types/src/SubPackages/react/component/node.d.ts +0 -7
- package/dist/types/src/SubPackages/react/component/web.d.ts +0 -7
- package/dist/types/src/SubPackages/react/jsx/index.d.ts +0 -12
- package/dist/types/src/SubPackages/react/jsx/node.d.ts +0 -4
- package/dist/types/src/SubPackages/react/jsx/web.d.ts +0 -4
- package/dist/types/src/SubPackages/react-dom/component/node.d.ts +0 -12
- package/dist/types/src/SubPackages/react-dom/component/web.d.ts +0 -11
- package/dist/types/src/SubPackages/react-dom/jsx/index.d.ts +0 -7
- package/dist/types/src/SubPackages/react-dom/jsx/node.d.ts +0 -6
- package/dist/types/src/SubPackages/react-dom/jsx/web.d.ts +0 -5
- package/dist/types/src/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +0 -5
- package/dist/types/src/SubPackages/react-test-renderer/component/index.d.ts +0 -13
- package/dist/types/src/SubPackages/react-test-renderer/component/node.d.ts +0 -8
- package/dist/types/src/SubPackages/react-test-renderer/component/web.d.ts +0 -3
- package/dist/types/src/SubPackages/react-test-renderer/fc/node.d.ts +0 -8
- package/dist/types/src/SubPackages/react-test-renderer/fc/web.d.ts +0 -8
- package/dist/types/src/SubPackages/react-test-renderer/jsx/index.d.ts +0 -17
- package/dist/types/src/SubPackages/react-test-renderer/jsx/node.d.ts +0 -9
- package/dist/types/src/SubPackages/react-test-renderer/jsx/web.d.ts +0 -8
- package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/index.d.ts +0 -16
- package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/node.d.ts +0 -4
- package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/web.d.ts +0 -4
- package/dist/types/src/Types.d.ts +0 -90
- package/dist/types/src/Web.d.ts +0 -10
- package/dist/types/src/defaultConfig.d.ts +0 -3
- package/dist/types/src/lib/abstractBase.d.ts +0 -110
- package/dist/types/src/lib/basebuilder.d.ts +0 -27
- package/dist/types/src/lib/classBuilder.d.ts +0 -7
- package/dist/types/src/lib/core.d.ts +0 -8
- package/dist/types/src/lib/index.d.ts +0 -60
- package/dist/types/src/lib/types.d.ts +0 -40
- package/dist/types/src/utils.d.ts +0 -2
- package/dist/types/testeranto.d.ts +0 -16
- package/docker-compose.yml +0 -37
- package/src/SubPackages/puppeteer.ts +0 -51
- package/src/cli.ts +0 -535
- package/src/cli2.ts +0 -157
- package/testeranto.ts +0 -13
- package/dist/common/{src/Node.js → Node.js} +0 -0
- package/dist/common/{src/PM → PM}/index.js +0 -0
- package/dist/common/{src/PM → PM}/node.js +0 -0
- package/dist/common/{src/PM → PM}/web.js +0 -0
- package/dist/common/{src/SubPackages → SubPackages}/react/component/node.js +0 -0
- package/dist/common/{src/SubPackages → SubPackages}/react/component/web.js +0 -0
- package/dist/common/{src/SubPackages → SubPackages}/react/jsx/node.js +0 -0
- package/dist/common/{src/SubPackages → SubPackages}/react/jsx/web.js +0 -0
- package/dist/common/{src/SubPackages → SubPackages}/react-dom/jsx/index.js +0 -0
- package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/component/index.js +0 -0
- package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/component/node.js +0 -0
- package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/component/web.js +0 -0
- package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/jsx/node.js +0 -0
- package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/jsx/web.js +0 -0
- package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/jsx-promised/node.js +1 -1
- package/dist/common/{src/SubPackages → SubPackages}/react-test-renderer/jsx-promised/web.js +0 -0
- package/dist/common/{src/Types.js → Types.js} +0 -0
- package/dist/common/{src/Web.js → Web.js} +0 -0
- package/dist/common/{src/esbuildConfigs → esbuildConfigs}/featuresPlugin.js +0 -0
- package/dist/common/{src/esbuildConfigs → esbuildConfigs}/index.js +0 -0
- package/dist/common/{src/puppeteerConfiger.js → puppeteerConfiger.js} +0 -0
- package/dist/common/{src/web.html.js → web.html.js} +0 -0
- package/dist/module/{src/Node.js → Node.js} +0 -0
- package/dist/module/{src/PM → PM}/index.js +0 -0
- package/dist/module/{src/PM → PM}/node.js +0 -0
- package/dist/module/{src/PM → PM}/web.js +0 -0
- package/dist/module/{src/SubPackages → SubPackages}/react/component/node.js +0 -0
- package/dist/module/{src/SubPackages → SubPackages}/react/component/web.js +0 -0
- package/dist/module/{src/SubPackages → SubPackages}/react/jsx/node.js +0 -0
- package/dist/module/{src/SubPackages → SubPackages}/react/jsx/web.js +0 -0
- package/dist/module/{src/SubPackages → SubPackages}/react-dom/jsx/index.js +0 -0
- package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/MemoExoticComponent/node.js +0 -0
- package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/component/index.js +0 -0
- package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/component/interface.js +0 -0
- package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/component/node.js +0 -0
- package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/component/web.js +0 -0
- package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/fc/node.js +0 -0
- package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/fc/web.js +0 -0
- package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/jsx/node.js +0 -0
- package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/jsx/web.js +0 -0
- package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/jsx-promised/index.js +0 -0
- package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/jsx-promised/node.js +1 -1
- /package/dist/module/{src/SubPackages → SubPackages}/react-test-renderer/jsx-promised/web.js +0 -0
- /package/dist/module/{src/Types.js → Types.js} +0 -0
- /package/dist/module/{src/Web.js → Web.js} +0 -0
- /package/dist/module/{src/esbuildConfigs → esbuildConfigs}/featuresPlugin.js +0 -0
- /package/dist/module/{src/esbuildConfigs → esbuildConfigs}/index.js +0 -0
- /package/dist/{types/src/cli.d.ts → module/lib/types.js} +0 -0
- /package/dist/module/{src/puppeteerConfiger.js → puppeteerConfiger.js} +0 -0
- /package/dist/module/{src/web.html.js → web.html.js} +0 -0
- /package/dist/types/{src/Init.d.ts → Init.d.ts} +0 -0
- /package/dist/types/{src/cli2.d.ts → ReportServer.d.ts} +0 -0
- /package/dist/types/{src/SubPackages → SubPackages}/react-test-renderer/component/interface.d.ts +0 -0
- /package/dist/types/{src/init-docs.d.ts → build.d.ts} +0 -0
- /package/dist/types/{src/esbuildConfigs → esbuildConfigs}/featuresPlugin.d.ts +0 -0
- /package/dist/types/{src/puppeteerConfiger.d.ts → puppeteerConfiger.d.ts} +0 -0
- /package/dist/types/{src/web.html.d.ts → web.html.d.ts} +0 -0
|
@@ -33,17 +33,17 @@ export default (testInput, testSpecifications, testImplementations, testInterfac
|
|
|
33
33
|
} }), []));
|
|
34
34
|
});
|
|
35
35
|
},
|
|
36
|
-
andWhen: function (s, whenCB) {
|
|
36
|
+
andWhen: async function (s, whenCB) {
|
|
37
37
|
return whenCB(s);
|
|
38
38
|
},
|
|
39
39
|
butThen: async function (s, thenCB) {
|
|
40
40
|
return thenCB(s);
|
|
41
41
|
},
|
|
42
42
|
afterEach: (testInterface === null || testInterface === void 0 ? void 0 : testInterface.afterEach) ||
|
|
43
|
-
async function (store, ndx,
|
|
43
|
+
async function (store, ndx, utils) {
|
|
44
44
|
return store;
|
|
45
45
|
},
|
|
46
|
-
afterAll: async (store,
|
|
46
|
+
afterAll: async (store, utils) => {
|
|
47
47
|
// setTimeout(() => {
|
|
48
48
|
// console.log("This will run after 1 second");
|
|
49
49
|
// }, 1000); // 1000 milliseconds = 1 second
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createElement } from "react";
|
|
2
|
-
import { renderToStaticMarkup, renderToStaticNodeStream } from "react-dom/server";
|
|
3
|
-
import Stream from
|
|
2
|
+
import { renderToStaticMarkup, renderToStaticNodeStream, } from "react-dom/server";
|
|
3
|
+
import Stream from "stream";
|
|
4
4
|
import Testeranto from "../../../Node.js";
|
|
5
5
|
export { renderToStaticMarkup, renderToStaticNodeStream, Stream };
|
|
6
6
|
export default (testImplementations, testSpecifications, testInput) => {
|
|
@@ -10,7 +10,7 @@ export default (testImplementations, testSpecifications, testInput) => {
|
|
|
10
10
|
resolve(null);
|
|
11
11
|
});
|
|
12
12
|
},
|
|
13
|
-
beforeEach: async (
|
|
13
|
+
beforeEach: async () => {
|
|
14
14
|
return new Promise((resolve, rej) => {
|
|
15
15
|
resolve(createElement(testInput));
|
|
16
16
|
});
|
|
@@ -32,30 +32,31 @@ export default (testImplementations, testSpecifications, testInput) => {
|
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
},
|
|
35
|
-
beforeEach: async (subject
|
|
36
|
-
return
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
35
|
+
beforeEach: async (subject) => {
|
|
36
|
+
return subject;
|
|
37
|
+
// return new Promise((resolve, rej) => {
|
|
38
|
+
// resolve(subject);
|
|
39
|
+
// // const tc = TesterantoComponent({
|
|
40
|
+
// // innerComp: () =>
|
|
41
|
+
// // testInput({
|
|
42
|
+
// // port: 3003,
|
|
43
|
+
// // address: "some-address",
|
|
44
|
+
// // secretKey: "someSecretKey",
|
|
45
|
+
// // abi: "foo",
|
|
46
|
+
// // }),
|
|
47
|
+
// // done: (reactElement: any) => {
|
|
48
|
+
// // console.log("mark9");
|
|
49
|
+
// // resolve(reactElement);
|
|
50
|
+
// // // process.nextTick(() => {
|
|
51
|
+
// // // resolve(reactElement);
|
|
52
|
+
// // // });
|
|
53
|
+
// // },
|
|
54
|
+
// // });
|
|
55
|
+
// // console.log("mark9", tc);
|
|
56
|
+
// // createPortal(tc, subject.domRoot);
|
|
57
|
+
// });
|
|
57
58
|
},
|
|
58
|
-
andWhen: function (s, whenCB, tr, utils) {
|
|
59
|
+
andWhen: async function (s, whenCB, tr, utils) {
|
|
59
60
|
return whenCB(s, utils);
|
|
60
61
|
// return new Promise(async (resolve, rej) => {
|
|
61
62
|
// // resolve(await whenCB(s, utils));
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import renderer, { act } from "react-test-renderer";
|
|
3
|
-
const Context = React.createContext({});
|
|
4
|
-
const AppContext = React.createContext({});
|
|
5
|
-
const contextValue = {
|
|
6
|
-
ingredients: ["flour", "sugar", "eggs"],
|
|
7
|
-
temperature: "200",
|
|
8
|
-
};
|
|
9
3
|
export const testInterface = {
|
|
10
|
-
butThen: async function (s, thenCB
|
|
4
|
+
butThen: async function (s, thenCB) {
|
|
11
5
|
// console.log("butThen", thenCB.toString());
|
|
12
6
|
return thenCB(s);
|
|
13
7
|
},
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import ReactDom from "react-dom/client";
|
|
2
|
+
import React, { useEffect, useState } from "react";
|
|
3
|
+
import { Col, Nav, Row, Tab } from "react-bootstrap";
|
|
4
|
+
import 'bootstrap/dist/css/bootstrap.min.css';
|
|
5
|
+
import "./style.css";
|
|
6
|
+
import { Footer } from "./Footer";
|
|
7
|
+
const StepPane = ({ step }) => {
|
|
8
|
+
return React.createElement("div", null,
|
|
9
|
+
React.createElement("pre", null,
|
|
10
|
+
React.createElement("code", null, JSON.stringify(step, null, 2))));
|
|
11
|
+
};
|
|
12
|
+
const TestPane = ({ given }) => {
|
|
13
|
+
return React.createElement("div", null,
|
|
14
|
+
" ",
|
|
15
|
+
React.createElement(Tab.Container, { id: "TestPane-tabs", defaultActiveKey: "first" },
|
|
16
|
+
React.createElement(Row, null,
|
|
17
|
+
React.createElement(Col, { sm: 3 },
|
|
18
|
+
React.createElement(Nav, { variant: "pills", className: "flex-column" },
|
|
19
|
+
React.createElement(Nav.Item, null,
|
|
20
|
+
React.createElement(Nav.Link, { eventKey: `bdd-features` }, "features"),
|
|
21
|
+
...given.whens.map((w, ndx) => React.createElement(Nav.Link, { eventKey: `bdd-when-${ndx}` },
|
|
22
|
+
"When ",
|
|
23
|
+
w.name,
|
|
24
|
+
" ",
|
|
25
|
+
w.error && "!")),
|
|
26
|
+
...given.thens.map((t, ndx) => React.createElement(Nav.Link, { eventKey: `bdd-then-${ndx}` },
|
|
27
|
+
"Then ",
|
|
28
|
+
t.name,
|
|
29
|
+
" ",
|
|
30
|
+
t.error && "!")),
|
|
31
|
+
React.createElement(Nav.Link, { eventKey: `bdd-errors` }, "errors")))),
|
|
32
|
+
React.createElement(Col, { sm: 9 },
|
|
33
|
+
React.createElement(Tab.Content, null,
|
|
34
|
+
React.createElement(Tab.Pane, { eventKey: `bdd-features` },
|
|
35
|
+
React.createElement("pre", null,
|
|
36
|
+
React.createElement("code", null, JSON.stringify(given.features, null, 2)))),
|
|
37
|
+
...given.whens.map((w, ndx) => React.createElement(Tab.Pane, { eventKey: `bdd-when-${ndx}` },
|
|
38
|
+
React.createElement(StepPane, { step: w }))),
|
|
39
|
+
...given.thens.map((t, ndx) => React.createElement(Tab.Pane, { eventKey: `bdd-then-${ndx}` },
|
|
40
|
+
React.createElement(StepPane, { step: t }))),
|
|
41
|
+
React.createElement(Tab.Pane, { eventKey: `bdd-errors` },
|
|
42
|
+
React.createElement("pre", null,
|
|
43
|
+
React.createElement("code", null, JSON.stringify(given.error, null, 2)))))))));
|
|
44
|
+
};
|
|
45
|
+
const BddPage = () => {
|
|
46
|
+
const [configs, setConfigs] = useState();
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
(async () => {
|
|
49
|
+
fetch('/kokomoBay/docs/testeranto.json')
|
|
50
|
+
.then(response => response.json())
|
|
51
|
+
.then(json => {
|
|
52
|
+
setConfigs(json);
|
|
53
|
+
})
|
|
54
|
+
.catch(error => console.error(error));
|
|
55
|
+
})();
|
|
56
|
+
}, []);
|
|
57
|
+
const [bddErrors, setBddErrors] = useState();
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
(async () => {
|
|
60
|
+
setBddErrors(await (await fetch(`tests.json`)).json());
|
|
61
|
+
})();
|
|
62
|
+
}, [configs]);
|
|
63
|
+
if (!configs || !bddErrors) {
|
|
64
|
+
return React.createElement("div", null, "loading...");
|
|
65
|
+
}
|
|
66
|
+
return React.createElement("div", null,
|
|
67
|
+
" ",
|
|
68
|
+
React.createElement(Row, null,
|
|
69
|
+
React.createElement(Col, { sm: 12 },
|
|
70
|
+
React.createElement("h2", null, bddErrors.name))),
|
|
71
|
+
React.createElement(Row, null,
|
|
72
|
+
React.createElement(Tab.Container, { id: "root-tab-container", defaultActiveKey: "first" },
|
|
73
|
+
React.createElement(Row, null,
|
|
74
|
+
React.createElement(Col, { sm: 3 },
|
|
75
|
+
React.createElement(Nav, { variant: "pills", className: "flex-column" }, ...bddErrors.givens.map((g) => React.createElement(Nav.Item, null,
|
|
76
|
+
React.createElement(Nav.Link, { eventKey: g.key },
|
|
77
|
+
g.key,
|
|
78
|
+
": Given ",
|
|
79
|
+
g.name))))),
|
|
80
|
+
React.createElement(Col, { sm: 9 },
|
|
81
|
+
React.createElement(Tab.Content, null, ...bddErrors.givens.map((g) => React.createElement(Tab.Pane, { eventKey: g.key },
|
|
82
|
+
React.createElement(TestPane, { given: g })))))))),
|
|
83
|
+
React.createElement(Footer, null));
|
|
84
|
+
};
|
|
85
|
+
document.addEventListener("DOMContentLoaded", function () {
|
|
86
|
+
const elem = document.getElementById("root");
|
|
87
|
+
if (elem) {
|
|
88
|
+
ReactDom.createRoot(elem).render(React.createElement(BddPage, {}, []));
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
console.log("hello BddPage!");
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import readline from "readline";
|
|
4
|
+
import { glob } from "glob";
|
|
5
|
+
import esbuild from "esbuild";
|
|
6
|
+
import esbuildNodeConfiger from "./esbuildConfigs/node.js";
|
|
7
|
+
import esbuildWebConfiger from "./esbuildConfigs/web.js";
|
|
8
|
+
import webHtmlFrame from "./web.html.js";
|
|
9
|
+
readline.emitKeypressEvents(process.stdin);
|
|
10
|
+
if (process.stdin.isTTY)
|
|
11
|
+
process.stdin.setRawMode(true);
|
|
12
|
+
const getRunnables = (tests, payload = {
|
|
13
|
+
nodeEntryPoints: {},
|
|
14
|
+
webEntryPoints: {},
|
|
15
|
+
}) => {
|
|
16
|
+
return tests.reduce((pt, cv, cndx, cry) => {
|
|
17
|
+
if (cv[1] === "node") {
|
|
18
|
+
pt.nodeEntryPoints[cv[0]] = path.resolve(`./docs/node/${cv[0].split(".").slice(0, -1).concat("mjs").join(".")}`);
|
|
19
|
+
}
|
|
20
|
+
else if (cv[1] === "web") {
|
|
21
|
+
pt.webEntryPoints[cv[0]] = path.resolve(`./docs/web/${cv[0].split(".").slice(0, -1).concat("mjs").join(".")}`);
|
|
22
|
+
}
|
|
23
|
+
if (cv[3].length) {
|
|
24
|
+
getRunnables(cv[3], payload);
|
|
25
|
+
}
|
|
26
|
+
return pt;
|
|
27
|
+
}, payload);
|
|
28
|
+
};
|
|
29
|
+
import(process.cwd() + "/" + process.argv[2]).then(async (module) => {
|
|
30
|
+
const rawConfig = module.default;
|
|
31
|
+
const getSecondaryEndpointsPoints = (runtime) => {
|
|
32
|
+
const meta = (ts, st) => {
|
|
33
|
+
ts.forEach((t) => {
|
|
34
|
+
if (t[1] === runtime) {
|
|
35
|
+
st.add(t[0]);
|
|
36
|
+
}
|
|
37
|
+
if (Array.isArray(t[3])) {
|
|
38
|
+
meta(t[3], st);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
return st;
|
|
42
|
+
};
|
|
43
|
+
return Array.from(meta(config.tests, new Set()));
|
|
44
|
+
};
|
|
45
|
+
const config = Object.assign(Object.assign({}, rawConfig), { buildDir: process.cwd() + "/" + rawConfig.outdir });
|
|
46
|
+
let nodeDone = false;
|
|
47
|
+
let webDone = false;
|
|
48
|
+
let mode = config.devMode ? "DEV" : "PROD";
|
|
49
|
+
let status = "build";
|
|
50
|
+
// let pm: PM_Main | undefined = new PM_Main(config);
|
|
51
|
+
// const fileHashes = {};
|
|
52
|
+
const { nodeEntryPoints, webEntryPoints } = getRunnables(config.tests);
|
|
53
|
+
const onNodeDone = () => {
|
|
54
|
+
nodeDone = true;
|
|
55
|
+
onDone();
|
|
56
|
+
};
|
|
57
|
+
const onWebDone = () => {
|
|
58
|
+
webDone = true;
|
|
59
|
+
onDone();
|
|
60
|
+
};
|
|
61
|
+
const onDone = async () => {
|
|
62
|
+
if (nodeDone && webDone) {
|
|
63
|
+
status = "built";
|
|
64
|
+
}
|
|
65
|
+
if (nodeDone && webDone && status === "built") {
|
|
66
|
+
// Object.entries(nodeEntryPoints).forEach(([k, outputFile]) => {
|
|
67
|
+
// console.log("watching", outputFile);
|
|
68
|
+
// try {
|
|
69
|
+
// watch(outputFile, async (filename) => {
|
|
70
|
+
// const hash = await fileHash(outputFile);
|
|
71
|
+
// if (fileHashes[k] !== hash) {
|
|
72
|
+
// fileHashes[k] = hash;
|
|
73
|
+
// console.log(`< ${filename} `);
|
|
74
|
+
// pm.launchNode(k, outputFile);
|
|
75
|
+
// }
|
|
76
|
+
// });
|
|
77
|
+
// } catch (e) {
|
|
78
|
+
// console.error(e);
|
|
79
|
+
// }
|
|
80
|
+
// });
|
|
81
|
+
// Object.entries(webEntryPoints).forEach(([k, outputFile]) => {
|
|
82
|
+
// console.log("watching", outputFile);
|
|
83
|
+
// watch(outputFile, async (filename) => {
|
|
84
|
+
// const hash = await fileHash(outputFile);
|
|
85
|
+
// console.log(`< ${filename} ${hash}`);
|
|
86
|
+
// if (fileHashes[k] !== hash) {
|
|
87
|
+
// fileHashes[k] = hash;
|
|
88
|
+
// pm.launchWeb(k, outputFile);
|
|
89
|
+
// }
|
|
90
|
+
// });
|
|
91
|
+
// });
|
|
92
|
+
}
|
|
93
|
+
if (nodeDone && webDone && mode === "PROD") {
|
|
94
|
+
console.log("Testeranto-EsBuild is all done. Goodbye!");
|
|
95
|
+
process.exit();
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
if (mode === "PROD") {
|
|
99
|
+
console.log("waiting for tests to finish");
|
|
100
|
+
console.log(JSON.stringify({
|
|
101
|
+
nodeDone: nodeDone,
|
|
102
|
+
webDone: webDone,
|
|
103
|
+
mode: mode,
|
|
104
|
+
}, null, 2));
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
console.log("waiting for tests to change");
|
|
108
|
+
}
|
|
109
|
+
if (config.devMode) {
|
|
110
|
+
console.log("ready and watching for changes...");
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
// pm.shutDown();
|
|
114
|
+
}
|
|
115
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
console.log(`Press 'q' to shutdown gracefully. Press 'x' to shutdown forcefully.`);
|
|
119
|
+
process.stdin.on("keypress", (str, key) => {
|
|
120
|
+
if (key.name === "q") {
|
|
121
|
+
console.log("Testeranto-Build is shutting down...");
|
|
122
|
+
mode = "PROD";
|
|
123
|
+
onDone();
|
|
124
|
+
}
|
|
125
|
+
if (key.name === "x") {
|
|
126
|
+
console.log("Testeranto-Build is shutting down forcefully...");
|
|
127
|
+
process.exit(-1);
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
fs.writeFileSync(`${config.outdir}/testeranto.json`, JSON.stringify(config, null, 2));
|
|
131
|
+
Promise.resolve(Promise.all([...getSecondaryEndpointsPoints("web")].map(async (sourceFilePath) => {
|
|
132
|
+
const sourceFileSplit = sourceFilePath.split("/");
|
|
133
|
+
const sourceDir = sourceFileSplit.slice(0, -1);
|
|
134
|
+
const sourceFileName = sourceFileSplit[sourceFileSplit.length - 1];
|
|
135
|
+
const sourceFileNameMinusJs = sourceFileName
|
|
136
|
+
.split(".")
|
|
137
|
+
.slice(0, -1)
|
|
138
|
+
.join(".");
|
|
139
|
+
const htmlFilePath = path.normalize(`${process.cwd()}/${config.outdir}/web/${sourceDir.join("/")}/${sourceFileNameMinusJs}.html`);
|
|
140
|
+
const jsfilePath = `./${sourceFileNameMinusJs}.mjs`;
|
|
141
|
+
return fs.promises
|
|
142
|
+
.mkdir(path.dirname(htmlFilePath), { recursive: true })
|
|
143
|
+
.then((x) => fs.writeFileSync(htmlFilePath, webHtmlFrame(jsfilePath, htmlFilePath)));
|
|
144
|
+
})));
|
|
145
|
+
glob(`./${config.outdir}/chunk-*.mjs`, {
|
|
146
|
+
ignore: "node_modules/**",
|
|
147
|
+
}).then((chunks) => {
|
|
148
|
+
chunks.forEach((chunk) => {
|
|
149
|
+
fs.unlinkSync(chunk);
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
await Promise.all([
|
|
153
|
+
esbuild
|
|
154
|
+
.context(esbuildNodeConfiger(config, Object.keys(nodeEntryPoints)))
|
|
155
|
+
.then(async (nodeContext) => {
|
|
156
|
+
if (config.devMode) {
|
|
157
|
+
await nodeContext.watch().then((v) => {
|
|
158
|
+
onNodeDone();
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
nodeContext.rebuild().then((v) => {
|
|
163
|
+
onNodeDone();
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
return nodeContext;
|
|
167
|
+
}),
|
|
168
|
+
esbuild
|
|
169
|
+
.context(esbuildWebConfiger(config, Object.keys(webEntryPoints)))
|
|
170
|
+
.then(async (webContext) => {
|
|
171
|
+
if (config.devMode) {
|
|
172
|
+
await webContext.watch().then((v) => {
|
|
173
|
+
onWebDone();
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
webContext.rebuild().then((v) => {
|
|
178
|
+
onWebDone();
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
return webContext;
|
|
182
|
+
}),
|
|
183
|
+
]);
|
|
184
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
const otherInputs = {};
|
|
3
|
+
const register = (entrypoint, sources) => {
|
|
4
|
+
if (!otherInputs[entrypoint]) {
|
|
5
|
+
otherInputs[entrypoint] = new Set();
|
|
6
|
+
}
|
|
7
|
+
sources.forEach((s) => otherInputs[entrypoint].add(s));
|
|
8
|
+
};
|
|
9
|
+
export default (platform, entryPoints) => {
|
|
10
|
+
return {
|
|
11
|
+
register,
|
|
12
|
+
inputFilesPluginFactory: {
|
|
13
|
+
name: "metafileWriter",
|
|
14
|
+
setup(build) {
|
|
15
|
+
build.onEnd((result) => {
|
|
16
|
+
// console.log("build.onEnd", entryPoints);
|
|
17
|
+
fs.writeFileSync(`docs/${platform}/metafile.json`, JSON.stringify(result, null, 2));
|
|
18
|
+
});
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -11,18 +11,9 @@ export default (config, entryPoints) => {
|
|
|
11
11
|
"process.env.FLUENTFFMPEG_COV": "0",
|
|
12
12
|
}, absWorkingDir: process.cwd(), banner: {
|
|
13
13
|
js: `import { createRequire } from 'module';const require = createRequire(import.meta.url);`,
|
|
14
|
-
}, platform: "node", external: [
|
|
15
|
-
// "testeranto.json",
|
|
16
|
-
// "features.test.js",
|
|
17
|
-
"react",
|
|
18
|
-
// "events",
|
|
19
|
-
// "ganache"
|
|
20
|
-
...config.externals,
|
|
21
|
-
], entryPoints: [...entryPoints], plugins: [
|
|
14
|
+
}, platform: "node", external: ["react", ...config.externals], entryPoints: [...entryPoints], plugins: [
|
|
22
15
|
featuresPlugin,
|
|
23
|
-
...(config.nodePlugins.map((p) => p(register, entryPoints)) || []),
|
|
24
16
|
inputFilesPluginFactory,
|
|
25
|
-
// inputFilesPlugin("node", entryPoints),
|
|
26
17
|
{
|
|
27
18
|
name: "rebuild-notify",
|
|
28
19
|
setup(build) {
|
|
@@ -36,5 +27,6 @@ export default (config, entryPoints) => {
|
|
|
36
27
|
});
|
|
37
28
|
},
|
|
38
29
|
},
|
|
30
|
+
...(config.nodePlugins.map((p) => p(register, entryPoints)) || []),
|
|
39
31
|
] });
|
|
40
32
|
};
|
|
@@ -4,19 +4,9 @@ import inputFilesPlugin from "./inputFilesPlugin.js";
|
|
|
4
4
|
import featuresPlugin from "./featuresPlugin.js";
|
|
5
5
|
export default (config, entryPoints) => {
|
|
6
6
|
const { inputFilesPluginFactory, register } = inputFilesPlugin("web", entryPoints);
|
|
7
|
-
return Object.assign(Object.assign({}, baseEsBuildConfig(config)), {
|
|
8
|
-
// inject: ["./node_modules/testeranto/dist/cjs-shim.js"],
|
|
9
|
-
// banner: {
|
|
10
|
-
// js: `import { createRequire } from 'module';const require = createRequire(import.meta.url);`,
|
|
11
|
-
// },
|
|
12
|
-
// splitting: true,
|
|
13
|
-
outdir: config.outdir + "/web", alias: {
|
|
7
|
+
return Object.assign(Object.assign({}, baseEsBuildConfig(config)), { outdir: config.outdir + "/web", alias: {
|
|
14
8
|
react: path.resolve("./node_modules/react"),
|
|
15
9
|
}, metafile: true, external: [
|
|
16
|
-
// "testeranto.json",
|
|
17
|
-
// "features.test.ts",
|
|
18
|
-
// "url",
|
|
19
|
-
// "react",
|
|
20
10
|
"path",
|
|
21
11
|
"fs",
|
|
22
12
|
"stream",
|
|
@@ -36,8 +26,6 @@ export default (config, entryPoints) => {
|
|
|
36
26
|
"dns",
|
|
37
27
|
], platform: "browser", entryPoints: [...entryPoints], plugins: [
|
|
38
28
|
featuresPlugin,
|
|
39
|
-
// markdownPlugin({}),
|
|
40
|
-
...(config.nodePlugins.map((p) => p(register, entryPoints)) || []),
|
|
41
29
|
inputFilesPluginFactory,
|
|
42
30
|
{
|
|
43
31
|
name: "rebuild-notify",
|
|
@@ -52,5 +40,6 @@ export default (config, entryPoints) => {
|
|
|
52
40
|
});
|
|
53
41
|
},
|
|
54
42
|
},
|
|
43
|
+
...(config.nodePlugins.map((p) => p(register, entryPoints)) || []),
|
|
55
44
|
] });
|
|
56
45
|
};
|
|
@@ -57,6 +57,7 @@ export class BaseSuite {
|
|
|
57
57
|
if (prop === "writeFileSync") {
|
|
58
58
|
return (fp, contents) => target[prop](`suite-${sNdx}/beforeAll/${fp}`, contents);
|
|
59
59
|
}
|
|
60
|
+
/* @ts-ignore:next-line */
|
|
60
61
|
return Reflect.get(...arguments);
|
|
61
62
|
},
|
|
62
63
|
});
|
|
@@ -156,6 +157,7 @@ export class BaseGiven {
|
|
|
156
157
|
if (prop === "screencast") {
|
|
157
158
|
return (opts, p) => target.screencast(Object.assign(Object.assign({}, opts), { path: `suite-${suiteNdx}/given-${key}/when/beforeEach/${opts.path}` }), p);
|
|
158
159
|
}
|
|
160
|
+
/* @ts-ignore:next-line */
|
|
159
161
|
return Reflect.get(...arguments);
|
|
160
162
|
},
|
|
161
163
|
});
|
|
@@ -190,6 +192,7 @@ export class BaseGiven {
|
|
|
190
192
|
if (prop === "writeFileSync") {
|
|
191
193
|
return (fp, contents) => target[prop](`suite-${suiteNdx}/given-${key}/afterEach/${fp}`, contents);
|
|
192
194
|
}
|
|
195
|
+
/* @ts-ignore:next-line */
|
|
193
196
|
return Reflect.get(...arguments);
|
|
194
197
|
},
|
|
195
198
|
});
|
|
@@ -226,6 +229,7 @@ export class BaseWhen {
|
|
|
226
229
|
if (prop === "writeFileSync") {
|
|
227
230
|
return (fp, contents) => target[prop](`${filepath}/andWhen/${fp}`, contents);
|
|
228
231
|
}
|
|
232
|
+
/* @ts-ignore:next-line */
|
|
229
233
|
return Reflect.get(...arguments);
|
|
230
234
|
},
|
|
231
235
|
});
|
|
@@ -269,6 +273,7 @@ export class BaseThen {
|
|
|
269
273
|
if (prop === "writeFileSync") {
|
|
270
274
|
return (fp, contents) => target[prop](`${filepath}/${fp}`, contents);
|
|
271
275
|
}
|
|
276
|
+
/* @ts-ignore:next-line */
|
|
272
277
|
return Reflect.get(...arguments);
|
|
273
278
|
},
|
|
274
279
|
});
|
|
@@ -297,7 +302,7 @@ export class BaseCheck {
|
|
|
297
302
|
}
|
|
298
303
|
async check(subject, key, testResourceConfiguration, tester, artifactory, tLog, pm) {
|
|
299
304
|
tLog(`\n Check: ${this.name}`);
|
|
300
|
-
const store = await this.checkThat(subject, testResourceConfiguration, artifactory);
|
|
305
|
+
const store = await this.checkThat(subject, testResourceConfiguration, artifactory, pm);
|
|
301
306
|
await this.checkCB(Object.entries(this.whens).reduce((a, [key, when]) => {
|
|
302
307
|
a[key] = async (payload) => {
|
|
303
308
|
return await when(payload, testResourceConfiguration).test(store, testResourceConfiguration, tLog, pm, "x");
|
|
@@ -39,17 +39,30 @@ export class BaseBuilder {
|
|
|
39
39
|
const numberOfFailures = Object.keys(suiteDone.givens).filter((k) => {
|
|
40
40
|
return suiteDone.givens[k].error;
|
|
41
41
|
}).length;
|
|
42
|
-
puppetMaster.writeFileSync(`
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
42
|
+
puppetMaster.writeFileSync(`bdd_errors.txt`, numberOfFailures.toString());
|
|
43
|
+
const o = this.toObj();
|
|
44
|
+
puppetMaster.writeFileSync(`littleBoard.html`, `
|
|
45
|
+
<!DOCTYPE html>
|
|
46
|
+
<html lang="en">
|
|
47
|
+
|
|
48
|
+
<head>
|
|
49
|
+
<meta name="description" content="Webpage description goes here" />
|
|
50
|
+
<meta charset="utf-8" />
|
|
51
|
+
<title>kokomoBay - testeranto</title>
|
|
52
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
53
|
+
<meta name="author" content="" />
|
|
54
|
+
|
|
55
|
+
<link rel="stylesheet" href="/kokomoBay/docs/TestReport.css" />
|
|
56
|
+
<script src="/kokomoBay/docs/TestReport.js"></script>
|
|
57
|
+
|
|
58
|
+
</head>
|
|
59
|
+
|
|
60
|
+
<body>
|
|
61
|
+
<h1>Test report</h1>
|
|
62
|
+
<div id="root"/>
|
|
63
|
+
</body>
|
|
64
|
+
`);
|
|
51
65
|
puppetMaster.writeFileSync(`tests.json`, JSON.stringify(this.toObj(), null, 2));
|
|
52
|
-
// console.log(`exiting gracefully with ${numberOfFailures} failures.`);
|
|
53
66
|
return {
|
|
54
67
|
failed: numberOfFailures,
|
|
55
68
|
artifacts: this.artifacts || [],
|
|
@@ -31,8 +31,6 @@ export class ClassBuilder extends BaseBuilder {
|
|
|
31
31
|
};
|
|
32
32
|
return a;
|
|
33
33
|
}, {});
|
|
34
|
-
super(input, classySuites, classyGivens, classyWhens, classyThens, classyChecks, testResourceRequirement, testSpecification
|
|
35
|
-
// puppetMaster
|
|
36
|
-
);
|
|
34
|
+
super(input, classySuites, classyGivens, classyWhens, classyThens, classyChecks, testResourceRequirement, testSpecification);
|
|
37
35
|
}
|
|
38
36
|
}
|