Behavior Driven Development in ReactJS
如果想跳过前文,可以直接定位到实战篇
What is Test Driven Development?
Coding of features and tests go hand in hand.
- Write a unit test.
- Run the test. See it fail.
- Write the feature code to pass the test.
- Refactor the code.
Why TDD?
- It reduces errors and defects in the long run.
- It leads to higher quality code.
What is Behavior Driven Development?
- A variation of TDD that tests for user scenarios.
- Given, when, then… [ pattern ]
- Given notes, when deleting, then remove a note.
- BDD consists of scenarios/specifications.