File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -63,8 +63,6 @@ export default defineNuxtModule<NuxtVitestOptions>({
63
63
} )
64
64
} )
65
65
66
- const PORT = await getPort ( { port : 15555 } )
67
- const URL = `http://localhost:${ PORT } /__vitest__/`
68
66
let loaded = false
69
67
let promise : Promise < any > | undefined
70
68
let ctx : Vitest = undefined !
@@ -74,6 +72,8 @@ export default defineNuxtModule<NuxtVitestOptions>({
74
72
nuxt . callHook ( 'devtools:customTabs:refresh' )
75
73
} , 100 )
76
74
75
+ let URL : string
76
+
77
77
async function start ( ) {
78
78
const rawViteConfig = mergeConfig ( { } , await rawViteConfigPromise )
79
79
@@ -102,6 +102,11 @@ export default defineNuxtModule<NuxtVitestOptions>({
102
102
103
103
const watchMode = ! process . env . NUXT_VITEST_DEV_TEST && ! isCI
104
104
105
+ // We resolve the path here to ensure the dev server is already running with the correct protocol
106
+ const PORT = await getPort ( { port : 15555 } )
107
+ const PROTOCOL = nuxt . options . devServer . https ? 'https' : 'http'
108
+ URL = `${ PROTOCOL } ://localhost:${ PORT } /__vitest__/`
109
+
105
110
// For testing dev mode in CI, maybe expose an option to user later
106
111
const overrides : VitestConfig = watchMode
107
112
? {
You can’t perform that action at this time.
0 commit comments