1 / 5 · Welcome

Every problem is a question the world is asking.

Zetema (ζήτημα, Greek for “a thing sought”) gathers real problems people want solved, from public pages around the world. Builders find something worth building, and anyone living with a problem can share it, no coding needed.

Edit
Developer tools · A few weeksAnywhere· Source · Sep 2026

Developers can't mock two modules that share a file name, like two index.js files, in different folders.

JavaScript developers who write Jest tests with manual mocks

Where it stands

  1. Sourced (done)
  2. Kit (done)
  3. Wanted (next)
  4. Building
  5. Solved

How this problem came to be

  1. Found1 sourcegithub.com/jestjs
  2. Quoted5 claimseach checked against its page
  3. BriefWrittenand what solved looks like
  4. Market2 signals220 reactions on the issue
  5. Kit6 steps22 tools · 6 routes
  6. People0 want0 live it · 0 would test

The problem, broken down

Who it hurts
Jest users who write manual mocks for modules that have the same file name in different directories
The moment
Jest shows a duplicate manual mock warning, or the mock file is ignored and the real module is used instead.
What people do today
Developers rename their non-test files so each name is unique, which the source calls a workaround.
Why it's unsolved
The source says manual mocks are matched by base name across the project. Changing that is a breaking change, and the Jest maintainer says internal Facebook code depends on the current behavior.
What solved looks like
Two manual mocks with the same file name in different folders both work, and each one replaces the module next to it.

Evidence lens

Every claim points at the quote it rests on

Sources

GitHub · jestjs/jest ↗
[1]“This warning is caused by two manual mock files with the same file name.”[2]“If, however, I try to create `src/app/modules/__mocks__/{module1.js,module2.js}`, the mocked files are not used.”[3]“This means that `basename`s for modules need to be **globally** unique in a project when using manual mocks.”[4]“Yes, mocks are "global" as well. This is a terrible design that we have to live with, unfortunately.”[5]“Manual mocks are defined by writing a module in a __mocks__/ subdirectory immediately adjacent to the module.”

Claims

1Jest reports a duplicate manual mock when two mock files share the same file name.✓ Quote found in source
2The reporter says that a mock placed in a shared __mocks__ folder was not used.✓ Quote found in source
3A maintainer says basenames for modules must be globally unique when using manual mocks.✓ Quote found in source
4A maintainer says mocks are global and the design is hard to change.✓ Quote found in source
5Jest's documentation says manual mocks go in a __mocks__ folder right next to the module.✓ Quote found in source

Drafted with claude-haiku-5-5 from the cited source and published automatically. Every quote was checked against the source.

Sources

From a public page with a citation.

  1. [1]GitHub · jestjs/jest
What the source says, in short

Jest shows a duplicate manual mock warning, or the mock file is ignored and the real module is used instead. Developers rename their non-test files so each name is unique, which the source calls a workaround. The source says manual mocks are matched by base name across the project. Changing that is a breaking change, and the Jest maintainer says internal Facebook code depends on the current behavior.

Forks 0

Nobody has forked this yet. Be the first.

Market read

How big this is, from the evidence

  • npm registry ↗Our estimate · Low confidenceAbout 61 million Jest downloads a week on npm“"downloads":61298221”
  • GitHub ↗Builders' pull · Medium confidence220 reactions on the issue

How these were measured: The npm registry counted 61,298,221 downloads of jest from 29 October to 4 November 2026. Downloads include automated builds and are not people, and this is the upper bound of use, not the number who hit duplicate mock names. Total reactions on the GitHub issue, read from its API.

For whoever takes this up

The builder's path for this problem

A path written for this problem: its open questions, who to talk to, its data and its ideas, with tools for each stage and a starter prompt ready to paste into any assistant.

Open the path

Discussion 0

No comments yet.