This module will show you what TDD looks like in practice. The instructor will lead the group through a demonstration of TDD. Follow along!
👉 Fire up the tests by opening a new command window at the root of this project, and running npm run test-module-2
.
👉 Write tests & code to implement the specifications, one at a time.
REMEMBER! Make sure you write a failing test before you implement each specification!
i.e. if 15 is passed in, it returns “1 2 3 4 5 6 7 8 9 10 11 12 13 14 15”
i.e. “1 2 Fizz 4 5 Fizz 7 8 Fizz 10 11 Fizz 13 14 Fizz”
i.e. “1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 ??”
6. and for numbers that are multiples of both 3 and 5, where the number is replaced with the word “FizzBuzz”.
i.e. “1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz”
The lodash
library has been installed in this project. You might find the functions isNumber
and range
useful when you're implementing the specs. To import them into a file, include this line at the top:
import { isNumber, range } from 'lodash';