-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Node.js Cookbook - Fifth Edition
By :
Jest is a widely adopted open source JavaScript testing framework developed by Facebook. It is particularly favored for testing React applications, though its versatility extends to Node.js environments. Jest is an opinionated testing framework with a host of bundled features.
In this guide, we will explore how to effectively write and structure tests using Jest. You’ll learn the key principles of Jest and how to set up your testing environment. Additionally, we’ll explore Jest’s capabilities in measuring and reporting test coverage to help you understand how well your code base is covered by tests.
We will be using Jest to test a program that provides some text utility functions.
$ mkdir testing-with-jest $ cd testing-with-jest $ npm init --yes
textUtils.js:$ touch textUtils.js