Skip to content

Commit

Permalink
test: add example of importing a dynamic route
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Dec 5, 2023
1 parent 55cbda2 commit fe420b9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/app-vitest-full/pages/other/[slug].vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<template>
<div />
</template>
12 changes: 12 additions & 0 deletions examples/app-vitest-full/tests/nuxt/mount-component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { describe, expect, it } from 'vitest'
import { mount } from '@vue/test-utils'

import SlugPage from '~/pages/other/[slug].vue'

describe('mounting components', () => {
// https://github.com/nuxt/test-utils/issues/594
it('mounts a dynamic route', async () => {
const component = mount(SlugPage)
expect(component.html()).toMatchInlineSnapshot(`"<div></div>"`)
})
})

0 comments on commit fe420b9

Please sign in to comment.