Node.js: Testing and Code Quality

Node.js: Testing and Code Quality
Node.js: Testing and Code Quality
English | MP4 | AVC 1280×720 | AAC 48KHz 2ch | 3h 25m | 359 MB

A maintainable codebase should have clean and easy-to-manage code. In this course, Jon Peck shows how to gauge quality, implement testing, and measure code coverage in your Node.js apps. To help you better understand these key concepts, he walks through how to clean up a buggy restaurant booking app. First, Jon reviews testing and code quality fundamentals. Next, he shows how to find errors by linting your code base, and explores different testing frameworks and their components. Finally, he demonstrates how to write unit and functional tests to exercise the code base, then determine what code was executed with a code coverage report.

Topics include:

  • What is code quality?
  • Testing and code quality fundamentals
  • Coding conventions and standards
  • Creating and enforcing coding standards
  • Unit, integration, and functional testing
  • Test-driven development test specificatons
  • Behavior-driven development test specifications
  • Finding errors with linting
  • Extending an ESLint shareable config
  • Validating correctness with unit testing
  • Replacing and inspecting with stubs, spies, and mocks
  • Code coverage and why it matters
  • Coverage with continuous integration
Table of Contents

1 Welcome
2 What you should know
3 Configuring your development environment
4 Exercise files
5 Demo application setup and tour
6 What is code quality_
7 Coding conventions and standards
8 Creating and enforcing coding standards
9 Unit, integration, and functional testing
10 Testing frameworks
11 Test-driven development (TDD) and behavior-driven development (BDD) test specifications
12 Assertion libraries for correctness
13 EditorConfig standardization
14 Adding EditorConfig to a project and IDE
15 Comparing JavaScript linters
16 Installing ESLint
17 Configuring ESLint
18 Extending an ESLint shareable config
19 Linting your entire codebase
20 Cleaning code in Atom with ESLint
21 Survey of Node.js testing frameworks
22 Assertion library comparison
23 Installing Mocha and Chai
24 What and where to unit test_
25 Writing unit tests
26 Running test suites with Mocha
27 Testing callbacks with Mocha
28 Testing promises with Mocha
29 Replacing code with test doubles
30 Overriding dependencies with Proxyquire
31 Controlling responses with stubs
32 Stubbing a custom response
33 Observing interactions with spies
34 Verifying behavior with mocking
35 Code coverage and why it matters
36 Measuring code coverage with Istanbul
37 Functionally testing with Mocha
38 Test doubles and Express apps
39 Form submissions with Chai HTTP
40 Fallacies of 100% test coverage
41 Coverage with continuous integration
42 Testing and code quality goals
43 Where to go from here_