https://github.com/cedrickchee/tdd-node-pg-knex
A test-first approach to developing a REST-ful API in Node.js
https://github.com/cedrickchee/tdd-node-pg-knex
knexjs-nodejs-db-migration nodejs postgresql red-green-refactor tdd tdd-javascript
Last synced: 4 months ago
JSON representation
A test-first approach to developing a REST-ful API in Node.js
- Host: GitHub
- URL: https://github.com/cedrickchee/tdd-node-pg-knex
- Owner: cedrickchee
- Created: 2020-07-01T11:55:12.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-11T16:39:24.000Z (over 2 years ago)
- Last Synced: 2025-01-18T17:49:34.909Z (5 months ago)
- Topics: knexjs-nodejs-db-migration, nodejs, postgresql, red-green-refactor, tdd, tdd-javascript
- Language: JavaScript
- Homepage:
- Size: 75.2 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TDD with Node.js
A project created to learn Test Driven Development (TDD) with Node.js, PostgreSQL, and Knex.
We practice a [TDD approach](https://blog.cleancoder.com/uncle-bob/2014/12/17/TheCyclesOfTDD.html) called Red/Green/Refactor.The rules of Red/Green/Refactor (RGR) cycle are simple.
1. Create a unit tests that fails
2. Write production code that makes that test pass.
3. 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.
## Tech Stack
- Database: PostgreSQL
- SQL query builder: Knex.js
- Test runner: Mocha
- Test assertion: Chai## Local Development
Run the app with this command:
```sh
npm start
```Debug the app with this command:
```sh
npm run debug
```## Project status
We are not quite done since we are not testing or handling for all possible errors.