Reader small image

You're reading from  Full Stack Quarkus and React

Product typeBook
Published inNov 2022
Reading LevelBeginner
PublisherPackt
ISBN-139781800562738
Edition1st Edition
Languages
Right arrow
Author (1)
Marc Nuri San Felix
Marc Nuri San Felix
author image
Marc Nuri San Felix

Marc started his career as a freelance web application developer, creating and maintaining software for the transportation/courier industry. A few years ago Marc started working as an employee for different companies where he has helped build scalable web applications for different industries (retail, procurement software, e-commerce, etc.). He is now a professional Open Source developer focused on the creation and maintenance of developer tools for Java developers and Kubernetes.
Read more about Marc Nuri San Felix

Right arrow

Testing React components

Depending on the complexity of your components and their purpose, it might be advisable that you implement specific unit tests for them. This ensures the component behaves according to specification for every defined scenario and property.

Unit testing

Unit testing is a software development technique by which developers write automatic tests that verify that the smallest testable units of an application (called units) behave according to its design requirements.

Let us see a practical example by implementing a test for the CompleteChip component. In the Implementing a Task Edit dialog section in Chapter 9, Creating the Main Application, we created this custom component that renders the completion date of the provided task, or nothing if the provided task is not completed. To implement the test for this component, we’ll start by creating a new CompleteChip.test.js file in the src/tasks directory.

Test file naming

By default, Jest, with...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Full Stack Quarkus and React
Published in: Nov 2022Publisher: PacktISBN-13: 9781800562738

Author (1)

author image
Marc Nuri San Felix

Marc started his career as a freelance web application developer, creating and maintaining software for the transportation/courier industry. A few years ago Marc started working as an employee for different companies where he has helped build scalable web applications for different industries (retail, procurement software, e-commerce, etc.). He is now a professional Open Source developer focused on the creation and maintenance of developer tools for Java developers and Kubernetes.
Read more about Marc Nuri San Felix