whatisgithub

What is jest-mock-issue-repro?

gaearon/jest-mock-issue-repro — explained in plain English

Analysis updated 2026-07-18 · repo last pushed 2017-03-05

1JavaScriptAudience · developerComplexity · 1/5DormantSetup · easy

In one sentence

A minimal repository created to reproduce a specific bug in Jest's mock functionality, containing only the bare minimum code needed to trigger the issue.

Mindmap

mindmap
  root((repo))
    What it does
      Reproduces Jest bug
      Minimal test case
      Shows mock issue
    Tech stack
      JavaScript
      Jest
      Node
    Use cases
      Report bug to maintainers
      Confirm shared issue
      Debug mock behavior
    Audience
      Tool maintainers
      JavaScript developers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Reproduce a Jest mock bug by running the included test file.

USE CASE 2

Confirm a shared testing glitch by comparing your own mock issues to this example.

USE CASE 3

Provide a minimal test case to help Jest maintainers diagnose and fix the problem.

What is it built with?

JavaScriptJestNode.js

How does it compare?

gaearon/jest-mock-issue-repro0xmukesh/docusaurus-tutoriala15n/andrewscheuermann
Stars111
LanguageJavaScriptJavaScriptJavaScript
Last pushed2017-03-052021-12-272015-01-11
MaintenanceDormantDormantDormant
Setup difficultyeasyeasymoderate
Complexity1/52/51/5
Audiencedeveloperdevelopergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

No gotchas, just clone, run npm install, and npm test to see the bug occur.

No license information is provided in this repository.

So what is it?

This repository, created by Dan Abramov, exists to reproduce a specific bug in Jest's mock functionality. Jest is a popular testing tool for JavaScript applications, and "mocks" are a way to simulate parts of your code, like a function or a module, so you can test how other parts behave without relying on the real thing. When a developer runs into unexpected behavior with testing tools, they often create a minimal example like this to clearly show the problem to the people who maintain the tool. The entire project is essentially a stripped-down test case. There is no user-facing application or product here. Instead, it contains the bare minimum setup needed to trigger the issue: a configuration file, a test file named index.test.js, and the necessary dependencies. By keeping it this minimal, anyone can quickly download it, run the standard npm install and npm test commands, and see the exact problem occur on their own machine without any distracting extra code. This kind of repository is primarily meant for the maintainers of the testing tool and other developers who might be experiencing the same glitch. For example, if a developer finds that their mocked functions are not resetting correctly between tests, causing false failures or unexpected passes, they might look at this reproduction to confirm they are not alone. It serves as a shared, tangible reference point for a conversation about how to fix the underlying tool. The notable thing about this project is simply how little there is to it. It is built to be as small as possible to prove a point. The creator didn't add any extensive documentation or explanations beyond directing the reader to the test file itself. The entire value lies in the code inside that single test file, which demonstrates the exact steps needed to make the testing glitch happen.

Copy-paste prompts

Prompt 1
How do I set up and run this Jest mock bug reproduction repository step by step?
Prompt 2
What specific Jest mock issue does this test file demonstrate, and what is the expected versus actual behavior?
Prompt 3
Based on this minimal reproduction, what might cause Jest mocks to not reset correctly between tests?

Frequently asked questions

What is jest-mock-issue-repro?

A minimal repository created to reproduce a specific bug in Jest's mock functionality, containing only the bare minimum code needed to trigger the issue.

What language is jest-mock-issue-repro written in?

Mainly JavaScript. The stack also includes JavaScript, Jest, Node.js.

Is jest-mock-issue-repro actively maintained?

Dormant — no commits in 2+ years (last push 2017-03-05).

What license does jest-mock-issue-repro use?

No license information is provided in this repository.

How hard is jest-mock-issue-repro to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is jest-mock-issue-repro for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.