Built using TDD, clean architecture, Factory pattern and dependency injection.
Before installing, download and install Node.js.
Clone the project with:
$ git clone https://github.com/elgsantos/delivery-route-api.git
Get in the path project, then install the dependencies with:
$ npm install
Install Jest globally to run tests
$ npm install jest -g
To test and commit files using the repository standard, install semistandard globally
$ npm install semistandard -g
If local, create a .env file on project's root directory containing your MONGO_URL:
MONGO_URL = "your_url"
You can start the server with:
$ npm start
To run and watch unit tests, use:
$ npm run test:unit
To run and watch integration tests, use:
$ npm run test:integration
Read the documentation.
The following tools were used in the development of the API:
- Code editor: vscode
- Semistandard Extension: vscode-semistandard
- REST Client: Insomnia
Feel free to develop and contribute, and send your pull requests. ๐
- The semistandard should be used, to ensure that the code will follow the same standard.
- Before each commit, husky runs tasks to standardize the code correctly.
- Tests are performed on the staged files, and if the tests are not ok, the commit will be canceled.
$ git commit -m "some awesome feature"
husky > pre-commit (node v12.4.0)
โผ Some of your tasks use `git add` command. Please remove it from the config since
all modifications made by tasks will be automatically added to the git commit index.
Preparing... [started]
Preparing... [completed]
Running tasks... [started]
Running tasks for *.js [started]
semistandard --fix [started]
semistandard --fix [completed]
npm run test:staged [started]
npm run test:staged [completed]
git add [started]
git add [completed]
Running tasks for *.js [completed]
Running tasks... [completed]
Applying modifications... [started]
Applying modifications... [completed]
Cleaning up... [started]
Cleaning up... [completed]
[master f252e10] server and database configuration
23 files changed, 334 insertions(+), 32 deletions(-)
- Tests are also performed before push, so code will be pushed if 100% is passing.
$ git push origin master
husky > pre-push (node v12.4.0)
...
Test Suites: 9 passed, 9 total
Tests: 40 passed, 40 total
...
- Eduardo Santos - elgsantos
Distributed under the MIT License. See LICENSE
for more information.