- Explain WHY tdd
- Identify two testing libraries for Node.js
- List the parts of a test
- Describe the TDD flow
- Saves Time
- Prevent Regressions
- Design Better Code
- Serve as documentation
- Chai
- Mocha
- Jasmine
- QUnit
- & many, many more...
TIPS:
Don't get caught up in specifics
Deeply grok the principles
It's OK to look up the syntax!!
3
1. THINK (write the test)
2. Run the test and watch it fail (RED)
3. Make minimal changes to pass the test (GREEN)
4. Refactor to reduce redundancy
5. Re-run the test at each change to see if the test passes
...
4. Repeat with additional cases
A user...
Has a first name which:
- Is not an empty string
- Does not contain special characters
A secondary goal of TDD is to serve as documentation of the code's behavior in a human comprehendible (not just human readable) format.
For example, the first statement, "A User", frames what the test group is talking about.
- Explain WHY tdd
- Identify two testing libraries for Node.js
- List the parts of a test
- Describe the TDD flow