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