auto-tdd 0.1.3

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.
Files changed (43) hide show
  1. package/.dockerignore +4 -0
  2. package/.github/ISSUE_TEMPLATE/feature_request.md +21 -0
  3. package/.github/workflows/main.yml +72 -0
  4. package/.nvmrc +1 -0
  5. package/LICENSE +674 -0
  6. package/README.md +24 -0
  7. package/TODO +17 -0
  8. package/adapters/Adapter.js +5 -0
  9. package/adapters/AdapterThing.spec.js +10 -0
  10. package/cucumber.js +3 -0
  11. package/docker-compose.yml +21 -0
  12. package/domain/Thing.port.js +5 -0
  13. package/domain/calculator.js +9 -0
  14. package/domain/domain.spec.js +14 -0
  15. package/domain/javascript-user-interface.js +22 -0
  16. package/domain/test-cases/all.js +5 -0
  17. package/domain/test-cases/sum.js +26 -0
  18. package/domain/test-cases/test-user.js +22 -0
  19. package/features/simple_math.feature +37 -0
  20. package/features/support/steps.js +15 -0
  21. package/features/support/transform.js +16 -0
  22. package/features/support/world.js +22 -0
  23. package/http-api/Dockerfile +21 -0
  24. package/http-api/healthcheck.js +36 -0
  25. package/http-api/start.js +26 -0
  26. package/lambda-function/Dockerfile +16 -0
  27. package/lambda-function/app.js +8 -0
  28. package/package.json +58 -0
  29. package/publish-on-docker-hub.sh +13 -0
  30. package/renovate.json +4 -0
  31. package/stryker.conf.js +13 -0
  32. package/test-doubles/FakeThing.spec.js +3 -0
  33. package/test-http-api/container-test-cases.js +19 -0
  34. package/test-http-api/delay.js +3 -0
  35. package/test-http-api/docker-compose.component.spec.js +33 -0
  36. package/test-http-api/docker.component.spec.js +40 -0
  37. package/test-http-api/http-api-user-interface.js +12 -0
  38. package/test-http-api/runCommand.js +12 -0
  39. package/test-integration/TestingThingDoesStuff.spec.js +3 -0
  40. package/test-lambda-function/delay.js +3 -0
  41. package/test-lambda-function/docker.component.spec.js +55 -0
  42. package/test-lambda-function/runCommand.js +12 -0
  43. package/test-lambda-function/testing-lambda-function-user-interface.js +13 -0
package/.dockerignore ADDED
@@ -0,0 +1,4 @@
1
+ node_modules
2
+ npm-debug.log
3
+ Dockerfile
4
+ .dockerignore
@@ -0,0 +1,21 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest any idea
4
+ title: ''
5
+ labels: enhancement, question
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Examples:**
11
+ _Write some examples of use. Think of what the user is not able to do now and how it should feel when the idea is finished. Be very specific and detailed and always answer the questions: What does the user want? Why? How would the user interact with the system? Who starts the interaction? What information do they share within the interaction? How the user gets what it wanted?_
12
+
13
+ **Rules:**
14
+ _Many examples define a rule. And once the rule is set other examples could be generated. Write down the rules as you extract them from the examples. ( and be sure to add the examples that better define the rule )_
15
+
16
+ **Doubts:**
17
+ _Write any situation that may be not so clear and you think that we need to work on._
18
+
19
+
20
+ **Developer Notes:**
21
+ _Write any considerations about the way it could be implemented or any technical issues we may have to deal with._
@@ -0,0 +1,72 @@
1
+ name: "Test and publish"
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ build:
11
+ name: "Test and publish"
12
+ runs-on: ubuntu-latest
13
+ permissions:
14
+ contents: write
15
+
16
+ steps:
17
+ #Prepare node environment
18
+ - name: "Checkout source code"
19
+ uses: actions/checkout@v4
20
+ with:
21
+ ref: ${{ github.ref }}
22
+
23
+ - name: Read Node.js version from .nvmrc
24
+ id: read_nvmrc
25
+ run: |
26
+ echo "::set-output name=node_version::$(cat .nvmrc)"
27
+
28
+ - name: "Setup Node.js"
29
+ uses: actions/setup-node@v3
30
+ with:
31
+ node-version: ${{ steps.read_nvmrc.outputs.node_version }}
32
+ registry-url: 'https://registry.npmjs.org'
33
+
34
+ - name: Install Compose
35
+ uses: ndeloof/install-compose-action@v0.0.1
36
+ with:
37
+ legacy: true # will also install in PATH as `docker-compose`
38
+
39
+ - name: Check docker-compose is installed
40
+ run: docker-compose -v
41
+
42
+ #Run tests
43
+ - run: npm ci
44
+ - run: npm test
45
+
46
+ #Increase version in main branch
47
+ - name: "Automated Version Bump"
48
+ if: github.ref == 'refs/heads/master'
49
+ id: version-bump
50
+ uses: "phips28/gh-action-bump-version@master"
51
+ with:
52
+ tag-prefix: ''
53
+ env:
54
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55
+
56
+ #Publish to npm in main branch
57
+ - run: npm publish
58
+ if: github.ref == 'refs/heads/master'
59
+ env:
60
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
61
+
62
+ - name: Login to Docker Hub
63
+ if: github.ref == 'refs/heads/master'
64
+ run: |
65
+ DOCKERHUB_USERNAME=$(node -p "require('./package.json').dockerHubUsername")
66
+ echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
67
+
68
+ - name: Build and push Docker images
69
+ if: github.ref == 'refs/heads/master'
70
+ run: |
71
+ ./publish-on-docker-hub.sh "http-api"
72
+ ./publish-on-docker-hub.sh "lambda-function"
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ 18.18.1