testing-library / vue-testing-library

🦎 Simple and complete Vue.js testing utilities that encourage good testing practices.
http://testing-library.com/vue
MIT License
1.08k stars 109 forks source link

Vue 3: typed TestComponent on render function #228

Closed sand4rt closed 3 years ago

sand4rt commented 3 years ago

Proposal:

Change line 45 index.d.ts from:

export function render(
  TestComponent: any, // this makes me sad :sob:
  options?: RenderOptions,
): RenderResult

To:

export function render(
  TestComponent: new () => ComponentPublicInstance,
  options?: RenderOptions,
): RenderResult
afontcu commented 3 years ago

Will this handle all Component signatures? If I recall correctly, we had a hard time doing this in the official Vue Test Utils for Vue 3 – Check this out: https://github.com/vuejs/vue-test-utils-next/blob/master/src/mount.ts

sand4rt commented 3 years ago

Probably not if i look at the VTU implementation. I guess this ticket can be closed.