testeranto 0.129.0 → 0.135.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 +137798 -0
- package/.aider.input.history +370 -0
- package/.aider.tags.cache.v3/{ec/c0/161c249c35be853cc40cf11f9267.val → 62/f5/8af72140d93c58db2f6aa5bf3f1f.val} +0 -0
- package/.aider.tags.cache.v3/8e/ec/2d4659a1589a0187a757ab1cbefa.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/d8/b0/a8966fcd65890fd9f70d7afe8141.val +0 -0
- package/.aider.tags.cache.v3/dd/5b/0ade824b0841c7c11e9352c5d2ca.val +0 -0
- package/README.md +194 -182
- 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 +189 -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 +492 -428
- package/dist/common/src/PM/node.js +54 -22
- 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 +66 -12
- package/dist/common/src/defaultConfig.js +1 -0
- package/dist/common/src/esbuildConfigs/consoleDetectorPlugin.js +27 -0
- package/dist/common/src/esbuildConfigs/eslint-formatter-testeranto.js +16 -1
- package/dist/common/src/esbuildConfigs/node.js +2 -16
- package/dist/common/src/esbuildConfigs/pure.js +12 -12
- package/dist/common/src/esbuildConfigs/rebuildPlugin.js +22 -0
- package/dist/common/src/esbuildConfigs/web.js +12 -17
- package/dist/common/src/lib/Sidecar.js +6 -0
- package/dist/common/src/lib/abstractBase.js +13 -6
- package/dist/common/src/lib/basebuilder.js +1 -3
- package/dist/common/src/lib/classBuilder.js +6 -20
- 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 +182 -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 +493 -429
- package/dist/module/src/PM/node.js +54 -22
- 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 +66 -12
- package/dist/module/src/defaultConfig.js +1 -0
- package/dist/module/src/esbuildConfigs/consoleDetectorPlugin.js +24 -0
- package/dist/module/src/esbuildConfigs/eslint-formatter-testeranto.js +16 -1
- package/dist/module/src/esbuildConfigs/node.js +2 -16
- package/dist/module/src/esbuildConfigs/pure.js +12 -12
- package/dist/module/src/esbuildConfigs/rebuildPlugin.js +17 -0
- package/dist/module/src/esbuildConfigs/web.js +12 -17
- package/dist/module/src/lib/Sidecar.js +2 -0
- package/dist/module/src/lib/abstractBase.js +13 -6
- package/dist/module/src/lib/basebuilder.js +1 -3
- package/dist/module/src/lib/classBuilder.js +6 -20
- 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 +3287 -385
- package/dist/prebuild/ReportClient.js +0 -24638
- package/dist/prebuild/TestReport.js +26 -22
- package/dist/prebuild/build.mjs +192 -70
- package/dist/prebuild/esbuildConfigs/eslint-formatter-testeranto.mjs +14 -1
- package/dist/prebuild/init-docs.mjs +2 -5
- package/dist/prebuild/mothership/index.mjs +17 -0
- package/dist/prebuild/run.mjs +733 -433
- package/dist/types/src/CoreTypes.d.ts +51 -0
- package/dist/types/src/Node.d.ts +2 -2
- 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 +2 -0
- package/dist/types/src/PM/__tests__/pureSidecar.testeranto.d.ts +2 -0
- package/dist/types/src/PM/__tests__/webSidecar.testeranto.d.ts +2 -0
- package/dist/types/src/PM/base.d.ts +6 -5
- package/dist/types/src/PM/index.d.ts +6 -4
- 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/SP__Polygon.test.d.ts +1 -0
- package/dist/types/src/Types.d.ts +80 -58
- package/dist/types/src/Web.d.ts +1 -1
- package/dist/types/src/WebSidecar.d.ts +8 -0
- package/dist/types/src/esbuildConfigs/consoleDetectorPlugin.d.ts +2 -0
- package/dist/types/src/esbuildConfigs/rebuildPlugin.d.ts +6 -0
- package/dist/types/src/lib/Sidecar.d.ts +5 -0
- package/dist/types/src/lib/abstractBase.d.ts +6 -12
- package/dist/types/src/lib/classBuilder.d.ts +7 -1
- package/dist/types/src/lib/core.d.ts +8 -2
- 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 +2 -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/docs/index.md +277 -0
- package/package.json +23 -104
- package/src/CoreTypes.ts +171 -0
- package/src/Init.ts +6 -5
- package/src/Node.ts +32 -15
- package/src/NodeSidecar.ts +22 -0
- package/src/PM/PM_WithEslintAndTsc.ts +315 -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 +10 -4
- package/src/PM/main.ts +616 -589
- package/src/PM/node.ts +77 -33
- 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 +278 -157
- package/src/Web.ts +0 -3
- package/src/WebSidecar.ts +14 -0
- package/src/build.ts +104 -16
- package/src/defaultConfig.ts +1 -0
- package/src/esbuildConfigs/README.md +46 -0
- package/src/esbuildConfigs/consoleDetectorPlugin.ts +29 -0
- package/src/esbuildConfigs/eslint-formatter-testeranto.ts +17 -1
- package/src/esbuildConfigs/node.ts +2 -18
- package/src/esbuildConfigs/pure.ts +19 -14
- package/src/esbuildConfigs/rebuildPlugin.ts +23 -0
- package/src/esbuildConfigs/web.ts +15 -18
- package/src/lib/Sidecar.ts +6 -0
- package/src/lib/TEST_ADAPTER_RENAME.md +48 -0
- package/src/lib/abstractBase.ts +18 -10
- package/src/lib/basebuilder.ts +5 -4
- package/src/lib/classBuilder.ts +19 -21
- package/src/lib/core.ts +28 -19
- 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/common/src/{SubPackages/react-dom/jsx/index.js → CoreTypes.js} +0 -0
- /package/dist/module/src/{SubPackages/react-dom/jsx/index.js → CoreTypes.js} +0 -0
package/dist/module/src/build.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
1
3
|
import ansiC from "ansi-colors";
|
|
2
4
|
import fs from "fs";
|
|
3
5
|
import path from "path";
|
|
@@ -11,7 +13,7 @@ import { getRunnables } from "./utils.js";
|
|
|
11
13
|
readline.emitKeypressEvents(process.stdin);
|
|
12
14
|
if (process.stdin.isTTY)
|
|
13
15
|
process.stdin.setRawMode(true);
|
|
14
|
-
|
|
16
|
+
const testName = process.argv[2];
|
|
15
17
|
let mode = process.argv[3];
|
|
16
18
|
if (mode !== "once" && mode !== "dev") {
|
|
17
19
|
console.error(`The 4th argument should be 'dev' or 'once', not '${mode}'.`);
|
|
@@ -41,6 +43,19 @@ import(process.cwd() + "/" + "testeranto.config.ts").then(async (module) => {
|
|
|
41
43
|
};
|
|
42
44
|
return Array.from(meta(config.tests, new Set()));
|
|
43
45
|
};
|
|
46
|
+
const getSideCars = (runtime) => {
|
|
47
|
+
return Array.from(new Set(config.tests
|
|
48
|
+
.reduce((mm, t) => {
|
|
49
|
+
mm = mm.concat(t[3]);
|
|
50
|
+
return mm;
|
|
51
|
+
}, [])
|
|
52
|
+
.filter((t) => {
|
|
53
|
+
return t[1] === runtime;
|
|
54
|
+
})
|
|
55
|
+
.map((t) => {
|
|
56
|
+
return t[0];
|
|
57
|
+
})));
|
|
58
|
+
};
|
|
44
59
|
const config = Object.assign(Object.assign({}, rawConfig), { buildDir: process.cwd() + "/testeranto/bundles/" + testName });
|
|
45
60
|
console.log(`Press 'q' to shutdown gracefully. Press 'x' to shutdown forcefully.`);
|
|
46
61
|
process.stdin.on("keypress", (str, key) => {
|
|
@@ -61,7 +76,11 @@ import(process.cwd() + "/" + "testeranto.config.ts").then(async (module) => {
|
|
|
61
76
|
let webDone = false;
|
|
62
77
|
let importDone = false;
|
|
63
78
|
let status = "build";
|
|
64
|
-
const { nodeEntryPoints, webEntryPoints,
|
|
79
|
+
const { nodeEntryPoints, nodeEntryPointSidecars, webEntryPoints, webEntryPointSidecars, pureEntryPoints, pureEntryPointSidecars, } = getRunnables(config.tests, testName);
|
|
80
|
+
// const { nodeEntryPointsSidecars, webEntryPointsSidecars, importEntryPointsSideCars } = getRunnableSidecars(
|
|
81
|
+
// config.tests,
|
|
82
|
+
// testName
|
|
83
|
+
// );
|
|
65
84
|
const onNodeDone = () => {
|
|
66
85
|
nodeDone = true;
|
|
67
86
|
onDone();
|
|
@@ -83,6 +102,7 @@ import(process.cwd() + "/" + "testeranto.config.ts").then(async (module) => {
|
|
|
83
102
|
process.exit();
|
|
84
103
|
}
|
|
85
104
|
};
|
|
105
|
+
console.log(`testeranto/reports/${testName}`);
|
|
86
106
|
if (!fs.existsSync(`testeranto/reports/${testName}`)) {
|
|
87
107
|
fs.mkdirSync(`testeranto/reports/${testName}`);
|
|
88
108
|
}
|
|
@@ -121,13 +141,14 @@ import(process.cwd() + "/" + "testeranto.config.ts").then(async (module) => {
|
|
|
121
141
|
<title>${pckge.name} - testeranto</title>
|
|
122
142
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
123
143
|
<meta name="author" content="" />
|
|
144
|
+
<base href="https://adamwong246.github.io/spacetrash_v8" target="_blank">
|
|
124
145
|
|
|
125
146
|
<script type="application/json" id="bigConfig">
|
|
126
147
|
${JSON.stringify(Object.keys(bigConfig.projects))}
|
|
127
148
|
</script>
|
|
128
149
|
|
|
129
|
-
<link rel="stylesheet" href="Project.css" />
|
|
130
|
-
<script type="module" src="Project.js"></script>
|
|
150
|
+
<link rel="stylesheet" href="/reports/Project.css" />
|
|
151
|
+
<script type="module" src="/reports/Project.js"></script>
|
|
131
152
|
|
|
132
153
|
</head>
|
|
133
154
|
|
|
@@ -161,11 +182,24 @@ import(process.cwd() + "/" + "testeranto.config.ts").then(async (module) => {
|
|
|
161
182
|
// });
|
|
162
183
|
// });
|
|
163
184
|
const x = [
|
|
164
|
-
["pure", Object.keys(
|
|
185
|
+
["pure", Object.keys(pureEntryPoints)],
|
|
165
186
|
["node", Object.keys(nodeEntryPoints)],
|
|
166
187
|
["web", Object.keys(webEntryPoints)],
|
|
188
|
+
// [
|
|
189
|
+
// "pure",
|
|
190
|
+
// [...Object.keys(pureEntryPoints), ...Object.keys(pureEntryPointSidecars)],
|
|
191
|
+
// ],
|
|
192
|
+
// [
|
|
193
|
+
// "node",
|
|
194
|
+
// [...Object.keys(nodeEntryPoints), ...Object.keys(nodeEntryPointSidecars)],
|
|
195
|
+
// ],
|
|
196
|
+
// [
|
|
197
|
+
// "web",
|
|
198
|
+
// [...Object.keys(webEntryPoints), ...Object.keys(webEntryPointSidecars)],
|
|
199
|
+
// ],
|
|
167
200
|
];
|
|
168
201
|
x.forEach(async ([runtime, keys]) => {
|
|
202
|
+
console.log(runtime, keys);
|
|
169
203
|
keys.forEach(async (k) => {
|
|
170
204
|
const folder = `testeranto/reports/${testName}/${k
|
|
171
205
|
.split(".")
|
|
@@ -183,8 +217,8 @@ import(process.cwd() + "/" + "testeranto.config.ts").then(async (module) => {
|
|
|
183
217
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
184
218
|
<meta name="author" content="" />
|
|
185
219
|
|
|
186
|
-
<link rel="stylesheet" href="
|
|
187
|
-
<script src="
|
|
220
|
+
<link rel="stylesheet" href="../../../../../../TestReport.css" />
|
|
221
|
+
<script src="../../../../../../TestReport.js"></script>
|
|
188
222
|
|
|
189
223
|
</head>
|
|
190
224
|
|
|
@@ -194,14 +228,34 @@ import(process.cwd() + "/" + "testeranto.config.ts").then(async (module) => {
|
|
|
194
228
|
`);
|
|
195
229
|
});
|
|
196
230
|
});
|
|
231
|
+
[
|
|
232
|
+
[pureEntryPoints, pureEntryPointSidecars, "pure"],
|
|
233
|
+
[webEntryPoints, webEntryPointSidecars, "web"],
|
|
234
|
+
[nodeEntryPoints, nodeEntryPointSidecars, "node"],
|
|
235
|
+
].forEach(([eps, eps2, runtime]) => {
|
|
236
|
+
[...Object.keys(eps), ...Object.keys(eps2)].forEach((ep) => {
|
|
237
|
+
const fp = path.resolve(`testeranto`, `reports`, testName, ep.split(".").slice(0, -1).join("."), runtime);
|
|
238
|
+
fs.mkdirSync(fp, { recursive: true });
|
|
239
|
+
});
|
|
240
|
+
});
|
|
197
241
|
await Promise.all([
|
|
198
242
|
...[
|
|
199
|
-
[
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
243
|
+
[
|
|
244
|
+
esbuildImportConfiger,
|
|
245
|
+
pureEntryPoints,
|
|
246
|
+
pureEntryPointSidecars,
|
|
247
|
+
onImportDone,
|
|
248
|
+
],
|
|
249
|
+
[
|
|
250
|
+
esbuildNodeConfiger,
|
|
251
|
+
nodeEntryPoints,
|
|
252
|
+
nodeEntryPointSidecars,
|
|
253
|
+
onNodeDone,
|
|
254
|
+
],
|
|
255
|
+
[esbuildWebConfiger, webEntryPoints, webEntryPointSidecars, onWebDone],
|
|
256
|
+
].map(([configer, entryPoints, sidecars, done]) => {
|
|
203
257
|
esbuild
|
|
204
|
-
.context(configer(config, Object.keys(entryPoints), testName))
|
|
258
|
+
.context(configer(config, [...Object.keys(entryPoints), ...Object.keys(sidecars)], testName))
|
|
205
259
|
.then(async (ctx) => {
|
|
206
260
|
if (mode === "dev") {
|
|
207
261
|
await ctx.watch().then((v) => {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export const consoleDetectorPlugin = {
|
|
2
|
+
name: 'console-detector',
|
|
3
|
+
setup(build) {
|
|
4
|
+
build.onLoad({ filter: /\.(js|ts)$/ }, async (args) => {
|
|
5
|
+
const contents = await require('fs').promises.readFile(args.path, 'utf8');
|
|
6
|
+
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;
|
|
7
|
+
const matches = contents.match(consolePattern);
|
|
8
|
+
if (matches) {
|
|
9
|
+
const uniqueMethods = [...new Set(matches)];
|
|
10
|
+
return {
|
|
11
|
+
warnings: uniqueMethods.map(method => ({
|
|
12
|
+
text: `Detected ${method} call - Pure runtime does not allow IO operations. Use Node runtime instead.`,
|
|
13
|
+
location: {
|
|
14
|
+
file: args.path,
|
|
15
|
+
line: contents.split('\n').findIndex(line => line.includes(method)) + 1,
|
|
16
|
+
column: 0
|
|
17
|
+
}
|
|
18
|
+
}))
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
return null;
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
};
|
|
@@ -1,3 +1,18 @@
|
|
|
1
1
|
export default function (results) {
|
|
2
|
-
return
|
|
2
|
+
return results
|
|
3
|
+
.filter((r) => r.messages.length)
|
|
4
|
+
.map((r) => {
|
|
5
|
+
const path = r.filePath.replace(process.cwd() + "/", "");
|
|
6
|
+
return [
|
|
7
|
+
path,
|
|
8
|
+
...r.messages.map((m) => {
|
|
9
|
+
var _a;
|
|
10
|
+
return [
|
|
11
|
+
`${m.line}:${m.column} ${m.message} (${m.ruleId || ""})`,
|
|
12
|
+
...(((_a = m.suggestions) === null || _a === void 0 ? void 0 : _a.map((s) => `- ${s.message}${s.fix ? " (fix)" : ""}`)) || []),
|
|
13
|
+
].join("\n");
|
|
14
|
+
}),
|
|
15
|
+
].join("\n");
|
|
16
|
+
})
|
|
17
|
+
.join("\n\n");
|
|
3
18
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import baseEsBuildConfig from "./index.js";
|
|
2
2
|
import inputFilesPlugin from "./inputFilesPlugin.js";
|
|
3
3
|
import featuresPlugin from "./featuresPlugin";
|
|
4
|
+
import rebuildPlugin from "./rebuildPlugin.js";
|
|
4
5
|
export default (config, entryPoints, testName) => {
|
|
5
6
|
const { inputFilesPluginFactory, register } = inputFilesPlugin("node", testName);
|
|
6
7
|
return Object.assign(Object.assign({}, baseEsBuildConfig(config)), { splitting: true, outdir: `testeranto/bundles/node/${testName}/`,
|
|
@@ -14,22 +15,7 @@ export default (config, entryPoints, testName) => {
|
|
|
14
15
|
}, platform: "node", external: ["react", ...config.externals], entryPoints: [...entryPoints], plugins: [
|
|
15
16
|
featuresPlugin,
|
|
16
17
|
inputFilesPluginFactory,
|
|
17
|
-
|
|
18
|
-
name: "rebuild-notify",
|
|
19
|
-
setup: (build) => {
|
|
20
|
-
build.onStart(() => {
|
|
21
|
-
console.log(`> node build starting...`);
|
|
22
|
-
});
|
|
23
|
-
build.onEnd((result) => {
|
|
24
|
-
console.log(`> node build ended with ${result.errors.length} errors`);
|
|
25
|
-
if (result.errors.length > 0) {
|
|
26
|
-
console.log(result);
|
|
27
|
-
}
|
|
28
|
-
// console.log(result);
|
|
29
|
-
// result.errors.length !== 0 && process.exit(-1);
|
|
30
|
-
});
|
|
31
|
-
},
|
|
32
|
-
},
|
|
18
|
+
rebuildPlugin("node"),
|
|
33
19
|
...(config.nodePlugins.map((p) => p(register, entryPoints)) || []),
|
|
34
20
|
] });
|
|
35
21
|
};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import baseEsBuildConfig from "./index.js";
|
|
2
2
|
import inputFilesPlugin from "./inputFilesPlugin.js";
|
|
3
3
|
import featuresPlugin from "./featuresPlugin.js";
|
|
4
|
+
import { isBuiltin } from "node:module";
|
|
5
|
+
import { consoleDetectorPlugin } from "./consoleDetectorPlugin.js";
|
|
6
|
+
import rebuildPlugin from "./rebuildPlugin.js";
|
|
4
7
|
export default (config, entryPoints, testName) => {
|
|
5
8
|
const { inputFilesPluginFactory, register } = inputFilesPlugin("pure", testName);
|
|
6
|
-
return Object.assign(Object.assign({}, baseEsBuildConfig(config)), { drop: [
|
|
9
|
+
return Object.assign(Object.assign({}, baseEsBuildConfig(config)), { drop: [], splitting: true, outdir: `testeranto/bundles/pure/${testName}/`,
|
|
7
10
|
// inject: [`./node_modules/testeranto/dist/cjs-shim.js`],
|
|
8
11
|
metafile: true, supported: {
|
|
9
12
|
"dynamic-import": true,
|
|
@@ -14,22 +17,19 @@ export default (config, entryPoints, testName) => {
|
|
|
14
17
|
}, platform: "node", external: ["react", ...config.externals], entryPoints: [...entryPoints], plugins: [
|
|
15
18
|
featuresPlugin,
|
|
16
19
|
inputFilesPluginFactory,
|
|
20
|
+
consoleDetectorPlugin,
|
|
17
21
|
{
|
|
18
|
-
name: "
|
|
19
|
-
setup
|
|
20
|
-
build.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
build.onEnd((result) => {
|
|
24
|
-
console.log(`> pure build ended with ${result.errors.length} errors`);
|
|
25
|
-
if (result.errors.length > 0) {
|
|
26
|
-
console.log(result);
|
|
22
|
+
name: "native-node-import-filter",
|
|
23
|
+
setup(build) {
|
|
24
|
+
build.onResolve({ filter: /fs/ }, (args) => {
|
|
25
|
+
if (isBuiltin(args.path)) {
|
|
26
|
+
throw new Error(`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"`);
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
// result.errors.length !== 0 && process.exit(-1);
|
|
28
|
+
return { path: args.path };
|
|
30
29
|
});
|
|
31
30
|
},
|
|
32
31
|
},
|
|
32
|
+
rebuildPlugin("pure"),
|
|
33
33
|
...((config.nodePlugins || []).map((p) => p(register, entryPoints)) ||
|
|
34
34
|
[]),
|
|
35
35
|
] });
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
export default (r) => {
|
|
3
|
+
return {
|
|
4
|
+
name: "rebuild-notify",
|
|
5
|
+
setup: (build) => {
|
|
6
|
+
build.onStart(() => {
|
|
7
|
+
console.log(`> web build starting...`);
|
|
8
|
+
});
|
|
9
|
+
build.onEnd((result) => {
|
|
10
|
+
console.log(`> web build ended with ${result.errors.length} errors`);
|
|
11
|
+
if (result.errors.length > 0) {
|
|
12
|
+
fs.writeFileSync(`./testeranto/reports${r}_build_errors`, JSON.stringify(result, null, 2));
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import { polyfillNode } from "esbuild-plugin-polyfill-node";
|
|
1
2
|
import path from "path";
|
|
2
3
|
import baseEsBuildConfig from "./index.js";
|
|
3
4
|
import inputFilesPlugin from "./inputFilesPlugin.js";
|
|
4
5
|
import featuresPlugin from "./featuresPlugin.js";
|
|
6
|
+
import rebuildPlugin from "./rebuildPlugin.js";
|
|
5
7
|
export default (config, entryPoints, testName) => {
|
|
6
8
|
const { inputFilesPluginFactory, register } = inputFilesPlugin("web", testName);
|
|
7
|
-
return Object.assign(Object.assign({}, baseEsBuildConfig(config)), { outdir: `testeranto/bundles/web/${testName}`, alias: {
|
|
9
|
+
return Object.assign(Object.assign({}, baseEsBuildConfig(config)), { treeShaking: true, outdir: `testeranto/bundles/web/${testName}`, alias: {
|
|
8
10
|
react: path.resolve("./node_modules/react"),
|
|
9
11
|
}, metafile: true, external: [
|
|
10
12
|
"path",
|
|
@@ -27,22 +29,15 @@ export default (config, entryPoints, testName) => {
|
|
|
27
29
|
], platform: "browser", entryPoints: [...entryPoints], plugins: [
|
|
28
30
|
featuresPlugin,
|
|
29
31
|
inputFilesPluginFactory,
|
|
30
|
-
{
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
console.log(result);
|
|
40
|
-
}
|
|
41
|
-
// console.log(result);
|
|
42
|
-
// result.errors.length !== 0 && process.exit(-1);
|
|
43
|
-
});
|
|
44
|
-
},
|
|
45
|
-
},
|
|
32
|
+
polyfillNode({
|
|
33
|
+
// You might need to configure specific Node.js modules you want to polyfill
|
|
34
|
+
// Example:
|
|
35
|
+
// modules: {
|
|
36
|
+
// 'util': true,
|
|
37
|
+
// 'fs': false,
|
|
38
|
+
// }
|
|
39
|
+
}),
|
|
40
|
+
rebuildPlugin("web"),
|
|
46
41
|
...((config.webPlugins || []).map((p) => p(register, entryPoints)) || []),
|
|
47
42
|
] });
|
|
48
43
|
};
|
|
@@ -54,7 +54,7 @@ export class BaseSuite {
|
|
|
54
54
|
catch (e) {
|
|
55
55
|
this.failed = true;
|
|
56
56
|
this.fails = this.fails + 1;
|
|
57
|
-
|
|
57
|
+
console.error(e);
|
|
58
58
|
// this.fails.push(giver);
|
|
59
59
|
// return this;
|
|
60
60
|
}
|
|
@@ -101,7 +101,12 @@ export class BaseGiven {
|
|
|
101
101
|
return {
|
|
102
102
|
key: this.key,
|
|
103
103
|
name: this.name,
|
|
104
|
-
whens: this.whens.map((w) =>
|
|
104
|
+
whens: this.whens.map((w) => {
|
|
105
|
+
if (w && w.toObj)
|
|
106
|
+
return w.toObj();
|
|
107
|
+
console.error("w is not as expected!", w);
|
|
108
|
+
return {};
|
|
109
|
+
}),
|
|
105
110
|
thens: this.thens.map((t) => t.toObj()),
|
|
106
111
|
error: this.error ? [this.error, this.error.stack] : null,
|
|
107
112
|
failed: this.failed,
|
|
@@ -136,7 +141,7 @@ export class BaseGiven {
|
|
|
136
141
|
}
|
|
137
142
|
for (const [thenNdx, thenStep] of this.thens.entries()) {
|
|
138
143
|
const t = await thenStep.test(this.store, testResourceConfiguration, tLog, pm, `suite-${suiteNdx}/given-${key}/then-${thenNdx}`);
|
|
139
|
-
|
|
144
|
+
tester(t);
|
|
140
145
|
// ((t) => {
|
|
141
146
|
// return tester(t);
|
|
142
147
|
// })();
|
|
@@ -167,16 +172,18 @@ export class BaseWhen {
|
|
|
167
172
|
this.whenCB = whenCB;
|
|
168
173
|
}
|
|
169
174
|
toObj() {
|
|
175
|
+
console.log("toObj error", this.error);
|
|
170
176
|
return {
|
|
171
177
|
name: this.name,
|
|
172
|
-
error: this.error,
|
|
178
|
+
error: this.error && this.error.name + this.error.stack,
|
|
173
179
|
};
|
|
174
180
|
}
|
|
175
181
|
async test(store, testResourceConfiguration, tLog, pm, filepath) {
|
|
176
182
|
tLog(" When:", this.name);
|
|
177
183
|
return await this.andWhen(store, this.whenCB, testResourceConfiguration, andWhenProxy(pm, filepath)).catch((e) => {
|
|
178
|
-
|
|
179
|
-
|
|
184
|
+
console.log("MARK9", e);
|
|
185
|
+
this.error = e;
|
|
186
|
+
throw e;
|
|
180
187
|
});
|
|
181
188
|
}
|
|
182
189
|
}
|
|
@@ -25,15 +25,13 @@ export class BaseBuilder {
|
|
|
25
25
|
},
|
|
26
26
|
runner,
|
|
27
27
|
receiveTestResourceConfig: async function (puppetMaster) {
|
|
28
|
-
const start = await puppetMaster.start();
|
|
29
28
|
const logFilePath = "log.txt";
|
|
30
29
|
const access = await puppetMaster.createWriteStream(logFilePath);
|
|
31
30
|
const tLog = async (...l) => {
|
|
32
|
-
const x = await puppetMaster.write(access, `${l.toString()}\n`);
|
|
33
31
|
// console.log("x", x);
|
|
34
32
|
};
|
|
35
33
|
const suiteDone = await runner(puppetMaster, tLog);
|
|
36
|
-
const logPromise = new Promise(async (res
|
|
34
|
+
const logPromise = new Promise(async (res) => {
|
|
37
35
|
await puppetMaster.end(access);
|
|
38
36
|
res(true);
|
|
39
37
|
});
|
|
@@ -8,34 +8,20 @@ export class ClassBuilder extends BaseBuilder {
|
|
|
8
8
|
return a;
|
|
9
9
|
}, {});
|
|
10
10
|
const classyGivens = Object.entries(testImplementation.givens).reduce((a, [key, g]) => {
|
|
11
|
-
a[key] = (features, whens, thens) => {
|
|
12
|
-
|
|
13
|
-
return new givenKlasser.prototype.constructor(key, features, whens, thens, testImplementation.givens[key]
|
|
14
|
-
// givEn
|
|
15
|
-
);
|
|
11
|
+
a[key] = (features, whens, thens, ...initialValues) => {
|
|
12
|
+
return new givenKlasser.prototype.constructor(key, features, whens, thens, testImplementation.givens[key], initialValues);
|
|
16
13
|
};
|
|
17
14
|
return a;
|
|
18
15
|
}, {});
|
|
19
16
|
const classyWhens = Object.entries(testImplementation.whens).reduce((a, [key, whEn]) => {
|
|
20
|
-
a[key] = (payload) => {
|
|
21
|
-
return new whenKlasser.prototype.constructor(`${whEn.name}: ${payload && payload.toString()}`, whEn(payload));
|
|
17
|
+
a[key] = (...payload) => {
|
|
18
|
+
return new whenKlasser.prototype.constructor(`${whEn.name}: ${payload && payload.toString()}`, whEn(...payload));
|
|
22
19
|
};
|
|
23
20
|
return a;
|
|
24
21
|
}, {});
|
|
25
22
|
const classyThens = Object.entries(testImplementation.thens).reduce((a, [key, thEn]) => {
|
|
26
|
-
a[key] = (expected, x) => {
|
|
27
|
-
return new thenKlasser.prototype.constructor(`${thEn.name}: ${expected && expected.toString()}`,
|
|
28
|
-
// () => {
|
|
29
|
-
// thEn(expected);
|
|
30
|
-
// // return new Promise((res), rej) => {
|
|
31
|
-
// // }
|
|
32
|
-
// // try {
|
|
33
|
-
// // thEn(expected);
|
|
34
|
-
// // } catch (c) {
|
|
35
|
-
// // console.log("mark99");
|
|
36
|
-
// // }
|
|
37
|
-
// },
|
|
38
|
-
thEn(expected));
|
|
23
|
+
a[key] = (expected, ...x) => {
|
|
24
|
+
return new thenKlasser.prototype.constructor(`${thEn.name}: ${expected && expected.toString()}`, thEn(expected, ...x));
|
|
39
25
|
};
|
|
40
26
|
return a;
|
|
41
27
|
}, {});
|
|
@@ -30,12 +30,17 @@ export default class Testeranto extends ClassBuilder {
|
|
|
30
30
|
}
|
|
31
31
|
}, class When extends BaseWhen {
|
|
32
32
|
async andWhen(store, whenCB, testResource, pm) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
return await fullTestInterface.andWhen(store, whenCB, testResource, pm);
|
|
34
|
+
// try {
|
|
35
|
+
// return await fullTestInterface.andWhen(
|
|
36
|
+
// store,
|
|
37
|
+
// whenCB,
|
|
38
|
+
// testResource,
|
|
39
|
+
// pm
|
|
40
|
+
// );
|
|
41
|
+
// } catch (e) {
|
|
42
|
+
// console.log("mark22", e);
|
|
43
|
+
// }
|
|
39
44
|
}
|
|
40
45
|
}, class Then extends BaseThen {
|
|
41
46
|
async butThen(store, thenCB, testResource, pm) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const BaseTestInterface = {
|
|
1
|
+
export const BaseTestInterface = () => ({
|
|
2
2
|
beforeAll: async (s) => s,
|
|
3
3
|
beforeEach: async function (subject, initialValues, x, testResource, pm) {
|
|
4
4
|
return subject;
|
|
@@ -8,9 +8,17 @@ export const BaseTestInterface = {
|
|
|
8
8
|
butThen: async (store, thenCb) => {
|
|
9
9
|
return thenCb(store);
|
|
10
10
|
},
|
|
11
|
-
andWhen: async (
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
andWhen: async (store, whenCB, testResource, pm) => {
|
|
12
|
+
try {
|
|
13
|
+
await whenCB(store, testResource, pm);
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
console.error("Error in andWhen:", error);
|
|
17
|
+
throw error; // Re-throw to maintain test failure
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
assertThis: (x) => x,
|
|
21
|
+
});
|
|
14
22
|
export const DefaultTestInterface = (p) => {
|
|
15
23
|
return Object.assign(Object.assign({}, BaseTestInterface), p);
|
|
16
24
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import express from "express";
|
|
2
|
+
const app = express();
|
|
3
|
+
app.get("/", (req, res) => {
|
|
4
|
+
res.send("Hello World!");
|
|
5
|
+
});
|
|
6
|
+
export default (port) => {
|
|
7
|
+
app.listen(port, () => {
|
|
8
|
+
console.log(`Example app listening on port ${port}`);
|
|
9
|
+
});
|
|
10
|
+
return app;
|
|
11
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import Testeranto from "../Node";
|
|
2
|
+
import appFactory from "./index";
|
|
3
|
+
const specification = (Suite, Given, When, Then) => {
|
|
4
|
+
console.log("Suite", Suite);
|
|
5
|
+
return [
|
|
6
|
+
Suite.TheMothership("the mothership allows the coordination of test resources", {
|
|
7
|
+
test0: Given.ItIsRunning([`a resource can be claimed`], [When.IClaimTheResource("test")], [
|
|
8
|
+
// Then.TheResourceIsClaimed("test")
|
|
9
|
+
]),
|
|
10
|
+
}, []),
|
|
11
|
+
];
|
|
12
|
+
};
|
|
13
|
+
const implementation = {
|
|
14
|
+
suites: { TheMothership: (x) => x },
|
|
15
|
+
givens: { ItIsRunning: () => undefined },
|
|
16
|
+
whens: {
|
|
17
|
+
IClaimTheResource: (resource) => async (i, tr, p) => {
|
|
18
|
+
fetch(`http://localhost:${tr.ports[0]}/claim?${resource}`);
|
|
19
|
+
},
|
|
20
|
+
IReleaseTheResource: function (resource) {
|
|
21
|
+
throw new Error("Function not implemented.");
|
|
22
|
+
},
|
|
23
|
+
IResetTheResource: function (Iw_0) {
|
|
24
|
+
throw new Error("Function not implemented.");
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
thens: {
|
|
28
|
+
TheResourceIsClaimed: (resource) => async (z, u) => {
|
|
29
|
+
throw new Error("Function not implemented.");
|
|
30
|
+
},
|
|
31
|
+
TheResourceIsUnClaimed: function (It_0) {
|
|
32
|
+
throw new Error("Function not implemented.");
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
checks: { AnEmptyState: () => "any" },
|
|
36
|
+
};
|
|
37
|
+
const testInterface = {
|
|
38
|
+
// assertThis: function (x: any) {
|
|
39
|
+
// throw new Error("Function not implemented.");
|
|
40
|
+
// },
|
|
41
|
+
// andWhen: function (store: any, whenCB: any, testResource: ITTestResourceConfiguration, pm: IPM): Promise<any> {
|
|
42
|
+
// throw new Error("Function not implemented.");
|
|
43
|
+
// },
|
|
44
|
+
// butThen: function (store: any, thenCB: any, testResource: ITTestResourceConfiguration, pm: IPM): Promise<any> {
|
|
45
|
+
// throw new Error("Function not implemented.");
|
|
46
|
+
// },
|
|
47
|
+
// afterAll: function (store: any, pm: IPM) {
|
|
48
|
+
// throw new Error("Function not implemented.");
|
|
49
|
+
// },
|
|
50
|
+
// afterEach: function (store: any, key: string, pm: IPM): Promise<unknown> {
|
|
51
|
+
// throw new Error("Function not implemented.");
|
|
52
|
+
// },
|
|
53
|
+
// beforeAll: function (input: Express, testResource: ITTestResourceConfiguration, pm: IPM): Promise<any> {
|
|
54
|
+
// throw new Error("Function not implemented.");
|
|
55
|
+
// },
|
|
56
|
+
beforeEach: async (subject, initializer, testResource, initialValues, pm) => {
|
|
57
|
+
return subject(testResource.ports[0]);
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
export default Testeranto(appFactory, specification, implementation, testInterface);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export class Queue {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.items = [];
|
|
4
|
+
}
|
|
5
|
+
enqueue(element) {
|
|
6
|
+
this.items.push(element);
|
|
7
|
+
}
|
|
8
|
+
dequeue() {
|
|
9
|
+
if (this.isEmpty()) {
|
|
10
|
+
return "Queue is empty";
|
|
11
|
+
}
|
|
12
|
+
return this.items.shift();
|
|
13
|
+
}
|
|
14
|
+
peek() {
|
|
15
|
+
if (this.isEmpty()) {
|
|
16
|
+
return "Queue is empty";
|
|
17
|
+
}
|
|
18
|
+
return this.items[0];
|
|
19
|
+
}
|
|
20
|
+
isEmpty() {
|
|
21
|
+
return this.items.length === 0;
|
|
22
|
+
}
|
|
23
|
+
size() {
|
|
24
|
+
return this.items.length;
|
|
25
|
+
}
|
|
26
|
+
clear() {
|
|
27
|
+
this.items = [];
|
|
28
|
+
}
|
|
29
|
+
print() {
|
|
30
|
+
console.log(this.items.join(" -> "));
|
|
31
|
+
}
|
|
32
|
+
}
|