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
|
@@ -6,16 +6,22 @@ export default class Testeranto extends ClassBuilder {
|
|
|
6
6
|
const fullTestInterface = DefaultTestInterface(testInterface);
|
|
7
7
|
super(testImplementation, testSpecification, input, class extends BaseSuite {
|
|
8
8
|
afterAll(store, artifactory, pm) {
|
|
9
|
-
return fullTestInterface.afterAll(store,
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
return fullTestInterface.afterAll(store,
|
|
10
|
+
// (fPath: string, value: unknown) =>
|
|
11
|
+
// // TODO does not work?
|
|
12
|
+
// {
|
|
13
|
+
// artifactory(`afterAll4-${this.name}/${fPath}`, value);
|
|
14
|
+
// },
|
|
15
|
+
pm);
|
|
12
16
|
}
|
|
13
17
|
assertThat(t) {
|
|
14
18
|
fullTestInterface.assertThis(t);
|
|
15
19
|
}
|
|
16
20
|
async setup(s, artifactory, tr, pm) {
|
|
17
21
|
return (fullTestInterface.beforeAll ||
|
|
18
|
-
(async (input, artifactory, tr, pm) => input))(s, this.testResourceConfiguration,
|
|
22
|
+
(async (input, artifactory, tr, pm) => input))(s, this.testResourceConfiguration,
|
|
23
|
+
// artifactory,
|
|
24
|
+
pm);
|
|
19
25
|
}
|
|
20
26
|
}, class Given extends BaseGiven {
|
|
21
27
|
constructor() {
|
|
@@ -23,10 +29,15 @@ export default class Testeranto extends ClassBuilder {
|
|
|
23
29
|
this.uberCatcher = uberCatcher;
|
|
24
30
|
}
|
|
25
31
|
async givenThat(subject, testResource, artifactory, initializer, initialValues, pm) {
|
|
26
|
-
return fullTestInterface.beforeEach(subject, initializer,
|
|
32
|
+
return fullTestInterface.beforeEach(subject, initializer,
|
|
33
|
+
// artifactory,
|
|
34
|
+
testResource, initialValues, pm);
|
|
27
35
|
}
|
|
28
36
|
afterEach(store, key, artifactory, pm) {
|
|
29
|
-
return new Promise((res) => res(fullTestInterface.afterEach(store, key,
|
|
37
|
+
return new Promise((res) => res(fullTestInterface.afterEach(store, key,
|
|
38
|
+
// (fPath: string, value: unknown) =>
|
|
39
|
+
// artifactory(`after/${fPath}`, value),
|
|
40
|
+
pm)));
|
|
30
41
|
}
|
|
31
42
|
}, class When extends BaseWhen {
|
|
32
43
|
async andWhen(store, whenCB, testResource, pm) {
|
|
@@ -86,12 +97,17 @@ export default class Testeranto extends ClassBuilder {
|
|
|
86
97
|
this.initialValues = initialValues;
|
|
87
98
|
}
|
|
88
99
|
async checkThat(subject, testResourceConfiguration, artifactory, pm) {
|
|
89
|
-
return fullTestInterface.beforeEach(subject, this.initialValues,
|
|
100
|
+
return fullTestInterface.beforeEach(subject, this.initialValues,
|
|
101
|
+
// (fPath: string, value: unknown) =>
|
|
102
|
+
// artifactory(`before/${fPath}`, value),
|
|
103
|
+
testResourceConfiguration, this.initialValues, pm);
|
|
90
104
|
}
|
|
91
105
|
afterEach(store, key, artifactory, pm) {
|
|
92
|
-
return new Promise((res) => res(fullTestInterface.afterEach(store, key,
|
|
93
|
-
//
|
|
94
|
-
|
|
106
|
+
return new Promise((res) => res(fullTestInterface.afterEach(store, key,
|
|
107
|
+
// (fPath: string, value: unknown) =>
|
|
108
|
+
// // TODO does not work?
|
|
109
|
+
// artifactory(`afterEach2-${this.name}/${fPath}`, value),
|
|
110
|
+
pm)));
|
|
95
111
|
}
|
|
96
112
|
}, testResourceRequirement);
|
|
97
113
|
}
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import ansiC from "ansi-colors";
|
|
2
|
+
import { watch } from "fs";
|
|
3
|
+
import path from "path";
|
|
4
|
+
import crypto from "node:crypto";
|
|
5
|
+
import fs from "fs";
|
|
6
|
+
import tsc from "tsc-prog";
|
|
7
|
+
import { ESLint } from "eslint";
|
|
8
|
+
import ts from "typescript";
|
|
9
|
+
import readline from "readline";
|
|
10
|
+
import { PM_Main } from "./PM/main";
|
|
11
|
+
import { lintExitCodePather, lintPather, tscExitCodePather, tscPather, } from "./utils";
|
|
12
|
+
console.log(ansiC.inverse("Press 'x' to shutdown forcefully."));
|
|
13
|
+
readline.emitKeypressEvents(process.stdin);
|
|
14
|
+
if (process.stdin.isTTY)
|
|
15
|
+
process.stdin.setRawMode(true);
|
|
16
|
+
process.stdin.on("keypress", (str, key) => {
|
|
17
|
+
if (key.name === "x") {
|
|
18
|
+
console.log(ansiC.inverse("Shutting down forcefully..."));
|
|
19
|
+
process.exit(-1);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
async function fileHash(filePath, algorithm = "md5") {
|
|
23
|
+
return new Promise((resolve, reject) => {
|
|
24
|
+
const hash = crypto.createHash(algorithm);
|
|
25
|
+
const fileStream = fs.createReadStream(filePath);
|
|
26
|
+
fileStream.on("data", (data) => {
|
|
27
|
+
hash.update(data);
|
|
28
|
+
});
|
|
29
|
+
fileStream.on("end", () => {
|
|
30
|
+
const fileHash = hash.digest("hex");
|
|
31
|
+
resolve(fileHash);
|
|
32
|
+
});
|
|
33
|
+
fileStream.on("error", (error) => {
|
|
34
|
+
reject(`Error reading file: ${error.message}`);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
async function filesHash(files, algorithm = "md5") {
|
|
39
|
+
return new Promise((resolve, reject) => {
|
|
40
|
+
resolve(files.reduce(async (mm, f) => {
|
|
41
|
+
return (await mm) + (await fileHash(f));
|
|
42
|
+
}, Promise.resolve("")));
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
const getRunnables = (tests, payload = {
|
|
46
|
+
nodeEntryPoints: {},
|
|
47
|
+
webEntryPoints: {},
|
|
48
|
+
}) => {
|
|
49
|
+
return tests.reduce((pt, cv, cndx, cry) => {
|
|
50
|
+
if (cv[1] === "node") {
|
|
51
|
+
pt.nodeEntryPoints[cv[0]] = path.resolve(`./docs/node/${cv[0].split(".").slice(0, -1).concat("mjs").join(".")}`);
|
|
52
|
+
}
|
|
53
|
+
else if (cv[1] === "web") {
|
|
54
|
+
pt.webEntryPoints[cv[0]] = path.resolve(`./docs/web/${cv[0].split(".").slice(0, -1).concat("mjs").join(".")}`);
|
|
55
|
+
}
|
|
56
|
+
if (cv[3].length) {
|
|
57
|
+
getRunnables(cv[3], payload);
|
|
58
|
+
}
|
|
59
|
+
return pt;
|
|
60
|
+
}, payload);
|
|
61
|
+
};
|
|
62
|
+
const changes = {};
|
|
63
|
+
const tscCheck = async ({ entrypoint, addableFiles, platform, }) => {
|
|
64
|
+
console.log(ansiC.green(ansiC.inverse(`tsc < ${entrypoint}`)));
|
|
65
|
+
const program = tsc.createProgramFromConfig({
|
|
66
|
+
basePath: process.cwd(), // always required, used for relative paths
|
|
67
|
+
configFilePath: "tsconfig.json", // config to inherit from (optional)
|
|
68
|
+
compilerOptions: {
|
|
69
|
+
rootDir: "src",
|
|
70
|
+
outDir: tscPather(entrypoint, platform),
|
|
71
|
+
// declaration: true,
|
|
72
|
+
// skipLibCheck: true,
|
|
73
|
+
noEmit: true,
|
|
74
|
+
},
|
|
75
|
+
include: addableFiles, //["src/**/*"],
|
|
76
|
+
// exclude: ["**/*.test.ts", "**/*.spec.ts"],
|
|
77
|
+
});
|
|
78
|
+
const tscPath = tscPather(entrypoint, platform);
|
|
79
|
+
let allDiagnostics = program.getSemanticDiagnostics();
|
|
80
|
+
const d = [];
|
|
81
|
+
allDiagnostics.forEach((diagnostic) => {
|
|
82
|
+
if (diagnostic.file) {
|
|
83
|
+
let { line, character } = ts.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start);
|
|
84
|
+
let message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n");
|
|
85
|
+
d.push(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
d.push(ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n"));
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
fs.writeFileSync(tscPath, d.join("\n"));
|
|
92
|
+
fs.writeFileSync(tscExitCodePather(entrypoint, platform), d.length.toString());
|
|
93
|
+
};
|
|
94
|
+
const eslint = new ESLint();
|
|
95
|
+
const formatter = await eslint.loadFormatter("./node_modules/testeranto/dist/prebuild/esbuildConfigs/eslint-formatter-testeranto.mjs");
|
|
96
|
+
const eslintCheck = async (entrypoint, platform, addableFiles) => {
|
|
97
|
+
console.log(ansiC.green(ansiC.inverse(`eslint < ${entrypoint}`)));
|
|
98
|
+
const results = (await eslint.lintFiles(addableFiles))
|
|
99
|
+
.filter((r) => r.messages.length)
|
|
100
|
+
.filter((r) => {
|
|
101
|
+
return r.messages[0].ruleId !== null;
|
|
102
|
+
})
|
|
103
|
+
.map((r) => {
|
|
104
|
+
delete r.source;
|
|
105
|
+
return r;
|
|
106
|
+
});
|
|
107
|
+
fs.writeFileSync(lintPather(entrypoint, platform), await formatter.format(results));
|
|
108
|
+
fs.writeFileSync(lintExitCodePather(entrypoint, platform), results.length.toString());
|
|
109
|
+
};
|
|
110
|
+
const makePrompt = async (entryPoint, addableFiles, platform) => {
|
|
111
|
+
const promptPath = path.join("./docs/", platform, entryPoint.split(".").slice(0, -1).join("."), `prompt.txt`);
|
|
112
|
+
const testPaths = path.join("./docs/", platform, entryPoint.split(".").slice(0, -1).join("."), `tests.json`);
|
|
113
|
+
const featuresPath = path.join("./docs/", platform, entryPoint.split(".").slice(0, -1).join("."), `featurePrompt.txt`);
|
|
114
|
+
fs.writeFileSync(promptPath, `
|
|
115
|
+
${addableFiles
|
|
116
|
+
.map((x) => {
|
|
117
|
+
return `/add ${x}`;
|
|
118
|
+
})
|
|
119
|
+
.join("\n")}
|
|
120
|
+
|
|
121
|
+
/read ${lintPather(entryPoint, platform)}
|
|
122
|
+
/read ${tscPather(entryPoint, platform)}
|
|
123
|
+
/read ${testPaths}
|
|
124
|
+
|
|
125
|
+
/load ${featuresPath}
|
|
126
|
+
|
|
127
|
+
/code Fix the failing tests described in ${testPaths}. Correct any type signature errors described in the files ${tscPather(entryPoint, platform)}. Implement any method which throws "Function not implemented. Resolve the lint errors described in ${lintPather(entryPoint, platform)}"
|
|
128
|
+
`);
|
|
129
|
+
};
|
|
130
|
+
const metafileOutputs = async (platform) => {
|
|
131
|
+
const metafile = JSON.parse(fs.readFileSync(`docs/${platform}/metafile.json`).toString()).metafile;
|
|
132
|
+
if (!metafile)
|
|
133
|
+
return;
|
|
134
|
+
const outputs = metafile.outputs;
|
|
135
|
+
Object.keys(outputs).forEach(async (k) => {
|
|
136
|
+
const addableFiles = Object.keys(outputs[k].inputs).filter((i) => {
|
|
137
|
+
if (!fs.existsSync(i))
|
|
138
|
+
return false;
|
|
139
|
+
if (i.startsWith("node_modules"))
|
|
140
|
+
return false;
|
|
141
|
+
return true;
|
|
142
|
+
});
|
|
143
|
+
const f = `${k.split(".").slice(0, -1).join(".")}/`;
|
|
144
|
+
if (!fs.existsSync(f)) {
|
|
145
|
+
fs.mkdirSync(f);
|
|
146
|
+
}
|
|
147
|
+
const entrypoint = outputs[k].entryPoint;
|
|
148
|
+
if (entrypoint) {
|
|
149
|
+
const changeDigest = await filesHash(addableFiles);
|
|
150
|
+
if (changeDigest === changes[entrypoint]) {
|
|
151
|
+
// skip
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
changes[entrypoint] = changeDigest;
|
|
155
|
+
tscCheck({ platform, addableFiles, entrypoint });
|
|
156
|
+
eslintCheck(entrypoint, platform, addableFiles);
|
|
157
|
+
makePrompt(entrypoint, addableFiles, platform);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
import(process.cwd() + "/" + process.argv[2]).then(async (module) => {
|
|
163
|
+
const rawConfig = module.default;
|
|
164
|
+
const config = Object.assign(Object.assign({}, rawConfig), { buildDir: process.cwd() + "/" + rawConfig.outdir });
|
|
165
|
+
let mode = config.devMode ? "DEV" : "PROD";
|
|
166
|
+
const fileHashes = {};
|
|
167
|
+
let pm = new PM_Main(config);
|
|
168
|
+
console.log(ansiC.inverse(`Press 'q' to shutdown gracefully`));
|
|
169
|
+
process.stdin.on("keypress", (str, key) => {
|
|
170
|
+
if (key.name === "q") {
|
|
171
|
+
console.log(ansiC.inverse("Testeranto-Run is shutting down gracefully..."));
|
|
172
|
+
mode = "PROD";
|
|
173
|
+
// onDone();
|
|
174
|
+
nodeMetafileWatcher.close();
|
|
175
|
+
webMetafileWatcher.close();
|
|
176
|
+
pm.shutDown();
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
metafileOutputs("node");
|
|
180
|
+
const nodeMetafileWatcher = watch("docs/node/metafile.json", async (e, filename) => {
|
|
181
|
+
console.log(ansiC.green(ansiC.inverse(`< ${e} ${filename} (node)`)));
|
|
182
|
+
metafileOutputs("node");
|
|
183
|
+
});
|
|
184
|
+
metafileOutputs("web");
|
|
185
|
+
const webMetafileWatcher = watch("docs/web/metafile.json", async (e, filename) => {
|
|
186
|
+
console.log(ansiC.green(ansiC.inverse(`< ${e} ${filename} (web)`)));
|
|
187
|
+
metafileOutputs("web");
|
|
188
|
+
});
|
|
189
|
+
await pm.startPuppeteer({
|
|
190
|
+
slowMo: 1,
|
|
191
|
+
// timeout: 1,
|
|
192
|
+
waitForInitialPage: false,
|
|
193
|
+
executablePath:
|
|
194
|
+
// process.env.CHROMIUM_PATH || "/opt/homebrew/bin/chromium",
|
|
195
|
+
"/opt/homebrew/bin/chromium",
|
|
196
|
+
headless: true,
|
|
197
|
+
dumpio: true,
|
|
198
|
+
// timeout: 0,
|
|
199
|
+
devtools: true,
|
|
200
|
+
args: [
|
|
201
|
+
"--auto-open-devtools-for-tabs",
|
|
202
|
+
`--remote-debugging-port=3234`,
|
|
203
|
+
// "--disable-features=IsolateOrigins,site-per-process",
|
|
204
|
+
"--disable-site-isolation-trials",
|
|
205
|
+
"--allow-insecure-localhost",
|
|
206
|
+
"--allow-file-access-from-files",
|
|
207
|
+
"--allow-running-insecure-content",
|
|
208
|
+
"--disable-dev-shm-usage",
|
|
209
|
+
"--disable-extensions",
|
|
210
|
+
"--disable-gpu",
|
|
211
|
+
"--disable-setuid-sandbox",
|
|
212
|
+
"--disable-site-isolation-trials",
|
|
213
|
+
"--disable-web-security",
|
|
214
|
+
"--no-first-run",
|
|
215
|
+
"--no-sandbox",
|
|
216
|
+
"--no-startup-window",
|
|
217
|
+
// "--no-zygote",
|
|
218
|
+
"--reduce-security-for-testing",
|
|
219
|
+
"--remote-allow-origins=*",
|
|
220
|
+
"--unsafely-treat-insecure-origin-as-secure=*",
|
|
221
|
+
// "--disable-features=IsolateOrigins",
|
|
222
|
+
// "--remote-allow-origins=ws://localhost:3234",
|
|
223
|
+
// "--single-process",
|
|
224
|
+
// "--unsafely-treat-insecure-origin-as-secure",
|
|
225
|
+
// "--unsafely-treat-insecure-origin-as-secure=ws://192.168.0.101:3234",
|
|
226
|
+
// "--disk-cache-dir=/dev/null",
|
|
227
|
+
// "--disk-cache-size=1",
|
|
228
|
+
// "--start-maximized",
|
|
229
|
+
],
|
|
230
|
+
}, ".");
|
|
231
|
+
const { nodeEntryPoints, webEntryPoints } = getRunnables(config.tests);
|
|
232
|
+
Object.entries(nodeEntryPoints).forEach(([k, outputFile]) => {
|
|
233
|
+
pm.launchNode(k, outputFile);
|
|
234
|
+
try {
|
|
235
|
+
watch(outputFile, async (e, filename) => {
|
|
236
|
+
const hash = await fileHash(outputFile);
|
|
237
|
+
if (fileHashes[k] !== hash) {
|
|
238
|
+
fileHashes[k] = hash;
|
|
239
|
+
console.log(ansiC.green(ansiC.inverse(`< ${e} ${filename}`)));
|
|
240
|
+
pm.launchNode(k, outputFile);
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
catch (e) {
|
|
245
|
+
console.error(e);
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
Object.entries(webEntryPoints).forEach(([k, outputFile]) => {
|
|
249
|
+
pm.launchWeb(k, outputFile);
|
|
250
|
+
watch(outputFile, async (e, filename) => {
|
|
251
|
+
const hash = await fileHash(outputFile);
|
|
252
|
+
if (fileHashes[k] !== hash) {
|
|
253
|
+
fileHashes[k] = hash;
|
|
254
|
+
console.log(ansiC.green(ansiC.inverse(`< ${e} ${filename}`)));
|
|
255
|
+
pm.launchWeb(k, outputFile);
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
});
|
|
259
|
+
});
|