diff --git a/packages/react-refresh/src/__tests__/ReactFreshBabelPlugin-test.js b/packages/react-refresh/src/__tests__/ReactFreshBabelPlugin-test.js index cdcfe4d840730..ee2bc70f8125c 100644 --- a/packages/react-refresh/src/__tests__/ReactFreshBabelPlugin-test.js +++ b/packages/react-refresh/src/__tests__/ReactFreshBabelPlugin-test.js @@ -504,10 +504,15 @@ describe('ReactFreshBabelPlugin', () => { it("respects Babel's envName option", () => { const envName = 'random'; expect(() => - transform(`export default function BabelEnv () { return null };`, { - envName, - skipEnvCheck: false, - }), + transform( + `export default function Foo() { + return

Hi

; + }`, + { + envName, + skipEnvCheck: false, + }, + ), ).toThrowError( 'React Refresh Babel transform should only be enabled in development environment. ' + 'Instead, the environment is: "' +