You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Hot runtime: RNTL configure() in one file reaches later files on the worker #807
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.tsximport{configure}from"@testing-library/react-native";test("a",()=>configure({defaultIncludeHiddenElements: true}));// b.test.tsxawaitrender(<Textstyle={{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