Your tests should be short and ideally test only one thing.
The test in the image is described by the string passed to the it
function. Take good care writing the description so that it’s clear what is being tested. Do your best to cover the following:
This is also known as AAA (Arrange, Act, Assert).
18
54 reads
The idea is part of this collection:
Learn more about computerscience with this collection
Understanding machine learning models
Improving data analysis and decision-making
How Google uses logic in machine learning
Related collections
Similar ideas to Structuring Tests
Jest offers describe
function to help structure your tests. Use describe
to group together all tests that belong to one functionality. Describes can be nested, if you need that. Other functions you'll commonly u...
Read & Learn
20x Faster
without
deepstash
with
deepstash
with
deepstash
Personalized microlearning
—
100+ Learning Journeys
—
Access to 200,000+ ideas
—
Access to the mobile app
—
Unlimited idea saving
—
—
Unlimited history
—
—
Unlimited listening to ideas
—
—
Downloading & offline access
—
—
Supercharge your mind with one idea per day
Enter your email and spend 1 minute every day to learn something new.
I agree to receive email updates