Skip to Content
Full-Stack React Projects - Second Edition
book

Full-Stack React Projects - Second Edition

by Shama Hoque
April 2020
Intermediate to advanced
716 pages
18h 55m
English
Packt Publishing
Content preview from Full-Stack React Projects - Second Edition

Installing the packages

In order to set up Jest and integrate the test code with our projects, we first need to install the relevant Node packages. The following packages will be required in order to write the test code and run the tests:

  • jest: To include the Jest testing framework
  • babel-jest: To compile JS code for Jest
  • react-test-renderer: To create a snapshot of the DOM tree rendered by a React DOM without using a browser

To install these packages as devDependencies, run the following yarn command from the command line:

yarn add --dev jest babel-jest react-test-renderer

Once these packages are installed, we can start adding tests after configuring the test runner script, as discussed in the next section.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Full-Stack React Projects

Full-Stack React Projects

Shama Hoque
React Native - The Practical Guide

React Native - The Practical Guide

Academind by Maximilian Schwarzmüller GmbH

Publisher Resources

ISBN: 9781839215414Supplemental Content