diff --git a/packages/plugin-react/src/index.ts b/packages/plugin-react/src/index.ts index fbcdce8a..3db4d992 100644 --- a/packages/plugin-react/src/index.ts +++ b/packages/plugin-react/src/index.ts @@ -128,7 +128,7 @@ export default function viteReact(opts: Options = {}): PluginOption[] { skipFastRefresh = isProduction || config.command === 'build' || - (!!process.env.TEST && !process.env.VITE_TEST_HMR) + config.server.hmr === false if ('jsxPure' in opts) { config.logger.warnOnce( diff --git a/playground/test-utils.ts b/playground/test-utils.ts index 4b13bcfe..d404d438 100644 --- a/playground/test-utils.ts +++ b/playground/test-utils.ts @@ -95,7 +95,7 @@ export async function untilUpdated( runInBuild = false, ): Promise { if (isBuild && !runInBuild) return - const maxTries = process.env.CI ? 200 : 50 + const maxTries = process.env.CI ? 100 : 50 for (let tries = 0; tries < maxTries; tries++) { const actual = (await poll()) ?? '' if (actual.indexOf(expected) > -1 || tries === maxTries - 1) { diff --git a/playground/vitest.config.e2e.ts b/playground/vitest.config.e2e.ts index 28c166ae..0671b3ba 100644 --- a/playground/vitest.config.e2e.ts +++ b/playground/vitest.config.e2e.ts @@ -1,7 +1,7 @@ import { resolve } from 'node:path' import { defineConfig } from 'vitest/config' -const timeout = process.env.CI ? 50000 : 30000 +const timeout = process.env.CI ? 20_000 : 10_000 export default defineConfig({ resolve: { diff --git a/playground/vitestGlobalSetup.ts b/playground/vitestGlobalSetup.ts index 8e655ccd..7a63d6d1 100644 --- a/playground/vitestGlobalSetup.ts +++ b/playground/vitestGlobalSetup.ts @@ -9,7 +9,6 @@ const DIR = path.join(os.tmpdir(), 'vitest_playwright_global_setup') let browserServer: BrowserServer | undefined export async function setup(): Promise { - process.env.VITE_TEST_HMR = 'true' // To force HMR transformation in test environment process.env.NODE_ENV = process.env.VITE_TEST_BUILD ? 'production' : 'development'