Fix TestUtils crash with NODE_ENV=production (#7246)
Fix TestUtils crash with NODE_ENV=production (#7246)

I caused it with #7189.
We generally don’t recommend running TestUtils in production environment but this is technically a regression.

Fixes #7231.
(cherry picked from commit 27d7592cf63253b318c9feac564c8ea2fe9d8383)

with-git/react,with-git/react,with-git/react,with-git/react,with-git/react,with-git/react,with-git/react