Skip to content

Hot runtime: RNTL configure() in one file reaches later files on the worker #807

Open

Description

@danfry1

Under hotRuntime, a call to React Native Testing Library's configure() in one test file stays in effect for every later file on the same worker. Under per-file isolation (and under Jest), each file loads RNTL again and starts from its defaults.

Repro: two files run in order on one worker.

// a.test.tsx
import { configure } from "@testing-library/react-native";
test("a", () => configure({ defaultIncludeHiddenElements: true }));

// b.test.tsx
await render(<Text style={{ display: "none" }}>hidden</Text>);
screen.queryByText("hidden"); // per-file isolation: null; hot: found

RNTL is a resident package, so its module-level config survives the per-file reset. hotRuntime: { freshRuntime: true } does not have the problem, since RNTL loads again for each file.

A file that calls configure() in a setup file is unaffected, because setup files run again for every file. The problem is a configure() call inside a test file, which leaks to whichever files run after it.

Either restore RNTL's configuration at each file boundary, or document it as a known difference.

Activity

  1. added this to the 0.16.0 milestone on Nov 14, 2026
  2. added
    bug
    area:hot-runtime
    priority:medium
    on Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:hot-runtimebugpriority:medium

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions