Skip to content

Commit f1e5a2d

Browse files
committed
test: double gotoPath timeout in CI
1 parent be9706d commit f1e5a2d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/utils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { parse } from 'devalue'
55
import { reactive, ref, shallowReactive, shallowRef } from 'vue'
66
import { createError } from 'h3'
77
import { getBrowser, url, useTestContext } from '@nuxt/test-utils/e2e'
8+
import { isCI } from 'std-env'
89

910
export const isRenderingJson = process.env.TEST_PAYLOAD !== 'js'
1011

@@ -71,8 +72,9 @@ export function expectNoErrorsOrWarnings (consoleLogs: Array<{ type: string, tex
7172
expect(consoleLogWarnings).toEqual([])
7273
}
7374

75+
const BASE_TIMEOUT = isCI ? 6_000 : 3_000
7476
export async function gotoPath (page: Page, path: string, retries = 0) {
75-
await vi.waitFor(() => page.goto(url(path), { timeout: 3000 }), { timeout: 3000 * retries || 3000 })
77+
await vi.waitFor(() => page.goto(url(path), { timeout: BASE_TIMEOUT }), { timeout: BASE_TIMEOUT * retries || BASE_TIMEOUT })
7678
await page.waitForFunction(path => window.useNuxtApp?.()._route.fullPath === path && !window.useNuxtApp?.().isHydrating, path)
7779
}
7880

0 commit comments

Comments
 (0)