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. Start With the Properties
      1. 14.7.2.1. organization
      2. 14.7.2.2. executiveDirector
      3. 14.7.2.3. percentageCoolEmployees
      4. 14.7.2.4. programsOffered
    3. 14.7.3. launchOutput()
      1. 14.7.3.1. Write the First Test
      2. 14.7.3.2. Write Code to Pass the First Test
      3. 14.7.3.3. Write the Next Two Tests
      4. 14.7.3.4. Write Code to Pass the New Tests
      5. 14.7.3.5. Hmmm, Tricky
      6. 14.7.3.6. More Tests and Code Snippets
    4. 14.7.4. New Condition
    5. 14.7.5. Bonus Missions
      1. 14.7.5.1. DRYing the Code