# Jest — card for AI agents

Delightful JavaScript testing framework with minimal configuration.

Category: Testing · npm package `jest` · latest version 30.5.2 (checked 2026-11-01)
Install: `npm install jest`
License: MIT (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Rules for AI agents (paste into AGENTS.md or CLAUDE.md)

## 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.

## What it is
- Jest is a JavaScript test framework. The site calls it "a delightful JavaScript Testing Framework with a focus on simplicity" and names Babel, TypeScript, Node, React, Angular and Vue as project types it works with. The README says it "works out of the box for most JavaScript projects."
- Setup is a dev dependency plus a `"test": "jest"` script in `package.json`. Tests live in files such as `sum.test.js` and use `test` and `expect`. If you want a config file, `npm init jest@latest` asks a few questions and writes one with a short note on each option.
- TypeScript goes through Babel or through `ts-jest`. Typed globals come from `@jest/globals` or `@types/jest`. Vite is the sore spot: the docs say Jest is not supported by Vite, and the README says it is "not fully supported".

## Caveats
- Vite: unsupported per the docs, "not fully" per the README: The Getting Started docs say Jest is not supported by Vite because of the Vite plugin system. They say the `vite-jest` 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".
- Babel path skips type-checking: With `@babel/preset-typescript`, TypeScript is only transpiled, so Jest does not type-check tests as they run. For type checks, the docs point to `ts-jest` or running `tsc` separately.
- `@types/jest` is third-party and can lag: The docs note that `@types/jest` is maintained at DefinitelyTyped. They warn the latest Jest features or versions may not be covered yet. `@jest/globals` ships with Jest and updates with it.
- A Babel config silently turns on `babel-jest`: The docs say `babel-jest` installs with Jest and transforms files whenever a Babel configuration exists. Setting `transform: {}` in `jest.config.js` turns this off.
- ESLint flags Jest globals: The docs say ESLint does not know Jest's globals and will raise `no-undef` errors. The fixes they give are importing helpers from `@jest/globals`, adding the `jest` globals to the ESLint config, or using `eslint-plugin-jest`.

## Numbers (AgentGid data)
- Gid Score: 85.5 (#39 of all tools, 3 of 122 in its category)
- Used in 396 public projects set up for AI coding agents (6.3%)
- Downloads last week: 63,211,142 (as of 2026-11-24), +36.1% over 4 weeks
- GitHub stars: 45,478 (as of 2026-11-24)
- Last push: 2026-11-20

## Often used with
Testing Library 44.7%, ESLint 77.5%, TypeScript 86.9%, Prettier 53.0%, ts-node 33.1%, React 58.1%

## Checked alternatives (same job)
- Vitest: https://agentgid.com/tools/vitest/agent.md

## Links
- AgentGid page: https://agentgid.com/tools/jest/
- Homepage: https://jestjs.io/
- Repository: https://github.com/jestjs/jest
- Source: https://github.com/jestjs/jest#readme
- Source: https://github.com/jestjs/jest
- Source: https://github.com/jestjs/jest/releases
- Source: https://jestjs.io
- Source: https://jestjs.io/docs/getting-started

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
