- Make It Fail
- Make It Pass
- Refactor
0. Write test write a test to prove the next small piece of functionality is missing or wrong
--> Run all the tests All the tests should fail
1. Write Code write the simplest production code to fix test
--> Run all the tests All the tests should pass
YOU NOW HAVE CODE THAT WORKS
2.Refactor Incremental refactoring the code untill its acceptable
*** YOU NOW HAVE CODE YOU LIKE***
- jest for testing
- install globally
npm install jest --global
- install globally
- wallaby for test running
- install vscode plugin
- get the Web App
- before writing
index.js
, createindex.spec.js
- write first test as describe block the first describe block is usualy the name of a feature or the entry point to the application
- the entry point is the point where execution begins
- Unit test == Unit of work
- Unit of work has entry point and exit point
- entry point is where function is invoked
- use the name of the function
- exit point
- return value
- state change
- output file