AI Instructor Live Labs Included

Testing JavaScript and TypeScript Applications

Write reliable JavaScript with Jest, Supertest, and React Testing Library — unit tests, mocking, API tests, and coverage.

Intermediate
10h 50m
12 Lessons
JS-500
Testing JavaScript and TypeScript Badge

View badge details

About This Course

Write reliable JavaScript and TypeScript with comprehensive testing. Learn Jest fundamentals, mocking with jest.fn/jest.mock, testing Express APIs with Supertest, testing React components with Testing Library, code coverage, and CI integration. The capstone retrofits tests onto the ByteForge app with 80%+ coverage. Requires Node.js/Express and React experience. Course 6 of 6 in the JavaScript Learning Path.

Course Curriculum

12 Lessons
01
AI Lesson
AI Lesson

Jest Fundamentals

35m
02
Lab Exercise
Lab Exercise

Jest Fundamentals - Lab Exercises

1h 15m 1 Exercises

Why test (regression/confidence/documentation), Jest setup and configuration, describe/it/expect, matchers (toBe/toEqual/toContain/toThrow/toBeNull), test organization, running tests (--watch/--verbose/--coverage)

03
AI Lesson
AI Lesson

Testing Functions and Mocking

35m
04
Lab Exercise
Lab Exercise

Testing Functions and Mocking - Lab Exercises

1h 15m 1 Exercises

Testing pure functions, testing async functions (resolves/rejects), jest.fn() for mock functions, jest.mock() for module mocking, jest.spyOn(), mock implementations and return values, clearing and resetting mocks

05
AI Lesson
AI Lesson

Testing Express APIs

35m
06
Lab Exercise
Lab Exercise

Testing Express APIs - Lab Exercises

1h 15m 1 Exercises

Supertest for HTTP testing, testing GET/POST/PUT/DELETE endpoints, testing with test database (in-memory SQLite), testing authentication (JWT headers), testing validation (bad input), testing error responses, beforeEach/afterEach setup

07
AI Lesson
AI Lesson

Testing React Components

35m
08
Lab Exercise
Lab Exercise

Testing React Components - Lab Exercises

1h 15m 1 Exercises

React Testing Library philosophy (test behavior not implementation), render/screen/fireEvent/waitFor, querying (getByRole/getByText/getByTestId), testing user interactions, testing async components (data fetching), testing forms, testing routing

09
AI Lesson
AI Lesson

Coverage and CI Integration

30m
10
Lab Exercise
Lab Exercise

Coverage and CI Integration - Lab Exercises

1h 15m 1 Exercises

Code coverage reports (--coverage), understanding coverage metrics (statements/branches/functions/lines), coverage thresholds in jest.config, what to test vs what not to test, snapshot testing (when useful/when harmful), CI pipeline integration basics

11
AI Lesson
AI Lesson

Capstone Briefing Add Tests to ByteForge

30m
12
Lab Exercise
Lab Exercise

Capstone Add Tests to ByteForge - Lab Exercises

1h 15m 1 Exercises

Capstone: retrofit tests onto the ByteForge Express API and React dashboard. Unit tests for utilities, API tests with supertest, React component tests with Testing Library, mock external dependencies, achieve 80%+ coverage

This course includes:

  • 24/7 AI Instructor Support
  • Live Lab Environments
  • 6 Hands-on Lessons
  • Completion Badge
Testing JavaScript and TypeScript Badge

Earn Your Badge

Complete all lessons to unlock the Testing JavaScript and TypeScript achievement badge.

Skill Level Intermediate
Total Duration 10h 50m
Testing JavaScript and TypeScript Badge
Achievement Badge

Testing JavaScript and TypeScript

Demonstrates proficiency in JavaScript testing — Jest, Supertest, React Testing Library, mocking, and coverage.

Course Testing JavaScript and TypeScript Applications

Skills You'll Earn

Jest Testing Supertest React Testing Library Mocking Coverage

Complete all lessons in this course to earn this badge