Skip to content

Latest commit

 

History

History
59 lines (38 loc) · 1013 Bytes

README.md

File metadata and controls

59 lines (38 loc) · 1013 Bytes

Unit Testing Jest

Description

A JavaScript project that has some unit tests tested with the testing framework Jest.

Contents

Setup Steps

Initialize and create a package.json file.

npm init

Install Jest.

npm install --save-dev jest

Modify the package.json file and place our own script that will run test suite using jest.

"scripts": {
   "test": "jest"
 }

Modify the package.json file and add the following so we generate a report for Codecov.

  "jest": {
    "coverageDirectory": "./coverage/",
    "collectCoverage": true
  }

How to run the project locally

npm test

Helpful resources

Getting started with Jest

Intro to Testing Vanilla JS with Jest