Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/luizcalaca/api-test-finance
API with TDD
https://github.com/luizcalaca/api-test-finance
integration-testing jest knexjs nodejs supertest tdd
Last synced: 8 days ago
JSON representation
API with TDD
- Host: GitHub
- URL: https://github.com/luizcalaca/api-test-finance
- Owner: luizcalaca
- Created: 2021-12-25T13:48:57.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-01-06T18:13:01.000Z (about 3 years ago)
- Last Synced: 2024-11-25T22:13:31.019Z (2 months ago)
- Topics: integration-testing, jest, knexjs, nodejs, supertest, tdd
- Language: JavaScript
- Homepage:
- Size: 373 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# api-test-finance
[![N|Solid](https://res.cloudinary.com/practicaldev/image/fetch/s--S6Nn_hYs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3fnnfif593kiswfmwwen.jpg)](https://jestjs.io/pt-BR/)
The main goal is showed a TDD development with some importants tools.
## Features
- TDD with Jest
- NodeJS
- Express
- Knex
- Docker
- Linter
- PostgreSQL## ESLint
Initial configuration (after install)
```sh
./node_modules/.bin/eslint --init
```Fix all problems
```sh
./node_modules/.bin/eslint --fix .
```## Some importants advises
Important to use a secure mode from Jest. It is into package.json scripts: `"secure-mode": "jest --watchAll"`
```sh
npm run secure-mode
```## Installations and details
Here is just some informations. To install all dependences is:
```sh
npm install
```Some informations:
```sh
npm i -S -E body-parser # get the data from send method and take into body
``````sh
npm i -S -E consign # consign include all imported middlewares into app.js
```## Docker
```sh
docker-compose up
```> Note: `-d` is required after up for run on background.
## Knex
```sh
node_modules/.bin/knex migrate:make create_users --env test
``````sh
node_modules/.bin/knex migrate:latest --env test
``````sh
node_modules/.bin/knex migrate:rollback --env test
```test is the name into the knexfile.js
## Jest
test.skip (ignores it)
test.only (executes just it on the file)
## License
MIT
**Free Software, Yeah!**