describe('math', () => {
it('adds numbers', () => {
expect(1 + 2).toBe(3);
});
});What does
it(...) represent in this code?- aA group of related tests
- bA single test case✓
- cA setup hook run before tests
- dAn assertion library
Explanation:
it() (an alias of test()) defines one individual test case with a description and a callback containing the actual assertions. describe() is what groups related tests together.