|
1 | 1 | import { promises as fsp } from 'node:fs'
|
2 | 2 | import { fileURLToPath } from 'node:url'
|
3 |
| -import { describe, expect, it } from 'vitest' |
| 3 | +import { beforeAll, describe, expect, it } from 'vitest' |
4 | 4 | import { isWindows } from 'std-env'
|
5 | 5 | import { join } from 'pathe'
|
6 | 6 | import { $fetch, fetch, setup } from '@nuxt/test-utils/e2e'
|
@@ -28,7 +28,7 @@ if (process.env.TEST_ENV !== 'built' && !isWindows) {
|
28 | 28 | const indexVue = await fsp.readFile(join(fixturePath, 'pages/index.vue'), 'utf8')
|
29 | 29 |
|
30 | 30 | describe('hmr', () => {
|
31 |
| - it('should load dev server', async () => { |
| 31 | + beforeAll(async () => { |
32 | 32 | await expectWithPolling(() => $fetch<string>('/').then(r => r.includes('Home page')).catch(() => null), true)
|
33 | 33 | })
|
34 | 34 |
|
@@ -150,6 +150,8 @@ if (process.env.TEST_ENV !== 'built' && !isWindows) {
|
150 | 150 |
|
151 | 151 | await fsp.writeFile(join(fixturePath, 'pages/routes/non-existent.vue'), `<template><div data-testid="contents">A new route!</div></template>`)
|
152 | 152 |
|
| 153 | + await expectWithPolling(() => consoleLogs.some(log => log.text.includes('hmr')), true) |
| 154 | + |
153 | 155 | await page.getByRole('link').click()
|
154 | 156 | await expectWithPolling(() => page.getByTestId('contents').textContent(), 'A new route!')
|
155 | 157 |
|
|
0 commit comments