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 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 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

33 sources
Read the rest
r https://github.com/szmarczak/http-timer https://github.com/szmarczak/defer-to-connect https://github.com/szmarczak/cacheable-lookup https://github.com/jaredwray/cacheable https://github.com/biomejs/biome https://github.com/sindresorhus/decompress-response https://github.com/sindresorhus/mimic-response https://github.com/octet-stream/form-data-encoder https://github.com/szmarczak/http2-wrapper https://github.com/szmarczak/resolve-alpn https://github.com/sindresorhus/lowercase-keys https://github.com/sindresorhus/p-cancelable https://github.com/sindresorhus/responselike https://github.com/sindresorhus/type-fest https://github.com/sindresorhus/tagged-tag https://github.com/max-mapper/extract-zip https://github.com/sindresorhus/get-stream https://github.com/Sec-ant/readable-stream https://github.com/sindresorhus/is-stream https://github.com/thejoshwolfe/yauzl https://github.com/brianloveswords/buffer-crc32 https://github.com/andrewrk/node-pend https://github.com/i18next/i18next https://github.com/babel/babel https://github.com/microsoft/TypeScript https://github.com/lezer-parser https://github.com/lucide-icons/lucide https://github.com/mathjax/MathJax https://github.com/mermaid-js/mermaid https://github.com/moment/moment https://github.com/mozilla/pdf.js https://github.com/pixijs/pixijs https://github.com/mapbox/earcut https://github.com/primus/eventemitter3 https://github.com/matt-way/gifuct-js https://github.com/matt-way/jsBinarySchemaParser https://github.com/kaimallea/isMobile https://github.com/browserslist/caniuse-lite https://github.com/jkroso/parse-svg-path https://github.com/avoidwork/tiny-lru https://github.com/PrismJS/prism/ https://github.com/mourner/rbush https://github.com/mourner/quickselect https://github.com/remarkjs/remark https://github.com/hakimel/reveal.js https://github.com/barrysteyn/node-scrypt https://github.com/nodejs/nan https://github.com/mixmark-io/turndown https://github.com/mixmark-io/domino https://github.com/webpack/webpack https://github.com/acornjs/acorn https://github.com/nicolo-ribaudo/acorn-import-phases https://github.com/browserslist/browserslist https://github.com/web-platform-dx/baseline-browser-mapping https://github.com/kilian/electron-to-chromium https://github.com/chicoxyzzy/node-releases https://github.com/browserslist/update-db https://github.com/lukeed/escalade https://github.com/alexeyraspopov/picocolors https://github.com/samccone/chrome-trace-event https://github.com/webpack/enhanced-resolve https://github.com/isaacs/node-graceful-fs https://github.com/webpack/tapable https://github.com/guybedford/es-module-lexer https://github.com/eslint/js https://github.com/browserify/events https://github.com/fitzgen/glob-to-regexp https://github.com/isaacs/node-graceful-fs https://github.com/npm/json-parse-even-better-errors https://github.com/webpack/loader-runner https://github.com/jshttp/mime-types https://github.com/jshttp/mime-db https://github.com/suguru03/neo-async https://github.com/webpack/schema-utils https://github.com/ajv-validator/ajv https://github.com/epoberezkin/fast-deep-equal https://github.com/fastify/fast-uri https://github.com/epoberezkin/json-schema-traverse https://github.com/floatdrop/require-from-string https://github.com/ajv-validator/ajv-formats https://github.com/ajv-validator/ajv-keywords https://github.com/DefinitelyTyped/DefinitelyTyped https://github.com/webpack-contrib/terser-webpack-plugin https://github.com/jridgewell/sourcemaps https://github.com/jestjs/jest https://github.com/yahoo/serialize-javascript https://github.com/browserify/randombytes https://github.com/terser/terser https://github.com/tj/commander.js https://github.com/evanw/node-source-map-support https://github.com/LinusU/buffer-from https://github.com/mozilla/source-map https://github.com/webpack/watchpack https://github.com/webpack/webpack-sources https://github.com/eemeli/yaml
In Less is safer: Reducing the risk of supply chain attacks
It's not a secret what jest does. There are a few abstractions to jump through, but I find jest's code very readable overall. By default the `workerThreads` option is set to `false`. Then we reach their `WorkerPool` class which pools the test runs. The "Worker" in the name is not to be confused with WebWorkers or node's worker_threads. It's merely the term the jest team has chosen. Inside that and because workerThreads is set to false, we instantiate a child process here https://github.com/jestjs/jest/blob/00ef0ed0a03764f24ff568bc...
In Speeding up the JavaScript ecosystem – The barrel file debacle
The problem is that for many use cases, ESM is not feature complete. There are important features that are under experimental flags or broken in node.js. node.js released broken, backwards incompatible version of ESM with new resolution algorithm and is waiting for everyone to figure out workarounds for theirs shitty implementation. [jest ESM support] https://github.com/jestjs/jest/issues/9430 [typescript extensions] https://github.com/microsoft/TypeScript/issues/16577 [typescript exports] https://github.com/microsoft/TypeScript/issues/33079 [node.js issues] https://github.com/nodejs/node/issues?q=is%3Aissue+is%3Aopen+sort%3Acomments-desc+… Only in the from few months ago, tooling support is close enough to make it usable.
In ES modules: A cartoon deep-dive (2018)
No, you were using non-standard ESM modules (compiled to CommonJS defined by babel) Typescript recently added support for ESM compatible with node.js see "module": "node16"[1][2] The Whole ESM saga is clusterfuck, not much better than python 2 -> 3 migration. Large node.js codebases have no viable path to migrate, and most tools still cannot support ESM properly[3]. Stuff is already breaking because prolific library authors are switching to ESM. As someone that maintain large part of TS/JS tooling in my day job, I absolutely despise decisions made by node.js module team. My side projects are now in Elixir and zig because these communities care about DX. [1] https://nodejs.org/api/esm.html#differences-between-es-modules-and-commonjs [2] https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-7.html [3] https://github.
Read the rest
com/facebook/jest/issues/9430
In PR that converts the TypeScript repo from namespaces to modules

What do y'all use for back end integration testing? (Services, Parallelism)

There's many unit testing libraries like mocha and jest but there do not seem to be many for integration testing. To be clear, I mean integrating disparate backend modules together. For example, the extremely common case of testing a bunch of lambda functions on AWS. To be fair, there is a lot of overlap. They both need an assertion library, great debugging features for when tests fail, various hooks for setup and teardown, and some way to control the execution flow of tests. It is the last feature where unit testing libraries refuse to play ball. Integration tests oftentimes require a partial order and can be represented as a DAG: certain tests are dependent on other tests before they can run but where possible, parallelism should be employed (for performance reasons). This Github issue refers to my problem but the maintainers completely
Read the rest
misunderstand the use case [0]. Mocha has mocha-steps[1] but its a total order and everything is run serially. Is this not a common use case? Are people okay with the performance of running integration test suites serially? Do people just invest in unit tests more and leave integration tests to some script some guy made way back "but it works?" Seems crazy to me that popular libraries don't let you declare a partial order for your tests or declare arbitrary dependencies. [0]: https://github.com/facebook/jest/issues/5823 [1]: https://www.npmjs.com/package/mocha-steps
2 points · Open discussion

Showing the 15 most recent of 33 sources. Enable JavaScript to search and browse every indexed mention.

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.