Chapter 14: Unit Testing
Learning Objectives
Upon completing the content in this chapter, you should be able to do the following:
- Write unit tests to test the behavior of functions
- Identify proper test cases for which a test should be written
- Understand the importance of testing in creating well-functioning code
- Use test-driven development to define the behavior of code before writing it, and to ensure that code is properly tested
Key Terminology
Here is a list of key terms for this chapter, broken down by the page they first appear on. Make note of these terms and their definitions.
Why Test Your Code?
- unit testing
- regression
- self-documenting code
Hello, Jest!
- Jest
- unit testing framework
- test suite
- specification
- spec
- expectation
- matcher
Test-Driven Development
- test-driven development
- refactoring code