May 2019
Intermediate to advanced
496 pages
10h 38m
English
What exactly is a test? We'll discover that by writing one. In your project directory, type the following commands:
mkdir testtouch test/Appointment.test.js
Open the test/Appointment.test.js file in your favorite editor or IDE and enter the following:
describe('Appointment', () => {});
The describe function defines a test suite, which is simply a set of tests with a given name. The first argument is the name (or description) of the unit you are testing. It could be a React component, a function, or a module. The second argument is a function inside of which you define your tests.
Read now
Unlock full access