testeranto 0.74.0 → 0.79.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/.eslintrc.js +5 -2
- package/Bundle.Dockerfile +52 -0
- package/README.md +25 -24
- package/build-tests.ts +16 -0
- package/dist/common/build-tests.js +38 -0
- package/dist/common/init-docs.js +8 -0
- package/dist/common/run-tests.js +34 -0
- package/dist/common/src/Aider.js +96 -0
- package/dist/common/src/Init.js +10 -0
- package/dist/common/{Node.js → src/Node.js} +1 -0
- package/dist/common/src/PM/index.js +7 -0
- package/dist/common/{PM → src/PM}/main.js +287 -10
- package/dist/common/{PM → src/PM}/node.js +4 -0
- package/dist/common/{PM → src/PM}/web.js +3 -0
- package/dist/common/{Project.js → src/Project.js} +15 -57
- package/dist/common/{Puppeteer.js → src/Puppeteer.js} +65 -26
- package/dist/common/{SubPackages → src/SubPackages}/react-dom/component/web.js +5 -25
- package/dist/common/src/SubPackages/react-dom/jsx/web.js +117 -0
- package/dist/common/{SubPackages/react-test-renderer/component/index.js → src/SubPackages/react-test-renderer/component/interface.js} +0 -20
- package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/component/node.js +2 -2
- package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/component/web.js +2 -2
- package/dist/common/{Types.js → src/Types.js} +0 -2
- package/dist/common/{esbuildConfigs → src/esbuildConfigs}/index.js +1 -0
- package/dist/common/src/esbuildConfigs/inputFilesPlugin.js +52 -0
- package/dist/common/{esbuildConfigs → src/esbuildConfigs}/node.js +5 -1
- package/dist/common/src/esbuildConfigs/report.js +14 -0
- package/dist/common/{esbuildConfigs → src/esbuildConfigs}/web.js +3 -1
- package/dist/common/src/lib/abstractBase.js +581 -0
- package/dist/common/{lib → src/lib}/basebuilder.js +12 -38
- package/dist/common/{lib → src/lib}/classBuilder.js +1 -3
- package/dist/common/{lib → src/lib}/core.js +3 -5
- package/dist/common/src/lib/types.js +2 -0
- package/dist/common/src/utils.js +16 -0
- package/dist/common/testeranto.js +15 -0
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/build-tests.js +10 -0
- package/dist/module/init-docs.js +3 -0
- package/dist/module/run-tests.js +6 -0
- package/dist/module/src/Aider.js +89 -0
- package/dist/module/src/Init.js +5 -0
- package/dist/module/{Node.js → src/Node.js} +1 -0
- package/dist/module/src/PM/index.js +3 -0
- package/dist/module/src/PM/main.js +617 -0
- package/dist/module/{PM → src/PM}/node.js +4 -0
- package/dist/module/{PM → src/PM}/web.js +3 -0
- package/dist/module/{Project.js → src/Project.js} +15 -57
- package/dist/module/{Puppeteer.js → src/Puppeteer.js} +65 -26
- package/dist/module/{SubPackages → src/SubPackages}/react-dom/component/web.js +5 -25
- package/dist/module/src/SubPackages/react-dom/jsx/web.js +89 -0
- package/dist/module/{SubPackages/react-test-renderer/component/index.js → src/SubPackages/react-test-renderer/component/interface.js} +0 -20
- package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/component/node.js +1 -1
- package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/component/web.js +1 -1
- package/dist/module/{esbuildConfigs → src/esbuildConfigs}/index.js +1 -0
- package/dist/module/src/esbuildConfigs/inputFilesPlugin.js +47 -0
- package/dist/module/{esbuildConfigs → src/esbuildConfigs}/node.js +5 -1
- package/dist/module/src/esbuildConfigs/report.js +14 -0
- package/dist/module/{esbuildConfigs → src/esbuildConfigs}/web.js +3 -1
- package/dist/module/src/lib/abstractBase.js +573 -0
- package/dist/module/{lib → src/lib}/basebuilder.js +12 -38
- package/dist/module/{lib → src/lib}/classBuilder.js +1 -3
- package/dist/module/{lib → src/lib}/core.js +3 -5
- package/dist/module/src/utils.js +9 -0
- package/dist/module/testeranto.js +13 -0
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/build-tests.d.ts +3 -0
- package/dist/types/init-docs.d.ts +2 -0
- package/dist/types/run-tests.d.ts +2 -0
- package/dist/types/src/Aider.d.ts +1 -0
- package/dist/types/src/Init.d.ts +2 -0
- package/dist/types/src/Node.d.ts +6 -0
- package/dist/types/{PM → src/PM}/index.d.ts +3 -2
- package/dist/types/{PM → src/PM}/main.d.ts +8 -3
- package/dist/types/{PM → src/PM}/node.d.ts +2 -0
- package/dist/types/{PM → src/PM}/web.d.ts +1 -0
- package/dist/types/{Project.d.ts → src/Project.d.ts} +1 -1
- package/dist/types/src/Puppeteer.d.ts +2 -0
- package/dist/types/src/SubPackages/puppeteer.d.ts +6 -0
- package/dist/types/{SubPackages → src/SubPackages}/react/component/node.d.ts +1 -1
- package/dist/types/{SubPackages → src/SubPackages}/react/component/web.d.ts +1 -1
- package/dist/types/src/SubPackages/react/jsx/node.d.ts +4 -0
- package/dist/types/src/SubPackages/react/jsx/web.d.ts +4 -0
- package/dist/types/{SubPackages → src/SubPackages}/react-dom/component/node.d.ts +2 -2
- package/dist/types/src/SubPackages/react-dom/component/web.d.ts +11 -0
- package/dist/types/src/SubPackages/react-dom/jsx/node.d.ts +6 -0
- package/dist/types/src/SubPackages/react-dom/jsx/web.d.ts +5 -0
- package/dist/types/src/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +5 -0
- package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/component/index.d.ts +0 -7
- package/dist/types/src/SubPackages/react-test-renderer/component/interface.d.ts +9 -0
- package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/component/node.d.ts +1 -2
- package/dist/types/src/SubPackages/react-test-renderer/component/web.d.ts +3 -0
- package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/fc/node.d.ts +1 -1
- package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/fc/web.d.ts +1 -1
- package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx/node.d.ts +1 -2
- package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx/web.d.ts +1 -2
- package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/node.d.ts +4 -0
- package/dist/types/src/SubPackages/react-test-renderer/jsx-promised/web.d.ts +4 -0
- package/dist/types/src/Types.d.ts +51 -0
- package/dist/types/src/Web.d.ts +6 -0
- package/dist/types/src/esbuildConfigs/inputFilesPlugin.d.ts +5 -0
- package/dist/types/{lib → src/lib}/abstractBase.d.ts +8 -8
- package/dist/types/{lib → src/lib}/basebuilder.d.ts +1 -1
- package/dist/types/{lib → src/lib}/classBuilder.d.ts +1 -1
- package/dist/types/{lib → src/lib}/core.d.ts +1 -1
- package/dist/types/{lib → src/lib}/index.d.ts +5 -5
- package/dist/types/{lib → src/lib}/types.d.ts +15 -15
- package/dist/types/src/utils.d.ts +2 -0
- package/dist/types/testeranto.d.ts +16 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/docker-compose.yml +37 -0
- package/init-docs.ts +5 -0
- package/package.json +72 -25
- package/run-tests.ts +9 -0
- package/src/Aider.ts +125 -0
- package/src/Init.ts +20 -0
- package/src/Node.ts +31 -2
- package/src/PM/index.ts +7 -84
- package/src/PM/main.ts +400 -16
- package/src/PM/node.ts +6 -0
- package/src/PM/web.ts +4 -0
- package/src/Project.ts +33 -84
- package/src/Puppeteer.ts +115 -62
- package/src/SubPackages/react-dom/component/web.ts +10 -30
- package/src/SubPackages/react-dom/jsx/web.ts +110 -76
- package/src/SubPackages/react-test-renderer/component/index.ts +0 -66
- package/src/SubPackages/react-test-renderer/component/interface.ts +48 -0
- package/src/SubPackages/react-test-renderer/component/node.ts +2 -1
- package/src/SubPackages/react-test-renderer/component/web.ts +2 -1
- package/src/Types.ts +138 -29
- package/src/Web.ts +32 -2
- package/src/esbuildConfigs/index.ts +1 -0
- package/src/esbuildConfigs/inputFilesPlugin.ts +67 -0
- package/src/esbuildConfigs/node.ts +4 -2
- package/src/esbuildConfigs/report.ts +13 -13
- package/src/esbuildConfigs/web.ts +4 -0
- package/src/lib/abstractBase.ts +366 -36
- package/src/lib/basebuilder.ts +26 -52
- package/src/lib/classBuilder.ts +14 -2
- package/src/lib/core.ts +18 -7
- package/src/lib/index.ts +115 -7
- package/src/lib/types.ts +143 -37
- package/src/utils.ts +15 -0
- package/testeranto.ts +13 -0
- package/tsconfig.common.json +12 -4
- package/tsconfig.json +9 -3
- package/tsconfig.module.json +2 -3
- package/tsconfig.types.json +1 -2
- package/dist/common/Features.js +0 -84
- package/dist/common/PM/index.js +0 -71
- package/dist/common/Reporter.js +0 -119
- package/dist/common/Scheduler.js +0 -1
- package/dist/common/SubPackages/react-dom/jsx/web.js +0 -93
- package/dist/common/esbuildConfigs/report.js +0 -13
- package/dist/common/lib/abstractBase.js +0 -348
- package/dist/common/preload.js +0 -15
- package/dist/common/report.html.js +0 -31
- package/dist/module/Features.js +0 -73
- package/dist/module/PM/index.js +0 -67
- package/dist/module/PM/main.js +0 -340
- package/dist/module/Reporter.js +0 -114
- package/dist/module/Scheduler.js +0 -1
- package/dist/module/SubPackages/react-dom/jsx/web.js +0 -65
- package/dist/module/Types.js +0 -3
- package/dist/module/esbuildConfigs/report.js +0 -11
- package/dist/module/lib/abstractBase.js +0 -340
- package/dist/module/preload.js +0 -15
- package/dist/module/report.html.js +0 -29
- package/dist/prebuild/Report.css +0 -11358
- package/dist/prebuild/Report.js +0 -37585
- package/dist/types/Features.d.ts +0 -68
- package/dist/types/Node.d.ts +0 -6
- package/dist/types/SubPackages/puppeteer.d.ts +0 -6
- package/dist/types/SubPackages/react/jsx/node.d.ts +0 -4
- package/dist/types/SubPackages/react/jsx/web.d.ts +0 -4
- package/dist/types/SubPackages/react-dom/component/web.d.ts +0 -5
- package/dist/types/SubPackages/react-dom/jsx/node.d.ts +0 -6
- package/dist/types/SubPackages/react-dom/jsx/web.d.ts +0 -5
- package/dist/types/SubPackages/react-test-renderer/MemoExoticComponent/node.d.ts +0 -5
- package/dist/types/SubPackages/react-test-renderer/component/web.d.ts +0 -4
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/node.d.ts +0 -5
- package/dist/types/SubPackages/react-test-renderer/jsx-promised/web.d.ts +0 -5
- package/dist/types/Types.d.ts +0 -50
- package/dist/types/Web.d.ts +0 -6
- package/dist/types/esbuildConfigs/report.d.ts +0 -4
- package/dist/types/preload.d.ts +0 -0
- package/dist/types/report.html.d.ts +0 -2
- package/electronBuild.ts +0 -32
- package/src/Features.ts +0 -118
- package/src/Report.tsx +0 -521
- package/src/Reporter.ts +0 -134
- package/src/Scheduler.ts +0 -0
- package/src/preload.ts +0 -17
- package/src/report.html.ts +0 -29
- package/tests/Rectangle.test.ts +0 -189
- /package/dist/common/{SubPackages → src/SubPackages}/puppeteer.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react/component/node.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react/component/web.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react/jsx/index.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react/jsx/node.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react/jsx/web.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-dom/component/node.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-dom/jsx/index.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-dom/jsx/node.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/MemoExoticComponent/node.js +0 -0
- /package/dist/common/{lib/types.js → src/SubPackages/react-test-renderer/component/index.js} +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/fc/node.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/fc/web.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx/index.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx/node.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx/web.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/index.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/node.js +0 -0
- /package/dist/common/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/web.js +0 -0
- /package/dist/common/{Web.js → src/Web.js} +0 -0
- /package/dist/common/{esbuildConfigs → src/esbuildConfigs}/features.js +0 -0
- /package/dist/common/{esbuildConfigs → src/esbuildConfigs}/tests.js +0 -0
- /package/dist/common/{lib → src/lib}/index.js +0 -0
- /package/dist/common/{puppeteerConfiger.js → src/puppeteerConfiger.js} +0 -0
- /package/dist/common/{web.html.js → src/web.html.js} +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/puppeteer.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react/component/node.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react/component/web.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react/jsx/index.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react/jsx/node.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react/jsx/web.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-dom/component/node.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-dom/jsx/index.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-dom/jsx/node.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/MemoExoticComponent/node.js +0 -0
- /package/dist/module/{lib/types.js → src/SubPackages/react-test-renderer/component/index.js} +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/fc/node.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/fc/web.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx/index.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx/node.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx/web.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/index.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/node.js +0 -0
- /package/dist/module/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/web.js +0 -0
- /package/dist/{types/Puppeteer.d.ts → module/src/Types.js} +0 -0
- /package/dist/module/{Web.js → src/Web.js} +0 -0
- /package/dist/module/{esbuildConfigs → src/esbuildConfigs}/features.js +0 -0
- /package/dist/module/{esbuildConfigs → src/esbuildConfigs}/tests.js +0 -0
- /package/dist/module/{lib → src/lib}/index.js +0 -0
- /package/dist/{types/Reporter.d.ts → module/src/lib/types.js} +0 -0
- /package/dist/module/{puppeteerConfiger.js → src/puppeteerConfiger.js} +0 -0
- /package/dist/module/{web.html.js → src/web.html.js} +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react/jsx/index.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-dom/jsx/index.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx/index.d.ts +0 -0
- /package/dist/types/{SubPackages → src/SubPackages}/react-test-renderer/jsx-promised/index.d.ts +0 -0
- /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/features.d.ts +0 -0
- /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/index.d.ts +0 -0
- /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/node.d.ts +0 -0
- /package/dist/types/{Scheduler.d.ts → src/esbuildConfigs/report.d.ts} +0 -0
- /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/tests.d.ts +0 -0
- /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/web.d.ts +0 -0
- /package/dist/types/{puppeteerConfiger.d.ts → src/puppeteerConfiger.d.ts} +0 -0
- /package/dist/types/{web.html.d.ts → src/web.html.d.ts} +0 -0
package/.eslintrc.js
CHANGED
|
@@ -17,12 +17,15 @@ module.exports = {
|
|
|
17
17
|
},
|
|
18
18
|
"plugins": [
|
|
19
19
|
"react",
|
|
20
|
-
"@typescript-eslint"
|
|
20
|
+
"@typescript-eslint",
|
|
21
|
+
"react-hooks"
|
|
21
22
|
],
|
|
22
23
|
"rules": {
|
|
23
24
|
"@typescript-eslint/ban-ts-comment": "warn",
|
|
24
25
|
"prefer-const": "warn",
|
|
25
|
-
"@typescript-eslint/no-unused-vars": "warn"
|
|
26
|
+
"@typescript-eslint/no-unused-vars": "warn",
|
|
27
|
+
"react-hooks/rules-of-hooks": "error", // Checks rules of Hooks
|
|
28
|
+
"react-hooks/exhaustive-deps": "warn" // Checks effect dependencies
|
|
26
29
|
}
|
|
27
30
|
}
|
|
28
31
|
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
FROM node:18.18.0
|
|
2
|
+
RUN apt-get update && \
|
|
3
|
+
apt-get install -y --no-install-recommends \
|
|
4
|
+
python3 \
|
|
5
|
+
make \
|
|
6
|
+
g++ && \
|
|
7
|
+
rm -rf /var/lib/apt/lists/*
|
|
8
|
+
# FROM shivjm/node-chromium:node18-chromium81-alpine
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
RUN yarn global add node-gyp
|
|
13
|
+
|
|
14
|
+
RUN mkdir -p /usr/src/app
|
|
15
|
+
RUN mkdir -p /usr/src/app/docs
|
|
16
|
+
WORKDIR /usr/src/app
|
|
17
|
+
COPY package.json /usr/src/app
|
|
18
|
+
RUN yarn install
|
|
19
|
+
COPY ./src/ /usr/src/app/src
|
|
20
|
+
COPY ./subPackages/ /usr/src/app/subPackages
|
|
21
|
+
COPY ./testeranto.mts /usr/src/app/testeranto.mts
|
|
22
|
+
COPY ./tsconfig.json /usr/src/app/tsconfig.json
|
|
23
|
+
COPY ./init.mts /usr/src/app/init.mts
|
|
24
|
+
COPY ./bundle.mts /usr/src/app/bundle.mts
|
|
25
|
+
COPY ./test.mts /usr/src/app/test.mts
|
|
26
|
+
|
|
27
|
+
RUN yarn run init
|
|
28
|
+
|
|
29
|
+
RUN apt-get update && apt-get install -y chromium
|
|
30
|
+
RUN /usr/bin/chromium --no-sandbox --version > /etc/chromium-version
|
|
31
|
+
|
|
32
|
+
ENV CHROMIUM_PATH=/usr/bin/chromium
|
|
33
|
+
RUN yarn bundle
|
|
34
|
+
# COPY ./docs/ /usr/src/app/docs
|
|
35
|
+
# # COPY ./testeranto.json /usr/src/app/testeranto.json
|
|
36
|
+
# # COPY prebuild.sh /usr/src/app
|
|
37
|
+
# # COPY postBuild.sh /usr/src/app
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
# # RUN yarn build
|
|
41
|
+
|
|
42
|
+
# RUN cp ./node_modules/testeranto/dist/prebuild/TaskManBackEnd.mjs /usr/src/app/TaskManBackEnd.mjs
|
|
43
|
+
# RUN cp ./node_modules/testeranto/dist/prebuild/TaskManFrontEnd.js /usr/src/app/TaskManFrontEnd.js
|
|
44
|
+
# RUN cp ./node_modules/testeranto/dist/prebuild/TaskManFrontEnd.css /usr/src/app/TaskManFrontEnd.css
|
|
45
|
+
|
|
46
|
+
# # RUN ts-node-esm ./node_modules/testeranto/dist/prebuild/TaskManBackEnd.mjs
|
|
47
|
+
|
|
48
|
+
# EXPOSE 3000
|
|
49
|
+
# EXPOSE 27017
|
|
50
|
+
# ENV MONGO_HOST=host.docker.internal
|
|
51
|
+
# # # CMD ['yarn', 'testeranto-testrun', '&', 'yarn', 'testeranto-taskman']
|
|
52
|
+
CMD ["yarn", "test"]
|
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ If so, then testeranto might be the testing tool you have been looking for!
|
|
|
22
22
|
|
|
23
23
|
## about
|
|
24
24
|
|
|
25
|
-
Testeranto.ts an Acceptance Test Driven Development ([ATDD](https://en.wikipedia.org/wiki/Acceptance_test-driven_development)) framework. It
|
|
25
|
+
Testeranto.ts an typescript Acceptance Test Driven Development ([ATDD](https://en.wikipedia.org/wiki/Acceptance_test-driven_development)) framework. It includes a library of common patterns to help write your tests, a test runner to schedule the tests and a reporter to display the results. The tests are specified in a strongly-typed gherkin-like syntax. Features are tracked _as code_, rather than living in a separate app. Tests can be run in the browser frontend or the node backend, or both! Testeranto can be used to test _anything_ that can be bundled with esbuild.
|
|
26
26
|
|
|
27
27
|
## Getting started
|
|
28
28
|
|
|
@@ -45,11 +45,11 @@ Testeranto.ts an Acceptance Test Driven Development ([ATDD](https://en.wikipedia
|
|
|
45
45
|
|
|
46
46
|
## 3 distinguishing features of testeranto
|
|
47
47
|
|
|
48
|
-
1. Rather than testing your code directly, Testeranto requires you wrap your code with a semantic interface which is based on TS type signatures. These interfaces can be shared and your code is
|
|
48
|
+
1. Rather than testing your code directly, Testeranto requires you wrap your code with a semantic interface which is based on TS type signatures. These interfaces can be shared and your code is tested through the gherkin-ish directives provided by that interface.
|
|
49
49
|
|
|
50
|
-
2. Testeranto tracks features and
|
|
50
|
+
2. Testeranto tracks features and tests results directly in the source code. You may be accustomed to using tools like Jira and Trello to define user stories and assign story points. Using Testeranto, this data lives within the code base _as_ typescript code. Features are defined as nodes within a directed graph, allowing the reporter to summarize these features and their test results.
|
|
51
51
|
|
|
52
|
-
3. Testeranto is designed for both the backend and the frontend. It leverages
|
|
52
|
+
3. Testeranto is designed for both the backend and the frontend. It leverages puppeteer to provide both of these runtimes. Each of your tests can be executed in the backend node runtime, within the frontend chromium browser runtime, or both.
|
|
53
53
|
|
|
54
54
|
## the good parts
|
|
55
55
|
|
|
@@ -65,11 +65,11 @@ Rather than the traditional method of specifying tests in plain text, Testeranto
|
|
|
65
65
|
|
|
66
66
|
## the bad parts
|
|
67
67
|
|
|
68
|
-
Testeranto is not designed to maximize performance.
|
|
68
|
+
Testeranto is very flexible and unopinionated, but not designed to maximize performance.
|
|
69
69
|
|
|
70
|
-
Testeranto does not (yet!)
|
|
70
|
+
Testeranto does not (yet!) allow a means of allowing non-coders to affect changes so, as they say, "git good 💪!"
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
Testeranto uses ONLY node v8 and chromium. It does not support bun or deno, nor firefox nor safari.
|
|
73
73
|
|
|
74
74
|
## How it works
|
|
75
75
|
|
|
@@ -81,14 +81,30 @@ Testeranto is comprised of 3 parts
|
|
|
81
81
|
- Build the node-style tests
|
|
82
82
|
- Build the web-style tests
|
|
83
83
|
|
|
84
|
-
2. The test runner watches the output of those build processes and launches the tests as those files change.
|
|
84
|
+
2. The test runner watches the output of those build processes and launches the tests as those files change. It uses puppeteer to run web tests in chromium. It uses dynamic loading to import the node tests directly into the node v8 process.
|
|
85
|
+
|
|
85
86
|
3. A Report which links your features, your tests and the results of those tests into a handy website.
|
|
86
87
|
|
|
88
|
+
## CLI
|
|
89
|
+
|
|
90
|
+
There are 3 commands you should add to your `package.json`
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
// build the tests once
|
|
94
|
+
"testeranto-esbuild": "ts-node-esm testeranto.mts",
|
|
95
|
+
|
|
96
|
+
// build the tests, watching for changes
|
|
97
|
+
"testeranto-esbuild-dev": "ts-node-esm testeranto.mts",
|
|
98
|
+
|
|
99
|
+
// run the tests
|
|
100
|
+
"testeranto-puppeteer":"ts-node-esm node_modules/testeranto/dist/module/Puppeteer.js",
|
|
101
|
+
```
|
|
102
|
+
|
|
87
103
|
## Hybrid tests
|
|
88
104
|
|
|
89
105
|
Consider the a scenario: You have an http server which serves a frontend react component. You have multiple ways you can test this.
|
|
90
106
|
|
|
91
|
-
- A node test of the logic of the http server
|
|
107
|
+
- A node test of the logic of the http server.
|
|
92
108
|
- A node test of the full http server, tested over http request.
|
|
93
109
|
- A node test of the react component with react-test-render
|
|
94
110
|
- A web test of the react component rendering it to the dom.
|
|
@@ -112,18 +128,3 @@ This is designed so that each piece can be worked upon separately. You can think
|
|
|
112
128
|
- "Product Manager" handles the "specification"
|
|
113
129
|
- "Middle Engineer" handles the "interface"
|
|
114
130
|
- "Junior Engineer" handles the "implementation"
|
|
115
|
-
|
|
116
|
-
## CLI
|
|
117
|
-
|
|
118
|
-
There are 3 commands you should add to your `package.json`
|
|
119
|
-
|
|
120
|
-
```
|
|
121
|
-
// build the tests once
|
|
122
|
-
"testeranto-esbuild": "ts-node-esm testeranto.mts",
|
|
123
|
-
|
|
124
|
-
// build the tests, watching for changes
|
|
125
|
-
"testeranto-esbuild-dev": "ts-node-esm testeranto.mts",
|
|
126
|
-
|
|
127
|
-
// run the tests
|
|
128
|
-
"testeranto-puppeteer":"ts-node-esm node_modules/testeranto/dist/module/Puppeteer.js",
|
|
129
|
-
```
|
package/build-tests.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// import { ITProject } from "./src/Project.js";
|
|
2
|
+
|
|
3
|
+
// import Project from "./testeranto.js";
|
|
4
|
+
|
|
5
|
+
import process from "process";
|
|
6
|
+
import { ITProject } from "./src/Project";
|
|
7
|
+
// import { ITProject } from "testeranto/src/Project";
|
|
8
|
+
|
|
9
|
+
// process.chdir(__dirname);
|
|
10
|
+
|
|
11
|
+
// import Puppeteer from "./src/Puppeteer.js";
|
|
12
|
+
|
|
13
|
+
console.log(process.argv);
|
|
14
|
+
const Project = await import(process.argv[2]);
|
|
15
|
+
|
|
16
|
+
export default new ITProject(Project as any);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// import { ITProject } from "./src/Project.js";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
27
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
// import Project from "./testeranto.js";
|
|
31
|
+
const process_1 = __importDefault(require("process"));
|
|
32
|
+
const Project_1 = require("./src/Project");
|
|
33
|
+
// import { ITProject } from "testeranto/src/Project";
|
|
34
|
+
// process.chdir(__dirname);
|
|
35
|
+
// import Puppeteer from "./src/Puppeteer.js";
|
|
36
|
+
console.log(process_1.default.argv);
|
|
37
|
+
const Project = await Promise.resolve().then(() => __importStar(require(process_1.default.argv[2])));
|
|
38
|
+
exports.default = new Project_1.ITProject(Project);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const Init_js_1 = __importDefault(require("./src/Init.js"));
|
|
7
|
+
const testeranto_js_1 = __importDefault(require("./testeranto.js"));
|
|
8
|
+
exports.default = (0, Init_js_1.default)(testeranto_js_1.default);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const process_1 = __importDefault(require("process"));
|
|
30
|
+
process_1.default.chdir(__dirname);
|
|
31
|
+
const Puppeteer_js_1 = __importDefault(require("./src/Puppeteer.js"));
|
|
32
|
+
console.log(process_1.default.argv);
|
|
33
|
+
const Project = await Promise.resolve().then(() => __importStar(require(process_1.default.argv[2])));
|
|
34
|
+
exports.default = (0, Puppeteer_js_1.default)(Project);
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.execCommand = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const child_process_1 = require("child_process");
|
|
9
|
+
const execCommand = async (command) => {
|
|
10
|
+
return new Promise((resolve, reject) => {
|
|
11
|
+
const [cmd, ...args] = command.split(" ");
|
|
12
|
+
const childProcess = (0, child_process_1.spawn)(cmd, args);
|
|
13
|
+
childProcess.stdout.on("data", (data) => {
|
|
14
|
+
process.stdout.write(data.toString());
|
|
15
|
+
});
|
|
16
|
+
childProcess.stderr.on("data", (data) => {
|
|
17
|
+
process.stderr.write(data.toString());
|
|
18
|
+
});
|
|
19
|
+
childProcess.on("error", (error) => {
|
|
20
|
+
reject(error);
|
|
21
|
+
});
|
|
22
|
+
childProcess.on("exit", (code) => {
|
|
23
|
+
if (code === 0) {
|
|
24
|
+
resolve();
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
reject(new Error(`Command exited with code ${code}.`));
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
exports.execCommand = execCommand;
|
|
33
|
+
const key = process.argv[2];
|
|
34
|
+
console.log(key);
|
|
35
|
+
const exitcode = fs_1.default.readFileSync(`${key}/exitcode`).toString();
|
|
36
|
+
console.log("exitcode", exitcode);
|
|
37
|
+
// if (exitcode != "0") {
|
|
38
|
+
if (exitcode != "0") {
|
|
39
|
+
const inputFiles = JSON.parse(fs_1.default.readFileSync(`${key}/inputFiles.json`).toString());
|
|
40
|
+
inputFiles.push(`${key}/tests.json`);
|
|
41
|
+
const features = await (await Promise.all(Array.from(new Set(JSON.parse(fs_1.default.readFileSync(`${key}/tests.json`).toString())
|
|
42
|
+
.givens.reduce((mm, lm) => {
|
|
43
|
+
mm.push(lm.features.reduce((mm2, lm2) => {
|
|
44
|
+
mm2.push(lm2);
|
|
45
|
+
return mm2;
|
|
46
|
+
}, []));
|
|
47
|
+
return mm;
|
|
48
|
+
}, [])
|
|
49
|
+
.flat()
|
|
50
|
+
.flat()))))
|
|
51
|
+
.reduce(async (mm, feature) => {
|
|
52
|
+
const req = await octokit.request(`GET /repos/adamwong246/kokomobay-taskman/contents/Task/${feature}.json`, {
|
|
53
|
+
owner: "adamwong246",
|
|
54
|
+
repo: "kokomoBay-taskman",
|
|
55
|
+
path: `Task/${feature}.json`,
|
|
56
|
+
headers: {
|
|
57
|
+
"X-GitHub-Api-Version": "2022-11-28",
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
const j = JSON.parse(atob(req.data.content));
|
|
61
|
+
(await mm).push([
|
|
62
|
+
feature,
|
|
63
|
+
JSON.stringify({
|
|
64
|
+
name: j.name,
|
|
65
|
+
body: j.body,
|
|
66
|
+
}),
|
|
67
|
+
]);
|
|
68
|
+
return mm;
|
|
69
|
+
}, Promise.resolve([]))
|
|
70
|
+
.then((z) => {
|
|
71
|
+
const final = z.reduce((mm, [k, v], ndx) => {
|
|
72
|
+
mm[k] = v;
|
|
73
|
+
return mm;
|
|
74
|
+
}, {});
|
|
75
|
+
const as = JSON.stringify(final);
|
|
76
|
+
fs_1.default.writeFile(`./${key}/features.json`, as, () => {
|
|
77
|
+
inputFiles.push(`./${key}/features.json`);
|
|
78
|
+
const scriptCommand = `aider --model deepseek --api-key deepseek=${process.env.DEEPSEEK_KEY} --message "Fix the failing tests" ${inputFiles.join(" ")}`;
|
|
79
|
+
console.log("scriptCommand", scriptCommand);
|
|
80
|
+
(0, exports.execCommand)(scriptCommand);
|
|
81
|
+
// itermTab(scriptCommand).then(() => console.log("yay"));
|
|
82
|
+
// const child = spawn("xterm -e", scriptCommand.split(" "), {
|
|
83
|
+
// detached: true,
|
|
84
|
+
// stdio: "ignore",
|
|
85
|
+
// });
|
|
86
|
+
// runCommandInITerm(scriptCommand);
|
|
87
|
+
});
|
|
88
|
+
//
|
|
89
|
+
});
|
|
90
|
+
// features.then((x) => {
|
|
91
|
+
// console.log("done", x);
|
|
92
|
+
// });
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
console.log("that test is not failing");
|
|
96
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const fs_1 = __importDefault(require("fs"));
|
|
7
|
+
exports.default = async (partialConfig) => {
|
|
8
|
+
const config = Object.assign(Object.assign({}, partialConfig), { buildDir: process.cwd() + "/" + partialConfig.outdir });
|
|
9
|
+
fs_1.default.writeFileSync(`${config.outdir}/testeranto.json`, JSON.stringify(Object.assign(Object.assign({}, config), { buildDir: process.cwd() + "/" + config.outdir }), null, 2));
|
|
10
|
+
};
|
|
@@ -12,6 +12,7 @@ class NodeTesteranto extends core_js_1.default {
|
|
|
12
12
|
}
|
|
13
13
|
async receiveTestResourceConfig(partialTestResource) {
|
|
14
14
|
const t = JSON.parse(partialTestResource);
|
|
15
|
+
console.log("receiveTestResourceConfig", t);
|
|
15
16
|
const pm = new node_js_1.PM_Node(t);
|
|
16
17
|
const { failed, artifacts, logPromise } = await this.testJobs[0].receiveTestResourceConfig(pm);
|
|
17
18
|
pm.customclose();
|