Jest test() Function
Multiple Choice Easy
Question
In Jest, what are the two arguments passed to test()?
Hint
One describes the test, the other runs it.
Explanation
In Jest, test(name, callback) takes two arguments: a string name that describes what the test checks, and a callback function that contains the test logic including any assertions. For example: test('adds 1 + 2 to equal 3', () => { expect(1 + 2).toBe(3); }).
Related Resources
Related Lessons
- Jest Basics
Getting started with Jest.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.