test_driven_fizzbuzz
This repository is my efforts at following along with chapter 1 of the book:
Test-Driven React. Find Problems Early, Fix Them Quickly, Code with Confidence
by Trevor Burnham
Copyright © 2019 The Pragmatic Programmers, LLC.
https://pragprog.com/titles/tbreact/test-driven-react/
Chapter 1 Test-Driven Development with Jest
Rules
The rules of FizzBuzz are:
Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz.” For numbers which are multiples of both three and five print “FizzBuzz.”
Mantra
Red, green, repeat
Links
JavaScript background
https://github.com/getify/You-Dont-Know-JS
Node
NPX: https://blog.npmjs.org/post/162869356040/introducing-npx-an-npm-package-runner
Common commands:
npm init \\creates a package.json
npm install --save-dev <package> \\ install a dependency
npx <package> \\ run a binary
npx jest --watchAll \\ automatically run tests on file save
npm run test -- --coverage --coverageReporters=text \\ print code coverage
Jest
API: https://jestjs.io/docs/api