testeranto 0.9.20
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 +29 -0
- package/.prettierrc +4 -0
- package/.vscode/launch.json +20 -0
- package/.vscode/settings.json +7 -0
- package/README.md +86 -0
- package/bin/build.sh +5 -0
- package/bin/report.sh +6 -0
- package/bin/watch.sh +5 -0
- package/dist/reporter.css +10326 -0
- package/dist/reporter.html +16 -0
- package/dist/reporter.js +26777 -0
- package/example-testeranto.config.json +65 -0
- package/nodemon.json +7 -0
- package/package.json +54 -0
- package/src/BaseClasses.ts +353 -0
- package/src/Features.ts +102 -0
- package/src/Project.ts +23 -0
- package/src/Report.tsx +347 -0
- package/src/build.js +88 -0
- package/src/index.ts +153 -0
- package/src/lib/Scheduler.ts +350 -0
- package/src/lib/level0.ts +157 -0
- package/src/lib/level1.ts +191 -0
- package/src/types.ts +122 -0
- package/src/watch.ts +69 -0
- package/testeranto.ts-0.0.1.tgz +0 -0
- package/truffle-config.js +124 -0
- package/tsconfig.json +33 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/yarn-error.log +3144 -0
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
"env": {
|
|
3
|
+
"browser": true,
|
|
4
|
+
"es2021": true
|
|
5
|
+
},
|
|
6
|
+
"extends": [
|
|
7
|
+
"eslint:recommended",
|
|
8
|
+
"plugin:react/recommended",
|
|
9
|
+
"plugin:@typescript-eslint/recommended"
|
|
10
|
+
],
|
|
11
|
+
"overrides": [
|
|
12
|
+
],
|
|
13
|
+
"parser": "@typescript-eslint/parser",
|
|
14
|
+
"parserOptions": {
|
|
15
|
+
"ecmaVersion": "latest",
|
|
16
|
+
"sourceType": "module"
|
|
17
|
+
},
|
|
18
|
+
"plugins": [
|
|
19
|
+
"react",
|
|
20
|
+
"@typescript-eslint"
|
|
21
|
+
],
|
|
22
|
+
"rules": {
|
|
23
|
+
"@typescript-eslint/ban-ts-comment": "warn",
|
|
24
|
+
"prefer-const": "warn",
|
|
25
|
+
"@typescript-eslint/no-unused-vars": "warn"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
package/.prettierrc
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Use IntelliSense to learn about possible attributes.
|
|
3
|
+
// Hover to view descriptions of existing attributes.
|
|
4
|
+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
5
|
+
"version": "0.2.0",
|
|
6
|
+
"configurations": [
|
|
7
|
+
{
|
|
8
|
+
"type": "node",
|
|
9
|
+
"request": "launch",
|
|
10
|
+
"name": "Launch Program",
|
|
11
|
+
"skipFiles": [
|
|
12
|
+
"<node_internals>/**"
|
|
13
|
+
],
|
|
14
|
+
"program": "${workspaceFolder}/index.js",
|
|
15
|
+
"outFiles": [
|
|
16
|
+
"${workspaceFolder}/**/*.js"
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
package/README.md
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# testeranto
|
|
2
|
+
|
|
3
|
+
🚧 this project has not yet reached a stable api 🚧
|
|
4
|
+
|
|
5
|
+
home: [adamwong246.github.io/testeranto](https://adamwong246.github.io/testeranto/)
|
|
6
|
+
|
|
7
|
+
source: [github.com/adamwong246/testeranto](https://github.com/adamwong246/testeranto)
|
|
8
|
+
|
|
9
|
+
npm: [npmjs.com/package/testeranto](https://www.npmjs.com/package/testeranto)
|
|
10
|
+
|
|
11
|
+
dev: [github.dev/adamwong246/testeranto](https://github.dev/adamwong246/testeranto)
|
|
12
|
+
|
|
13
|
+
example report: [kokomoBay acceptance tests](https://chromapdx.github.io/kokomoBay/report.html)
|
|
14
|
+
|
|
15
|
+
tl;dr
|
|
16
|
+
|
|
17
|
+
Do you like BDD?
|
|
18
|
+
Do you love Typescript?
|
|
19
|
+
Do you hate Jira?
|
|
20
|
+
|
|
21
|
+
If yes, then testeranto might be the testing tool you have been looking for!
|
|
22
|
+
|
|
23
|
+
## about
|
|
24
|
+
|
|
25
|
+
Testeranto.ts an Acceptance Test Driven Development ([ATDD](https://en.wikipedia.org/wiki/Acceptance_test-driven_development)) framework. It focuses on testing features which cross application boundaries using strongly typed tests and specified in a gherkin-like syntax.
|
|
26
|
+
|
|
27
|
+
## what is Acceptance Test Driven Development?
|
|
28
|
+
|
|
29
|
+
ATDD is the latest evolution of BDD and TDD methodologies. Where TDD tests are written for the benefit of the developer and BDD tests are written from the perspective of the user, ATDD uses executable tests which resolve to acceptance critera and draws from a larger range of stakeholders.
|
|
30
|
+
|
|
31
|
+
## 3 distinguishing features of testeranto
|
|
32
|
+
|
|
33
|
+
0. Testeranto can execute many types of tests. It abstracts away the differences between a "small" unit test and a "big" integration test. Features can thus be tracked across many test suites.
|
|
34
|
+
|
|
35
|
+
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 now tested through the gherkin-ish directives provided by that interface.
|
|
36
|
+
|
|
37
|
+
2. Testeranto tracks features and test 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- Under 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.
|
|
38
|
+
|
|
39
|
+
## tech of note
|
|
40
|
+
|
|
41
|
+
- typescript - tests are functions with type parameters
|
|
42
|
+
- esbuild - used to quickly generate test bundles
|
|
43
|
+
- graphology - used to store features within a semantic network
|
|
44
|
+
|
|
45
|
+
## the good parts
|
|
46
|
+
|
|
47
|
+
Testeranto includes a test runner which bundles and executes your tests, taking care to only run the tests which have changed. It is designed to run most tests in parallel, though it has support for tests which require a shared resource, like a port.
|
|
48
|
+
|
|
49
|
+
Testeranto includes a test reporter which displays the state of your code in a web app. ([see example](https://adamwong246.github.io/testeranto/dist/report.html)) This reporter can also be run locally for the developer's convenience.
|
|
50
|
+
|
|
51
|
+
Testeranto can very feasibly be used to test any code- a ruby HTTP server, for example. While testeranto itself and it's test implementations are typescript, the subject of the test can be any stateful software.
|
|
52
|
+
|
|
53
|
+
Testeranto allows you to test the same code in multiple ways. You can test your unbundled TS in a unit-test fashion, and also bundle that same code, then testing it through a interface like puppeteer, fetch, curl, etc.
|
|
54
|
+
|
|
55
|
+
Testeranto exposes an extended gherkin syntax. You can use the given-when-then lingua-franca, AND you can also use an imperative `Check` which is a bit more flexible.
|
|
56
|
+
|
|
57
|
+
Rather than the traditional method of specifying tests in plain text, Testeranto tests and features are just TS, editable and type-checkable from [github's online editor](https://github.dev/adamwong246/testeranto)!
|
|
58
|
+
|
|
59
|
+
## the bad parts
|
|
60
|
+
|
|
61
|
+
Testeranto does not (yet!) of a means of allowing non-coders to affect changes so, as they say, "get good 💪!"
|
|
62
|
+
|
|
63
|
+
Testeranto is not for testing pure functions. It's designed only to address _stateful_ logic.
|
|
64
|
+
|
|
65
|
+
Testeranto prefers TS and to be leveraged to it full potential requires at least some proficiency with the language.
|
|
66
|
+
|
|
67
|
+
Because Testeranto is so un-opinionated that it does not provide test infrastructure. You will need to find an existing recipe or implement it yourself, though I plan to have some sort of public repo of test interfaces someday 😅
|
|
68
|
+
|
|
69
|
+
### examples of test infrastructures
|
|
70
|
+
|
|
71
|
+
- [Testing a class](/tests/Rectangle/Rectangle.test.ts)
|
|
72
|
+
- [Testing a Redux store](/tests/Redux+Reselect+React/app.redux.test.ts)
|
|
73
|
+
- [Testing a Reselect Selector based on a Redux store](/tests/Redux+Reselect+React/LoginSelector.test.ts)
|
|
74
|
+
- [Testing a React Component with Reselect Selector based on a Redux store](/tests/Redux+Reselect+React/app.reduxToolkit.test.ts)
|
|
75
|
+
- [Testing an http server with node's fetch](/tests/httpServer/server.http.test.ts)
|
|
76
|
+
- [Testing an http server with puppeteer](/tests/httpServer/server.puppeteer.test.ts)
|
|
77
|
+
- [Testing a Classical react component](/tests/ClassicalReact/ClassicalComponent.react-test-renderer.test.tsx)
|
|
78
|
+
- [Testing a Classical react component, bundled with esbuild and tested with puppeteer with screenshots](/tests/ClassicalReact/ClassicalComponent.react-test-renderer.test.tsx)
|
|
79
|
+
|
|
80
|
+
### road map
|
|
81
|
+
|
|
82
|
+
- replace "cancelable-promises" with pm2
|
|
83
|
+
- fix "checks" aka tdd/bdd
|
|
84
|
+
- improve type signatures
|
|
85
|
+
- hunt down many ts "ignore-s" and "any-s"
|
|
86
|
+
- separate example from library
|
package/bin/build.sh
ADDED
package/bin/report.sh
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env sh
|
|
2
|
+
|
|
3
|
+
# yarn nodemon --config nodemon.json ./node_modules/testeranto/src/build.ts testeranto.config.json
|
|
4
|
+
cp ./node_modules/testeranto/dist/reporter.css ./dist/reporter.css
|
|
5
|
+
cp ./node_modules/testeranto/dist/reporter.js ./dist/reporter.js
|
|
6
|
+
cp ./node_modules/testeranto/dist/reporter.html ./dist/reporter.html
|