# Jest

> A test tool for JavaScript. It finds your tests and runs them.

**Field:** Software Development  
**Category:** Testing & Quality  
**Also known as:** Jest JS, jest testing

## Think of it like

Think of it like a full test kit in one box. Everything you need is inside.

## Definition

Jest is a popular tool for testing JavaScript and TypeScript code. Facebook built it and released it in 2014. It finds test files, runs them and shows which passed. It also has mocks, spies and snapshot tests built in, so most projects need nothing extra. Test files usually end in .test.js, and checks are written with expect.

## Example

Emma adds Jest to her React app. She types npx jest, and it runs her 85 tests in 6 seconds.

## Example code

```console
$ npx jest
Tests:       1 passed, 1 total
```

Jest found the tests, ran them and printed the count.

## Why it matters

It works with almost no set-up. A JavaScript project can have tests from day one.

## Common mistake

Testing code that needs a browser in Jest's default setup. Pick a browser-like test environment first.

## Three principles

- **For JavaScript.** And TypeScript.
- **All in one.** Runner, mocks, snapshots.
- **Little set-up.** Works out of the box.

## Related terms

- [Test Runner](https://learn.benibix.com/term/development/test-runner)
- [Vitest](https://learn.benibix.com/term/development/vitest)
- [JavaScript](https://learn.benibix.com/term/development/javascript)
- [Snapshot Test](https://learn.benibix.com/term/development/snapshot-test)
- [Testing Library](https://learn.benibix.com/term/development/testing-library)

## Told apart from

- [Jest vs Vitest](https://learn.benibix.com/compare/jest-vs-vitest): Jest and Vitest are both tools that run tests for JavaScript, and their test and expect functions look almost the same. Vitest is built on Vite and reuses its settings, so it fits apps made with Vite. Jest is older and works with almost any project.

---

Source: https://learn.benibix.com/term/development/jest
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
