Skip to content
masterclass Buddy

Jest · Module

assertions

Jest tests JavaScript code with test files and assertions. Install it as a development dependency, add a test script, and run the test command.

Last updated

Syntax

test(name, fn)
expect(value).toBe(expected)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • expect
  • toBe
  • Using Matchers
  • npm test
  • yarn test
  • sum.test.js

Source: Getting Started · Jest. Checked 2026-11-03.