3. Used by agents' projects
Dependency in 396 public GitHub projects set up for AI coding agents that we scanned (6.3%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
From the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error
What Jest does
Jest's own site makes speed its main argument: it says each test runs in its own process so tests can run in parallel, failed tests run first, and the README adds a watch mode that only reruns tests tied to changed files.
Jest popularity
Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated
How Jest is used
- Jest is a dependency in 396 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (8.1% of the 4,867 JavaScript/TypeScript ones), #5 of 122 in testing.
- Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 1,123; those are left out of every share on this page.
- The most used alternative in our scan is Vitest (1,312 projects).
- Projects that use it most often also use Testing Library (44.7%), ESLint (77.5%), TypeScript (86.9%).
- It is more common in projects set up for Devin Desktop (14.3%) than for GitHub Copilot (5.7%).
By coding agent
Often used with
Jest in practice
Strengths
The site says tests are parallelized by running them in their own processes. It says unique global state per test lets Jest run them in parallel reliably. It also says Jest runs previously failed tests first and reorders runs by how long each test file takes.
The README says the interactive watch mode "only runs test files related to changed files."
The site says snapshot tests track large objects. It says the snapshots can sit alongside your tests or be embedded inline in them.
The site says Jest resolves imports in tests with its own resolver. It says this makes it simple to mock any object outside the test's scope, and that the Mock Functions API can spy on calls.
Watch out for
The Getting Started docs say Jest is not supported by Vite because of the Vite plugin system. They say the <code>vite-jest</code> examples are "not compatible with versions of Vite later than 2.4.2" and name Vitest as one alternative. The README uses softer wording: "not fully supported".
With <code>@babel/preset-typescript</code>, TypeScript is only transpiled, so Jest does not type-check tests as they run. For type checks, the docs point to <code>ts-jest</code> or running <code>tsc</code> separately.
The docs note that <code>@types/jest</code> is maintained at DefinitelyTyped. They warn the latest Jest features or versions may not be covered yet. <code>@jest/globals</code> ships with Jest and updates with it.
The README's first test (sum.test.js)
const sum = require('./sum');
test('adds 1 + 2 to equal 3', () => {
expect(sum(1, 2)).toBe(3);
});More about Jest
Funding
- Open Collective: https://opencollective.com/jest
Head to head
- Vitest vs Jest used together in 61 projects
Packages around it
- ts-jest: TypeScript preprocessor for Jest
- jest-environment-jsdom: jsdom test environment
- babel-jest: Babel transform, installed with Jest
- jest-environment-node: Node test environment
- jest-expo: Jest preset for Expo
- jest-util: Jest internal utilities
Alternatives
Jest This page
Next-generation testing framework powered by Vite with native ESM.
Get started
Install it.
npm install jestRules for your agent
## Jest
- Install Jest as a dev dependency (`npm install --save-dev jest`) and run it through a `"test": "jest"` script in `package.json`.
- In test files, import `describe`, `expect`, `test` and other helpers from `@jest/globals`. The docs say this lets ESLint work without extra config and avoids `no-undef` errors.
- If the project uses `@types/jest` instead, match its version to Jest (the docs' example: Jest 27.4.0 → `@types/jest` 27.4.x).
- When TypeScript goes through `@babel/preset-typescript`, do not count on Jest to catch type errors. Use `ts-jest` or run `tsc` separately.
- Any Babel config makes `babel-jest` transform files. Set `transform: {}` in `jest.config.js` if that is not wanted.
- Before adding Jest to a Vite project, check the limits. The docs say it is not supported by Vite and `vite-jest` is not compatible with Vite later than 2.4.2. The README says "not fully supported". The docs name Vitest as one alternative.