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

Adding a tests folder

To add the client-side test in the MERN Social application, we will create a folder, called tests, in the client folder, which will contain test files relevant to testing the React components. When the test command is run, Jest will look for the test code in these files.

The test case for this example will be a test on the Post component in the frontend of the MERN Social application, and we will add tests for the Post component in a file called post.test.js. This file will be placed in the tests folder. Now that we have a file ready for adding the test code, in the next section, we will demonstrate how to add an example test case.

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