HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
jestjs
jest
TypeScript2016–2026
jestjs / jest

jest

Delightful JavaScript Testing.

31Distinct people
33Mentions
0Explicit recommenders
45.5KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Delightful JavaScript Testing.

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 8–Nov 15 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/15/2026, 12:45:45 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year33 dated mentions

Observed mentions: 2016-10-11 16:52:33 UTC to 2026-02-05 14:35:26 UTC.

02468102016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments20162017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 2 mentions; 2 submissions, 0 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 6 mentions; 2 submissions, 4 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20212022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 10 mentions; 3 submissions, 7 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC202
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC202
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC220
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC624
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC312
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC101
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC1037
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC505
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC000
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC101
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC101

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
🃏 Delightful JavaScript Testing 👩🏻‍💻 Developer Ready: A comprehensive JavaScript testing solution. Works out of the box for most JavaScript projects. 🏃🏽 Instant Feedback: Fast, interactive watch mode only runs test files related to changed files. 📸 Snapshot Testing: Capture snapshots of large objects to simplify testing and to analyze how they change over time. See more on jestjs.io Table of Contents Getting Started Running from command line Additional Configuration Generate a basic configuration file Using Babel Using webpack Using Vite Using Parcel Using Typescript Documentation Badge Contributing Code of Conduct Contributing Guide Good First Issues Credits Backers Sponsors License Copyright Getting Started Install Jest using yarn: yarn add --dev jest Or npm: npm install --save-dev jest Note: Jest documentation uses yarn commands, but npm will also work. You can compare yarn and npm commands in the yarn docs, here. Let's get started by writing a test for a hypothetical function that adds two numbers. First, create a sum.js file: function sum(a, b) { return a + b; } module.exports = sum; Then, create a file named sum.test.js. This will contain our actual test: const sum = require('./sum'); test('adds 1 + 2 to equal 3', () => { expect(sum(1, 2)).toBe(3); }); Add the following section to your package.json: { "scripts": { "test": "jest" } } Finally, run yarn test or npm test and Jest will print this message: PASS ./sum.test.js ✓ adds 1 + 2 to equal 3 (5ms) You just successfully wrote your first test using Jest! This test used expect and toBe to test that two values were exactly identical. To learn about the other things that Jest can test, see Using Matchers. Running from command line You can run Jest directly from the CLI (if it's globally available in your PATH, e.g. by yarn global add jest or npm install jest --global) with a variety of useful options. Here's how to run Jest on files matching my-test, using config.json as a configuration file and display a native OS notification after the run: jest my-test --notify --config=config.json If you'd like to learn more about running jest through the command line, take a look at the Jest CLI Options page. Additional Configuration Generate a basic configuration file Based on your project, Jest will ask you a few questions and will create a basic configuration file with a short description for each option: yarn create jest Using Babel To use Babel, install required dependencies via yarn: yarn add --dev babel-jest @babel/core @babel/preset-env Configure Babel to target your current version of Node by creating a babel.config.js file in the root of your project: // babel.config.js module.exports = { presets: [['@babel/preset-env', {targets: {node: 'current'}}]], }; The ideal configuration for Babel will depend on your project. See Babel's docs for more details. Making your Babel config jest-aware Jest will set process.env.NODE_ENV to 'test' if it's not set to something else. You can use that in your configuration to conditionally setup only the compilation needed for Jest, e.g. // babel.config.js module.exports = api => { const isTest = api.env('test'); // You can use isTest to determine what presets and plugins to use. return { // ... }; }; Note: babel-jest is automatically installed when installing Jest and will automatically transform files if a babel configuration exists in your project. To avoid this behavior, you can explicitly reset the transform configuration option: // jest.config.js module.exports = { transform: {}, }; Using webpack Jest can be used in projects that use webpack to manage assets, styles, and compilation. webpack does offer some unique challenges over other tools. Refer to the webpack guide to get started. Using Vite Jest can be used in projects that use vite to serves source code over native ESM to provide some frontend tooling, vite is an opinionated tool and does offer some out-of-the box workflows. Jest is not fully supported by vite due to how the plugin system from vite works, but there is some working examples for first-class jest integration using the vite-jest, since this is not fully supported, you might as well read the limitation of the vite-jest. Refer to the vite guide to get started. Using Parcel Jest can be used in projects that use parcel-bundler to manage assets, styles, and compilation similar to webpack. Parcel requires zero configuration. Refer to the official docs to get started. Using TypeScript Jest supports TypeScript, via Babel. First, make sure you followed the instructions on using Babel above. Next, install the @babel/preset-typescript via yarn: yarn add --dev @babel/preset-typescript Then add @babel/preset-typescript to the list of presets in your babel.config.js. // babel.config.js module.exports = { presets: [ ['@babel/preset-env', {targets: {node: 'current'}}], + '@babel/preset-typescript', ], }; However, there are some caveats to using TypeScript with Babel. Because TypeScript support in Babel is purely transpilation, Jest will not type-check your tests as they are run. If you want that, you can use ts-jest instead, or just run the TypeScript compiler tsc separately (or as part of your build process). Documentation Learn more about using Jest on the official site! Getting Started Guides API Reference Configuring Jest Badge Show the world you're using Jest → [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg?logo=jest)](https://github.com/jestjs/jest) [![jest tested](https://img.shields.io/badge/Jest-tested-eee.svg?logo=jest&labelColor=99424f)](https://github.com/jestjs/jest) [![jest](https://jestjs.io/img/jest-badge.svg)](https://github.com/jestjs/jest) Contributing Development of Jest happens in the open on GitHub, and we are grateful to the community for contributing bugfixes and improvements. Read below to learn how you can take part in improving Jest. Code of Conduct Facebook has adopted a Cod
Read the full README on GitHub

What Hacker News says

2 sources
When jest was first released, it was incredibly, glacially slow, buggy, poorly documented, and seemed to be largely unmaintained. Critical features were broken and stayed broken for months. I was an early adopter and I got burned hard, having to rewrite everything in Mocha. Since then, apparently, it has changed hugely, and is now fast, reliable, and pleasant to use. Or so I've heard; I have no particular reason to change back to jest, since mocha is fine. But if you're wondering why you've heard about it being slow, it's because for many, many months jest was absurdly, unbelievably slow; simple "hello world" tests would take seconds, and even a medium projects would take minutes. And there was no watch mode, nor any ability to re-run failing tests, or re-run tests on changed files. It was absurd. Edit: See, eg, https://github.com/f
Read the rest
acebook/jest/issues/116 opened 8 Aug 2014, and finally closed 17 Feb 2016. Quite a run. Also, there were tons of bugs with the mocking and, especially, the `dontMock()` methods; many things could cause attempts to turn mocking off to silently, invisibly fail (or even more fun, to cause an attempt to disable mocking on one item to cause it to be silently, invisibly disabled on all items). It's amazingly hard to track down a failing test when a bug triggered by code in another test can cause items that should be mocked to not be mocked, and visa versa.
In Jest – Painless JavaScript Testing
You are right, we aren't 100% compatible right now. Please track the issues on the Yarn GitHub repo that you linked or better yet: help us fix it. This is a community project and we are excited for the community to jump in and help us out and complete the few missing pieces. I agree local development with many packages can be hard. For Jest we adopted `lerna` See https://github.com/facebook/jest and https://github.com/lerna/lerna which makes cross-package development in a mono-repo a lot of fun. Maybe that solution will work for you?
In Yarn – A new package manager for JavaScript

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.