A project created to learn Test Driven Development (TDD) with Node.js, PostgreSQL, and Knex. We practice a TDD approach called Red/Green/Refactor.
The rules of Red/Green/Refactor (RGR) cycle are simple.
- Create a unit tests that fails
- Write production code that makes that test pass.
- Clean up the mess you just made.
Make it work. Make it right. Make it fast. — Kent Beck's original injunction
What are we creating?
This is a test-first approach to developing a RESTful API.
- Database: PostgreSQL
- SQL query builder: Knex.js
- Test runner: Mocha
- Test assertion: Chai
Run the app with this command:
npm start
Debug the app with this command:
npm run debug
We are not quite done since we are not testing or handling for all possible errors.