JavaScript: Test-Driven Development (ES6)
2h 21mAdvanced2019-11-21
Authors

Shaun Wassell
Full-Stack Software Developer
Course details
TDD is one of the most hotly discussed subjects in the software development world. Even the most carefully constructed applications grow to the point where debugging and ensuring quality becomes difficult. Test-driven development (TDD) helps with this tremendously by ensuring that all parts of your application are covered by tests. In this course, Shaun Wassell explores the foundational techniques and tools for unit and integration tests. Along the way, he zooms out to examine how they all fit together. Shaun also highlights TDD's strengths and weaknesses and provides real-world examples that showcase how TDD can fit into your development workflow.
Learning objectives
Advantages and disadvantages of TDD
The basic TDD cycle
The purpose of unit testing
Testing basic and asynchronous functions
How integration tests fit into TDD
JavaScript libraries for integration testing
Improving your TDD workflow
Checking the test coverage of the codebase
Learning objectives
Advantages and disadvantages of TDD
The basic TDD cycle
The purpose of unit testing
Testing basic and asynchronous functions
How integration tests fit into TDD
JavaScript libraries for integration testing
Improving your TDD workflow
Checking the test coverage of the codebase
Skills covered
Software TestingJavaScriptDevOps FoundationsOracleDevOpsProgramming LanguagesSoftware DevelopmentDeep Dive (X:Y)
Concepts
0. Introduction
- 01 - Intro video
- 02 - What you should know
- 03 - What this course covers
- 04 - Software installation
1. Test-Driven Development (TDD) Basics
- 05 - What is TDD
- 06 - Advantages of TDD
- 07 - Disadvantages of TDD
- 08 - The basic TDD cycle
- 09 - Writing effective tests
- 10 - The three different types of tests
2. Writing Unit Tests
- 11 - The purpose of unit testing
- 12 - JavaScript frameworks for unit testing
- 13 - Writing and running basic tests
- 14 - Testing basic functions
- 15 - Testing asynchronous functions
- 16 - Modifying existing functionality
- 17 - To mock or not to mock
- 18 - Challenge - Given criteria, write unit tests
- 19 - Solution - Given criteria, write unit tests
3. Writing Integration Tests
- 20 - Introduction to integration testing
- 21 - How do integration tests fit into TDD
- 22 - Test doubles
- 23 - When shouldn't I use test doubles
- 24 - The two categories of integration tests
- 25 - JavaScript libraries For integration testing
4. Writing End-to-End Tests
- 26 - Integration testing in practice
- 27 - Testing Node servers with SuperTest
- 28 - Testing an endpoint - The basic approach
- 29 - Creating a Mocha setup file
5. Improving Your TDD Workflow
- 30 - Testing database communication - Basic setup
- 31 - Database setup and teardown in tests
- 32 - Ignoring object properties in Mocha
- 33 - Using environment variables in testing
- 34 - Creating test helpers
- 35 - Resetting the database between tests
6. A Real-World Example
- 36 - Creating test-doubles with Sinon
- 37 - Testing a Node endpoint with SuperTest
- 38 - Implementing a server endpoint
- 39 - Testing a server's error path
- 40 - Challenge - Testing Not Found
- 41 - Solution - Testing Not Found
7. Running Tests
- 42 - Run tests automatically
- 43 - Checking test coverage with NYC
Conclusion
- 44 - Next steps