Skip to content

Commit 35f0657

Browse files
committed
chore: fix flaky test
1 parent 12ba618 commit 35f0657

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/e2e/extend-registry.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { describe, expect, it } from 'vitest'
22
import { createResolver } from '@nuxt/kit'
3-
import { createPage, setup } from '@nuxt/test-utils/e2e'
3+
import { createPage, setup, url } from '@nuxt/test-utils/e2e'
44
import { parseURL } from 'ufo'
55

66
const { resolve } = createResolver(import.meta.url)
@@ -13,7 +13,7 @@ await setup({
1313

1414
describe('basic', () => {
1515
it('extended registry script loads and executes function', async () => {
16-
const page = await createPage('/')
16+
const page = await createPage()
1717
const logs: { text: string, location: string }[] = []
1818
// visit and collect all logs, we need to do a snapshot on them
1919
page.addListener('console', (msg) => {
@@ -22,8 +22,9 @@ describe('basic', () => {
2222
location: `${parseURL(msg.location().url).pathname}:${msg.location().lineNumber}`,
2323
})
2424
})
25+
await page.goto(url('/'))
2526
await page.waitForTimeout(5000)
26-
expect(logs).toMatchInlineSnapshot(`
27+
expect(logs.filter(log => !log.location.startsWith('/_nuxt'))).toMatchInlineSnapshot(`
2728
[
2829
{
2930
"location": "/myScript.js:1",

0 commit comments

Comments
 (0)