Skip to content

Commit

Permalink
test: remove workaround for route update
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Dec 5, 2023
1 parent e662c1f commit c9699ad
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions examples/app-vitest-full/tests/nuxt/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,8 @@ describe('client-side nuxt features', () => {
it('allows pushing to other pages', async () => {
await navigateTo('/something')
expect(useNuxtApp().$router.currentRoute.value.path).toEqual('/something')
// It takes a few ticks for the Nuxt useRoute to be updated (as, after suspense resolves,
// we wait for a final hook and then update the injected route object )
const route = useRoute()
await new Promise<void>(resolve => {
const unsub = watch(
() => route.path,
path => {
if (path === '/something') {
unsub()
resolve()
}
}
)
})
expect(route.path).toEqual('/something')
await nextTick()
expect(useRoute().path).toEqual('/something')
})
})

Expand Down

0 comments on commit c9699ad

Please sign in to comment.