diff --git a/packages/browser/src/node/plugin.ts b/packages/browser/src/node/plugin.ts index 524fb9bf3307..a96da95ce8d1 100644 --- a/packages/browser/src/node/plugin.ts +++ b/packages/browser/src/node/plugin.ts @@ -168,7 +168,6 @@ export default (browserServer: BrowserServer, base = '/'): Plugin[] => { const define: Record = {} for (const env in (project.config.env || {})) { const stringValue = JSON.stringify(project.config.env[env]) - define[`process.env.${env}`] = stringValue define[`import.meta.env.${env}`] = stringValue } @@ -388,24 +387,10 @@ export default (browserServer: BrowserServer, base = '/'): Plugin[] => { } }, }, - // TODO: remove this when @testing-library/vue supports ESM { name: 'vitest:browser:support-testing-library', config() { return { - define: { - // testing-library/preact - 'process.env.PTL_SKIP_AUTO_CLEANUP': !!process.env.PTL_SKIP_AUTO_CLEANUP, - // testing-library/react - 'process.env.RTL_SKIP_AUTO_CLEANUP': !!process.env.RTL_SKIP_AUTO_CLEANUP, - 'process.env?.RTL_SKIP_AUTO_CLEANUP': !!process.env.RTL_SKIP_AUTO_CLEANUP, - // testing-library/svelte, testing-library/solid - 'process.env.STL_SKIP_AUTO_CLEANUP': !!process.env.STL_SKIP_AUTO_CLEANUP, - // testing-library/vue - 'process.env.VTL_SKIP_AUTO_CLEANUP': !!process.env.VTL_SKIP_AUTO_CLEANUP, - // dom.debug() - 'process.env.DEBUG_PRINT_LIMIT': process.env.DEBUG_PRINT_LIMIT || 7000, - }, optimizeDeps: { esbuildOptions: { plugins: [ diff --git a/test/browser/test/another.test.ts b/test/browser/test/another.test.ts index 1e66b9ab7ea2..31e0886d7897 100644 --- a/test/browser/test/another.test.ts +++ b/test/browser/test/another.test.ts @@ -3,3 +3,7 @@ import { expect, it } from 'vitest' it('basic 3', async () => { expect(globalThis.window).toBeDefined() }) + +it('no process', () => { + expect(globalThis.process).toBeUndefined() +})