testeranto 0.129.0 → 0.134.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/.aider.chat.history.md +137197 -0
- package/.aider.input.history +334 -0
- package/.aider.tags.cache.v3/18/8b/7dfca822129dad10b5cacadf7728.val +0 -0
- package/.aider.tags.cache.v3/{ec/c0/161c249c35be853cc40cf11f9267.val → 62/f5/8af72140d93c58db2f6aa5bf3f1f.val} +0 -0
- package/.aider.tags.cache.v3/8d/fa/12860238755bcfab9af8a93c52ab.val +0 -0
- package/.aider.tags.cache.v3/{b7/e6/5be87b62aeaf2bc244ff41c1b61a.val → a7/97/6d37fce350ad2d588f36729db0cd.val} +0 -0
- package/.aider.tags.cache.v3/{e3/e6/3501625caf5d5eb171f0d248462e.val → ad/3c/10f2ab1397f6d544e613d2a6acaf.val} +0 -0
- package/.aider.tags.cache.v3/cache.db +0 -0
- package/.aider.tags.cache.v3/cache.db-shm +0 -0
- package/.aider.tags.cache.v3/cache.db-wal +0 -0
- package/.aider.tags.cache.v3/dd/5b/0ade824b0841c7c11e9352c5d2ca.val +0 -0
- package/README.md +333 -34
- package/bundle.js +8 -75
- package/dist/common/src/Init.js +6 -1
- package/dist/common/src/Node.js +6 -4
- package/dist/common/src/NodeSidecar.js +15 -0
- package/dist/common/src/PM/PM_WithEslintAndTsc.js +187 -0
- package/dist/common/src/PM/__tests__/nodeSidecar.testeranto.js +109 -0
- package/dist/common/src/PM/__tests__/pureSidecar.testeranto.js +94 -0
- package/dist/common/src/PM/__tests__/webSidecar.testeranto.js +94 -0
- package/dist/common/src/PM/base.js +33 -16
- package/dist/common/src/PM/main.js +484 -425
- package/dist/common/src/PM/node.js +44 -19
- package/dist/common/src/PM/nodeSidecar.js +65 -0
- package/dist/common/src/PM/pure.js +55 -47
- package/dist/common/src/PM/pureSidecar.js +48 -0
- package/dist/common/src/PM/sidecar.js +11 -0
- package/dist/common/src/PM/web.js +24 -6
- package/dist/common/src/PM/webSidecar.js +47 -0
- package/dist/common/src/PureSidecar.js +13 -0
- package/dist/common/src/SP__Polygon.test.js +10 -0
- package/dist/common/src/WebSidecar.js +14 -0
- package/dist/common/src/build.js +63 -10
- package/dist/common/src/defaultConfig.js +1 -0
- package/dist/common/src/esbuildConfigs/consoleDetectorPlugin.js +27 -0
- package/dist/common/src/esbuildConfigs/pure.js +15 -1
- package/dist/common/src/esbuildConfigs/web.js +10 -1
- package/dist/common/src/{SubPackages/react-dom/jsx/index.js → lib/Sidecar.js} +4 -0
- package/dist/common/src/lib/abstractBase.js +7 -5
- package/dist/common/src/lib/basebuilder.js +1 -3
- package/dist/common/src/lib/classBuilder.js +4 -17
- package/dist/common/src/lib/core.js +11 -6
- package/dist/common/src/lib/index.js +13 -4
- package/dist/common/src/lib/pmProxy.js +1 -1
- package/dist/common/src/mothership/index.js +16 -0
- package/dist/common/src/mothership/test.js +65 -0
- package/dist/common/src/utils/queue.js +36 -0
- package/dist/common/src/utils.js +34 -5
- package/dist/common/testeranto.config.js +77 -39
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/src/Init.js +6 -1
- package/dist/module/src/Node.js +6 -4
- package/dist/module/src/NodeSidecar.js +11 -0
- package/dist/module/src/PM/PM_WithEslintAndTsc.js +180 -0
- package/dist/module/src/PM/__tests__/nodeSidecar.testeranto.js +104 -0
- package/dist/module/src/PM/__tests__/pureSidecar.testeranto.js +89 -0
- package/dist/module/src/PM/__tests__/webSidecar.testeranto.js +89 -0
- package/dist/module/src/PM/base.js +33 -16
- package/dist/module/src/PM/main.js +485 -426
- package/dist/module/src/PM/node.js +44 -19
- package/dist/module/src/PM/nodeSidecar.js +58 -0
- package/dist/module/src/PM/pure.js +55 -44
- package/dist/module/src/PM/pureSidecar.js +41 -0
- package/dist/module/src/PM/sidecar.js +7 -0
- package/dist/module/src/PM/web.js +24 -6
- package/dist/module/src/PM/webSidecar.js +40 -0
- package/dist/module/src/Project.js +154 -75
- package/dist/module/src/PureSidecar.js +9 -0
- package/dist/module/src/ReportClient.js +132 -97
- package/dist/module/src/SP__Polygon.test.js +8 -0
- package/dist/module/src/TestReport.js +32 -14
- package/dist/module/src/WebSidecar.js +10 -0
- package/dist/module/src/build.js +63 -10
- package/dist/module/src/defaultConfig.js +1 -0
- package/dist/module/src/esbuildConfigs/consoleDetectorPlugin.js +24 -0
- package/dist/module/src/esbuildConfigs/pure.js +15 -1
- package/dist/module/src/esbuildConfigs/web.js +10 -1
- package/dist/module/src/lib/Sidecar.js +2 -0
- package/dist/module/src/lib/abstractBase.js +7 -5
- package/dist/module/src/lib/basebuilder.js +1 -3
- package/dist/module/src/lib/classBuilder.js +4 -17
- package/dist/module/src/lib/core.js +11 -6
- package/dist/module/src/lib/index.js +12 -4
- package/dist/module/src/lib/pmProxy.js +1 -1
- package/dist/module/src/mothership/index.js +11 -0
- package/dist/module/src/mothership/test.js +60 -0
- package/dist/module/src/utils/queue.js +32 -0
- package/dist/module/src/utils.js +34 -5
- package/dist/module/testeranto.config.js +77 -36
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/prebuild/Project.js +3288 -385
- package/dist/prebuild/ReportClient.js +0 -24638
- package/dist/prebuild/TestReport.js +14 -8
- package/dist/prebuild/build.mjs +159 -15
- package/dist/prebuild/init-docs.mjs +2 -5
- package/dist/prebuild/mothership/index.mjs +17 -0
- package/dist/prebuild/run.mjs +693 -412
- package/dist/types/src/NodeSidecar.d.ts +6 -0
- package/dist/types/src/PM/PM_WithEslintAndTsc.d.ts +23 -0
- package/dist/types/src/PM/__tests__/nodeSidecar.testeranto.d.ts +20 -0
- package/dist/types/src/PM/__tests__/pureSidecar.testeranto.d.ts +20 -0
- package/dist/types/src/PM/__tests__/webSidecar.testeranto.d.ts +20 -0
- package/dist/types/src/PM/base.d.ts +6 -5
- package/dist/types/src/PM/index.d.ts +5 -3
- package/dist/types/src/PM/main.d.ts +23 -26
- package/dist/types/src/PM/node.d.ts +8 -6
- package/dist/types/src/PM/nodeSidecar.d.ts +13 -0
- package/dist/types/src/PM/pure.d.ts +4 -3
- package/dist/types/src/PM/pureSidecar.d.ts +11 -0
- package/dist/types/src/PM/sidecar.d.ts +8 -0
- package/dist/types/src/PM/web.d.ts +18 -8
- package/dist/types/src/PM/webSidecar.d.ts +11 -0
- package/dist/types/src/PureSidecar.d.ts +8 -0
- package/dist/types/src/Types.d.ts +109 -43
- package/dist/types/src/WebSidecar.d.ts +8 -0
- package/dist/types/src/esbuildConfigs/consoleDetectorPlugin.d.ts +2 -0
- package/dist/types/src/lib/Sidecar.d.ts +5 -0
- package/dist/types/src/lib/abstractBase.d.ts +6 -6
- package/dist/types/src/lib/classBuilder.d.ts +7 -1
- package/dist/types/src/lib/core.d.ts +7 -1
- package/dist/types/src/lib/index.d.ts +10 -4
- package/dist/types/src/lib/types.d.ts +12 -2
- package/dist/types/src/mothership/index.d.ts +2 -0
- package/dist/types/src/mothership/test.d.ts +21 -0
- package/dist/types/src/utils/queue.d.ts +11 -0
- package/dist/types/src/utils.d.ts +4 -7
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +19 -105
- package/src/Init.ts +6 -5
- package/src/Node.ts +7 -4
- package/src/NodeSidecar.ts +22 -0
- package/src/PM/PM_WithEslintAndTsc.ts +284 -0
- package/src/PM/__tests__/nodeSidecar.testeranto.ts +173 -0
- package/src/PM/__tests__/pureSidecar.testeranto.ts +157 -0
- package/src/PM/__tests__/webSidecar.testeranto.ts +157 -0
- package/src/PM/base.ts +38 -17
- package/src/PM/index.ts +9 -3
- package/src/PM/main.ts +608 -582
- package/src/PM/node.ts +67 -23
- package/src/PM/nodeSidecar.ts +73 -0
- package/src/PM/pure.ts +68 -58
- package/src/PM/pureSidecar.ts +56 -0
- package/src/PM/sidecar.ts +48 -0
- package/src/PM/web.ts +42 -11
- package/src/PM/webSidecar.ts +55 -0
- package/src/Project.tsx +312 -109
- package/src/Pure.ts +0 -2
- package/src/PureSidecar.ts +14 -0
- package/src/ReportClient.tsx +164 -170
- package/src/SP__Polygon.test.ts +13 -0
- package/src/TestReport.tsx +77 -6
- package/src/Types.ts +227 -122
- package/src/WebSidecar.ts +14 -0
- package/src/build.ts +101 -14
- package/src/defaultConfig.ts +1 -0
- package/src/esbuildConfigs/README.md +46 -0
- package/src/esbuildConfigs/consoleDetectorPlugin.ts +29 -0
- package/src/esbuildConfigs/pure.ts +22 -1
- package/src/esbuildConfigs/web.ts +13 -0
- package/src/lib/Sidecar.ts +6 -0
- package/src/lib/TEST_ADAPTER_RENAME.md +48 -0
- package/src/lib/abstractBase.ts +12 -9
- package/src/lib/basebuilder.ts +5 -4
- package/src/lib/classBuilder.ts +15 -18
- package/src/lib/core.ts +24 -11
- package/src/lib/index.ts +38 -18
- package/src/lib/pmProxy.ts +3 -1
- package/src/lib/types.ts +15 -2
- package/src/mothership/index.ts +15 -0
- package/src/mothership/test.ts +137 -0
- package/src/run.ts +0 -1
- package/src/utils/queue.ts +41 -0
- package/src/utils.ts +41 -15
- package/testeranto/bundles/node/mothership/chunk-PG6KUKNP.mjs +44 -0
- package/testeranto/bundles/node/mothership/chunk-V2EQEXU2.mjs +1032 -0
- package/testeranto/bundles/node/mothership/metafile.json +389 -0
- package/testeranto/bundles/node/mothership/src/PM/__tests__/nodeSidecar.testeranto.mjs +1219 -0
- package/testeranto/bundles/node/mothership/src/PM/__tests__/pureSidecar.testeranto.mjs +156 -0
- package/testeranto/bundles/node/mothership/src/PM/__tests__/sidecar.testeranto.mjs +1199 -0
- package/testeranto/bundles/node/mothership/src/PM/__tests__/webSidecar.testeranto.mjs +156 -0
- package/testeranto/bundles/node/mothership/src/mothership/test.mjs +24411 -0
- package/testeranto/bundles/pure/mothership/metafile.json +8 -0
- package/testeranto/bundles/web/mothership/metafile.json +8 -0
- package/testeranto/index.html +4 -4
- package/testeranto/reports/mothership/config.json +25 -0
- package/testeranto/reports/{redux → mothership}/index.html +8 -8
- package/testeranto/reports/mothership/src/PM/__tests__/nodeSidecar.testeranto/node/console_log.txt +0 -0
- package/testeranto/reports/mothership/src/PM/__tests__/nodeSidecar.testeranto/node/index.html +20 -0
- package/testeranto/reports/mothership/src/PM/__tests__/nodeSidecar.testeranto/node/lint_errors.json +1564 -0
- package/testeranto/reports/mothership/src/PM/__tests__/nodeSidecar.testeranto/node/log.txt +0 -0
- package/testeranto/reports/mothership/src/PM/__tests__/nodeSidecar.testeranto/node/prompt.txt +22 -0
- package/testeranto/reports/mothership/src/PM/__tests__/nodeSidecar.testeranto/node/type_errors.txt +35 -0
- package/testeranto/reports/mothership/src/PM/__tests__/pureSidecar.testeranto/node/index.html +20 -0
- package/testeranto/reports/mothership/src/PM/__tests__/pureSidecar.testeranto/node/lint_errors.json +80 -0
- package/testeranto/reports/mothership/src/PM/__tests__/pureSidecar.testeranto/node/prompt.txt +12 -0
- package/testeranto/reports/mothership/src/PM/__tests__/pureSidecar.testeranto/node/type_errors.txt +26 -0
- package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/bdd_errors.txt +1 -0
- package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/console_log.txt +0 -0
- package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/index.html +20 -0
- package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/lint_errors.json +1564 -0
- package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/log.txt +0 -0
- package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/prompt.txt +22 -0
- package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/tests.json +56 -0
- package/testeranto/reports/mothership/src/PM/__tests__/sidecar.testeranto/node/type_errors.txt +29 -0
- package/testeranto/reports/mothership/src/PM/__tests__/webSidecar.testeranto/node/index.html +20 -0
- package/testeranto/reports/mothership/src/PM/__tests__/webSidecar.testeranto/node/lint_errors.json +80 -0
- package/testeranto/reports/mothership/src/PM/__tests__/webSidecar.testeranto/node/prompt.txt +12 -0
- package/testeranto/reports/mothership/src/PM/__tests__/webSidecar.testeranto/node/type_errors.txt +26 -0
- package/testeranto/reports/mothership/src/mothership/test/node/bdd_errors.txt +1 -0
- package/testeranto/reports/mothership/src/mothership/test/node/console_log.txt +4 -0
- package/testeranto/reports/mothership/src/mothership/test/node/index.html +20 -0
- package/testeranto/reports/mothership/src/mothership/test/node/lint_errors.json +1 -0
- package/testeranto/reports/mothership/src/mothership/test/node/log.txt +0 -0
- package/testeranto/reports/mothership/src/mothership/test/node/prompt.txt +12 -0
- package/testeranto/reports/mothership/src/mothership/test/node/tests.json +24 -0
- package/testeranto/reports/mothership/src/mothership/test/node/type_errors.txt +18 -0
- package/testeranto/reports/mothership/summary.json +9 -0
- package/testeranto.config.ts +82 -44
- package/tsc.log +78 -81
- package/dist/common/src/SubPackages/react/component/index.js +0 -20
- package/dist/common/src/SubPackages/react/component/node.js +0 -10
- package/dist/common/src/SubPackages/react/component/pure.js +0 -10
- package/dist/common/src/SubPackages/react/component/web.js +0 -10
- package/dist/common/src/SubPackages/react/jsx/index.js +0 -64
- package/dist/common/src/SubPackages/react/jsx/node.js +0 -10
- package/dist/common/src/SubPackages/react/jsx/pure.js +0 -10
- package/dist/common/src/SubPackages/react/jsx/web.js +0 -10
- package/dist/common/src/SubPackages/react-dom/component/dynamic.js +0 -61
- package/dist/common/src/SubPackages/react-dom/component/node.js +0 -10
- package/dist/common/src/SubPackages/react-dom/component/pure.js +0 -10
- package/dist/common/src/SubPackages/react-dom/component/static.js +0 -26
- package/dist/common/src/SubPackages/react-dom/component/web.js +0 -16
- package/dist/common/src/SubPackages/react-dom/jsx/dynamic.js +0 -31
- package/dist/common/src/SubPackages/react-dom/jsx/node.js +0 -10
- package/dist/common/src/SubPackages/react-dom/jsx/pure.js +0 -10
- package/dist/common/src/SubPackages/react-dom/jsx/static.js +0 -59
- package/dist/common/src/SubPackages/react-dom/jsx/web.js +0 -16
- package/dist/common/src/SubPackages/react-test-renderer/MemoExoticComponent/node.js +0 -54
- package/dist/common/src/SubPackages/react-test-renderer/component/index.js +0 -15
- package/dist/common/src/SubPackages/react-test-renderer/component/interface.js +0 -70
- package/dist/common/src/SubPackages/react-test-renderer/component/node.js +0 -8
- package/dist/common/src/SubPackages/react-test-renderer/component/pure.js +0 -8
- package/dist/common/src/SubPackages/react-test-renderer/component/test/implementation.js +0 -57
- package/dist/common/src/SubPackages/react-test-renderer/component/test/node.js +0 -10
- package/dist/common/src/SubPackages/react-test-renderer/component/test/pure.js +0 -10
- package/dist/common/src/SubPackages/react-test-renderer/component/test/web.js +0 -10
- package/dist/common/src/SubPackages/react-test-renderer/component/web.js +0 -8
- package/dist/common/src/SubPackages/react-test-renderer/fc/node.js +0 -60
- package/dist/common/src/SubPackages/react-test-renderer/fc/web.js +0 -60
- package/dist/common/src/SubPackages/react-test-renderer/jsx/index.js +0 -67
- package/dist/common/src/SubPackages/react-test-renderer/jsx/node.js +0 -10
- package/dist/common/src/SubPackages/react-test-renderer/jsx/pure.js +0 -10
- package/dist/common/src/SubPackages/react-test-renderer/jsx/web.js +0 -10
- package/dist/common/src/SubPackages/react-test-renderer/jsx-promised/index.js +0 -52
- package/dist/common/src/SubPackages/react-test-renderer/jsx-promised/node.js +0 -10
- package/dist/common/src/SubPackages/react-test-renderer/jsx-promised/web.js +0 -10
- package/dist/common/src/examples/react/component/index.js +0 -33
- package/dist/common/src/examples/react/component/test.js +0 -36
- package/dist/module/src/SubPackages/react/component/index.js +0 -13
- package/dist/module/src/SubPackages/react/component/node.js +0 -5
- package/dist/module/src/SubPackages/react/component/pure.js +0 -5
- package/dist/module/src/SubPackages/react/component/web.js +0 -5
- package/dist/module/src/SubPackages/react/jsx/index.js +0 -58
- package/dist/module/src/SubPackages/react/jsx/node.js +0 -5
- package/dist/module/src/SubPackages/react/jsx/pure.js +0 -5
- package/dist/module/src/SubPackages/react/jsx/web.js +0 -5
- package/dist/module/src/SubPackages/react-dom/component/dynamic.js +0 -54
- package/dist/module/src/SubPackages/react-dom/component/node.js +0 -5
- package/dist/module/src/SubPackages/react-dom/component/pure.js +0 -5
- package/dist/module/src/SubPackages/react-dom/component/static.js +0 -22
- package/dist/module/src/SubPackages/react-dom/component/web.js +0 -11
- package/dist/module/src/SubPackages/react-dom/jsx/dynamic.js +0 -27
- package/dist/module/src/SubPackages/react-dom/jsx/node.js +0 -5
- package/dist/module/src/SubPackages/react-dom/jsx/pure.js +0 -5
- package/dist/module/src/SubPackages/react-dom/jsx/static.js +0 -53
- package/dist/module/src/SubPackages/react-dom/jsx/web.js +0 -11
- package/dist/module/src/SubPackages/react-test-renderer/MemoExoticComponent/node.js +0 -16
- package/dist/module/src/SubPackages/react-test-renderer/component/index.js +0 -14
- package/dist/module/src/SubPackages/react-test-renderer/component/interface.js +0 -31
- package/dist/module/src/SubPackages/react-test-renderer/component/node.js +0 -3
- package/dist/module/src/SubPackages/react-test-renderer/component/pure.js +0 -3
- package/dist/module/src/SubPackages/react-test-renderer/component/test/implementation.js +0 -54
- package/dist/module/src/SubPackages/react-test-renderer/component/test/node.js +0 -5
- package/dist/module/src/SubPackages/react-test-renderer/component/test/pure.js +0 -5
- package/dist/module/src/SubPackages/react-test-renderer/component/test/web.js +0 -5
- package/dist/module/src/SubPackages/react-test-renderer/component/web.js +0 -3
- package/dist/module/src/SubPackages/react-test-renderer/fc/node.js +0 -22
- package/dist/module/src/SubPackages/react-test-renderer/fc/web.js +0 -22
- package/dist/module/src/SubPackages/react-test-renderer/jsx/index.js +0 -28
- package/dist/module/src/SubPackages/react-test-renderer/jsx/node.js +0 -5
- package/dist/module/src/SubPackages/react-test-renderer/jsx/pure.js +0 -5
- package/dist/module/src/SubPackages/react-test-renderer/jsx/web.js +0 -5
- package/dist/module/src/SubPackages/react-test-renderer/jsx-promised/index.js +0 -16
- package/dist/module/src/SubPackages/react-test-renderer/jsx-promised/node.js +0 -5
- package/dist/module/src/SubPackages/react-test-renderer/jsx-promised/web.js +0 -5
- package/dist/module/src/examples/react/component/index.js +0 -26
- package/dist/module/src/examples/react/component/test.js +0 -32
- package/dist/prebuild/ReportClient.css +0 -11342
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/types/src/SubPackages/react/component/index.d.ts +0 -4
- package/dist/types/src/SubPackages/react/component/node.d.ts +0 -4
- package/dist/types/src/SubPackages/react/component/pure.d.ts +0 -4
- package/dist/types/src/SubPackages/react/component/web.d.ts +0 -4
- package/dist/types/src/SubPackages/react/jsx/index.d.ts +0 -5
- package/dist/types/src/SubPackages/react/jsx/node.d.ts +0 -4
- package/dist/types/src/SubPackages/react/jsx/pure.d.ts +0 -4
- package/dist/types/src/SubPackages/react/jsx/web.d.ts +0 -4
- package/dist/types/src/SubPackages/react-dom/component/dynamic.d.ts +0 -20
- package/dist/types/src/SubPackages/react-dom/component/node.d.ts +0 -4
- package/dist/types/src/SubPackages/react-dom/component/pure.d.ts +0 -4
- package/dist/types/src/SubPackages/react-dom/component/static.d.ts +0 -9
- package/dist/types/src/SubPackages/react-dom/component/web.d.ts +0 -4
- package/dist/types/src/SubPackages/react-dom/jsx/dynamic.d.ts +0 -5
- package/dist/types/src/SubPackages/react-dom/jsx/index.d.ts +0 -6
- package/dist/types/src/SubPackages/react-dom/jsx/node.d.ts +0 -4
- package/dist/types/src/SubPackages/react-dom/jsx/pure.d.ts +0 -4
- package/dist/types/src/SubPackages/react-dom/jsx/static.d.ts +0 -5
- 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 -6
- package/dist/types/src/SubPackages/react-test-renderer/component/index.d.ts +0 -5
- package/dist/types/src/SubPackages/react-test-renderer/component/interface.d.ts +0 -3
- package/dist/types/src/SubPackages/react-test-renderer/component/node.d.ts +0 -4
- package/dist/types/src/SubPackages/react-test-renderer/component/pure.d.ts +0 -4
- package/dist/types/src/SubPackages/react-test-renderer/component/test/implementation.d.ts +0 -4
- package/dist/types/src/SubPackages/react-test-renderer/component/test/node.d.ts +0 -3
- package/dist/types/src/SubPackages/react-test-renderer/component/test/pure.d.ts +0 -4
- package/dist/types/src/SubPackages/react-test-renderer/component/test/web.d.ts +0 -3
- package/dist/types/src/SubPackages/react-test-renderer/component/web.d.ts +0 -4
- 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 -9
- package/dist/types/src/SubPackages/react-test-renderer/jsx/index.d.ts +0 -11
- package/dist/types/src/SubPackages/react-test-renderer/jsx/node.d.ts +0 -4
- package/dist/types/src/SubPackages/react-test-renderer/jsx/pure.d.ts +0 -4
- package/dist/types/src/SubPackages/react-test-renderer/jsx/web.d.ts +0 -4
- package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/index.d.ts +0 -15
- package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/node.d.ts +0 -5
- package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/web.d.ts +0 -5
- package/dist/types/src/examples/react/component/index.d.ts +0 -13
- package/dist/types/src/examples/react/component/test.d.ts +0 -17
- package/src/SubPackages/react/component/index.ts +0 -28
- package/src/SubPackages/react/component/node.ts +0 -17
- package/src/SubPackages/react/component/pure.ts +0 -17
- package/src/SubPackages/react/component/web.ts +0 -17
- package/src/SubPackages/react/jsx/index.ts +0 -75
- package/src/SubPackages/react/jsx/node.ts +0 -23
- package/src/SubPackages/react/jsx/pure.ts +0 -23
- package/src/SubPackages/react/jsx/web.ts +0 -24
- package/src/SubPackages/react-dom/component/dynamic.ts +0 -107
- package/src/SubPackages/react-dom/component/node.ts +0 -17
- package/src/SubPackages/react-dom/component/pure.ts +0 -17
- package/src/SubPackages/react-dom/component/static.ts +0 -41
- package/src/SubPackages/react-dom/component/web.ts +0 -32
- package/src/SubPackages/react-dom/jsx/dynamic.ts +0 -46
- package/src/SubPackages/react-dom/jsx/index.ts +0 -6
- package/src/SubPackages/react-dom/jsx/node.ts +0 -18
- package/src/SubPackages/react-dom/jsx/pure.ts +0 -18
- package/src/SubPackages/react-dom/jsx/static.ts +0 -87
- package/src/SubPackages/react-dom/jsx/web.ts +0 -26
- package/src/SubPackages/react-test-renderer/MemoExoticComponent/node.ts +0 -54
- package/src/SubPackages/react-test-renderer/component/index.ts +0 -32
- package/src/SubPackages/react-test-renderer/component/interface.ts +0 -43
- package/src/SubPackages/react-test-renderer/component/node.ts +0 -18
- package/src/SubPackages/react-test-renderer/component/pure.ts +0 -18
- package/src/SubPackages/react-test-renderer/component/test/implementation.ts +0 -63
- package/src/SubPackages/react-test-renderer/component/test/node.ts +0 -14
- package/src/SubPackages/react-test-renderer/component/test/pure.ts +0 -14
- package/src/SubPackages/react-test-renderer/component/test/web.ts +0 -14
- package/src/SubPackages/react-test-renderer/component/web.ts +0 -18
- package/src/SubPackages/react-test-renderer/fc/node.ts +0 -83
- package/src/SubPackages/react-test-renderer/fc/web.ts +0 -80
- package/src/SubPackages/react-test-renderer/jsx/index.ts +0 -61
- package/src/SubPackages/react-test-renderer/jsx/node.ts +0 -31
- package/src/SubPackages/react-test-renderer/jsx/pure.ts +0 -31
- package/src/SubPackages/react-test-renderer/jsx/web.ts +0 -32
- package/src/SubPackages/react-test-renderer/jsx-promised/index.ts +0 -73
- package/src/SubPackages/react-test-renderer/jsx-promised/node.ts +0 -36
- package/src/SubPackages/react-test-renderer/jsx-promised/web.ts +0 -36
- package/src/examples/react/component/index.tsx +0 -35
- package/src/examples/react/component/test.ts +0 -83
- package/testeranto/bundles/node/redux/metafile.json +0 -559
- package/testeranto/bundles/pure/redux/metafile.json +0 -554
- package/testeranto/bundles/web/redux/metafile.json +0 -504
- package/testeranto/bundles/web/redux/test/web.html +0 -19
- package/testeranto/reports/redux/config.json +0 -38
- package/testeranto/reports/redux/summary.json +0 -20
- /package/dist/{module/src/SubPackages/react-dom/jsx/index.js → types/src/SP__Polygon.test.d.ts} +0 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Plugin } from 'esbuild';
|
|
2
|
+
|
|
3
|
+
export const consoleDetectorPlugin: Plugin = {
|
|
4
|
+
name: 'console-detector',
|
|
5
|
+
setup(build) {
|
|
6
|
+
build.onLoad({ filter: /\.(js|ts)$/ }, async (args) => {
|
|
7
|
+
const contents = await require('fs').promises.readFile(args.path, 'utf8');
|
|
8
|
+
|
|
9
|
+
const consolePattern = /console\.(log|error|warn|info|debug|trace|dir|dirxml|table|group|groupEnd|clear|count|countReset|assert|profile|profileEnd|time|timeLog|timeEnd|timeStamp|context|memory)/g;
|
|
10
|
+
const matches = contents.match(consolePattern);
|
|
11
|
+
|
|
12
|
+
if (matches) {
|
|
13
|
+
const uniqueMethods = [...new Set(matches)];
|
|
14
|
+
return {
|
|
15
|
+
warnings: uniqueMethods.map(method => ({
|
|
16
|
+
text: `Detected ${method} call - Pure runtime does not allow IO operations. Use Node runtime instead.`,
|
|
17
|
+
location: {
|
|
18
|
+
file: args.path,
|
|
19
|
+
line: contents.split('\n').findIndex(line => line.includes(method)) + 1,
|
|
20
|
+
column: 0
|
|
21
|
+
}
|
|
22
|
+
}))
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return null;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
};
|
|
@@ -6,6 +6,9 @@ import baseEsBuildConfig from "./index.js";
|
|
|
6
6
|
import inputFilesPlugin from "./inputFilesPlugin.js";
|
|
7
7
|
import featuresPlugin from "./featuresPlugin.js";
|
|
8
8
|
|
|
9
|
+
import { isBuiltin } from "node:module";
|
|
10
|
+
import { consoleDetectorPlugin } from "./consoleDetectorPlugin.js";
|
|
11
|
+
|
|
9
12
|
export default (
|
|
10
13
|
config: ITestconfig,
|
|
11
14
|
entryPoints: string[],
|
|
@@ -18,7 +21,7 @@ export default (
|
|
|
18
21
|
return {
|
|
19
22
|
...baseEsBuildConfig(config),
|
|
20
23
|
|
|
21
|
-
drop: [
|
|
24
|
+
drop: [],
|
|
22
25
|
|
|
23
26
|
splitting: true,
|
|
24
27
|
|
|
@@ -46,6 +49,24 @@ export default (
|
|
|
46
49
|
featuresPlugin,
|
|
47
50
|
|
|
48
51
|
inputFilesPluginFactory,
|
|
52
|
+
|
|
53
|
+
consoleDetectorPlugin,
|
|
54
|
+
|
|
55
|
+
{
|
|
56
|
+
name: "native-node-import-filter",
|
|
57
|
+
setup(build) {
|
|
58
|
+
build.onResolve({ filter: /fs/ }, (args) => {
|
|
59
|
+
if (isBuiltin(args.path)) {
|
|
60
|
+
throw new Error(
|
|
61
|
+
`cannot use native node package "${args.path}" in a "pure" test. If you really want to use this package, convert this test from "pure" to "node"`
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return { path: args.path };
|
|
66
|
+
});
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
|
|
49
70
|
{
|
|
50
71
|
name: "rebuild-notify",
|
|
51
72
|
setup: (build) => {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { polyfillNode } from "esbuild-plugin-polyfill-node";
|
|
2
|
+
|
|
1
3
|
import { BuildOptions } from "esbuild";
|
|
2
4
|
import path from "path";
|
|
3
5
|
|
|
@@ -20,6 +22,7 @@ export default (
|
|
|
20
22
|
return {
|
|
21
23
|
...baseEsBuildConfig(config),
|
|
22
24
|
|
|
25
|
+
treeShaking: true,
|
|
23
26
|
outdir: `testeranto/bundles/web/${testName}`,
|
|
24
27
|
|
|
25
28
|
alias: {
|
|
@@ -55,6 +58,16 @@ export default (
|
|
|
55
58
|
plugins: [
|
|
56
59
|
featuresPlugin,
|
|
57
60
|
inputFilesPluginFactory,
|
|
61
|
+
|
|
62
|
+
polyfillNode({
|
|
63
|
+
// You might need to configure specific Node.js modules you want to polyfill
|
|
64
|
+
// Example:
|
|
65
|
+
// modules: {
|
|
66
|
+
// 'util': true,
|
|
67
|
+
// 'fs': false,
|
|
68
|
+
// }
|
|
69
|
+
}),
|
|
70
|
+
|
|
58
71
|
{
|
|
59
72
|
name: "rebuild-notify",
|
|
60
73
|
setup: (build) => {
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Test Adapter Rename Proposal
|
|
2
|
+
|
|
3
|
+
## Current Problems
|
|
4
|
+
1. `interface` is:
|
|
5
|
+
- Too vague/overloaded term
|
|
6
|
+
- Conflicts with TypeScript keyword
|
|
7
|
+
- Doesn't convey the wrapping/mediation purpose
|
|
8
|
+
|
|
9
|
+
## Proposed Solution
|
|
10
|
+
Rename to `TestAdapter` because:
|
|
11
|
+
- Standard pattern name in testing frameworks
|
|
12
|
+
- Precisely describes the wrapping/adaptation role
|
|
13
|
+
- Avoids language conflicts
|
|
14
|
+
- Matches industry terminology
|
|
15
|
+
|
|
16
|
+
## Required Changes
|
|
17
|
+
### File Renames:
|
|
18
|
+
- `testInterface.ts` → `testAdapter.ts`
|
|
19
|
+
|
|
20
|
+
### Type Changes:
|
|
21
|
+
- `ITestInterface` → `ITestAdapter`
|
|
22
|
+
- All related interface types
|
|
23
|
+
|
|
24
|
+
### Documentation Updates:
|
|
25
|
+
- Update all JSDoc references
|
|
26
|
+
- Update README examples
|
|
27
|
+
|
|
28
|
+
## Benefits
|
|
29
|
+
1. Clearer code intent
|
|
30
|
+
2. Better pattern alignment
|
|
31
|
+
3. Reduced naming collisions
|
|
32
|
+
4. More discoverable architecture
|
|
33
|
+
|
|
34
|
+
## Risks/Mitigations
|
|
35
|
+
1. Breaking change → Major version bump
|
|
36
|
+
2. Need to update all test files → Codemod script
|
|
37
|
+
3. Documentation updates → Batch update before release
|
|
38
|
+
|
|
39
|
+
## Implementation Plan
|
|
40
|
+
1. First create new types alongside old ones
|
|
41
|
+
2. Deprecate old names with warnings
|
|
42
|
+
3. Provide migration guide
|
|
43
|
+
4. Remove old names in next major version
|
|
44
|
+
|
|
45
|
+
## References
|
|
46
|
+
- [xUnit Test Patterns](http://xunitpatterns.com/)
|
|
47
|
+
- [VS Test Adapters](https://devblogs.microsoft.com/devops/how-to-write-a-visual-studio-test-adapter/)
|
|
48
|
+
- [JUnit TestEngine](https://junit.org/junit5/docs/current/user-guide/)
|
package/src/lib/abstractBase.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
+
import type { IT, OT } from "../Types.js";
|
|
2
4
|
|
|
3
5
|
import { ITTestResourceConfiguration, ITestArtifactory, ITLog } from ".";
|
|
4
6
|
import { IPM } from "./types.js";
|
|
@@ -118,7 +120,7 @@ export abstract class BaseSuite<I extends IT = IT, O extends OT = OT> {
|
|
|
118
120
|
} catch (e) {
|
|
119
121
|
this.failed = true;
|
|
120
122
|
this.fails = this.fails + 1;
|
|
121
|
-
|
|
123
|
+
console.error(e);
|
|
122
124
|
// this.fails.push(giver);
|
|
123
125
|
// return this;
|
|
124
126
|
}
|
|
@@ -292,8 +294,7 @@ export abstract class BaseGiven<I extends IT = IT> {
|
|
|
292
294
|
pm,
|
|
293
295
|
`suite-${suiteNdx}/given-${key}/then-${thenNdx}`
|
|
294
296
|
);
|
|
295
|
-
|
|
296
|
-
return tester(t);
|
|
297
|
+
tester(t);
|
|
297
298
|
// ((t) => {
|
|
298
299
|
// return tester(t);
|
|
299
300
|
// })();
|
|
@@ -326,7 +327,7 @@ export abstract class BaseGiven<I extends IT = IT> {
|
|
|
326
327
|
export abstract class BaseWhen<I extends IT> {
|
|
327
328
|
public name: string;
|
|
328
329
|
whenCB: (x: I["iselection"]) => I["then"];
|
|
329
|
-
error:
|
|
330
|
+
error: Error;
|
|
330
331
|
|
|
331
332
|
constructor(name: string, whenCB: (xyz: I["iselection"]) => I["then"]) {
|
|
332
333
|
this.name = name;
|
|
@@ -341,9 +342,10 @@ export abstract class BaseWhen<I extends IT> {
|
|
|
341
342
|
): Promise<any>;
|
|
342
343
|
|
|
343
344
|
toObj() {
|
|
345
|
+
console.log("toObj error", this.error);
|
|
344
346
|
return {
|
|
345
347
|
name: this.name,
|
|
346
|
-
error: this.error,
|
|
348
|
+
error: this.error && this.error.name + this.error.stack,
|
|
347
349
|
};
|
|
348
350
|
}
|
|
349
351
|
|
|
@@ -361,9 +363,10 @@ export abstract class BaseWhen<I extends IT> {
|
|
|
361
363
|
this.whenCB,
|
|
362
364
|
testResourceConfiguration,
|
|
363
365
|
andWhenProxy(pm, filepath)
|
|
364
|
-
).catch((e) => {
|
|
365
|
-
|
|
366
|
-
|
|
366
|
+
).catch((e: Error) => {
|
|
367
|
+
console.log("MARK9", e);
|
|
368
|
+
this.error = e;
|
|
369
|
+
throw e;
|
|
367
370
|
});
|
|
368
371
|
}
|
|
369
372
|
}
|
package/src/lib/basebuilder.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-empty-object-type */
|
|
3
|
+
/* eslint-disable no-async-promise-executor */
|
|
4
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
1
5
|
import { PassThrough } from "stream";
|
|
2
6
|
|
|
3
7
|
import { IT, ITestSpecification, OT } from "../Types.js";
|
|
@@ -105,21 +109,18 @@ export abstract class BaseBuilder<
|
|
|
105
109
|
receiveTestResourceConfig: async function (
|
|
106
110
|
puppetMaster: IPM
|
|
107
111
|
): Promise<IFinalResults> {
|
|
108
|
-
const start = await puppetMaster.start();
|
|
109
|
-
|
|
110
112
|
const logFilePath = "log.txt";
|
|
111
113
|
const access: number = await puppetMaster.createWriteStream(
|
|
112
114
|
logFilePath
|
|
113
115
|
);
|
|
114
116
|
|
|
115
117
|
const tLog = async (...l: string[]) => {
|
|
116
|
-
const x = await puppetMaster.write(access, `${l.toString()}\n`);
|
|
117
118
|
// console.log("x", x);
|
|
118
119
|
};
|
|
119
120
|
|
|
120
121
|
const suiteDone: BaseSuite<I, O> = await runner(puppetMaster, tLog);
|
|
121
122
|
|
|
122
|
-
const logPromise = new Promise(async (res
|
|
123
|
+
const logPromise = new Promise(async (res) => {
|
|
123
124
|
await puppetMaster.end(access);
|
|
124
125
|
res(true);
|
|
125
126
|
});
|
package/src/lib/classBuilder.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
1
3
|
import { IT, ITestImplementation, ITestSpecification, OT } from "../Types.js";
|
|
2
4
|
|
|
3
5
|
import { BaseBuilder } from "./basebuilder.js";
|
|
@@ -27,7 +29,13 @@ export abstract class ClassBuilder<
|
|
|
27
29
|
IExtenstions
|
|
28
30
|
> {
|
|
29
31
|
constructor(
|
|
30
|
-
testImplementation: ITestImplementation<I, O, M
|
|
32
|
+
testImplementation: ITestImplementation<I, O, M> & {
|
|
33
|
+
suites: Record<string, any>;
|
|
34
|
+
givens: Record<string, any>;
|
|
35
|
+
whens: Record<string, any>;
|
|
36
|
+
thens: Record<string, any>;
|
|
37
|
+
checks: Record<string, any>;
|
|
38
|
+
},
|
|
31
39
|
testSpecification: ITestSpecification<I, O>,
|
|
32
40
|
input: I["iinput"],
|
|
33
41
|
suiteKlasser: ISuiteKlasser<I, O>,
|
|
@@ -54,15 +62,15 @@ export abstract class ClassBuilder<
|
|
|
54
62
|
|
|
55
63
|
const classyGivens = Object.entries(testImplementation.givens).reduce(
|
|
56
64
|
(a, [key, g]) => {
|
|
57
|
-
a[key] = (features, whens, thens) => {
|
|
65
|
+
a[key] = (features, whens, thens, ...initialValues) => {
|
|
58
66
|
// console.log("givEn", givEn.toString());
|
|
59
67
|
return new givenKlasser.prototype.constructor(
|
|
60
68
|
key,
|
|
61
69
|
features,
|
|
62
70
|
whens,
|
|
63
71
|
thens,
|
|
64
|
-
testImplementation.givens[key]
|
|
65
|
-
|
|
72
|
+
testImplementation.givens[key],
|
|
73
|
+
initialValues
|
|
66
74
|
);
|
|
67
75
|
};
|
|
68
76
|
return a;
|
|
@@ -83,23 +91,12 @@ export abstract class ClassBuilder<
|
|
|
83
91
|
{}
|
|
84
92
|
);
|
|
85
93
|
|
|
86
|
-
const classyThens = Object.entries(testImplementation.thens).reduce(
|
|
94
|
+
const classyThens = Object.entries<(expected: any, ...x: any[]) => any>(testImplementation.thens).reduce(
|
|
87
95
|
(a, [key, thEn]: [string, (s: I["iselection"]) => I["isubject"]]) => {
|
|
88
|
-
a[key] = (expected, x) => {
|
|
96
|
+
a[key] = (expected, ...x) => {
|
|
89
97
|
return new thenKlasser.prototype.constructor(
|
|
90
98
|
`${thEn.name}: ${expected && expected.toString()}`,
|
|
91
|
-
|
|
92
|
-
// thEn(expected);
|
|
93
|
-
// // return new Promise((res), rej) => {
|
|
94
|
-
|
|
95
|
-
// // }
|
|
96
|
-
// // try {
|
|
97
|
-
// // thEn(expected);
|
|
98
|
-
// // } catch (c) {
|
|
99
|
-
// // console.log("mark99");
|
|
100
|
-
// // }
|
|
101
|
-
// },
|
|
102
|
-
thEn(expected)
|
|
99
|
+
thEn(expected, ...x)
|
|
103
100
|
);
|
|
104
101
|
};
|
|
105
102
|
return a;
|
package/src/lib/core.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
1
2
|
import {
|
|
2
3
|
ITestSpecification,
|
|
3
4
|
ITestImplementation,
|
|
@@ -32,7 +33,13 @@ export default abstract class Testeranto<
|
|
|
32
33
|
constructor(
|
|
33
34
|
input: I["iinput"],
|
|
34
35
|
testSpecification: ITestSpecification<I, O>,
|
|
35
|
-
testImplementation: ITestImplementation<I, O, M
|
|
36
|
+
testImplementation: ITestImplementation<I, O, M> & {
|
|
37
|
+
suites: Record<string, any>;
|
|
38
|
+
givens: Record<string, any>;
|
|
39
|
+
whens: Record<string, any>;
|
|
40
|
+
thens: Record<string, any>;
|
|
41
|
+
checks: Record<string, any>;
|
|
42
|
+
},
|
|
36
43
|
testResourceRequirement: ITTestResourceRequest = defaultTestResourceRequirement,
|
|
37
44
|
testInterface: Partial<ITestInterface<I>>,
|
|
38
45
|
uberCatcher: (cb: () => void) => void
|
|
@@ -111,16 +118,22 @@ export default abstract class Testeranto<
|
|
|
111
118
|
|
|
112
119
|
class When extends BaseWhen<I> {
|
|
113
120
|
async andWhen(store, whenCB, testResource, pm) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
121
|
+
return await fullTestInterface.andWhen(
|
|
122
|
+
store,
|
|
123
|
+
whenCB,
|
|
124
|
+
testResource,
|
|
125
|
+
pm
|
|
126
|
+
);
|
|
127
|
+
// try {
|
|
128
|
+
// return await fullTestInterface.andWhen(
|
|
129
|
+
// store,
|
|
130
|
+
// whenCB,
|
|
131
|
+
// testResource,
|
|
132
|
+
// pm
|
|
133
|
+
// );
|
|
134
|
+
// } catch (e) {
|
|
135
|
+
// console.log("mark22", e);
|
|
136
|
+
// }
|
|
124
137
|
}
|
|
125
138
|
} as any,
|
|
126
139
|
|
package/src/lib/index.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
1
3
|
import { PM_Pure } from "../PM/pure.js";
|
|
2
4
|
|
|
3
5
|
import { PM_Node } from "../PM/node.js";
|
|
@@ -16,32 +18,44 @@ import {
|
|
|
16
18
|
import { IGivens, BaseCheck, BaseSuite } from "./abstractBase.js";
|
|
17
19
|
import { IPM } from "./types.js";
|
|
18
20
|
|
|
19
|
-
export const BaseTestInterface: ITestInterface<
|
|
20
|
-
beforeAll: async (s) => s,
|
|
21
|
+
export const BaseTestInterface = <T extends IT>(): ITestInterface<T> => ({
|
|
22
|
+
beforeAll: async (s: T["istore"]) => s,
|
|
21
23
|
beforeEach: async function (
|
|
22
|
-
subject:
|
|
23
|
-
initialValues:
|
|
24
|
-
x:
|
|
25
|
-
testResource:
|
|
24
|
+
subject: T["isubject"],
|
|
25
|
+
initialValues: T["iinitialValues"],
|
|
26
|
+
x: unknown,
|
|
27
|
+
testResource: ITTestResourceConfiguration,
|
|
26
28
|
pm: IPM
|
|
27
|
-
) {
|
|
28
|
-
return subject
|
|
29
|
+
): Promise<T["isubject"]> {
|
|
30
|
+
return subject;
|
|
29
31
|
},
|
|
30
|
-
afterEach: async (s) => s,
|
|
31
|
-
afterAll: (store:
|
|
32
|
+
afterEach: async (s: T["istore"]) => s,
|
|
33
|
+
afterAll: (store: T["istore"]) => undefined,
|
|
32
34
|
butThen: async (
|
|
33
35
|
store: IT["istore"],
|
|
34
36
|
thenCb: (s: IT["iselection"]) => Promise<IT["isubject"]>
|
|
35
37
|
) => {
|
|
36
38
|
return thenCb(store);
|
|
37
39
|
},
|
|
38
|
-
andWhen: async (
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
andWhen: async (
|
|
41
|
+
store: IT["istore"],
|
|
42
|
+
whenCB: IT["when"],
|
|
43
|
+
testResource: ITTestResourceConfiguration,
|
|
44
|
+
pm: IPM
|
|
45
|
+
) => {
|
|
46
|
+
try {
|
|
47
|
+
await whenCB(store, testResource, pm);
|
|
48
|
+
} catch (error) {
|
|
49
|
+
console.error("Error in andWhen:", error);
|
|
50
|
+
throw error; // Re-throw to maintain test failure
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
assertThis: (x: any) => x,
|
|
54
|
+
});
|
|
41
55
|
|
|
42
|
-
export const DefaultTestInterface = (
|
|
43
|
-
p: Partial<ITestInterface<
|
|
44
|
-
): ITestInterface<
|
|
56
|
+
export const DefaultTestInterface = <T extends IT>(
|
|
57
|
+
p: Partial<ITestInterface<T>>
|
|
58
|
+
): ITestInterface<T> => {
|
|
45
59
|
return {
|
|
46
60
|
...BaseTestInterface,
|
|
47
61
|
...p,
|
|
@@ -52,7 +66,10 @@ export type ITTestResourceConfiguration = {
|
|
|
52
66
|
name: string;
|
|
53
67
|
fs: string;
|
|
54
68
|
ports: number[];
|
|
55
|
-
browserWSEndpoint
|
|
69
|
+
browserWSEndpoint?: string;
|
|
70
|
+
timeout?: number;
|
|
71
|
+
retries?: number;
|
|
72
|
+
environment?: Record<string, string>;
|
|
56
73
|
};
|
|
57
74
|
|
|
58
75
|
export type ITTestResourceRequirement = {
|
|
@@ -112,8 +129,11 @@ export type { ITestconfig, IBuiltConfig, IRunTime, ITestTypes };
|
|
|
112
129
|
|
|
113
130
|
export type IRunnables = {
|
|
114
131
|
nodeEntryPoints: Record<string, string>;
|
|
132
|
+
nodeEntryPointSidecars: Record<string, string>;
|
|
115
133
|
webEntryPoints: Record<string, string>;
|
|
116
|
-
|
|
134
|
+
webEntryPointSidecars: Record<string, string>;
|
|
135
|
+
pureEntryPoints: Record<string, string>;
|
|
136
|
+
pureEntryPointSidecars: Record<string, string>;
|
|
117
137
|
};
|
|
118
138
|
|
|
119
139
|
export type IFinalResults = {
|
package/src/lib/pmProxy.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
1
3
|
import { IPM } from "./types";
|
|
2
4
|
|
|
3
5
|
const prxy = function (pm: IPM, mappings: [string, (...x) => any][]) {
|
|
@@ -8,7 +10,7 @@ const prxy = function (pm: IPM, mappings: [string, (...x) => any][]) {
|
|
|
8
10
|
const arger = mapping[1];
|
|
9
11
|
|
|
10
12
|
if (prop === method) {
|
|
11
|
-
return (x) => target[prop](arger(x));
|
|
13
|
+
return (...x) => target[prop](arger(...x));
|
|
12
14
|
}
|
|
13
15
|
}
|
|
14
16
|
|
package/src/lib/types.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
1
2
|
import { PM_Node } from "../PM/node";
|
|
2
3
|
import { PM_Pure } from "../PM/pure";
|
|
3
4
|
import { PM_Web } from "../PM/web";
|
|
4
|
-
import { IT, OT } from "../Types";
|
|
5
|
+
import type { IT, OT } from "../Types";
|
|
5
6
|
|
|
6
7
|
import {
|
|
7
8
|
IGivens,
|
|
@@ -14,11 +15,23 @@ import {
|
|
|
14
15
|
|
|
15
16
|
export type IPM = PM_Node | PM_Web | PM_Pure;
|
|
16
17
|
|
|
18
|
+
export type TestPhase = 'beforeAll' | 'beforeEach' | 'test' | 'afterEach' | 'afterAll';
|
|
19
|
+
|
|
20
|
+
export type TestError = {
|
|
21
|
+
phase: TestPhase;
|
|
22
|
+
error: Error;
|
|
23
|
+
testName: string;
|
|
24
|
+
timestamp: number;
|
|
25
|
+
stackTrace?: string;
|
|
26
|
+
additionalInfo?: Record<string, unknown>;
|
|
27
|
+
isRetryable?: boolean;
|
|
28
|
+
};
|
|
29
|
+
|
|
17
30
|
export type ITestCheckCallback<I extends IT, O extends OT> = {
|
|
18
31
|
[K in keyof O["checks"]]: (
|
|
19
32
|
name: string,
|
|
20
33
|
features: string[],
|
|
21
|
-
checkCallback: (store: I["istore"], pm: IPM) => Promise<
|
|
34
|
+
checkCallback: (store: I["istore"], pm: IPM) => Promise<O["checks"][K]>,
|
|
22
35
|
|
|
23
36
|
...xtrasA: O["checks"][K]
|
|
24
37
|
) => BaseCheck<I>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import express from "express";
|
|
2
|
+
|
|
3
|
+
const app = express();
|
|
4
|
+
|
|
5
|
+
app.get("/", (req, res) => {
|
|
6
|
+
res.send("Hello World!");
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export default (port: number) => {
|
|
10
|
+
app.listen(port, () => {
|
|
11
|
+
console.log(`Example app listening on port ${port}`);
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
return app;
|
|
15
|
+
};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
3
|
+
import { ITTestResourceConfiguration } from "../lib";
|
|
4
|
+
import { IPM } from "../lib/types";
|
|
5
|
+
import Testeranto from "../Node";
|
|
6
|
+
import { PM } from "../PM";
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
Ibdd_out,
|
|
10
|
+
ITestSpecification,
|
|
11
|
+
IT,
|
|
12
|
+
ITestImplementation,
|
|
13
|
+
Ibdd_in,
|
|
14
|
+
IPartialNodeInterface,
|
|
15
|
+
} from "../Types";
|
|
16
|
+
|
|
17
|
+
import appFactory from "./index";
|
|
18
|
+
|
|
19
|
+
import type { Express } from "express";
|
|
20
|
+
|
|
21
|
+
type I = Ibdd_in<
|
|
22
|
+
(port: number) => Express,
|
|
23
|
+
(port: number) => Express,
|
|
24
|
+
any,
|
|
25
|
+
any,
|
|
26
|
+
any,
|
|
27
|
+
any,
|
|
28
|
+
any
|
|
29
|
+
>;
|
|
30
|
+
|
|
31
|
+
type O = Ibdd_out<
|
|
32
|
+
{
|
|
33
|
+
TheMothership: [null];
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
ItIsRunning: [];
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
IClaimTheResource: [string];
|
|
40
|
+
IReleaseTheResource: [string];
|
|
41
|
+
IResetTheResource: [string];
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
TheResourceIsClaimed: [string];
|
|
45
|
+
TheResourceIsUnClaimed: [string];
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
AnEmptyState;
|
|
49
|
+
}
|
|
50
|
+
>;
|
|
51
|
+
|
|
52
|
+
const specification: ITestSpecification<IT, O> = (Suite, Given, When, Then) => {
|
|
53
|
+
console.log("Suite", Suite);
|
|
54
|
+
return [
|
|
55
|
+
Suite.TheMothership(
|
|
56
|
+
"the mothership allows the coordination of test resources",
|
|
57
|
+
{
|
|
58
|
+
test0: Given.ItIsRunning(
|
|
59
|
+
[`a resource can be claimed`],
|
|
60
|
+
[When.IClaimTheResource("test")],
|
|
61
|
+
[
|
|
62
|
+
// Then.TheResourceIsClaimed("test")
|
|
63
|
+
]
|
|
64
|
+
),
|
|
65
|
+
},
|
|
66
|
+
[]
|
|
67
|
+
),
|
|
68
|
+
];
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const implementation: ITestImplementation<I, O> = {
|
|
72
|
+
suites: { TheMothership: (x) => x },
|
|
73
|
+
givens: { ItIsRunning: () => undefined },
|
|
74
|
+
whens: {
|
|
75
|
+
IClaimTheResource: (resource) => async (i, tr, p) => {
|
|
76
|
+
fetch(`http://localhost:${tr.ports[0]}/claim?${resource}`);
|
|
77
|
+
},
|
|
78
|
+
IReleaseTheResource: function (
|
|
79
|
+
resource: string
|
|
80
|
+
): (zel, tr, utils) => Promise<any> {
|
|
81
|
+
throw new Error("Function not implemented.");
|
|
82
|
+
},
|
|
83
|
+
IResetTheResource: function (
|
|
84
|
+
Iw_0: string
|
|
85
|
+
): (zel: any, tr, utils: PM) => Promise<any> {
|
|
86
|
+
throw new Error("Function not implemented.");
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
thens: {
|
|
90
|
+
TheResourceIsClaimed: (resource) => async (z, u) => {
|
|
91
|
+
throw new Error("Function not implemented.");
|
|
92
|
+
},
|
|
93
|
+
TheResourceIsUnClaimed: function (
|
|
94
|
+
It_0: string
|
|
95
|
+
): (ssel: any, utils: PM) => any {
|
|
96
|
+
throw new Error("Function not implemented.");
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
checks: { AnEmptyState: () => "any" },
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const testInterface: IPartialNodeInterface<I> = {
|
|
103
|
+
// assertThis: function (x: any) {
|
|
104
|
+
// throw new Error("Function not implemented.");
|
|
105
|
+
// },
|
|
106
|
+
// andWhen: function (store: any, whenCB: any, testResource: ITTestResourceConfiguration, pm: IPM): Promise<any> {
|
|
107
|
+
// throw new Error("Function not implemented.");
|
|
108
|
+
// },
|
|
109
|
+
// butThen: function (store: any, thenCB: any, testResource: ITTestResourceConfiguration, pm: IPM): Promise<any> {
|
|
110
|
+
// throw new Error("Function not implemented.");
|
|
111
|
+
// },
|
|
112
|
+
// afterAll: function (store: any, pm: IPM) {
|
|
113
|
+
// throw new Error("Function not implemented.");
|
|
114
|
+
// },
|
|
115
|
+
// afterEach: function (store: any, key: string, pm: IPM): Promise<unknown> {
|
|
116
|
+
// throw new Error("Function not implemented.");
|
|
117
|
+
// },
|
|
118
|
+
// beforeAll: function (input: Express, testResource: ITTestResourceConfiguration, pm: IPM): Promise<any> {
|
|
119
|
+
// throw new Error("Function not implemented.");
|
|
120
|
+
// },
|
|
121
|
+
beforeEach: async (
|
|
122
|
+
subject,
|
|
123
|
+
initializer: (c?: any) => any,
|
|
124
|
+
testResource: ITTestResourceConfiguration,
|
|
125
|
+
initialValues: any,
|
|
126
|
+
pm: IPM
|
|
127
|
+
) => {
|
|
128
|
+
return subject(testResource.ports[0]);
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export default Testeranto(
|
|
133
|
+
appFactory,
|
|
134
|
+
specification,
|
|
135
|
+
implementation,
|
|
136
|
+
testInterface
|
|
137
|
+
);
|