nuxt / test-utils

🧪 Test utilities for Nuxt

Home Page:http://nuxt.com/docs/getting-started/testing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`renderSuspended` does not provide the values returned from `setup` to the template

obulat opened this issue · comments

Environment

Nuxt project info:


  • Operating System: Linux
  • Node Version: v18.18.0
  • Nuxt Version: 3.9.3
  • CLI Version: 3.10.0
  • Nitro Version: 2.8.1
  • Package Manager: npm@10.2.3
  • Builder: -
  • User Config: devtools, modules
  • Runtime Modules: @nuxt/test-utils/module@3.10.0
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/github-7wbhms?file=test%2Ftest-component.spec.ts

Describe the bug

renderSuspended does not pass the values from setup function (not the <script setup>) to the template. The mountSuspended works fine.

Additional context

In the Openverse Nuxt 3 migration PR, I replaced render(renderContext, ...args) with render(_ctx, ...args) on this line:

render(renderContext, ...args)

which seems to fix the issue.

Logs

No response

This is because of defineComponent wrapper
I opened a PR to fix this #852