Test Driven Development
This week we're looking at writing our own JavaScript tests, before proceeding to write the code that makes them pass.
Learning objectives
To be able to answer "yes" to the following questions:
-
Can you write a test that describes the expected behaviour of a unit?
-
Can you use that test as a reference to write some code for the unit?
-
When you've passed the test, can you find ways to refactor the code?
Concepts
-
Test-Driven Development
-
Unit Testing
-
Jest
-
Refactoring
-
DRY - Don't Repeat Yourself
Challenge
This week's challenge uses the DIY Kata repository on GitHub.
-
Fork the repository to your own GitHub profile.
-
Clone down your fork.
-
Change directory into your cloned folder and run
npm install
. -
Start working through the challenges linked on the right.