LaunchCode logo
  1. Contents
  2. 14. Unit Testing

14. Unit TestingΒΆ

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

Back to top