Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fabio-miguel/tdd-nodejs-katas
Various complex katas (challenges) I have completed, such as a checkout & Roman numeral converter, whilst practising the core principles of TDD. JavaScript | Jest
https://github.com/fabio-miguel/tdd-nodejs-katas
katas nodejs tdd
Last synced: about 1 month ago
JSON representation
Various complex katas (challenges) I have completed, such as a checkout & Roman numeral converter, whilst practising the core principles of TDD. JavaScript | Jest
- Host: GitHub
- URL: https://github.com/fabio-miguel/tdd-nodejs-katas
- Owner: fabio-miguel
- Created: 2024-01-10T15:28:54.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-01-10T16:27:57.000Z (about 1 year ago)
- Last Synced: 2024-11-08T12:07:49.582Z (3 months ago)
- Topics: katas, nodejs, tdd
- Language: JavaScript
- Homepage:
- Size: 38.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# tdd-nodejs-katas
# About the Katas
**SPOILER**
If you haven't completed the Katas before and you don't want the solutions, don't go into the exercise folders.# Properties of Good Tests
**Fast:** Should run within milliseconds
**Isolated:** No dependency on other tests
**Repeatable:** Doesn't require an initial state (i.e. no need to set-up anything prior)
**Timely:** Test is written when we need it.# Core Principle
**Red** Write a failing test
**Green** Write the minimal code required to pass the test
**Refactor** Improve the quality of the code.# Key Rules
**Only one failing test at a time**
You can't write any more tests unless the every other test is green
**Tests drive implementation**
You can't wite code that is unrelated to the test.# Other Things to consider
**Don't Repeat Yourself (DRY)**
If you find yourself repeating code, can you optimise it?
**Simplest passing code**
Remember, you want the simplest passing code. But you will refactor this. Eventually your tests should drive an algorithm, thus forcing you to implement real-life, business usecases.