Skip to content
masterclass Buddy

Jest · Function

fit

Jest runs JavaScript tests from test files. Install it, add a test script, and use expect with matchers such as toBe to check results.

Last updated

Syntax

npm install --save-dev jest

// package.json
{"scripts":{"test":"jest"}}

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

Subscribe
  • expect
  • toBe
  • test
  • collectCoverage
  • collectCoverageFrom
  • clearMocks
  • moduleNameMapper
  • jest.config.js

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