A good point is calculate Requirements coverage, if you define all use cases on test controllers (INT or E2E) you can calculate if your test are passing throw all logic (As in UNIT tests with code climate but with INT or e2e tests as well).
This project is a little template that how to make the diferent testing layers in node backend.
Quality there are not only on the test, the processes are important, on the following link you can se a litle list of basic checks:
- Code coverage with code climate and jest
- Branch protection
- PR reviews are mandatories with template (Defined on Github project)
- Husky pre hooks, run linter on pre-commit hook
- Run test on Github actions CI - Release Workflow
- Custom .eslintrc.json configuration for preserve the code quality
Docker Desktop installed and Node 14 or higher
You should do the following steps:
On Terminal into project path:
> npm i
> npm run test:unit
> npm run test:contract:consumer
> npm run test:contract:provider
> npm run test:int
> npm run test:specification
To simulate the PR review pipeline, I've changed the webhook event for master branch push.
- Github actions for automating the release
- Pull request tempplate (with all checks)
A list of test cases proposed for automation:
- You can see all test cases into the reports folder, you just need to open the .html file.
A short explanation of the provided solution.
- I've use Typescript because is an oriented and typed language with an easy way to build, configure and launch whatever thing you want to do.
- I use Jest as test runner because is a delightful Testing Framework with a focus on simplicity.
The reports are located on reports folder into api project.
The Artifacts are on workflow action section.
https://github.com/ferraobox/qa-node-typescript-backend/actions/
you can check them opening the specific run.