Search
Contents
14.
Unit Testing
14.
Unit Testing
ΒΆ
14.1. Why Test Your Code?
14.1.1. Know Your Code
Really
Works
14.1.2. Find Regressions
14.1.3. Tests as Documentation
14.2. Hello, Jasmine!
14.2.1. Using Jasmine
14.2.2. Hello, Jasmine!
14.2.2.1.
index.js
14.2.2.2.
hello.js
14.2.2.3.
spec/hello.spec.js
14.2.2.4. Specifications and Expectations
14.2.2.5. Test Reporting
14.2.3. Check Your Understanding
14.3. Unit Testing in Action
14.3.1. What to Test
14.3.2. Setting Up
14.3.3. Positive and Negative Test Cases
14.3.3.1. Positive Test Cases
14.3.3.2. Negative Test Cases
14.3.4. Edge Cases
14.3.5. Toward a Better Testing Workflow
14.3.6. Check Your Understanding
14.4. Test-Driven Development
14.4.1. The Test/Code Cycle
14.4.2. Red, Green, Refactor
14.5. TDD in Action
14.5.1. Requirements
14.5.2. Requirement #1
14.5.2.1. Code Red
14.5.2.2. Go Green!
14.5.2.3. Refactor if Needed
14.5.3. Requirement #2
14.5.4. Requirement #3
14.5.5. Requirement #4
14.5.6. Requirement #5
14.5.7. Requirement #6
14.5.8. Use TDD to Add These Features
14.6. Exercises: Unit Testing
14.6.1. Automatic Testing to Find Errors
14.6.2. Try One on Your Own
14.6.3. Bonus Mission
14.7. Studio: Unit Testing
14.7.1. Source Code
14.7.2. Write the First Test
14.7.3. Write Code to Pass the First Test
14.7.4. Write the Next Two Tests
14.7.5. Write Code to Pass the New Tests
14.7.6. Hmmm, Tricky
14.7.7. More Tests and Code Snippets
14.7.8. New Condition
14.7.9. Bonus Missions
14.7.9.1. DRYing the Code
14.7.9.2. What if We Already Have Code?
←
13.7.
Studio: Boosting Confidence
14.1.
Why Test Your Code?
→