Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

LinkedIn Learning

JavaScript: Test-Driven Development (ES6)

via LinkedIn Learning

Overview

Create a more stable and quality-focused development process through test-driven development. Learn foundational techniques for unit and integration tests with JavaScript ES6.

Syllabus

Introduction
  • Intro video
  • What you should know
  • What this course covers
  • Software installation
1. Test-Driven Development (TDD) Basics
  • What is TDD?
  • Advantages of TDD
  • Disadvantages of TDD
  • The basic TDD cycle
  • Writing effective tests
  • The three different types of tests
2. Writing Unit Tests
  • The purpose of unit testing
  • JavaScript frameworks for unit testing
  • Writing and running basic tests
  • Testing basic functions
  • Testing asynchronous functions
  • Modifying existing functionality
  • To mock or not to mock?
  • Challenge: Given criteria, write unit tests
  • Solution: Given criteria, write unit tests
3. Writing Integration Tests
  • Introduction to integration testing
  • How do integration tests fit into TDD?
  • Test doubles
  • When shouldn't I use test doubles?
  • The two categories of integration tests
  • JavaScript libraries For integration testing
4. Writing End-to-End Tests
  • Integration testing in practice
  • Testing Node servers with SuperTest
  • Testing an endpoint: The basic approach
  • Creating a Mocha setup file
5. Improving Your TDD Workflow
  • Testing database communication: Basic setup
  • Database setup and teardown in tests
  • Ignoring object properties in Mocha
  • Using environment variables in testing
  • Creating test helpers
  • Resetting the database between tests
6. A Real-World Example
  • Creating test-doubles with Sinon
  • Testing a Node endpoint with SuperTest
  • Implementing a server endpoint
  • Testing a server's error path
  • Challenge: Testing "Not Found"
  • Solution: Testing "Not Found"
7. Running Tests
  • Run tests automatically
  • Checking test coverage with NYC
Conclusion
  • Next steps

Taught by

Shaun Wassell

Reviews

4.7 rating at LinkedIn Learning based on 192 ratings

Start your review of JavaScript: Test-Driven Development (ES6)

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.