File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed
Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -2,16 +2,14 @@ export async function setupNuxt() {
22 const { useRouter } = await import ( '#app/composables/router' )
33 // @ts -expect-error alias to allow us to transform the entrypoint
44 await import ( '#app/nuxt-vitest-app-entry' ) . then ( r => r . default ( ) )
5- // We must manually call `page:finish` to snc route after navigation
5+ // We must manually call `page:finish` to sync route after navigation
66 // as there is no `<NuxtPage>` instantiated by default.
77 const nuxtApp = useNuxtApp ( )
8- await nuxtApp . callHook ( 'page:finish' )
9- useRouter ( ) . afterEach ( ( ) => {
10- if ( 'sync' in nuxtApp . _route ) {
11- nuxtApp . _route . sync ?.( )
12- }
13- else {
14- return nuxtApp . callHook ( 'page:finish' )
15- }
16- } )
8+ function sync ( ) {
9+ return nuxtApp . _route . sync
10+ ? nuxtApp . _route . sync ( )
11+ : nuxtApp . callHook ( 'page:finish' )
12+ }
13+ useRouter ( ) . afterEach ( ( ) => sync ( ) )
14+ return sync ( )
1715}
You can’t perform that action at this time.
0 commit comments