You write five tests for the contacts page. Every one begins with the same two lines. Copying them is tedious, and when the flow changes you edit five places.
A hook is code that runs around your tests automatically.
beforeEach, afterEach, beforeAll and afterAll. Choosing between them is a decision about test independence.
You write five tests for the contacts page. Every one begins with the same two lines. Copying them is tedious, and when the flow changes you edit five places.
A hook is code that runs around your tests automatically.
members only
The Foundations track and the first 5 lectures of each framework are free. This lecture is part of the paid course, which unlocks every lecture, all three frameworks, and downloads.
See the options →