diff --git a/src/vitest-environment-nuxt/runtime/render.ts b/src/vitest-environment-nuxt/runtime/render.ts index 1f36837aa..85ad9dbfa 100644 --- a/src/vitest-environment-nuxt/runtime/render.ts +++ b/src/vitest-environment-nuxt/runtime/render.ts @@ -5,10 +5,8 @@ import { h, nextTick, } from 'vue' - -import { - type RenderOptions as TestingLibraryRenderOptions, - render as renderFromTestingLibrary, +import type { + RenderOptions as TestingLibraryRenderOptions, } from '@testing-library/vue' import { defu } from 'defu' import type { RouteLocationRaw } from 'vue-router' @@ -68,6 +66,8 @@ export async function renderSuspended( ..._options } = options || {} + const { render : renderFromTestingLibrary } = await import('@testing-library/vue') + // @ts-ignore untyped global __unctx__ const { vueApp } = globalThis.__unctx__.get('nuxt-app').tryUse() const { render, setup } = component as DefineComponent