mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 13:45:18 +00:00
fix(test-utils): prevent orphaned processes and use baseURL when loading (#18623)
This commit is contained in:
parent
a0085b70a3
commit
c9d0b2f6be
@ -30,12 +30,13 @@ export async function startServer () {
|
|||||||
for (let i = 0; i < 50; i++) {
|
for (let i = 0; i < 50; i++) {
|
||||||
await new Promise(resolve => setTimeout(resolve, 100))
|
await new Promise(resolve => setTimeout(resolve, 100))
|
||||||
try {
|
try {
|
||||||
const res = await $fetch('/')
|
const res = await $fetch(ctx.nuxt!.options.app.baseURL)
|
||||||
if (!res.includes('__NUXT_LOADING__')) {
|
if (!res.includes('__NUXT_LOADING__')) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
} catch {}
|
} catch {}
|
||||||
}
|
}
|
||||||
|
ctx.serverProcess.kill()
|
||||||
throw new Error('Timeout waiting for dev server!')
|
throw new Error('Timeout waiting for dev server!')
|
||||||
} else {
|
} else {
|
||||||
ctx.serverProcess = execa('node', [
|
ctx.serverProcess = execa('node', [
|
||||||
|
Loading…
Reference in New Issue
Block a user