Skip to content

dodgeblaster/js-testing

Repository files navigation

jest-testing-patterns

Introduction

Click here for an introduction to testing and the testing pyramid

As a general rule, a good alocation of tests are 70/20/10, as is suggested in this Google Testing Article

This repository goes over the following:

1. How to use jest

In this section we go over:

  • Introduction to Jest
  • How to setup Jest
  • What a typical testing workflow looks like
  • How to test values that change over time
  • How to generate coverage reports
  • How to test external api errors
  • How to refactor

This section includes:

  • 7 Videos walking through the above topics
  • the project used in the videos, both the start and end state

Links

  • Click here to start this section

2. How to write testable code

In this section we go over:

  • Adding features with tests to an existing legacy codebase
  • General overview of how mocking can help make functions more testable

This section includes:

  • 1 Video demonstrating Adding features with tests to an existing legacy codebase
  • adding features project, both the start and end state
  • Mocking overview documentation
  • 1 Video talking through mocking overview documentation

Links

  • Click here to start the adding features section
  • Click here to view the mocking overview documentation

3. How to test external services

In this section we go over:

  • What is Ports and Adaptors
  • How does Ports and Adaptors help us make integration tests
  • How to make integration tests
  • How to split up unit and integration test cli commands

This section includes:

  • Documentation on Ports and Adaptors
  • 1 Video walking through Ports and Adaptors documentation
  • Reference Architecture which demonstrate integration testing
  • 1 Video walking through the reference architecture codebase

Links

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published