Skip to content
This repository has been archived by the owner on Oct 24, 2018. It is now read-only.
/ unit-test-workshop Public archive

Boilerplate project for frontend unit testing

Notifications You must be signed in to change notification settings

jaggli/unit-test-workshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

unit-test-workshop

This is a working repo of the unit test workshop

Check out the summary

Prerequisites

Setup your machine accordingly

Installation

  1. Download or clone this repository and cd into that directory
  2. run yarn to install all packages

Testing

  1. Run yarn test:watchall to run the test suite interactively.
  2. While the test suite is running, all files named *.test.js recursively inside the ./src/ directory are executed on each change made to a file.
  3. If everything went right, you should see something like this:
PASS  src/hiker.test.js
answer
  ✓ to life the universe and everything (3ms)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        0.946s
Ran all test suites.

Watch Usage
› Press o to only run tests related to changed files.
› Press p to filter by a filename regex pattern.
› Press q to quit watch mode.
› Press Enter to trigger a test run.

Available commands

  • yarn test - Runns all tests and quits
  • yarn test:coverage - Runns all tests and generates a coverage report
  • yarn test:watch - Watch files for changes and rerun tests related to changed files.
  • yarn test:watchall - Same as watch, but reruns all tests when a file has changed.