Objectives
• Testing JavaScript with Jest
• Trying out Pair Programming
• Exercise TDD and Pair Programming in a JavaScript Project
Audience
Software Developers, Team Leads, Enterprise Architects, Solution Architects, and Information Technology Architects
Prerequisites
Some knowledge of JavaScript is beneficial
Duration
1 day
Outline for TDD and Pair Programming in JavaScript Training
Chapter 1 - Testing JavaScript with Jest
- Jest Testing Framework
- Features
- Installation of Jest
- A Basic Test
- Run Test
- Test Failures
- Interactive Mode
- Code Coverage
- Unit Testing
- Anatomy of a Unit Test
- Expectations (Assertions)
- Common Matchers
- Combining Tests
- Testing async code with done
- Testing Promise Based Async Code
- Setup and Teardown
- Setup and Teardown Example
- Method Stubbing and Call Tracking with Spies
- A Spy Example
- spyOn Setup Variations
- Simulating Exceptions
- Summary
Lab Exercises
Lab 1. Testing JavaScript with
Lab 2. Jest