Skip to content

Commit fe420b9

Browse files
committed
test: add example of importing a dynamic route
1 parent 55cbda2 commit fe420b9

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<template>
2+
<div />
3+
</template>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { describe, expect, it } from 'vitest'
2+
import { mount } from '@vue/test-utils'
3+
4+
import SlugPage from '~/pages/other/[slug].vue'
5+
6+
describe('mounting components', () => {
7+
// https://github.com/nuxt/test-utils/issues/594
8+
it('mounts a dynamic route', async () => {
9+
const component = mount(SlugPage)
10+
expect(component.html()).toMatchInlineSnapshot(`"<div></div>"`)
11+
})
12+
})

0 commit comments

Comments
 (0)