Repolode
jestjs

jestjs/jest

Jest is a JavaScript testing framework with built-in assertions, mocking, snapshot testing and an interactive watch mode.

Stars
45,469
Forks
6,714
Open issues
244
Last commit
7 hours ago

What is it?

Jest is a JavaScript testing framework aimed at getting a test setup working with little configuration for most JavaScript projects. Tests are written with a familiar expect-style API, using matchers such as toBe to check values.

Its watch mode is interactive and only reruns test files related to the files that changed. Snapshot testing lets you capture large objects and track how their output changes over time.

Jest works with Babel for transpilation, and the documentation covers setups with webpack, Vite, Parcel and TypeScript. TypeScript is supported through Babel, which transpiles without type-checking, so tsc or ts-jest is needed for type checks.

Key features

  • 01Zero-configuration setup for most JavaScript projects
  • 02Interactive watch mode that reruns only tests related to changed files
  • 03Snapshot testing for capturing and comparing large object output
  • 04Built-in expect-style assertions and matchers
  • 05Babel integration for transpiling modern JavaScript and TypeScript

Use cases

  • Writing unit tests for JavaScript or TypeScript functions and modules
  • Running a fast test feedback loop during development with watch mode
  • Tracking unexpected changes in component or API output with snapshots

Quick start

  1. 1

    Install Jest as a dev dependency with npm

    npm install --save-dev jest
  2. 2

    Add a test script to package.json that runs jest

  3. 3

    Run the test suite with npm test

    npm test

Things to know

  • Jest does not type-check TypeScript tests when used with Babel, so a separate tsc step is needed for type checking.
  • Full Vite integration is not officially supported and relies on third-party plugins with limitations.

In collections

Topics

FAQ

What is jest?
Jest is a JavaScript testing framework with built-in assertions, mocking, snapshot testing and an interactive watch mode. Jest is a JavaScript testing framework aimed at getting a test setup working with little configuration for most JavaScript projects. Tests are written with a familiar expect-style API, using matchers such as toBe to check values.
Is jest free to use? What license does it have?
jest is open source under the MIT license. Check the license terms before using it in commercial products.
Is jest still maintained?
Actively maintained. The last commit to jest was on Oct 22, 2026.
What can I use jest for?
Writing unit tests for JavaScript or TypeScript functions and modules Running a fast test feedback loop during development with watch mode Tracking unexpected changes in component or API output with snapshots
How do I install jest?
Install Jest as a dev dependency with npm: npm install --save-dev jest Add a test script to package.json that runs jest Run the test suite with npm test: npm test
Where can I get jest?
The source code and installation instructions are on GitHub: https://github.com/jestjs/jest

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects