test-utils icon indicating copy to clipboard operation
test-utils copied to clipboard

Some prop names break component testing

Open oskarols opened this issue 1 year ago • 0 comments

Environment


  • Operating System: Linux
  • Node Version: v20.10.0
  • Nuxt Version: 3.13.2
  • CLI Version: 3.14.0
  • Nitro Version: -
  • Package Manager: [email protected]
  • Builder: -
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

I've written tests for this here: https://github.com/nuxt/test-utils/compare/main...oskarols:test-utils:fix-unusable-props

My @nuxt/test-utils branch: https://github.com/oskarols/test-utils/tree/fix-unusable-props

Describe the bug

Hi! 👋

We're trying to upgrade from 3.10.0 and ran into some issues.

Using renderSuspended or mountSuspended together with certain prop names will throw an error and fail the test. This is the case for props named error and url for instance.

This is the error received:

TypeError: 'set' on proxy: trap returned falsish for property 'url'                                             3:04:05 PM
 ❯ Proxy.clonedComponent.render ../../src/runtime-utils/mount.ts:131:48                                         3:04:05 PM
129|                             }                                                                              3:04:05 PM
130|                             for (const key in props || {}) {
131|                               renderContext[key] = _ctx[key]
   |                                                ^
132|                             }
133|                             for (const key in passedProps || {}) {
❯ renderComponentRoot ../../node_modules/.pnpm/@[email protected]/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:6408:16
❯ ReactiveEffect.componentUpdateFn [as fn] ../../node_modules/.pnpm/@[email protected]/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:5225:46
❯ ReactiveEffect.run ../../node_modules/.pnpm/@[email protected]/node_modules/@vue/reactivity/dist/reactivity.cjs.js:226:19
❯ setupRenderEffect ../../node_modules/.pnpm/@[email protected]/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:5360:5
❯ ../../node_modules/.pnpm/@[email protected]/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:7107:9

I've done some triaging and renderSuspended regresses between v13.13.1 and v13.14.0. Likely culprit: #852

Additional context

No response

Logs

No response

oskarols avatar Oct 22 '24 14:10 oskarols