Skip to content

Commit c9699ad

Browse files
committed
test: remove workaround for route update
1 parent e662c1f commit c9699ad

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

examples/app-vitest-full/tests/nuxt/index.spec.ts

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,8 @@ describe('client-side nuxt features', () => {
4242
it('allows pushing to other pages', async () => {
4343
await navigateTo('/something')
4444
expect(useNuxtApp().$router.currentRoute.value.path).toEqual('/something')
45-
// It takes a few ticks for the Nuxt useRoute to be updated (as, after suspense resolves,
46-
// we wait for a final hook and then update the injected route object )
47-
const route = useRoute()
48-
await new Promise<void>(resolve => {
49-
const unsub = watch(
50-
() => route.path,
51-
path => {
52-
if (path === '/something') {
53-
unsub()
54-
resolve()
55-
}
56-
}
57-
)
58-
})
59-
expect(route.path).toEqual('/something')
45+
await nextTick()
46+
expect(useRoute().path).toEqual('/something')
6047
})
6148
})
6249

0 commit comments

Comments
 (0)