testeranto 0.47.34 → 0.47.52
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/.nvmrc +1 -0
- package/Bundle.Dockerfile +45 -0
- package/README.md +86 -11
- package/Report.Dockerfile +43 -0
- package/dist/cjs-shim.js +12 -0
- package/dist/common/Features.js +3 -37
- package/dist/common/Init.js +30 -0
- package/dist/common/Node.js +15 -66
- package/dist/common/PM/index.js +7 -0
- package/dist/common/PM/main.js +641 -0
- package/dist/common/PM/node.js +88 -0
- package/dist/common/PM/web.js +132 -0
- package/dist/common/Project.js +109 -637
- package/dist/common/Puppeteer.js +103 -0
- package/dist/common/Reporter.js +112 -0
- package/dist/common/Scheduler.js +1 -0
- package/dist/common/SubPackages/puppeteer.js +21 -0
- package/dist/common/{subPackages → SubPackages}/react/component/node.js +4 -4
- package/dist/common/{subPackages → SubPackages}/react/component/web.js +4 -4
- package/dist/common/SubPackages/react/jsx/index.js +25 -0
- package/dist/common/SubPackages/react/jsx/node.js +10 -0
- package/dist/common/SubPackages/react/jsx/web.js +10 -0
- package/dist/common/{subPackages/react-dom/jsx → SubPackages/react-dom/component}/node.js +6 -6
- package/dist/common/SubPackages/react-dom/component/web.js +93 -0
- package/dist/common/SubPackages/react-dom/jsx/index.js +2 -0
- package/dist/common/SubPackages/react-dom/jsx/node.js +39 -0
- package/dist/common/SubPackages/react-dom/jsx/web.js +118 -0
- package/dist/common/SubPackages/react-test-renderer/MemoExoticComponent/node.js +44 -0
- package/dist/common/SubPackages/react-test-renderer/component/index.js +2 -0
- package/dist/common/{subPackages/react-test-renderer/component/index.js → SubPackages/react-test-renderer/component/interface.js} +23 -33
- package/dist/common/{subPackages/react-test-renderer/jsx → SubPackages/react-test-renderer/component}/node.js +3 -5
- package/dist/common/{subPackages/react/jsx → SubPackages/react-test-renderer/component}/web.js +3 -5
- package/dist/common/SubPackages/react-test-renderer/fc/node.js +50 -0
- package/dist/common/SubPackages/react-test-renderer/fc/web.js +50 -0
- package/dist/common/{subPackages → SubPackages}/react-test-renderer/jsx/index.js +7 -3
- package/dist/common/SubPackages/react-test-renderer/jsx/node.js +10 -0
- package/dist/common/SubPackages/react-test-renderer/jsx/web.js +10 -0
- package/dist/common/SubPackages/react-test-renderer/jsx-promised/index.js +42 -0
- package/dist/common/{subPackages/react/jsx → SubPackages/react-test-renderer/jsx-promised}/node.js +2 -2
- package/dist/common/TaskManBackEnd.js +174 -0
- package/dist/common/Web.js +31 -108
- package/dist/common/esbuildConfigs/features.js +14 -0
- package/dist/common/esbuildConfigs/index.js +21 -0
- package/dist/common/esbuildConfigs/inputFilesPlugin.js +49 -0
- package/dist/common/esbuildConfigs/node.js +39 -0
- package/dist/common/esbuildConfigs/report.js +14 -0
- package/dist/common/esbuildConfigs/tests.js +13 -0
- package/dist/common/esbuildConfigs/web.js +57 -0
- package/dist/common/lib/abstractBase.js +553 -0
- package/dist/common/lib/basebuilder.js +79 -0
- package/dist/common/lib/classBuilder.js +42 -0
- package/dist/common/lib/core.js +75 -0
- package/dist/common/lib/index.js +22 -0
- package/dist/common/lib/types.js +2 -0
- package/dist/common/mongooseSchemas.js +56 -0
- package/dist/common/preload.js +14 -27
- package/dist/common/puppeteerConfiger.js +24 -0
- package/dist/common/report.html.js +31 -0
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/common/utils.js +16 -0
- package/dist/common/web.html.js +22 -0
- package/dist/module/ExampleTab.js +112 -0
- package/dist/module/Features.js +2 -35
- package/dist/module/Init.js +25 -0
- package/dist/module/Node.js +15 -66
- package/dist/module/PM/index.js +3 -0
- package/dist/module/PM/main.js +611 -0
- package/dist/module/PM/node.js +81 -0
- package/dist/module/PM/web.js +125 -0
- package/dist/module/Project.js +110 -615
- package/dist/module/Puppeteer.js +98 -0
- package/dist/module/Reporter.js +107 -0
- package/dist/module/Scheduler.js +1 -0
- package/dist/module/SubPackages/puppeteer.js +16 -0
- package/dist/module/{subPackages → SubPackages}/react/component/node.js +3 -3
- package/dist/module/{subPackages → SubPackages}/react/component/web.js +3 -3
- package/dist/module/SubPackages/react/jsx/index.js +19 -0
- package/dist/module/SubPackages/react/jsx/node.js +5 -0
- package/dist/module/SubPackages/react/jsx/web.js +5 -0
- package/dist/module/{subPackages → SubPackages}/react-dom/component/node.js +7 -7
- package/dist/module/SubPackages/react-dom/component/web.js +88 -0
- package/dist/module/SubPackages/react-dom/jsx/node.js +31 -0
- package/dist/module/SubPackages/react-dom/jsx/web.js +90 -0
- package/dist/module/SubPackages/react-test-renderer/MemoExoticComponent/node.js +16 -0
- package/dist/module/SubPackages/react-test-renderer/component/index.js +1 -0
- package/dist/module/SubPackages/react-test-renderer/component/interface.js +39 -0
- package/dist/module/{subPackages → SubPackages}/react-test-renderer/component/node.js +2 -2
- package/dist/module/{subPackages → SubPackages}/react-test-renderer/component/web.js +2 -2
- package/dist/module/{subPackages → SubPackages}/react-test-renderer/fc/node.js +3 -3
- package/dist/module/SubPackages/react-test-renderer/fc/web.js +22 -0
- package/dist/module/{subPackages → SubPackages}/react-test-renderer/jsx/index.js +7 -3
- package/dist/module/SubPackages/react-test-renderer/jsx/node.js +5 -0
- package/dist/module/SubPackages/react-test-renderer/jsx/web.js +5 -0
- package/dist/module/SubPackages/react-test-renderer/jsx-promised/index.js +16 -0
- package/dist/module/{subPackages/react-test-renderer/jsx → SubPackages/react-test-renderer/jsx-promised}/node.js +1 -1
- package/dist/module/TaskManBackEnd.js +169 -0
- package/dist/module/TaskManFrontEnd.js +600 -0
- package/dist/module/Web.js +31 -108
- package/dist/module/esbuildConfigs/features.js +12 -0
- package/dist/module/esbuildConfigs/index.js +19 -0
- package/dist/module/esbuildConfigs/inputFilesPlugin.js +44 -0
- package/dist/module/esbuildConfigs/node.js +34 -0
- package/dist/module/esbuildConfigs/report.js +14 -0
- package/dist/module/esbuildConfigs/tests.js +11 -0
- package/dist/module/esbuildConfigs/web.js +52 -0
- package/dist/module/lib/abstractBase.js +545 -0
- package/dist/module/lib/basebuilder.js +75 -0
- package/dist/module/lib/classBuilder.js +38 -0
- package/dist/module/lib/core.js +72 -0
- package/dist/module/lib/index.js +18 -0
- package/dist/module/lib/types.js +1 -0
- package/dist/module/mongooseSchemas.js +50 -0
- package/dist/module/preload.js +15 -26
- package/dist/module/puppeteerConfiger.js +19 -0
- package/dist/module/report.html.js +29 -0
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/module/utils.js +9 -0
- package/dist/module/web.html.js +20 -0
- package/dist/prebuild/TaskManBackEnd.mjs +174 -0
- package/dist/prebuild/TaskManFrontEnd.css +12301 -0
- package/dist/prebuild/TaskManFrontEnd.js +81264 -0
- package/dist/types/Features.d.ts +1 -34
- package/dist/types/Init.d.ts +2 -0
- package/dist/types/Node.d.ts +5 -11
- package/dist/types/PM/index.d.ts +20 -0
- package/dist/types/PM/main.d.ts +31 -0
- package/dist/types/PM/node.d.ts +27 -0
- package/dist/types/PM/web.d.ts +25 -0
- package/dist/types/Project.d.ts +3 -29
- package/dist/types/Puppeteer.d.ts +2 -0
- package/dist/types/Reporter.d.ts +1 -0
- package/dist/types/Scheduler.d.ts +0 -0
- package/dist/types/SubPackages/puppeteer.d.ts +6 -0
- 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 +12 -0
- package/dist/types/SubPackages/react-dom/component/web.d.ts +11 -0
- package/dist/types/SubPackages/react-dom/jsx/index.d.ts +6 -0
- package/dist/types/SubPackages/react-dom/jsx/node.d.ts +6 -0
- package/dist/types/SubPackages/react-dom/jsx/web.d.ts +5 -0
- package/dist/types/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +5 -0
- package/dist/types/SubPackages/react-test-renderer/component/index.d.ts +13 -0
- package/dist/types/SubPackages/react-test-renderer/component/interface.d.ts +9 -0
- package/dist/types/SubPackages/react-test-renderer/component/node.d.ts +8 -0
- package/dist/types/SubPackages/react-test-renderer/component/web.d.ts +3 -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 +8 -0
- package/dist/types/{subPackages → SubPackages}/react-test-renderer/jsx/index.d.ts +5 -4
- package/dist/types/SubPackages/react-test-renderer/jsx/node.d.ts +8 -0
- package/dist/types/SubPackages/react-test-renderer/jsx/web.d.ts +8 -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 +4 -0
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/web.d.ts +4 -0
- package/dist/types/TaskManBackEnd.d.ts +3 -0
- package/dist/types/Types.d.ts +49 -16
- package/dist/types/Web.d.ts +5 -11
- package/dist/types/esbuildConfigs/features.d.ts +4 -0
- package/dist/types/esbuildConfigs/index.d.ts +4 -0
- package/dist/types/esbuildConfigs/inputFilesPlugin.d.ts +5 -0
- package/dist/types/esbuildConfigs/node.d.ts +4 -0
- package/dist/types/esbuildConfigs/report.d.ts +0 -0
- package/dist/types/esbuildConfigs/tests.d.ts +4 -0
- package/dist/types/esbuildConfigs/web.d.ts +4 -0
- package/dist/types/lib/abstractBase.d.ts +104 -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 +8 -0
- package/dist/types/lib/index.d.ts +59 -0
- package/dist/types/lib/types.d.ts +62 -0
- package/dist/types/mongooseSchemas.d.ts +124 -0
- package/dist/types/preload.d.ts +0 -1
- package/dist/types/puppeteerConfiger.d.ts +4 -0
- package/dist/types/report.html.d.ts +2 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/utils.d.ts +2 -0
- package/dist/types/web.html.d.ts +2 -0
- package/index.html +30 -0
- package/package.json +151 -79
- package/src/ExampleTab.tsx +219 -0
- package/src/Features.ts +2 -58
- package/src/Init.ts +51 -0
- package/src/Node.ts +71 -157
- package/src/PM/index.ts +25 -0
- package/src/PM/main.ts +830 -0
- package/src/PM/node.ts +128 -0
- package/src/PM/web.ts +166 -0
- package/src/Project.ts +158 -797
- package/src/Puppeteer.ts +141 -0
- package/src/Reporter.ts +126 -0
- package/src/Scheduler.ts +0 -0
- package/src/SubPackages/puppeteer.ts +51 -0
- package/src/SubPackages/react/component/node.ts +43 -0
- package/src/SubPackages/react/component/web.ts +43 -0
- package/src/SubPackages/react/jsx/index.ts +42 -0
- package/src/SubPackages/react/jsx/node.ts +26 -0
- package/src/SubPackages/react/jsx/web.ts +30 -0
- package/src/{subPackages → SubPackages}/react-dom/component/node.ts +24 -44
- package/src/SubPackages/react-dom/component/web.ts +143 -0
- package/src/SubPackages/react-dom/jsx/index.ts +6 -0
- package/src/SubPackages/react-dom/jsx/node.ts +68 -0
- package/src/SubPackages/react-dom/jsx/web.ts +139 -0
- package/src/SubPackages/react-test-renderer/MemoExoticComponent/node.ts +38 -0
- package/src/SubPackages/react-test-renderer/component/index.ts +23 -0
- package/src/SubPackages/react-test-renderer/component/interface.ts +48 -0
- package/src/SubPackages/react-test-renderer/component/node.ts +17 -0
- package/src/SubPackages/react-test-renderer/component/web.ts +17 -0
- package/src/SubPackages/react-test-renderer/fc/node.ts +49 -0
- package/src/SubPackages/react-test-renderer/fc/web.ts +48 -0
- package/src/SubPackages/react-test-renderer/jsx/index.ts +48 -0
- package/src/SubPackages/react-test-renderer/jsx/node.ts +20 -0
- package/src/SubPackages/react-test-renderer/jsx/web.ts +20 -0
- package/src/SubPackages/react-test-renderer/jsx-promised/index.ts +40 -0
- package/src/SubPackages/react-test-renderer/jsx-promised/node.ts +19 -0
- package/src/SubPackages/react-test-renderer/jsx-promised/web.ts +22 -0
- package/src/TaskManBackEnd.ts +228 -0
- package/src/TaskManFrontEnd.tsx +1222 -0
- package/src/Types.ts +222 -17
- package/src/Web.ts +86 -217
- package/src/cjs-shim.js +12 -0
- package/src/esbuildConfigs/features.ts +17 -0
- package/src/esbuildConfigs/index.ts +23 -0
- package/src/esbuildConfigs/inputFilesPlugin.ts +65 -0
- package/src/esbuildConfigs/node.ts +62 -0
- package/src/esbuildConfigs/report.ts +15 -0
- package/src/esbuildConfigs/tests.ts +14 -0
- package/src/esbuildConfigs/web.ts +79 -0
- package/src/lib/abstractBase.ts +910 -0
- package/src/lib/basebuilder.ts +214 -0
- package/src/lib/classBuilder.ts +131 -0
- package/src/lib/core.ts +224 -0
- package/src/lib/index.ts +226 -0
- package/src/lib/types.ts +303 -0
- package/src/mongooseSchemas.ts +105 -0
- package/src/preload.ts +14 -28
- package/src/puppeteerConfiger.ts +26 -0
- package/src/report.html.ts +29 -0
- package/src/utils.ts +15 -0
- package/src/web.html.ts +20 -0
- package/tests/Rectangle.test.ts +189 -0
- package/trash/TaskMan.Dockerfile +23 -0
- package/trash/TaskMan1.Dockerfile +43 -0
- package/trash/devBot.dockerfile +12 -0
- package/trash/docker-compose-dev.yml +9 -0
- package/trash/docker-compose-prod.yml +18 -0
- package/trash/electronBuild.ts +32 -0
- package/tsconfig.json +18 -6
- package/tsconfig.module.json +14 -4
- package/tsconfig.types.json +13 -4
- package/dist/common/NodeWriter.js +0 -56
- package/dist/common/core.js +0 -396
- package/dist/common/electron.js +0 -52
- package/dist/common/subPackages/react/jsx/index.js +0 -26
- package/dist/common/subPackages/react-dom/component/node.js +0 -101
- package/dist/common/subPackages/react-dom/component/web.js +0 -61
- package/dist/common/subPackages/react-dom/jsx/web.js +0 -76
- package/dist/common/subPackages/react-test-renderer/component/node.js +0 -8
- package/dist/common/subPackages/react-test-renderer/component/web.js +0 -8
- package/dist/module/NodeWriter.js +0 -50
- package/dist/module/Report.js +0 -186
- package/dist/module/core.js +0 -387
- package/dist/module/electron.js +0 -47
- package/dist/module/subPackages/react/jsx/index.js +0 -22
- package/dist/module/subPackages/react/jsx/node.js +0 -5
- package/dist/module/subPackages/react/jsx/web.js +0 -5
- package/dist/module/subPackages/react-dom/component/web.js +0 -56
- package/dist/module/subPackages/react-dom/jsx/node.js +0 -93
- package/dist/module/subPackages/react-dom/jsx/web.js +0 -48
- package/dist/module/subPackages/react-test-renderer/component/index.js +0 -52
- package/dist/types/NodeWriter.d.ts +0 -2
- package/dist/types/core.d.ts +0 -220
- package/dist/types/subPackages/react/component/node.d.ts +0 -12
- package/dist/types/subPackages/react/component/web.d.ts +0 -12
- package/dist/types/subPackages/react/jsx/index.d.ts +0 -15
- package/dist/types/subPackages/react/jsx/node.d.ts +0 -4
- package/dist/types/subPackages/react/jsx/web.d.ts +0 -4
- package/dist/types/subPackages/react-dom/component/node.d.ts +0 -14
- package/dist/types/subPackages/react-dom/component/web.d.ts +0 -19
- package/dist/types/subPackages/react-dom/jsx/node.d.ts +0 -14
- package/dist/types/subPackages/react-dom/jsx/web.d.ts +0 -15
- package/dist/types/subPackages/react-test-renderer/component/index.d.ts +0 -20
- package/dist/types/subPackages/react-test-renderer/component/node.d.ts +0 -9
- package/dist/types/subPackages/react-test-renderer/component/web.d.ts +0 -9
- package/dist/types/subPackages/react-test-renderer/jsx/node.d.ts +0 -4
- package/dist/types/subPackages/react-test-renderer/jsx/web.d.ts +0 -4
- package/src/NodeWriter.ts +0 -72
- package/src/Report.tsx +0 -392
- package/src/core.ts +0 -1396
- package/src/electron.ts +0 -59
- package/src/subPackages/react/component/node.ts +0 -75
- package/src/subPackages/react/component/web.ts +0 -80
- package/src/subPackages/react/jsx/index.ts +0 -64
- package/src/subPackages/react/jsx/node.ts +0 -29
- package/src/subPackages/react/jsx/web.ts +0 -29
- package/src/subPackages/react-dom/component/web.ts +0 -129
- package/src/subPackages/react-dom/jsx/node.ts +0 -150
- package/src/subPackages/react-dom/jsx/web.ts +0 -117
- package/src/subPackages/react-test-renderer/component/index.ts +0 -101
- package/src/subPackages/react-test-renderer/component/node.ts +0 -30
- package/src/subPackages/react-test-renderer/component/web.ts +0 -30
- package/src/subPackages/react-test-renderer/fc/node.tsx +0 -77
- package/src/subPackages/react-test-renderer/jsx/index.ts +0 -51
- package/src/subPackages/react-test-renderer/jsx/node.ts +0 -31
- package/src/subPackages/react-test-renderer/jsx/web.ts +0 -31
- /package/dist/common/{subPackages/react-test-renderer/jsx → SubPackages/react-test-renderer/jsx-promised}/web.js +0 -0
- /package/dist/{types/electron.d.ts → module/SubPackages/react-dom/jsx/index.js} +0 -0
- /package/dist/module/{subPackages/react-test-renderer/jsx → SubPackages/react-test-renderer/jsx-promised}/web.js +0 -0
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { PassThrough } from "stream";
|
|
2
|
+
|
|
3
|
+
import { ITTestResourceRequest, ITestJob, ITLog } from ".";
|
|
4
|
+
import { IBaseTest, ITestSpecification } from "../Types.js";
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
ISuiteKlasser,
|
|
8
|
+
IGivenKlasser,
|
|
9
|
+
IWhenKlasser,
|
|
10
|
+
IThenKlasser,
|
|
11
|
+
ICheckKlasser,
|
|
12
|
+
} from "./types.js";
|
|
13
|
+
import {
|
|
14
|
+
BaseCheck,
|
|
15
|
+
BaseSuite,
|
|
16
|
+
BaseWhen,
|
|
17
|
+
BaseThen,
|
|
18
|
+
BaseGiven,
|
|
19
|
+
} from "./abstractBase.js";
|
|
20
|
+
import { PM } from "../PM/index.js";
|
|
21
|
+
|
|
22
|
+
export abstract class BaseBuilder<
|
|
23
|
+
ITestShape extends IBaseTest<
|
|
24
|
+
unknown,
|
|
25
|
+
unknown,
|
|
26
|
+
unknown,
|
|
27
|
+
unknown,
|
|
28
|
+
unknown,
|
|
29
|
+
unknown,
|
|
30
|
+
unknown,
|
|
31
|
+
Record<string, any>,
|
|
32
|
+
Record<string, any>,
|
|
33
|
+
Record<string, any>,
|
|
34
|
+
Record<string, any>,
|
|
35
|
+
Record<string, any>
|
|
36
|
+
>,
|
|
37
|
+
SuiteExtensions,
|
|
38
|
+
GivenExtensions,
|
|
39
|
+
WhenExtensions,
|
|
40
|
+
ThenExtensions,
|
|
41
|
+
CheckExtensions
|
|
42
|
+
> {
|
|
43
|
+
specs: any;
|
|
44
|
+
|
|
45
|
+
assertThis: (t: ITestShape["then"]) => {};
|
|
46
|
+
|
|
47
|
+
testResourceRequirement: ITTestResourceRequest;
|
|
48
|
+
artifacts: Promise<unknown>[] = [];
|
|
49
|
+
testJobs: ITestJob[];
|
|
50
|
+
testSpecification: ITestSpecification<ITestShape>;
|
|
51
|
+
suitesOverrides: Record<keyof SuiteExtensions, ISuiteKlasser<ITestShape>>;
|
|
52
|
+
givenOverides: Record<keyof GivenExtensions, IGivenKlasser<ITestShape>>;
|
|
53
|
+
whenOverides: Record<keyof WhenExtensions, IWhenKlasser<ITestShape>>;
|
|
54
|
+
thenOverides: Record<keyof ThenExtensions, IThenKlasser<ITestShape>>;
|
|
55
|
+
checkOverides: Record<keyof CheckExtensions, ICheckKlasser<ITestShape>>;
|
|
56
|
+
puppetMaster: PM;
|
|
57
|
+
|
|
58
|
+
constructor(
|
|
59
|
+
public readonly input: ITestShape["iinput"],
|
|
60
|
+
suitesOverrides: Record<keyof SuiteExtensions, ISuiteKlasser<ITestShape>>,
|
|
61
|
+
givenOverides: Record<keyof GivenExtensions, IGivenKlasser<ITestShape>>,
|
|
62
|
+
whenOverides: Record<keyof WhenExtensions, IWhenKlasser<ITestShape>>,
|
|
63
|
+
thenOverides: Record<keyof ThenExtensions, IThenKlasser<ITestShape>>,
|
|
64
|
+
checkOverides: Record<keyof CheckExtensions, ICheckKlasser<ITestShape>>,
|
|
65
|
+
testResourceRequirement: ITTestResourceRequest,
|
|
66
|
+
testSpecification: any
|
|
67
|
+
) {
|
|
68
|
+
this.artifacts = [];
|
|
69
|
+
this.testResourceRequirement = testResourceRequirement;
|
|
70
|
+
this.suitesOverrides = suitesOverrides;
|
|
71
|
+
this.givenOverides = givenOverides;
|
|
72
|
+
this.whenOverides = whenOverides;
|
|
73
|
+
this.thenOverides = thenOverides;
|
|
74
|
+
this.checkOverides = checkOverides;
|
|
75
|
+
this.testSpecification = testSpecification;
|
|
76
|
+
|
|
77
|
+
this.specs = testSpecification(
|
|
78
|
+
this.Suites(),
|
|
79
|
+
this.Given(),
|
|
80
|
+
this.When(),
|
|
81
|
+
this.Then(),
|
|
82
|
+
this.Check()
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
this.testJobs = this.specs.map((suite: BaseSuite<ITestShape>) => {
|
|
86
|
+
const suiteRunner =
|
|
87
|
+
(suite: BaseSuite<ITestShape>) =>
|
|
88
|
+
async (
|
|
89
|
+
puppetMaster: PM,
|
|
90
|
+
tLog: ITLog
|
|
91
|
+
): Promise<BaseSuite<ITestShape>> => {
|
|
92
|
+
await puppetMaster.startPuppeteer(
|
|
93
|
+
{
|
|
94
|
+
browserWSEndpoint:
|
|
95
|
+
puppetMaster.testResourceConfiguration.browserWSEndpoint,
|
|
96
|
+
},
|
|
97
|
+
puppetMaster.testResourceConfiguration.fs
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
return await suite.run(
|
|
101
|
+
input,
|
|
102
|
+
puppetMaster.testResourceConfiguration,
|
|
103
|
+
(fPath: string, value: string | Buffer | PassThrough) =>
|
|
104
|
+
puppetMaster.testArtiFactoryfileWriter(
|
|
105
|
+
tLog,
|
|
106
|
+
(p: Promise<void>) => {
|
|
107
|
+
this.artifacts.push(p);
|
|
108
|
+
}
|
|
109
|
+
)(puppetMaster.testResourceConfiguration.fs + "/" + fPath, value),
|
|
110
|
+
tLog,
|
|
111
|
+
puppetMaster
|
|
112
|
+
);
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const runner = suiteRunner(suite);
|
|
116
|
+
|
|
117
|
+
return {
|
|
118
|
+
test: suite,
|
|
119
|
+
|
|
120
|
+
toObj: () => {
|
|
121
|
+
return suite.toObj();
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
runner,
|
|
125
|
+
|
|
126
|
+
receiveTestResourceConfig: async function (puppetMaster: PM) {
|
|
127
|
+
await puppetMaster.mkdirSync();
|
|
128
|
+
|
|
129
|
+
const logFilePath = "log.txt";
|
|
130
|
+
const access = await puppetMaster.createWriteStream(logFilePath);
|
|
131
|
+
const tLog = (...l: string[]) => {
|
|
132
|
+
puppetMaster.write(access, `${l.toString()}\n`);
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
const suiteDone: BaseSuite<ITestShape> = await runner(
|
|
136
|
+
puppetMaster,
|
|
137
|
+
tLog
|
|
138
|
+
);
|
|
139
|
+
|
|
140
|
+
const logPromise = new Promise((res, rej) => {
|
|
141
|
+
puppetMaster.end(access);
|
|
142
|
+
res(true);
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
const numberOfFailures = Object.keys(suiteDone.givens).filter((k) => {
|
|
146
|
+
return suiteDone.givens[k].error;
|
|
147
|
+
}).length;
|
|
148
|
+
puppetMaster.writeFileSync(`exitcode`, numberOfFailures.toString());
|
|
149
|
+
|
|
150
|
+
puppetMaster.writeFileSync(
|
|
151
|
+
`tests.json`,
|
|
152
|
+
JSON.stringify(this.toObj(), null, 2)
|
|
153
|
+
);
|
|
154
|
+
console.log(`exiting gracefully with ${numberOfFailures} failures.`);
|
|
155
|
+
return {
|
|
156
|
+
failed: numberOfFailures,
|
|
157
|
+
artifacts: this.artifacts || [],
|
|
158
|
+
logPromise,
|
|
159
|
+
};
|
|
160
|
+
},
|
|
161
|
+
};
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
Specs() {
|
|
166
|
+
return this.specs;
|
|
167
|
+
}
|
|
168
|
+
Suites() {
|
|
169
|
+
return this.suitesOverrides;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
Given(): Record<
|
|
173
|
+
keyof GivenExtensions,
|
|
174
|
+
(
|
|
175
|
+
name: string,
|
|
176
|
+
features: string[],
|
|
177
|
+
whens: BaseWhen<ITestShape>[],
|
|
178
|
+
thens: BaseThen<ITestShape>[],
|
|
179
|
+
gcb
|
|
180
|
+
) => BaseGiven<ITestShape>
|
|
181
|
+
> {
|
|
182
|
+
return this.givenOverides;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
When(): Record<
|
|
186
|
+
keyof WhenExtensions,
|
|
187
|
+
(arg0: ITestShape["istore"], ...arg1: any) => BaseWhen<ITestShape>
|
|
188
|
+
> {
|
|
189
|
+
return this.whenOverides;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
Then(): Record<
|
|
193
|
+
keyof ThenExtensions,
|
|
194
|
+
(
|
|
195
|
+
selection: ITestShape["iselection"],
|
|
196
|
+
expectation: any
|
|
197
|
+
) => BaseThen<ITestShape>
|
|
198
|
+
> {
|
|
199
|
+
return this.thenOverides;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
Check(): Record<
|
|
203
|
+
keyof CheckExtensions,
|
|
204
|
+
(
|
|
205
|
+
feature: string,
|
|
206
|
+
callback: (whens, thens) => any,
|
|
207
|
+
whens,
|
|
208
|
+
thens,
|
|
209
|
+
x
|
|
210
|
+
) => BaseCheck<ITestShape>
|
|
211
|
+
> {
|
|
212
|
+
return this.checkOverides;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IBaseTest,
|
|
3
|
+
ITestImplementation,
|
|
4
|
+
ITestSpecification,
|
|
5
|
+
} from "../Types.js";
|
|
6
|
+
|
|
7
|
+
import { BaseBuilder } from "./basebuilder.js";
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
ISuiteKlasser,
|
|
11
|
+
IGivenKlasser,
|
|
12
|
+
IWhenKlasser,
|
|
13
|
+
IThenKlasser,
|
|
14
|
+
ICheckKlasser,
|
|
15
|
+
} from "./types.js";
|
|
16
|
+
import { PM } from "../PM/index.js";
|
|
17
|
+
import { ITTestResourceRequest } from "./index.js";
|
|
18
|
+
|
|
19
|
+
export abstract class ClassBuilder<
|
|
20
|
+
ITestShape extends IBaseTest<
|
|
21
|
+
unknown,
|
|
22
|
+
unknown,
|
|
23
|
+
unknown,
|
|
24
|
+
unknown,
|
|
25
|
+
unknown,
|
|
26
|
+
unknown,
|
|
27
|
+
unknown,
|
|
28
|
+
Record<string, any>,
|
|
29
|
+
Record<string, any>,
|
|
30
|
+
Record<string, any>,
|
|
31
|
+
Record<string, any>,
|
|
32
|
+
Record<string, any>
|
|
33
|
+
>
|
|
34
|
+
> extends BaseBuilder<ITestShape, any, any, any, any, any> {
|
|
35
|
+
constructor(
|
|
36
|
+
testImplementation: ITestImplementation<ITestShape, any>,
|
|
37
|
+
testSpecification: ITestSpecification<ITestShape>,
|
|
38
|
+
input: ITestShape["iinput"],
|
|
39
|
+
suiteKlasser: ISuiteKlasser<ITestShape>,
|
|
40
|
+
givenKlasser: IGivenKlasser<ITestShape>,
|
|
41
|
+
whenKlasser: IWhenKlasser<ITestShape>,
|
|
42
|
+
thenKlasser: IThenKlasser<ITestShape>,
|
|
43
|
+
checkKlasser: ICheckKlasser<ITestShape>,
|
|
44
|
+
testResourceRequirement: ITTestResourceRequest
|
|
45
|
+
) {
|
|
46
|
+
const classySuites = Object.entries(testImplementation.suites).reduce(
|
|
47
|
+
(a, [key], index) => {
|
|
48
|
+
a[key] = (somestring, givens, checks) => {
|
|
49
|
+
return new suiteKlasser.prototype.constructor(
|
|
50
|
+
somestring,
|
|
51
|
+
index,
|
|
52
|
+
givens,
|
|
53
|
+
checks
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
return a;
|
|
57
|
+
},
|
|
58
|
+
{}
|
|
59
|
+
);
|
|
60
|
+
const classyGivens = Object.entries(testImplementation.givens).reduce(
|
|
61
|
+
(a, [key, givEn]) => {
|
|
62
|
+
a[key] = (features, whens, thens, givEn) => {
|
|
63
|
+
return new givenKlasser.prototype.constructor(
|
|
64
|
+
key,
|
|
65
|
+
features,
|
|
66
|
+
whens,
|
|
67
|
+
thens,
|
|
68
|
+
testImplementation.givens[key],
|
|
69
|
+
givEn
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
|
+
return a;
|
|
73
|
+
},
|
|
74
|
+
{}
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
const classyWhens = Object.entries(testImplementation.whens).reduce(
|
|
78
|
+
(a, [key, whEn]: [string, (x) => any]) => {
|
|
79
|
+
a[key] = (payload?: any) => {
|
|
80
|
+
return new whenKlasser.prototype.constructor(
|
|
81
|
+
`${whEn.name}: ${payload && payload.toString()}`,
|
|
82
|
+
whEn(payload)
|
|
83
|
+
);
|
|
84
|
+
};
|
|
85
|
+
return a;
|
|
86
|
+
},
|
|
87
|
+
{}
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
const classyThens = Object.entries(testImplementation.thens).reduce(
|
|
91
|
+
(a, [key, thEn]: [string, (x) => any]) => {
|
|
92
|
+
a[key] = (expected: any, x) => {
|
|
93
|
+
return new thenKlasser.prototype.constructor(
|
|
94
|
+
`${thEn.name}: ${expected && expected.toString()}`,
|
|
95
|
+
thEn(expected)
|
|
96
|
+
);
|
|
97
|
+
};
|
|
98
|
+
return a;
|
|
99
|
+
},
|
|
100
|
+
{}
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
const classyChecks = Object.entries(testImplementation.checks).reduce(
|
|
104
|
+
(a, [key, z]) => {
|
|
105
|
+
a[key] = (somestring, features, callback) => {
|
|
106
|
+
return new checkKlasser.prototype.constructor(
|
|
107
|
+
somestring,
|
|
108
|
+
features,
|
|
109
|
+
callback,
|
|
110
|
+
classyWhens,
|
|
111
|
+
classyThens
|
|
112
|
+
);
|
|
113
|
+
};
|
|
114
|
+
return a;
|
|
115
|
+
},
|
|
116
|
+
{}
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
super(
|
|
120
|
+
input,
|
|
121
|
+
classySuites,
|
|
122
|
+
classyGivens,
|
|
123
|
+
classyWhens,
|
|
124
|
+
classyThens,
|
|
125
|
+
classyChecks,
|
|
126
|
+
testResourceRequirement,
|
|
127
|
+
testSpecification
|
|
128
|
+
// puppetMaster
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
}
|
package/src/lib/core.ts
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import { IStore } from "../SubPackages/react/jsx";
|
|
2
|
+
import {
|
|
3
|
+
IBaseTest,
|
|
4
|
+
ITestSpecification,
|
|
5
|
+
ITestImplementation,
|
|
6
|
+
} from "../Types.js";
|
|
7
|
+
|
|
8
|
+
import { ITestInterface } from "./types.js";
|
|
9
|
+
import {
|
|
10
|
+
DefaultTestInterface,
|
|
11
|
+
ITTestResourceRequest,
|
|
12
|
+
ITestArtifactory,
|
|
13
|
+
defaultTestResourceRequirement,
|
|
14
|
+
} from "./index.js";
|
|
15
|
+
import {
|
|
16
|
+
BaseSuite,
|
|
17
|
+
BaseGiven,
|
|
18
|
+
BaseWhen,
|
|
19
|
+
BaseThen,
|
|
20
|
+
BaseCheck,
|
|
21
|
+
} from "./abstractBase.js";
|
|
22
|
+
import { ClassBuilder } from "./classBuilder.js";
|
|
23
|
+
import { PM } from "../PM/index";
|
|
24
|
+
|
|
25
|
+
export default abstract class Testeranto<
|
|
26
|
+
ITestShape extends IBaseTest<
|
|
27
|
+
unknown,
|
|
28
|
+
unknown,
|
|
29
|
+
unknown,
|
|
30
|
+
unknown,
|
|
31
|
+
unknown,
|
|
32
|
+
unknown,
|
|
33
|
+
unknown,
|
|
34
|
+
Record<string, any>,
|
|
35
|
+
Record<string, any>,
|
|
36
|
+
Record<string, any>,
|
|
37
|
+
Record<string, any>,
|
|
38
|
+
Record<string, any>
|
|
39
|
+
>
|
|
40
|
+
> extends ClassBuilder<ITestShape> {
|
|
41
|
+
constructor(
|
|
42
|
+
input: ITestShape["iinput"],
|
|
43
|
+
testSpecification: ITestSpecification<ITestShape>,
|
|
44
|
+
testImplementation: ITestImplementation<ITestShape>,
|
|
45
|
+
testResourceRequirement: ITTestResourceRequest = defaultTestResourceRequirement,
|
|
46
|
+
testInterface: Partial<ITestInterface<ITestShape>>
|
|
47
|
+
) {
|
|
48
|
+
const fullTestInterface = DefaultTestInterface(testInterface);
|
|
49
|
+
super(
|
|
50
|
+
testImplementation,
|
|
51
|
+
testSpecification,
|
|
52
|
+
input,
|
|
53
|
+
|
|
54
|
+
class extends BaseSuite<ITestShape> {
|
|
55
|
+
afterAll(store: IStore, artifactory: ITestArtifactory, pm: PM) {
|
|
56
|
+
// const pagesHandler = {
|
|
57
|
+
// get(target, prop) {
|
|
58
|
+
// console.log(`Getting pages property ${prop}`);
|
|
59
|
+
// return target[prop];
|
|
60
|
+
// },
|
|
61
|
+
// };
|
|
62
|
+
|
|
63
|
+
// const browserHandler = {
|
|
64
|
+
// get(target, prop) {
|
|
65
|
+
// console.log(`Getting browser property ${prop}`);
|
|
66
|
+
// if (prop === "pages") {
|
|
67
|
+
// // return target[prop];
|
|
68
|
+
// return new Proxy(target[prop], pagesHandler);
|
|
69
|
+
// } else {
|
|
70
|
+
// return target[prop];
|
|
71
|
+
// }
|
|
72
|
+
// },
|
|
73
|
+
// };
|
|
74
|
+
// const proxy = new Proxy(utils.browser, browserHandler);
|
|
75
|
+
|
|
76
|
+
return fullTestInterface.afterAll(
|
|
77
|
+
store,
|
|
78
|
+
(fPath: string, value: unknown) =>
|
|
79
|
+
// TODO does not work?
|
|
80
|
+
{
|
|
81
|
+
artifactory(`afterAll4-${this.name}/${fPath}`, value);
|
|
82
|
+
},
|
|
83
|
+
pm
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
assertThat(t) {
|
|
88
|
+
fullTestInterface.assertThis(t);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
async setup(
|
|
92
|
+
s: ITestShape["iinput"],
|
|
93
|
+
artifactory: ITestArtifactory,
|
|
94
|
+
tr,
|
|
95
|
+
pm
|
|
96
|
+
): Promise<ITestShape["isubject"]> {
|
|
97
|
+
return (
|
|
98
|
+
fullTestInterface.beforeAll ||
|
|
99
|
+
(async (
|
|
100
|
+
input: ITestShape["iinput"],
|
|
101
|
+
artifactory: ITestArtifactory,
|
|
102
|
+
tr,
|
|
103
|
+
pm: PM
|
|
104
|
+
) => input as any)
|
|
105
|
+
)(s, this.testResourceConfiguration, artifactory, pm);
|
|
106
|
+
}
|
|
107
|
+
} as any,
|
|
108
|
+
|
|
109
|
+
class Given extends BaseGiven<ITestShape> {
|
|
110
|
+
async givenThat(subject, testResource, artifactory, initializer, pm) {
|
|
111
|
+
return fullTestInterface.beforeEach(
|
|
112
|
+
subject,
|
|
113
|
+
initializer,
|
|
114
|
+
(fPath: string, value: unknown) =>
|
|
115
|
+
// TODO does not work?
|
|
116
|
+
artifactory(`beforeEach/${fPath}`, value),
|
|
117
|
+
testResource,
|
|
118
|
+
this.initialValues,
|
|
119
|
+
pm
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
afterEach(
|
|
124
|
+
store: ITestShape["istore"],
|
|
125
|
+
key: string,
|
|
126
|
+
artifactory,
|
|
127
|
+
pm
|
|
128
|
+
): Promise<unknown> {
|
|
129
|
+
return new Promise((res) =>
|
|
130
|
+
res(
|
|
131
|
+
fullTestInterface.afterEach(
|
|
132
|
+
store,
|
|
133
|
+
key,
|
|
134
|
+
(fPath: string, value: unknown) =>
|
|
135
|
+
artifactory(`after/${fPath}`, value),
|
|
136
|
+
pm
|
|
137
|
+
)
|
|
138
|
+
)
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
} as any,
|
|
142
|
+
|
|
143
|
+
class When extends BaseWhen<ITestShape> {
|
|
144
|
+
async andWhen(store, whenCB, testResource, pm) {
|
|
145
|
+
return await fullTestInterface.andWhen(
|
|
146
|
+
store,
|
|
147
|
+
whenCB,
|
|
148
|
+
testResource,
|
|
149
|
+
pm
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
} as any,
|
|
153
|
+
|
|
154
|
+
class Then extends BaseThen<ITestShape> {
|
|
155
|
+
async butThen(
|
|
156
|
+
store: any,
|
|
157
|
+
thenCB,
|
|
158
|
+
testResourceConfiguration: any,
|
|
159
|
+
pm: PM
|
|
160
|
+
): Promise<ITestShape["iselection"]> {
|
|
161
|
+
return await fullTestInterface.butThen(
|
|
162
|
+
store,
|
|
163
|
+
thenCB,
|
|
164
|
+
testResourceConfiguration,
|
|
165
|
+
pm
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
} as any,
|
|
169
|
+
|
|
170
|
+
class Check extends BaseCheck<ITestShape> {
|
|
171
|
+
initialValues: any;
|
|
172
|
+
|
|
173
|
+
constructor(
|
|
174
|
+
name: string,
|
|
175
|
+
features: string[],
|
|
176
|
+
checkCallback: (a, b) => any,
|
|
177
|
+
whens,
|
|
178
|
+
thens,
|
|
179
|
+
initialValues: any
|
|
180
|
+
) {
|
|
181
|
+
super(name, features, checkCallback, whens, thens);
|
|
182
|
+
this.initialValues = initialValues;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
async checkThat(subject, testResourceConfiguration, artifactory, pm) {
|
|
186
|
+
return fullTestInterface.beforeEach(
|
|
187
|
+
subject,
|
|
188
|
+
this.initialValues,
|
|
189
|
+
(fPath: string, value: unknown) =>
|
|
190
|
+
artifactory(`before/${fPath}`, value),
|
|
191
|
+
testResourceConfiguration,
|
|
192
|
+
this.initialValues,
|
|
193
|
+
pm
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
afterEach(
|
|
198
|
+
store: ITestShape["istore"],
|
|
199
|
+
key: string,
|
|
200
|
+
artifactory,
|
|
201
|
+
pm
|
|
202
|
+
): Promise<unknown> {
|
|
203
|
+
return new Promise((res) =>
|
|
204
|
+
res(
|
|
205
|
+
fullTestInterface.afterEach(
|
|
206
|
+
store,
|
|
207
|
+
key,
|
|
208
|
+
(fPath: string, value: unknown) =>
|
|
209
|
+
// TODO does not work?
|
|
210
|
+
artifactory(`afterEach2-${this.name}/${fPath}`, value),
|
|
211
|
+
pm
|
|
212
|
+
)
|
|
213
|
+
)
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
} as any,
|
|
217
|
+
|
|
218
|
+
testResourceRequirement
|
|
219
|
+
// puppetMaster
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
abstract receiveTestResourceConfig(partialTestResource: string);
|
|
224
|
+
}
|