@@ -47,8 +47,11 @@ async function bootNuxt(overrides: NuxtConfig, { withoutDevtools = false, instal
4747 await nuxt . close ( )
4848 await rm ( rootDir , { recursive : true , force : true } )
4949 } )
50- if ( withoutDevtools )
51- nuxt . options . modulesDir = [ join ( rootDir , 'node_modules' ) ]
50+ if ( withoutDevtools ) {
51+ nuxt . options . modulesDir = [
52+ join ( rootDir , 'node_modules' ) ,
53+ ]
54+ }
5255 await nuxt . ready ( )
5356 return nuxt
5457}
@@ -59,7 +62,11 @@ function onboardScripts(nuxt: Nuxt) {
5962
6063/** Serves what the module mounts on a real client Vite server; resolves to its origin. */
6164async function serveViteMiddleware ( nuxt : Nuxt ) : Promise < { origin : string , viteServer : ViteDevServer } > {
62- const viteServer = await createViteServer ( { configFile : false , logLevel : 'silent' , server : { middlewareMode : true , ws : false } } )
65+ const viteServer = await createViteServer ( {
66+ configFile : false ,
67+ logLevel : 'silent' ,
68+ server : { middlewareMode : true , ws : false } ,
69+ } )
6370 cleanups . push ( ( ) => viteServer . close ( ) )
6471 // Mount only what the module adds, not Vite's own transform middlewares.
6572 viteServer . middlewares . stack . length = 0
@@ -81,7 +88,10 @@ const onboardStatus = (origin: string) => fetch(`${origin}/__devtools/__onboard/
8188
8289describe ( '@nuxt/devtools-onboard' , ( ) => {
8390 it ( 'does nothing when devtools are disabled' , async ( ) => {
84- const nuxt = await bootNuxt ( { devtools : false , modules : [ onboardModule ] } )
91+ const nuxt = await bootNuxt ( {
92+ devtools : false ,
93+ modules : [ onboardModule ] ,
94+ } )
8595 expect ( nuxt . options . _requiredModules [ '@nuxt/devtools' ] ) . toBeUndefined ( )
8696 expect ( onboardScripts ( nuxt ) ) . toHaveLength ( 0 )
8797 } , 60_000 )
@@ -93,7 +103,10 @@ describe('@nuxt/devtools-onboard', () => {
93103 } , 60_000 )
94104
95105 it ( 'loads @nuxt/devtools-nightly installed under its own name, over @nuxt/devtools' , async ( ) => {
96- const nuxt = await bootNuxt ( { dev : true } , { withoutDevtools : true , installed : [ '@nuxt/devtools' , '@nuxt/devtools-nightly' ] } )
106+ const nuxt = await bootNuxt ( { dev : true } , {
107+ withoutDevtools : true ,
108+ installed : [ '@nuxt/devtools' , '@nuxt/devtools-nightly' ] ,
109+ } )
97110 expect ( nuxt . options . appConfig . loadedDevtools ) . toBe ( '@nuxt/devtools-nightly' )
98111 expect ( onboardScripts ( nuxt ) ) . toHaveLength ( 0 )
99112 } , 60_000 )
0 commit comments