1
1
import { describe , expect , it } from 'vitest'
2
2
import { createResolver } from '@nuxt/kit'
3
- import { createPage , setup } from '@nuxt/test-utils/e2e'
3
+ import { createPage , setup , url } from '@nuxt/test-utils/e2e'
4
4
import { parseURL } from 'ufo'
5
5
6
6
const { resolve } = createResolver ( import . meta. url )
@@ -13,7 +13,7 @@ await setup({
13
13
14
14
describe ( 'basic' , ( ) => {
15
15
it ( 'extended registry script loads and executes function' , async ( ) => {
16
- const page = await createPage ( '/' )
16
+ const page = await createPage ( )
17
17
const logs : { text : string , location : string } [ ] = [ ]
18
18
// visit and collect all logs, we need to do a snapshot on them
19
19
page . addListener ( 'console' , ( msg ) => {
@@ -22,8 +22,9 @@ describe('basic', () => {
22
22
location : `${ parseURL ( msg . location ( ) . url ) . pathname } :${ msg . location ( ) . lineNumber } ` ,
23
23
} )
24
24
} )
25
+ await page . goto ( url ( '/' ) )
25
26
await page . waitForTimeout ( 5000 )
26
- expect ( logs ) . toMatchInlineSnapshot ( `
27
+ expect ( logs . filter ( log => ! log . location . startsWith ( '/_nuxt' ) ) ) . toMatchInlineSnapshot ( `
27
28
[
28
29
{
29
30
"location": "/myScript.js:1",
0 commit comments