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
package/src/Types.ts
CHANGED
|
@@ -1,19 +1,224 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { ITTestResourceRequest, ITestCheckCallback } from "./lib/index.js";
|
|
2
|
+
import {
|
|
3
|
+
IGivens,
|
|
4
|
+
BaseCheck,
|
|
5
|
+
BaseSuite,
|
|
6
|
+
BaseWhen,
|
|
7
|
+
BaseThen,
|
|
8
|
+
BaseGiven,
|
|
9
|
+
} from "./lib/abstractBase.js";
|
|
10
|
+
import Testeranto from "./lib/core.js";
|
|
11
|
+
import {
|
|
12
|
+
INodeTestInterface,
|
|
13
|
+
ITestInterface,
|
|
14
|
+
IWebTestInterface,
|
|
15
|
+
} from "./lib/types.js";
|
|
16
|
+
|
|
17
|
+
export type IPartialInterface<
|
|
18
|
+
I extends IBaseTest<
|
|
19
|
+
unknown,
|
|
20
|
+
unknown,
|
|
21
|
+
unknown,
|
|
22
|
+
unknown,
|
|
23
|
+
unknown,
|
|
24
|
+
unknown,
|
|
25
|
+
unknown,
|
|
26
|
+
Record<string, any>,
|
|
27
|
+
Record<string, any>,
|
|
28
|
+
Record<string, any>,
|
|
29
|
+
Record<string, any>,
|
|
30
|
+
Record<string, any>
|
|
31
|
+
>
|
|
32
|
+
> = Partial<ITestInterface<I>>;
|
|
33
|
+
|
|
34
|
+
export type IPartialNodeInterface<
|
|
35
|
+
I extends IBaseTest<
|
|
36
|
+
unknown,
|
|
37
|
+
unknown,
|
|
38
|
+
unknown,
|
|
39
|
+
unknown,
|
|
40
|
+
unknown,
|
|
41
|
+
unknown,
|
|
42
|
+
unknown,
|
|
43
|
+
Record<string, any>,
|
|
44
|
+
Record<string, any>,
|
|
45
|
+
Record<string, any>,
|
|
46
|
+
Record<string, any>,
|
|
47
|
+
Record<string, any>
|
|
48
|
+
>
|
|
49
|
+
> = Partial<INodeTestInterface<I>>;
|
|
50
|
+
export type IPartialWebInterface<
|
|
51
|
+
I extends IBaseTest<
|
|
52
|
+
unknown,
|
|
53
|
+
unknown,
|
|
54
|
+
unknown,
|
|
55
|
+
unknown,
|
|
56
|
+
unknown,
|
|
57
|
+
unknown,
|
|
58
|
+
unknown,
|
|
59
|
+
Record<string, any>,
|
|
60
|
+
Record<string, any>,
|
|
61
|
+
Record<string, any>,
|
|
62
|
+
Record<string, any>,
|
|
63
|
+
Record<string, any>
|
|
64
|
+
>
|
|
65
|
+
> = Partial<IWebTestInterface<I>>;
|
|
66
|
+
|
|
67
|
+
export type IEntry<
|
|
68
|
+
ITestShape extends IBaseTest<
|
|
69
|
+
unknown,
|
|
70
|
+
unknown,
|
|
71
|
+
unknown,
|
|
72
|
+
unknown,
|
|
73
|
+
unknown,
|
|
74
|
+
unknown,
|
|
75
|
+
unknown,
|
|
76
|
+
Record<string, any>,
|
|
77
|
+
Record<string, any>,
|
|
78
|
+
Record<string, any>,
|
|
79
|
+
Record<string, any>,
|
|
80
|
+
Record<string, any>
|
|
81
|
+
>
|
|
82
|
+
> = (
|
|
83
|
+
input: ITestShape["iinput"],
|
|
84
|
+
testSpecification: ITestSpecification<ITestShape>,
|
|
85
|
+
testImplementation: ITestImplementation<ITestShape, object>,
|
|
86
|
+
testInterface: IPartialInterface<ITestShape>,
|
|
87
|
+
testResourceRequirement: ITTestResourceRequest
|
|
88
|
+
) => Promise<Testeranto<ITestShape>>;
|
|
89
|
+
|
|
90
|
+
export type ITestSpecification<
|
|
91
|
+
ITestShape extends IBaseTest<
|
|
92
|
+
unknown,
|
|
93
|
+
unknown,
|
|
94
|
+
unknown,
|
|
95
|
+
unknown,
|
|
96
|
+
unknown,
|
|
97
|
+
unknown,
|
|
98
|
+
unknown,
|
|
99
|
+
Record<string, any>,
|
|
100
|
+
Record<string, any>,
|
|
101
|
+
Record<string, any>,
|
|
102
|
+
Record<string, any>,
|
|
103
|
+
Record<string, any>
|
|
104
|
+
>
|
|
105
|
+
> = (
|
|
106
|
+
Suite: {
|
|
107
|
+
[K in keyof ITestShape["suites"]]: (
|
|
108
|
+
name: string,
|
|
109
|
+
givens: IGivens<ITestShape>,
|
|
110
|
+
checks: BaseCheck<ITestShape>[]
|
|
111
|
+
) => BaseSuite<ITestShape>;
|
|
112
|
+
},
|
|
113
|
+
Given: {
|
|
114
|
+
[K in keyof ITestShape["givens"]]: (
|
|
115
|
+
whens: BaseWhen<ITestShape>[],
|
|
116
|
+
thens: BaseThen<ITestShape>[],
|
|
117
|
+
...xtrasB: ITestShape["givens"][K]
|
|
118
|
+
) => BaseGiven<ITestShape>;
|
|
119
|
+
},
|
|
120
|
+
When: {
|
|
121
|
+
[K in keyof ITestShape["whens"]]: (
|
|
122
|
+
...xtrasC: ITestShape["whens"][K]
|
|
123
|
+
) => BaseWhen<ITestShape>;
|
|
124
|
+
},
|
|
125
|
+
Then: {
|
|
126
|
+
[K in keyof ITestShape["thens"]]: (
|
|
127
|
+
...xtrasD: ITestShape["thens"][K]
|
|
128
|
+
) => BaseThen<ITestShape>;
|
|
129
|
+
},
|
|
130
|
+
Check: ITestCheckCallback<ITestShape>
|
|
131
|
+
) => any[];
|
|
12
132
|
|
|
13
|
-
export type
|
|
133
|
+
export type ITestImplementation<
|
|
134
|
+
ITestShape extends IBaseTest<
|
|
135
|
+
unknown,
|
|
136
|
+
unknown,
|
|
137
|
+
unknown,
|
|
138
|
+
unknown,
|
|
139
|
+
unknown,
|
|
140
|
+
unknown,
|
|
141
|
+
unknown,
|
|
142
|
+
Record<string, any>,
|
|
143
|
+
Record<string, any>,
|
|
144
|
+
Record<string, any>,
|
|
145
|
+
Record<string, any>,
|
|
146
|
+
Record<string, any>
|
|
147
|
+
>,
|
|
148
|
+
IMod = object
|
|
149
|
+
> = Modify<
|
|
150
|
+
{
|
|
151
|
+
suites: {
|
|
152
|
+
[K in keyof ITestShape["suites"]]: string;
|
|
153
|
+
};
|
|
154
|
+
givens: {
|
|
155
|
+
[K in keyof ITestShape["givens"]]: (
|
|
156
|
+
...Ig: ITestShape["givens"][K]
|
|
157
|
+
) => ITestShape["given"];
|
|
158
|
+
};
|
|
159
|
+
whens: {
|
|
160
|
+
[K in keyof ITestShape["whens"]]: (
|
|
161
|
+
...Iw: ITestShape["whens"][K]
|
|
162
|
+
) => (zel: ITestShape["iselection"]) => ITestShape["when"];
|
|
163
|
+
};
|
|
164
|
+
thens: {
|
|
165
|
+
[K in keyof ITestShape["thens"]]: (
|
|
166
|
+
...It: ITestShape["thens"][K]
|
|
167
|
+
) => (ssel: ITestShape["iselection"]) => ITestShape["then"];
|
|
168
|
+
};
|
|
169
|
+
checks: {
|
|
170
|
+
[K in keyof ITestShape["checks"]]: (
|
|
171
|
+
...Ic: ITestShape["checks"][K]
|
|
172
|
+
) => ITestShape["given"];
|
|
173
|
+
};
|
|
174
|
+
},
|
|
175
|
+
IMod
|
|
176
|
+
>;
|
|
14
177
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
178
|
+
type Modify<T, R> = Omit<T, keyof R> & R;
|
|
179
|
+
|
|
180
|
+
// export type IBaseTest<Shape = any, II = Shape> = {
|
|
181
|
+
// iinput: II;
|
|
182
|
+
// isubject: Shape;
|
|
183
|
+
// istore: Shape;
|
|
184
|
+
// iselection: Shape;
|
|
185
|
+
// // iinitial;
|
|
186
|
+
|
|
187
|
+
// given;
|
|
188
|
+
// when;
|
|
189
|
+
// then;
|
|
190
|
+
|
|
191
|
+
// suites: Record<string, any>;
|
|
192
|
+
// givens: Record<string, any>;
|
|
193
|
+
// whens: Record<string, any>;
|
|
194
|
+
// thens: Record<string, any>;
|
|
195
|
+
// checks: Record<string, any>;
|
|
196
|
+
// };
|
|
197
|
+
|
|
198
|
+
export type IBaseTest<
|
|
199
|
+
IInput,
|
|
200
|
+
ISubject,
|
|
201
|
+
IStore,
|
|
202
|
+
ISelection,
|
|
203
|
+
IGiven,
|
|
204
|
+
IWhen,
|
|
205
|
+
IThen,
|
|
206
|
+
ISuites extends Record<string, any>,
|
|
207
|
+
IGivens extends Record<string, any>,
|
|
208
|
+
IWhens extends Record<string, any>,
|
|
209
|
+
IThens extends Record<string, any>,
|
|
210
|
+
IChecks extends Record<string, any>
|
|
211
|
+
> = {
|
|
212
|
+
iinput: IInput;
|
|
213
|
+
isubject: ISubject;
|
|
214
|
+
istore: IStore;
|
|
215
|
+
iselection: ISelection;
|
|
216
|
+
given: IGiven;
|
|
217
|
+
when: IWhen;
|
|
218
|
+
then: IThen;
|
|
219
|
+
suites: ISuites;
|
|
220
|
+
givens: IGivens;
|
|
221
|
+
whens: IWhens;
|
|
222
|
+
thens: IThens;
|
|
223
|
+
checks: IChecks;
|
|
224
|
+
};
|
package/src/Web.ts
CHANGED
|
@@ -1,233 +1,102 @@
|
|
|
1
|
+
import { PM_Web } from "./PM/web";
|
|
2
|
+
import type {
|
|
3
|
+
IBaseTest,
|
|
4
|
+
ITestImplementation,
|
|
5
|
+
ITestSpecification,
|
|
6
|
+
} from "./Types";
|
|
7
|
+
import Testeranto from "./lib/core.js";
|
|
1
8
|
import {
|
|
2
9
|
ITTestResourceConfiguration,
|
|
3
10
|
ITTestResourceRequest,
|
|
4
|
-
ITTestShape,
|
|
5
|
-
ITestArtificer,
|
|
6
|
-
ITestJob,
|
|
7
|
-
ITestSpecification,
|
|
8
11
|
defaultTestResourceRequirement,
|
|
9
|
-
} from "./
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
})
|
|
44
|
-
);
|
|
12
|
+
} from "./lib/index.js";
|
|
13
|
+
import { ITestInterface, IWebTestInterface } from "./lib/types";
|
|
14
|
+
|
|
15
|
+
class WebTesteranto<
|
|
16
|
+
TestShape extends IBaseTest<
|
|
17
|
+
unknown,
|
|
18
|
+
unknown,
|
|
19
|
+
unknown,
|
|
20
|
+
unknown,
|
|
21
|
+
unknown,
|
|
22
|
+
unknown,
|
|
23
|
+
unknown,
|
|
24
|
+
Record<string, any>,
|
|
25
|
+
Record<string, any>,
|
|
26
|
+
Record<string, any>,
|
|
27
|
+
Record<string, any>,
|
|
28
|
+
Record<string, any>
|
|
29
|
+
>
|
|
30
|
+
> extends Testeranto<TestShape> {
|
|
31
|
+
constructor(
|
|
32
|
+
input: TestShape["iinput"],
|
|
33
|
+
testSpecification: ITestSpecification<TestShape>,
|
|
34
|
+
testImplementation: ITestImplementation<TestShape>,
|
|
35
|
+
testResourceRequirement: ITTestResourceRequest,
|
|
36
|
+
testInterface: Partial<ITestInterface<TestShape>>
|
|
37
|
+
) {
|
|
38
|
+
super(
|
|
39
|
+
input,
|
|
40
|
+
testSpecification,
|
|
41
|
+
testImplementation,
|
|
42
|
+
testResourceRequirement,
|
|
43
|
+
testInterface
|
|
44
|
+
);
|
|
45
|
+
}
|
|
45
46
|
|
|
46
|
-
|
|
47
|
-
//
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
async receiveTestResourceConfig(partialTestResource: any) {
|
|
48
|
+
const t: ITTestResourceConfiguration = partialTestResource; //JSON.parse(partialTestResource);
|
|
49
|
+
const pm = new PM_Web(t);
|
|
50
|
+
const { failed, artifacts, logPromise } =
|
|
51
|
+
await this.testJobs[0].receiveTestResourceConfig(pm);
|
|
52
|
+
pm.customclose();
|
|
53
|
+
// Promise.all([...artifacts, logPromise]).then(async () => {
|
|
54
|
+
// console.log("hello world");
|
|
55
|
+
// pm.customclose();
|
|
56
|
+
// // we can't close the window becuase we might be taking a screenshot
|
|
57
|
+
// // window.close();
|
|
58
|
+
// // console.log(
|
|
59
|
+
// // "(window as any).browser",
|
|
60
|
+
// // JSON.stringify(await (window as any).browser)
|
|
61
|
+
// // );
|
|
62
|
+
// // var currentWindow = (await (window as any).browser).getCurrentWindow();
|
|
63
|
+
// // window.close();
|
|
64
|
+
// // var customWindow = window.open("", "_blank", "");
|
|
65
|
+
// // customWindow.close();
|
|
66
|
+
// // this.puppetMaster.browser.page
|
|
67
|
+
// // window["customclose"]();
|
|
68
|
+
// // console.log("goodbye", window["customclose"]());
|
|
69
|
+
// });
|
|
70
|
+
}
|
|
50
71
|
}
|
|
51
72
|
|
|
52
73
|
export default async <
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
74
|
+
ITestShape extends IBaseTest<
|
|
75
|
+
unknown,
|
|
76
|
+
unknown,
|
|
77
|
+
unknown,
|
|
78
|
+
unknown,
|
|
79
|
+
unknown,
|
|
80
|
+
unknown,
|
|
81
|
+
unknown,
|
|
82
|
+
Record<string, any>,
|
|
83
|
+
Record<string, any>,
|
|
84
|
+
Record<string, any>,
|
|
85
|
+
Record<string, any>,
|
|
86
|
+
Record<string, any>
|
|
87
|
+
>
|
|
61
88
|
>(
|
|
62
|
-
input:
|
|
63
|
-
testSpecification: ITestSpecification<
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
IStore,
|
|
67
|
-
ISelection,
|
|
68
|
-
IThenShape
|
|
69
|
-
>,
|
|
70
|
-
testImplementation,
|
|
71
|
-
testInterface: {
|
|
72
|
-
actionHandler?: (b: (...any) => any) => any;
|
|
73
|
-
andWhen: (
|
|
74
|
-
store: IStore,
|
|
75
|
-
actioner,
|
|
76
|
-
testResource: ITTestResourceConfiguration
|
|
77
|
-
) => Promise<ISelection>;
|
|
78
|
-
butThen?: (
|
|
79
|
-
store: IStore,
|
|
80
|
-
callback,
|
|
81
|
-
testResource: ITTestResourceConfiguration
|
|
82
|
-
) => Promise<ISelection>;
|
|
83
|
-
assertioner?: (t: IThenShape) => any;
|
|
84
|
-
|
|
85
|
-
afterAll?: (store: IStore, artificer: ITestArtificer) => any;
|
|
86
|
-
afterEach?: (
|
|
87
|
-
store: IStore,
|
|
88
|
-
key: string,
|
|
89
|
-
artificer: ITestArtificer
|
|
90
|
-
) => Promise<unknown>;
|
|
91
|
-
beforeAll?: (input: IInput, artificer: ITestArtificer) => Promise<ISubject>;
|
|
92
|
-
beforeEach?: (
|
|
93
|
-
subject: ISubject,
|
|
94
|
-
initialValues,
|
|
95
|
-
testResource: ITTestResourceConfiguration,
|
|
96
|
-
artificer: ITestArtificer
|
|
97
|
-
) => Promise<IStore>;
|
|
98
|
-
},
|
|
89
|
+
input: ITestShape["iinput"],
|
|
90
|
+
testSpecification: ITestSpecification<ITestShape>,
|
|
91
|
+
testImplementation: ITestImplementation<ITestShape>,
|
|
92
|
+
testInterface: Partial<IWebTestInterface<ITestShape>>,
|
|
99
93
|
testResourceRequirement: ITTestResourceRequest = defaultTestResourceRequirement
|
|
100
|
-
) => {
|
|
101
|
-
|
|
102
|
-
const mrt = new TesterantoLevelTwo(
|
|
94
|
+
): Promise<Testeranto<ITestShape>> => {
|
|
95
|
+
return new WebTesteranto<ITestShape>(
|
|
103
96
|
input,
|
|
104
97
|
testSpecification,
|
|
105
98
|
testImplementation,
|
|
106
|
-
testInterface,
|
|
107
99
|
testResourceRequirement,
|
|
108
|
-
testInterface
|
|
109
|
-
testInterface.beforeEach ||
|
|
110
|
-
async function (subject: any, initialValues: any, testResource: any) {
|
|
111
|
-
return subject as any;
|
|
112
|
-
},
|
|
113
|
-
testInterface.afterEach || (async (s) => s),
|
|
114
|
-
testInterface.afterAll || ((store: IStore) => undefined),
|
|
115
|
-
testInterface.butThen || (async (a) => a as any),
|
|
116
|
-
testInterface.andWhen,
|
|
117
|
-
testInterface.actionHandler ||
|
|
118
|
-
function (b: (...any: any[]) => any) {
|
|
119
|
-
return b;
|
|
120
|
-
},
|
|
121
|
-
(window as any).NodeWriter
|
|
122
|
-
);
|
|
123
|
-
|
|
124
|
-
const tl2: TesterantoLevelTwo<any, any, any, any, any, any, any, any> = mrt;
|
|
125
|
-
const t: ITestJob = tl2.testJobs[0];
|
|
126
|
-
const testResourceArg = decodeURIComponent(
|
|
127
|
-
new URLSearchParams(location.search).get('requesting') || ''
|
|
100
|
+
testInterface
|
|
128
101
|
);
|
|
129
|
-
|
|
130
|
-
try {
|
|
131
|
-
const partialTestResource = JSON.parse(
|
|
132
|
-
testResourceArg
|
|
133
|
-
) as ITTestResourceConfiguration;
|
|
134
|
-
|
|
135
|
-
console.log("initial test resource", partialTestResource);
|
|
136
|
-
|
|
137
|
-
if (partialTestResource.scheduled) {
|
|
138
|
-
console.log("test is scheduled");
|
|
139
|
-
|
|
140
|
-
console.log("awaiting test resources via WS...");
|
|
141
|
-
webSocket.addEventListener("open", (event) => {
|
|
142
|
-
webSocket.addEventListener("message", (event) => {
|
|
143
|
-
console.log("Message from server ", event.data);
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
const r = JSON.stringify({
|
|
147
|
-
type: "testeranto:hola",
|
|
148
|
-
data: {
|
|
149
|
-
requirement: {
|
|
150
|
-
...testResourceRequirement,
|
|
151
|
-
name: partialTestResource.name
|
|
152
|
-
}
|
|
153
|
-
},
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
webSocket.send(r);
|
|
157
|
-
|
|
158
|
-
console.log("awaiting test resources via websocket...", r);
|
|
159
|
-
webSocket.onmessage = (
|
|
160
|
-
async (msg: MessageEvent<any>) => {
|
|
161
|
-
console.log("message: ", msg);
|
|
162
|
-
|
|
163
|
-
const resourcesFromWs = JSON.parse(msg.data);
|
|
164
|
-
console.log("secondary test resource", resourcesFromWs);
|
|
165
|
-
|
|
166
|
-
const secondTestResource = {
|
|
167
|
-
fs: ".",
|
|
168
|
-
...JSON.parse(JSON.stringify(partialTestResource)),
|
|
169
|
-
...JSON.parse(JSON.stringify(resourcesFromWs)),
|
|
170
|
-
} as ITTestResourceConfiguration;
|
|
171
|
-
|
|
172
|
-
console.log("final test resource", secondTestResource);
|
|
173
|
-
receiveTestResourceConfigScheduled(t, secondTestResource);
|
|
174
|
-
}
|
|
175
|
-
);
|
|
176
|
-
});
|
|
177
|
-
} else {
|
|
178
|
-
receiveTestResourceConfigUnscheduled(t, partialTestResource);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
// const partialTestResource = JSON.parse(
|
|
182
|
-
// testResourceArg
|
|
183
|
-
// ) as ITTestResourceConfiguration;
|
|
184
|
-
|
|
185
|
-
// if (partialTestResource.fs && partialTestResource.ports) {
|
|
186
|
-
// receiveTestResourceConfig(t, partialTestResource);
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
// } else {
|
|
190
|
-
// console.log("test configuration is incomplete", partialTestResource);
|
|
191
|
-
// console.log(
|
|
192
|
-
// "requesting test resources via ws",
|
|
193
|
-
// testResourceRequirement
|
|
194
|
-
// );
|
|
195
|
-
|
|
196
|
-
// webSocket.addEventListener("open", (event) => {
|
|
197
|
-
// webSocket.addEventListener("message", (event) => {
|
|
198
|
-
// console.log("Message from server ", event.data);
|
|
199
|
-
// });
|
|
200
|
-
|
|
201
|
-
// const r = JSON.stringify({
|
|
202
|
-
// type: "testeranto:hola",
|
|
203
|
-
// data: {
|
|
204
|
-
// testResourceRequirement,
|
|
205
|
-
// },
|
|
206
|
-
// });
|
|
207
|
-
|
|
208
|
-
// webSocket.send(r);
|
|
209
|
-
|
|
210
|
-
// console.log("awaiting test resources via websocket...", r);
|
|
211
|
-
// webSocket.onmessage = (
|
|
212
|
-
// async (msg: MessageEvent<any>) => {
|
|
213
|
-
// console.log("message: ", msg);
|
|
214
|
-
|
|
215
|
-
// const resourcesFromPm2 = msg.data.testResourceConfiguration;
|
|
216
|
-
// const secondTestResource = {
|
|
217
|
-
// fs: ".",
|
|
218
|
-
// ...JSON.parse(JSON.stringify(partialTestResource)),
|
|
219
|
-
// ...JSON.parse(JSON.stringify(resourcesFromPm2)),
|
|
220
|
-
// } as ITTestResourceConfiguration;
|
|
221
|
-
|
|
222
|
-
// console.log("secondTestResource", secondTestResource);
|
|
223
|
-
// receiveTestResourceConfig(t, secondTestResource);
|
|
224
|
-
// }
|
|
225
|
-
// );
|
|
226
|
-
// });
|
|
227
|
-
// }
|
|
228
|
-
|
|
229
|
-
} catch (e) {
|
|
230
|
-
console.error(e);
|
|
231
|
-
// process.exit(-1);
|
|
232
|
-
}
|
|
233
102
|
};
|
package/src/cjs-shim.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import url from 'node:url';
|
|
4
|
+
|
|
5
|
+
// globalThis.require = createRequire(import.meta.url);
|
|
6
|
+
globalThis.__filename = url.fileURLToPath(import.meta.url);
|
|
7
|
+
globalThis.__dirname = path.dirname(__filename);
|
|
8
|
+
|
|
9
|
+
// const p = `${import.meta.url}/..`;
|
|
10
|
+
// globalThis.require = createRequire(`${import.meta.url}/..`);
|
|
11
|
+
// globalThis.__filename = url.fileURLToPath(`${import.meta.url}/..`);
|
|
12
|
+
// globalThis.__dirname = path.dirname(`${__filename}/..`);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BuildOptions } from "esbuild";
|
|
2
|
+
import { IBaseConfig } from "../lib/types";
|
|
3
|
+
|
|
4
|
+
export default (config: IBaseConfig): BuildOptions => {
|
|
5
|
+
return {
|
|
6
|
+
bundle: true,
|
|
7
|
+
entryPoints: [config.features],
|
|
8
|
+
minify: config.minify === true,
|
|
9
|
+
outbase: config.outbase,
|
|
10
|
+
write: true,
|
|
11
|
+
|
|
12
|
+
outfile: `${config.outdir}/features.test.js`,
|
|
13
|
+
// external: ["graphology"],
|
|
14
|
+
|
|
15
|
+
format: "esm",
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BuildOptions } from "esbuild";
|
|
2
|
+
|
|
3
|
+
import { IBaseConfig } from "../lib/types";
|
|
4
|
+
|
|
5
|
+
export default (config: IBaseConfig): BuildOptions => {
|
|
6
|
+
return {
|
|
7
|
+
// packages: "external",
|
|
8
|
+
target: "esnext",
|
|
9
|
+
format: "esm",
|
|
10
|
+
splitting: true,
|
|
11
|
+
outExtension: { ".js": ".mjs" },
|
|
12
|
+
outbase: config.outbase,
|
|
13
|
+
jsx: "transform",
|
|
14
|
+
bundle: true,
|
|
15
|
+
minify: config.minify === true,
|
|
16
|
+
write: true,
|
|
17
|
+
loader: {
|
|
18
|
+
".js": "jsx",
|
|
19
|
+
".png": "binary",
|
|
20
|
+
".jpg": "binary",
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
|
|
4
|
+
export default (
|
|
5
|
+
platform: "web" | "node",
|
|
6
|
+
entryPoints: Set<string> | string[]
|
|
7
|
+
) => {
|
|
8
|
+
return {
|
|
9
|
+
name: "metafileWriter",
|
|
10
|
+
setup(build) {
|
|
11
|
+
build.onEnd((result) => {
|
|
12
|
+
if (result.errors.length === 0) {
|
|
13
|
+
entryPoints.forEach((entryPoint) => {
|
|
14
|
+
const filePath = path.join(
|
|
15
|
+
"./docs/",
|
|
16
|
+
platform,
|
|
17
|
+
entryPoint.split(".").slice(0, -1).join("."),
|
|
18
|
+
`inputFiles.json`
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
const dirName = path.dirname(filePath);
|
|
22
|
+
|
|
23
|
+
if (!fs.existsSync(dirName)) {
|
|
24
|
+
fs.mkdirSync(dirName, { recursive: true });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
fs.writeFileSync(
|
|
28
|
+
filePath,
|
|
29
|
+
JSON.stringify(
|
|
30
|
+
Object.keys(
|
|
31
|
+
Object.keys(result.metafile.outputs)
|
|
32
|
+
.filter((s: string) => {
|
|
33
|
+
if (!result.metafile.outputs[s].entryPoint) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
return (
|
|
37
|
+
path.resolve(result.metafile.outputs[s].entryPoint) ===
|
|
38
|
+
path.resolve(entryPoint)
|
|
39
|
+
);
|
|
40
|
+
})
|
|
41
|
+
.reduce((mm: string[], el) => {
|
|
42
|
+
mm.push(result.metafile.outputs[el].inputs);
|
|
43
|
+
return mm;
|
|
44
|
+
}, [])[0]
|
|
45
|
+
)
|
|
46
|
+
.filter((f: string) => {
|
|
47
|
+
const regex = /^src\/.*/g;
|
|
48
|
+
const matches = f.match(regex);
|
|
49
|
+
const passes = matches?.length === 1;
|
|
50
|
+
return passes;
|
|
51
|
+
})
|
|
52
|
+
.filter((f: string) => {
|
|
53
|
+
const regex = /.*\.test\..*/g;
|
|
54
|
+
const matches = f.match(regex);
|
|
55
|
+
const passes = matches?.length === 1;
|
|
56
|
+
return !passes;
|
|
57
|
+
})
|
|
58
|
+
)
|
|
59
|
+
);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
};
|