testeranto 0.128.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 +560 -19
- 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 +488 -422
- 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 +489 -423
- 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 +696 -404
- 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 +617 -578
- 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
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# testeranto
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## The AI-powered BDD test framework for TypeScript projects
|
|
4
4
|
|
|
5
5
|
🚧 WARNING: Testeranto is still under development and is not ready for production yet. 🚧
|
|
6
6
|
|
|
@@ -12,9 +12,7 @@ npm: [npmjs.com/package/testeranto](https://www.npmjs.com/package/testeranto)
|
|
|
12
12
|
|
|
13
13
|
dev: [github.dev/adamwong246/testeranto](https://github.dev/adamwong246/testeranto)
|
|
14
14
|
|
|
15
|
-
example
|
|
16
|
-
|
|
17
|
-
example repo: [kokomo bay](https://github.com/ChromaPDX/kokomoBay)
|
|
15
|
+
example repo: [testeranto-starter](https://github.com/adamwong246/testeranto-starter)
|
|
18
16
|
|
|
19
17
|
## What is testeranto?
|
|
20
18
|
|
|
@@ -22,25 +20,568 @@ example repo: [kokomo bay](https://github.com/ChromaPDX/kokomoBay)
|
|
|
22
20
|
- Testeranto tests are specified in a strongly-typed gherkin-like syntax. Rather than testing your code directly, Testeranto requires you wrap your code with a semantic interface which is based on TS type signatures.
|
|
23
21
|
- Testeranto can be run in the frontend or the backend, or both.
|
|
24
22
|
- Testeranto can be used to test anything that can be bundled with esbuild.
|
|
25
|
-
- Testeranto
|
|
23
|
+
- Testeranto connects "features" to "tests". This allows the AI to read feature documentation from external systems, like Jira.
|
|
24
|
+
- Testeranto generates test results into static a website which can be deployed to github pages easily.
|
|
25
|
+
|
|
26
|
+
## Key Technologies
|
|
27
|
+
|
|
28
|
+
Testeranto builds on modern JavaScript/TypeScript tooling:
|
|
29
|
+
|
|
30
|
+
| Technology | Purpose |
|
|
31
|
+
| ---------- | -------------------------------------- |
|
|
32
|
+
| TypeScript | Strongly-typed test definitions |
|
|
33
|
+
| Puppeteer | Cross-runtime testing (Node & Browser) |
|
|
34
|
+
| esbuild | Fast test bundling |
|
|
35
|
+
| Aider.ai | AI-powered test fixing |
|
|
36
|
+
| ESLint | Static analysis of test files |
|
|
37
|
+
| tsc | Type checking of test files |
|
|
38
|
+
| Markdown | Feature documentation format |
|
|
39
|
+
|
|
40
|
+
## Quick Start
|
|
41
|
+
|
|
42
|
+
1. Install testeranto:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npm install testeranto
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
2. Create a test file (e.g., `rectangle.test.ts`):
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
import { Given, When, Then } from "testeranto";
|
|
52
|
+
|
|
53
|
+
type Rectangle = { width: number; height: number };
|
|
54
|
+
|
|
55
|
+
const RectangleSpec = (Suite, Given, When, Then) => [
|
|
56
|
+
Suite.Default("Rectangle tests", {
|
|
57
|
+
test1: Given.Default(
|
|
58
|
+
["Basic rectangle operations"],
|
|
59
|
+
[When.setWidth(5), When.setHeight(10)],
|
|
60
|
+
[Then.getWidth(5), Then.getHeight(10)]
|
|
61
|
+
),
|
|
62
|
+
}),
|
|
63
|
+
];
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
3. Run your tests in two separate terminals:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# Terminal 1 - Build in watch mode
|
|
70
|
+
yarn t-build rectangle.test.ts dev
|
|
71
|
+
|
|
72
|
+
# Terminal 2 - Run in watch mode
|
|
73
|
+
yarn t-run rectangle.test.ts dev
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Architecture Overview
|
|
77
|
+
|
|
78
|
+
```mermaid
|
|
79
|
+
flowchart TD
|
|
80
|
+
subgraph ThreePillars["Testeranto Core"]
|
|
81
|
+
Builder[Test Builder]
|
|
82
|
+
Runner[Test Runner]
|
|
83
|
+
Aider[AI Integration]
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
subgraph BuilderComponents[" "]
|
|
87
|
+
Specification[Specification]
|
|
88
|
+
Implementation[Implementation]
|
|
89
|
+
Interface[Interface]
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
subgraph Runtimes[" "]
|
|
93
|
+
Node[Node]
|
|
94
|
+
Web[Browser]
|
|
95
|
+
Pure[JS]
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
Builder --> Runner
|
|
99
|
+
Runner --> Aider
|
|
100
|
+
Aider --> Builder
|
|
101
|
+
|
|
102
|
+
Builder --> BuilderComponents
|
|
103
|
+
Runner --> Runtimes
|
|
104
|
+
|
|
105
|
+
style ThreePillars fill:none,stroke:#586e75
|
|
106
|
+
style Builder fill:#268bd2,stroke:#586e75,color:#fdf6e3
|
|
107
|
+
style Runner fill:#268bd2,stroke:#586e75,color:#fdf6e3
|
|
108
|
+
style Aider fill:#b58900,stroke:#586e75,color:#002b36
|
|
109
|
+
style BuilderComponents fill:#002b36,stroke:#586e75,color:#eee8d5
|
|
110
|
+
style Runtimes fill:#073642,stroke:#586e75,color:#eee8d5
|
|
111
|
+
style Specification fill:#2aa198,stroke:#586e75,color:#002b36
|
|
112
|
+
style Implementation fill:#2aa198,stroke:#586e75,color:#002b36
|
|
113
|
+
style Interface fill:#2aa198,stroke:#586e75,color:#002b36
|
|
114
|
+
style Node fill:#859900,stroke:#586e75,color:#002b36
|
|
115
|
+
style Web fill:#859900,stroke:#586e75,color:#002b36
|
|
116
|
+
style Pure fill:#859900,stroke:#586e75,color:#002b36
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Runtime Platforms
|
|
120
|
+
|
|
121
|
+
Testeranto runs tests in multiple runtime environments, each suited for different testing scenarios:
|
|
122
|
+
|
|
123
|
+
| Runtime | Description | When To Use | Key Characteristics |
|
|
124
|
+
| -------- | ------------------------------------------------- | ---------------------------------------------------------------------- | ------------------------------------------------------- |
|
|
125
|
+
| **Node** | Full IO access with Node.js built-in modules | Testing backend code, Node APIs, or anything needing filesystem access | Runs in Node v8 via fork, has access to fs, crypto, etc |
|
|
126
|
+
| **Web** | DOM API access with browser capabilities | Testing frontend code, UI interactions, or visual regression | Runs in Chrome page, can take screenshots/recordings |
|
|
127
|
+
| **Pure** | Isolated JS runtime without external dependencies | Fast unit tests that don't need external resources | Dynamically imported into main thread, no IO access |
|
|
128
|
+
|
|
129
|
+
**Key Considerations:**
|
|
130
|
+
|
|
131
|
+
- Use **Node** for testing backend services, file operations, or anything requiring Node.js APIs
|
|
132
|
+
- Use **Web** when testing browser-specific code that references `document` or `window`
|
|
133
|
+
- Use **Pure** for fast, isolated unit tests where you don't need console output or external resources
|
|
134
|
+
|
|
135
|
+
## CLI Commands
|
|
136
|
+
|
|
137
|
+
| Command | Description |
|
|
138
|
+
| ------------------------------------- | --------------------------------------------- |
|
|
139
|
+
| `yarn t-init` | Create a new testeranto project |
|
|
140
|
+
| `yarn t-build <YOUR_TESTS> dev\|once` | Build test bundles (watch or single-run mode) |
|
|
141
|
+
| `yarn t-run <YOUR_TESTS> dev\|once` | Run tests (watch or single-run mode) |
|
|
142
|
+
| `yarn t-report` | Launch test report server |
|
|
143
|
+
| `yarn t-aider` | Fix failing tests with AI |
|
|
144
|
+
|
|
145
|
+
Example workflow:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
# Initialize project
|
|
149
|
+
yarn t-init
|
|
150
|
+
|
|
151
|
+
# Write tests in test/*.test.ts
|
|
152
|
+
|
|
153
|
+
# In terminal 1 - Build tests (watch mode)
|
|
154
|
+
yarn t-build test/rectangle.test.ts dev
|
|
155
|
+
|
|
156
|
+
# In terminal 2 - Run tests (watch mode)
|
|
157
|
+
yarn t-run test/rectangle.test.ts dev
|
|
158
|
+
|
|
159
|
+
# Or for single-run mode:
|
|
160
|
+
yarn t-build test/rectangle.test.ts once
|
|
161
|
+
yarn t-run test/rectangle.test.ts once
|
|
162
|
+
|
|
163
|
+
# Get AI help with failures
|
|
164
|
+
yarn t-aider
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## AI
|
|
168
|
+
|
|
169
|
+
Testeranto generates a "prompt" alongside test results. This prompt is passed to aider as input.
|
|
170
|
+
|
|
171
|
+
```
|
|
172
|
+
// input src files which can be edited by aider
|
|
173
|
+
/add test/node.ts
|
|
174
|
+
|
|
175
|
+
// test report files that inform aider but should not be edited
|
|
176
|
+
/read testeranto/reports/allTests/node/test/node/tests.json
|
|
177
|
+
/read testeranto/reports/allTests/test/node/node/lint_errors.json
|
|
178
|
+
/read testeranto/reports/allTests/test/node/node/type_errors.txt
|
|
179
|
+
|
|
180
|
+
// A list of features which can inform aider.
|
|
181
|
+
/load testeranto/reports/allTests/node/test/node/featurePrompt.txt
|
|
182
|
+
|
|
183
|
+
// tell the AI what to do
|
|
184
|
+
/code Fix the failing tests described in testeranto/reports/allTests/node/test/node/tests.json. Correct any type signature errors described in the files testeranto/reports/allTests/test/node/node/type_errors.txt. Implement any method which throws "Function not implemented. Resolve the lint errors described in testeranto/reports/allTests/test/node/node/lint_errors.json"
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## "Features"
|
|
188
|
+
|
|
189
|
+
Testeranto connects "features" to tests. The features may be simple strings, but they can also take the form of local markdown files, or remote URLs to external feature tracking systems. For instance, this could be a jira ticket or a github issue. These features are used to inform the AI context.
|
|
190
|
+
|
|
191
|
+
```ts
|
|
192
|
+
import someMarkdownFile from "someMarkdownFile.md";
|
|
193
|
+
|
|
194
|
+
...
|
|
195
|
+
|
|
196
|
+
test0: Given.Default(
|
|
197
|
+
[
|
|
198
|
+
"https://api.github.com/repos/adamwong246/testeranto/issues/8",
|
|
199
|
+
"you can set the width and height of a Rectangle",
|
|
200
|
+
someMarkdownFile
|
|
201
|
+
],
|
|
202
|
+
|
|
203
|
+
[When.setWidth(4), When.setHeight(19)],
|
|
204
|
+
[Then.getWidth(4), Then.getHeight(19)]
|
|
205
|
+
),
|
|
206
|
+
...
|
|
207
|
+
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## Core Concepts
|
|
211
|
+
|
|
212
|
+
Testeranto's type system provides a rigorous framework for Behavior-Driven Development (BDD) testing. Let's break down the key components using a Rectangle class example.
|
|
213
|
+
|
|
214
|
+
### 1. Test Subject
|
|
215
|
+
|
|
216
|
+
First, define the class you want to test:
|
|
217
|
+
|
|
218
|
+
```typescript
|
|
219
|
+
class Rectangle {
|
|
220
|
+
constructor(public width: number, public height: number) {}
|
|
221
|
+
|
|
222
|
+
setWidth(w: number) {
|
|
223
|
+
this.width = w;
|
|
224
|
+
}
|
|
225
|
+
setHeight(h: number) {
|
|
226
|
+
this.height = h;
|
|
227
|
+
}
|
|
228
|
+
getArea() {
|
|
229
|
+
return this.width * this.height;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### 2. Test Interface Types
|
|
235
|
+
|
|
236
|
+
Testeranto uses a powerful type system to ensure your tests match your implementation:
|
|
237
|
+
|
|
238
|
+
```typescript
|
|
239
|
+
type IRectangle = Ibdd_in<
|
|
240
|
+
null, // No special initialization needed
|
|
241
|
+
null, // No special cleanup needed
|
|
242
|
+
Rectangle, // The test subject type
|
|
243
|
+
Rectangle, // State type between test steps
|
|
244
|
+
Rectangle, // Final state type
|
|
245
|
+
(n: number) => (r: Rectangle) => void, // When functions signature
|
|
246
|
+
(r: Rectangle) => number // Then functions signature
|
|
247
|
+
>;
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
This type definition ensures:
|
|
251
|
+
|
|
252
|
+
- Type safety throughout the test lifecycle
|
|
253
|
+
- Clear separation of test phases (setup, execution, verification)
|
|
254
|
+
- Proper function signatures for test steps
|
|
255
|
+
|
|
256
|
+
### 3. Test Specification
|
|
257
|
+
|
|
258
|
+
Define your BDD-style tests with full type checking:
|
|
259
|
+
|
|
260
|
+
```typescript
|
|
261
|
+
const RectangleSpec: ITestSpecification<IRectangle> = (
|
|
262
|
+
Suite,
|
|
263
|
+
Given,
|
|
264
|
+
When,
|
|
265
|
+
Then
|
|
266
|
+
) => [
|
|
267
|
+
Suite.Default("Rectangle Operations", {
|
|
268
|
+
// Test case 1: Basic dimension setting
|
|
269
|
+
basicDimensions: Given.Default(
|
|
270
|
+
["Validate basic rectangle operations"],
|
|
271
|
+
[When.setWidth(5), When.setHeight(10)], // Actions
|
|
272
|
+
[Then.getWidth(5), Then.getHeight(10)] // Assertions
|
|
273
|
+
),
|
|
274
|
+
|
|
275
|
+
// Test case 2: Area calculation
|
|
276
|
+
areaCalculation: Given.Default(
|
|
277
|
+
["Validate area calculation"],
|
|
278
|
+
[When.setWidth(3), When.setHeight(4)],
|
|
279
|
+
[(r) => r.getArea() === 12] // Custom assertion
|
|
280
|
+
),
|
|
281
|
+
}),
|
|
282
|
+
];
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
### Development Workflow
|
|
286
|
+
|
|
287
|
+
```mermaid
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
flowchart LR
|
|
293
|
+
|
|
294
|
+
subgraph hh["humans"]
|
|
295
|
+
direction LR
|
|
296
|
+
Human[🧑💻 ]
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
subgraph bb["AI"]
|
|
300
|
+
direction LR
|
|
301
|
+
Bot[🤖🧠 aider]
|
|
302
|
+
end
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
tests ---> L
|
|
306
|
+
subgraph tests
|
|
307
|
+
direction LR
|
|
308
|
+
A[Test Specification]
|
|
309
|
+
B[Test Interface]
|
|
310
|
+
C[Test Implementation]
|
|
311
|
+
K[application code]
|
|
312
|
+
end
|
|
313
|
+
|
|
314
|
+
subgraph buildSystem
|
|
315
|
+
direction TB
|
|
316
|
+
L["t-build"]
|
|
317
|
+
M[t-run]
|
|
318
|
+
L ---> M
|
|
319
|
+
|
|
320
|
+
M ---> N
|
|
321
|
+
M --->O
|
|
322
|
+
M --->P
|
|
323
|
+
N["BDD tests"]
|
|
324
|
+
O["Static analysis"]
|
|
325
|
+
P["Type checking"]
|
|
326
|
+
|
|
327
|
+
Q["reports"]
|
|
328
|
+
N ---> Q
|
|
329
|
+
O ---> Q
|
|
330
|
+
P ---> Q
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
end
|
|
335
|
+
|
|
336
|
+
Q ---> bb
|
|
337
|
+
|
|
338
|
+
buildSystem ---> bb
|
|
339
|
+
bb ---> tests
|
|
340
|
+
hh ---> tests
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
%% Styling
|
|
348
|
+
style Human fill:#268bd2,stroke:#586e75,color:#fdf6e3
|
|
349
|
+
style Bot fill:#d33682,stroke:#586e75,color:#fdf6e3
|
|
350
|
+
|
|
351
|
+
%% Layout tweaks
|
|
352
|
+
classDef column margin-right:20px
|
|
353
|
+
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
**Key Components:**
|
|
357
|
+
|
|
358
|
+
1. **Specification** - BDD test definitions (Given/When/Then)
|
|
359
|
+
2. **Implementation** - Concrete test logic and assertions
|
|
360
|
+
3. **Interface** - Test lifecycle hooks (before/after each)
|
|
361
|
+
|
|
362
|
+
**Rapid Development Loop:**
|
|
363
|
+
|
|
364
|
+
1. `t-build` continuously type-checks and bundles tests
|
|
365
|
+
2. `t-run` executes tests as they change
|
|
366
|
+
3. Aider analyzes failures and suggests fixes
|
|
367
|
+
4. Developer iterates based on feedback
|
|
368
|
+
|
|
369
|
+
The workflow creates a tight feedback loop where:
|
|
370
|
+
|
|
371
|
+
- Type errors are caught immediately during build
|
|
372
|
+
- Test failures trigger AI-assisted fixes
|
|
373
|
+
- Changes propagate instantly through the system
|
|
374
|
+
|
|
375
|
+
2. **Autocomplete** - IDE support for test steps
|
|
376
|
+
3. **Refactoring safety** - Changes to implementation trigger type errors in tests
|
|
377
|
+
4. **Documentation** - Types serve as living documentation
|
|
378
|
+
|
|
379
|
+
### The Testing Lifecycle
|
|
380
|
+
|
|
381
|
+
1. **Given** - Set up initial state
|
|
382
|
+
2. **When** - Perform actions on the subject
|
|
383
|
+
3. **Then** - Verify outcomes
|
|
384
|
+
4. **Check** - Imperative-style validations (optional)
|
|
385
|
+
|
|
386
|
+
Each phase is type-checked against your interface definition, ensuring tests remain valid as your code evolves.
|
|
387
|
+
|
|
388
|
+
```js
|
|
389
|
+
export default async <I extends IT, O extends OT, M>(
|
|
390
|
+
|
|
391
|
+
// the thing that is being tested.
|
|
392
|
+
input: I["iinput"],
|
|
393
|
+
|
|
394
|
+
testSpecification: ITestSpecification<I, O>,
|
|
395
|
+
testImplementation: ITestImplementation<I, O, M>,
|
|
396
|
+
testInterface: Partial<IWebTestInterface<I>>,
|
|
397
|
+
testResourceRequirement: ITTestResourceRequest = defaultTestResourceRequirement
|
|
398
|
+
) => {
|
|
399
|
+
|
|
400
|
+
// or WebTesteranto<I, O, M> or PureTesteranto<I, O, M>
|
|
401
|
+
return new NodeTesteranto<I, O, M>(
|
|
402
|
+
input,
|
|
403
|
+
testSpecification,
|
|
404
|
+
testImplementation,
|
|
405
|
+
testResourceRequirement,
|
|
406
|
+
testInterface
|
|
407
|
+
);
|
|
408
|
+
};
|
|
409
|
+
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
Practically speaking, for each thing you test, you will need to implement 3 types and 4 objects.
|
|
413
|
+
|
|
414
|
+
#### type I
|
|
415
|
+
|
|
416
|
+
this type describes the shape of the BDD test
|
|
417
|
+
|
|
418
|
+
```ts
|
|
419
|
+
export type I = Ibdd_in<
|
|
420
|
+
null,
|
|
421
|
+
null,
|
|
422
|
+
Rectangle,
|
|
423
|
+
Rectangle,
|
|
424
|
+
Rectangle,
|
|
425
|
+
(...x) => (rectangle: Rectangle, utils: IPM) => Rectangle,
|
|
426
|
+
(rectangle: Rectangle, utils: IPM) => Rectangle
|
|
427
|
+
>;
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
#### type O
|
|
431
|
+
|
|
432
|
+
this type describes the shape of the "interface"
|
|
433
|
+
|
|
434
|
+
```ts
|
|
435
|
+
export type O = Ibdd_out<
|
|
436
|
+
// Suite
|
|
437
|
+
{
|
|
438
|
+
Default: [string];
|
|
439
|
+
},
|
|
440
|
+
// "Given" are initial states
|
|
441
|
+
{
|
|
442
|
+
Default;
|
|
443
|
+
WidthOfOneAndHeightOfOne;
|
|
444
|
+
WidthAndHeightOf: [number, number];
|
|
445
|
+
},
|
|
446
|
+
// "Whens" are steps which change the state of the test subject
|
|
447
|
+
{
|
|
448
|
+
HeightIsPubliclySetTo: [number];
|
|
449
|
+
WidthIsPubliclySetTo: [number];
|
|
450
|
+
setWidth: [number];
|
|
451
|
+
setHeight: [number];
|
|
452
|
+
},
|
|
453
|
+
// "Thens" are steps which make assertions of the test subject
|
|
454
|
+
{
|
|
455
|
+
AreaPlusCircumference: [number];
|
|
456
|
+
circumference: [number];
|
|
457
|
+
getWidth: [number];
|
|
458
|
+
getHeight: [number];
|
|
459
|
+
area: [number];
|
|
460
|
+
prototype: [];
|
|
461
|
+
},
|
|
462
|
+
// "Checks" are similar to "Givens"
|
|
463
|
+
{
|
|
464
|
+
Default;
|
|
465
|
+
WidthOfOneAndHeightOfOne;
|
|
466
|
+
WidthAndHeightOf: [number, number];
|
|
467
|
+
}
|
|
468
|
+
>;
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
#### type M (optional)
|
|
472
|
+
|
|
473
|
+
this type describes the modifications to the shape of the "specification". It can be used to make your BDD tests DRYer but is not necessary
|
|
474
|
+
|
|
475
|
+
```ts
|
|
476
|
+
export type M = {
|
|
477
|
+
givens: {
|
|
478
|
+
[K in keyof O["givens"]]: (...Iw: O["givens"][K]) => Rectangle;
|
|
479
|
+
};
|
|
480
|
+
whens: {
|
|
481
|
+
[K in keyof O["whens"]]: (
|
|
482
|
+
...Iw: O["whens"][K]
|
|
483
|
+
) => (rectangle: Rectangle, utils: PM) => Rectangle;
|
|
484
|
+
};
|
|
485
|
+
thens: {
|
|
486
|
+
[K in keyof O["thens"]]: (
|
|
487
|
+
...Iw: O["thens"][K]
|
|
488
|
+
) => (rectangle: Rectangle, utils: PM) => Rectangle;
|
|
489
|
+
};
|
|
490
|
+
};
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
#### the "specification" aka ITestSpecification<I, O>
|
|
494
|
+
|
|
495
|
+
The test specification is the BDD tests logic. The specification implements BDD directives "Given", "When", and Then"
|
|
496
|
+
|
|
497
|
+
```ts
|
|
498
|
+
export const RectangleTesterantoBaseTestSpecification: ITestSpecification<
|
|
499
|
+
I,
|
|
500
|
+
O
|
|
501
|
+
> = (Suite, Given, When, Then, Check) => {
|
|
502
|
+
return [
|
|
503
|
+
Suite.Default(
|
|
504
|
+
"Testing the Rectangle class",
|
|
505
|
+
{
|
|
506
|
+
// A "given" is a strict BDD test. It starts with an initial state, then executes the "whens" which update the test subject, and then executes the "thens" as a assertions.
|
|
507
|
+
test0: Given.Default(
|
|
508
|
+
// a list of features
|
|
509
|
+
["https://api.github.com/repos/adamwong246/testeranto/issues/8"],
|
|
510
|
+
// a list of "whens"
|
|
511
|
+
[When.setWidth(4), When.setHeight(19)],
|
|
512
|
+
// a list of "thens"
|
|
513
|
+
[Then.getWidth(4), Then.getHeight(19)]
|
|
514
|
+
),
|
|
515
|
+
},
|
|
516
|
+
|
|
517
|
+
[
|
|
518
|
+
// a "check" is a less strict style of test. Instead of lists of whens and thens, you get a function callback.
|
|
519
|
+
Check.Default("imperative style?!", [], async (rectangle) => {
|
|
520
|
+
Then.getWidth(2).thenCB(rectangle);
|
|
521
|
+
Then.getHeight(2).thenCB(rectangle);
|
|
522
|
+
When.setHeight(22).whenCB(rectangle);
|
|
523
|
+
Then.getHeight(232).thenCB(rectangle);
|
|
524
|
+
}),
|
|
525
|
+
]
|
|
526
|
+
),
|
|
527
|
+
];
|
|
528
|
+
};
|
|
529
|
+
```
|
|
530
|
+
|
|
531
|
+
#### the "interface" aka testInterface: Partial<IWebTestInterface<I>>
|
|
532
|
+
|
|
533
|
+
The test interface is code which is NOT BDD steps. The interface implements "before all", "after all", "before each", and "after each", all of which are optional. f
|
|
534
|
+
|
|
535
|
+
```ts
|
|
536
|
+
export const RectangleTesterantoBaseInterface: IPartialInterface<I> = {
|
|
537
|
+
beforeEach: async (subject, i) => {
|
|
538
|
+
return i();
|
|
539
|
+
},
|
|
540
|
+
andWhen: async function (s, whenCB, tr, utils) {
|
|
541
|
+
return whenCB(s)(s, utils);
|
|
542
|
+
},
|
|
543
|
+
butThen: async (s, t, tr, pm) => {
|
|
544
|
+
return t(s, pm);
|
|
545
|
+
},
|
|
546
|
+
};
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
#### the "test resource requirement" aka ITTestResourceRequest (optional)
|
|
550
|
+
|
|
551
|
+
The test resource requirement describes things that the test needs to run, namely network ports. It is optional, but you should add this argument if your test needs to rely upon network ports
|
|
552
|
+
|
|
553
|
+
```ts
|
|
554
|
+
// TODO add example of test resource requirement
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
## Sidecars (COMING SOON)
|
|
558
|
+
|
|
559
|
+
Along side your test, you can include a number of "sidecars" which are other bundled javascript assets upon which your test depends. For example, suppose you have an app with a frontend and backend component. You could run a react test in the web and include the node http server as a sidecar.
|
|
560
|
+
|
|
561
|
+
## `eslint` and `tsc`
|
|
562
|
+
|
|
563
|
+
Alongside the bdd tests, testeranto runs eslint and tsc upon the input files to generate a list of static analysis errors and a list of type errors, respectively.
|
|
564
|
+
|
|
565
|
+
## Subprojects
|
|
566
|
+
|
|
567
|
+
Testeranto has a core repo, but there are also subprojects which implement tests by type and by technology
|
|
568
|
+
|
|
569
|
+
### testeranto-solidity
|
|
570
|
+
|
|
571
|
+
Test a solidity contract. Also included is an example of deploying a contrct to a ganache server.
|
|
572
|
+
|
|
573
|
+
### testeranto-reduxtoolkit
|
|
26
574
|
|
|
27
|
-
|
|
575
|
+
Test a redux store.
|
|
28
576
|
|
|
29
|
-
|
|
30
|
-
- typescript - tests are functions with type parameters
|
|
31
|
-
- puppeteer - provides access to both node and chrome runtimes
|
|
32
|
-
- esbuild - used to quickly generate test bundles
|
|
33
|
-
- aider - AI to automatically fix broken tests
|
|
577
|
+
### testeranto-http
|
|
34
578
|
|
|
35
|
-
|
|
579
|
+
Test a node http server.
|
|
36
580
|
|
|
37
|
-
|
|
581
|
+
### testeranto-react (COMING SOON)
|
|
38
582
|
|
|
39
|
-
|
|
583
|
+
Test a react component. You can choose from a variety of types (jsx functions, class style, etc) and you can test with `react`, `react-dom`, or `react-test-renderer`
|
|
40
584
|
|
|
41
|
-
|
|
585
|
+
### testeranto-express (COMING SOON)
|
|
42
586
|
|
|
43
|
-
|
|
44
|
-
2. Web - the test is run in chrome, in a page. If you code relies upon `window` or `document`, you should use this style.
|
|
45
|
-
3. Pure - the test is dynamically imported into the main thread. It will not have access to IO (console.log, etc) but it is more performant.
|
|
46
|
-
4. WebWorker - the test is tested in a web worker, in the browser, but not in a page.
|
|
587
|
+
### testeranto-xstate (COMING SOON)
|
package/bundle.js
CHANGED
|
@@ -2,11 +2,17 @@ import * as esbuild from 'esbuild'
|
|
|
2
2
|
|
|
3
3
|
await esbuild.build({
|
|
4
4
|
outExtension: { '.js': '.mjs' },
|
|
5
|
-
entryPoints: [
|
|
5
|
+
entryPoints: [
|
|
6
|
+
'src/build.ts',
|
|
7
|
+
'src/run.ts',
|
|
8
|
+
'src/init-docs.ts',
|
|
9
|
+
'src/ReportServer.ts',
|
|
10
|
+
'src/esbuildConfigs/eslint-formatter-testeranto.ts',
|
|
11
|
+
'src/mothership/index.ts'
|
|
12
|
+
],
|
|
6
13
|
bundle: true,
|
|
7
14
|
format: "esm",
|
|
8
15
|
platform: "node",
|
|
9
|
-
// outfile: 'dist/prebuild/cli.mjs'
|
|
10
16
|
outdir: 'dist/prebuild',
|
|
11
17
|
packages: "external",
|
|
12
18
|
supported: {
|
|
@@ -18,79 +24,6 @@ await esbuild.build({
|
|
|
18
24
|
},
|
|
19
25
|
})
|
|
20
26
|
|
|
21
|
-
// await esbuild.build({
|
|
22
|
-
// entryPoints: ['src/init-docs.ts'],
|
|
23
|
-
// bundle: true,
|
|
24
|
-
// format: "esm",
|
|
25
|
-
// platform: "node",
|
|
26
|
-
// // format: "node",
|
|
27
|
-
// outfile: 'dist/prebuild/init-docs.mjs',
|
|
28
|
-
// // external: ['crypto', 'os'],
|
|
29
|
-
// supported: {
|
|
30
|
-
// "dynamic-import": true,
|
|
31
|
-
// },
|
|
32
|
-
|
|
33
|
-
// banner: {
|
|
34
|
-
// js: `import { createRequire } from 'module';const require = createRequire(import.meta.url);`,
|
|
35
|
-
// },
|
|
36
|
-
// })
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
// await esbuild.build({
|
|
41
|
-
// entryPoints: ['src/cli2.ts'],
|
|
42
|
-
// bundle: true,
|
|
43
|
-
// format: "esm",
|
|
44
|
-
// platform: "node",
|
|
45
|
-
// outfile: 'dist/prebuild/cli2.mjs',
|
|
46
|
-
// packages: "external",
|
|
47
|
-
// supported: {
|
|
48
|
-
// "dynamic-import": true,
|
|
49
|
-
// },
|
|
50
|
-
|
|
51
|
-
// banner: {
|
|
52
|
-
// js: `import { createRequire } from 'module';const require = createRequire(import.meta.url);`,
|
|
53
|
-
// },
|
|
54
|
-
// })
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
// await esbuild.build({
|
|
60
|
-
// entryPoints: ['src/ReportServer.ts'],
|
|
61
|
-
// bundle: true,
|
|
62
|
-
// format: "esm",
|
|
63
|
-
// platform: "node",
|
|
64
|
-
// outfile: 'dist/prebuild/ReportServer.mjs',
|
|
65
|
-
// packages: "external",
|
|
66
|
-
// // supported: {
|
|
67
|
-
// // "dynamic-import": true,
|
|
68
|
-
// // },
|
|
69
|
-
|
|
70
|
-
// // banner: {
|
|
71
|
-
// // js: `import { createRequire } from 'module';const require = createRequire(import.meta.url);`,
|
|
72
|
-
// // },
|
|
73
|
-
// })
|
|
74
|
-
|
|
75
|
-
// await esbuild.build({
|
|
76
|
-
// entryPoints: ['src/esbuildConfigs/eslint-formatter-testeranto.ts'],
|
|
77
|
-
// bundle: true,
|
|
78
|
-
// format: "esm",
|
|
79
|
-
// platform: "node",
|
|
80
|
-
// outfile: 'dist/prebuild/eslint-formatter-testeranto.mjs',
|
|
81
|
-
// packages: "external",
|
|
82
|
-
// // supported: {
|
|
83
|
-
// // "dynamic-import": true,
|
|
84
|
-
// // },
|
|
85
|
-
|
|
86
|
-
// // banner: {
|
|
87
|
-
// // js: `import { createRequire } from 'module';const require = createRequire(import.meta.url);`,
|
|
88
|
-
// // },
|
|
89
|
-
// })
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
/////////////////////////
|
|
93
|
-
|
|
94
27
|
await esbuild.build({
|
|
95
28
|
entryPoints: ['src/ReportClient.tsx', 'src/TestReport.tsx', 'src/Project.tsx'],
|
|
96
29
|
bundle: true,
|