File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -137,6 +137,7 @@ export async function getVitestConfigFromNuxt(
137137 {
138138 define : {
139139 'process.env.NODE_ENV' : '"test"' ,
140+ 'process.env.__NUXT_VITEST_RESOLVED__' : '"true"' ,
140141 } ,
141142 resolve : {
142143 alias : {
Original file line number Diff line number Diff line change @@ -75,6 +75,12 @@ export function createTest(options: Partial<TestOptions>): TestHooks {
7575}
7676
7777export async function setup ( options : Partial < TestOptions > = { } ) {
78+ if ( process . env . __NUXT_VITEST_RESOLVED__ ) {
79+ console . warn (
80+ 'Do not use defineVitestConfig or defineVitestProject for end-to-end tests, as they only work with nuxt client-environment tests.\n'
81+ + 'Please refer to the setup section: https://nuxt.com/docs/4.x/getting-started/testing#setup' )
82+ }
83+
7884 const hooks = createTest ( options )
7985
8086 const setupFn = setupMaps [ hooks . ctx . options . runner ]
You can’t perform that action at this time.
0 commit comments