Skip to content

Commit e7b0784

Browse files
committed
test: update stub name for nuxt v4
1 parent 7078e10 commit e7b0784

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

examples/app-vitest-full/tests/nuxt/mount-suspended.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { describe, expect, it, vi, beforeEach, afterEach } from 'vitest'
22

33
import { mountSuspended } from '@nuxt/test-utils/runtime'
4+
import { satisfies } from 'semver'
5+
import { version as nuxtVersion } from 'nuxt/package.json'
46

57
import type { VueWrapper } from '@vue/test-utils'
68
import { mount } from '@vue/test-utils'
@@ -57,9 +59,10 @@ describe('mountSuspended', () => {
5759

5860
it('should work with shallow mounting within suspense', async () => {
5961
const component = await mountSuspended(App, { shallow: true })
62+
const stubName = satisfies(nuxtVersion, '^3') ? 'anonymous-stub' : 'global-component-stub'
6063
expect(component.html()).toMatchInlineSnapshot(`
6164
"<async-component-wrapper-stub></async-component-wrapper-stub>
62-
<anonymous-stub></anonymous-stub>
65+
<${stubName}></${stubName}>
6366
<nuxt-page-stub></nuxt-page-stub>
6467
<nuxt-link-stub to="/test"></nuxt-link-stub>"
6568
`)

0 commit comments

Comments
 (0)