YoVDO

Node.js: Testing and Code Quality

Offered By: LinkedIn Learning

Tags

Node.Js Courses JEST Exam Courses Unit Testing Courses Code Quality Courses Code Coverage Courses

Course Description

Overview

Learn how to measure quality, implement testing, and ensure code coverage in your node.js apps.

Syllabus

Introduction
  • Cleaning your codebase
  • What you should know
  • Preparing for Node.js development
  • Exercise files
  • Demo setup and tour
1. Testing and Code Quality Fundamentals
  • What is code quality?
  • Coding conventions and standards
  • Creating and enforcing coding standards
  • Unit, integration, and functional testing
  • Testing frameworks
  • TDD and BDD test specifications
  • Assertions for correctness
  • Challenge: Organize your tests
  • Solution: Organize your tests
2. Finding Errors with Linting
  • Standardizing with EditorConfig
  • Adding EditorConfig to a project and IDE
  • Comparing JavaScript linters
  • Installing ESLint
  • Configuring ESLint
  • Extending an ESLint shareable config
  • Linting your codebase
  • Fixing code in VSC with ESLint
  • Challenge: Create a shareable ESLint config
  • Solution: Create a shareable ESLint config
3. Validate Correctness with Unit Testing
  • Survey of Node.js testing frameworks
  • Install Jest in a Node.js project
  • What and where to unit test?
  • Writing your first Jest unit test
  • Running a test suite with Jest
  • Testing asynchronous callbacks with Jest
  • Writing callback test suites with Jest
  • Testing promises with Jest
  • Challenge: Test async/await with Jest
  • Solution: Test async/await with Jest
4. Replacing and Inspecting Using Spies, Stubs, and Mocks
  • Replacing code with test doubles
  • Mocking functions for test code
  • Writing your first Jest mock
  • Mock an entire module with Jest
  • Mocking module dependencies
  • Spying to observe interactions
  • Challenge: Mock a successful reservation creation
  • Solution: Mock a successful reservation creation
5. Reporting on Your Entire Codebase
  • Why code coverage matters
  • Measuring code coverage with Jest
  • Functional testing with Jest
  • Test doubles and Express apps
  • Form submissions with SuperTest
  • Fallacies of 100% test coverage
  • Coverage with continuous integration
  • Challenge: Isolate routes for faster tests
  • Solution: Isolate routes for faster tests
Conclusion
  • Testing and code quality goals
  • Where to go from here?

Taught by

Jon Peck

Related Courses

A Practical Introduction to Test-Driven Development
LearnQuest via Coursera
Android App Development
Vanderbilt University via Coursera
Building Interactive User Interfaces Using React Library
NIIT StackRoute via Coursera
Основы разработки на C++: жёлтый пояс
Moscow Institute of Physics and Technology via Coursera
Learn Intermediate Python 3
Codecademy