Vue-test-utils: TypeScript: typing error with props and attributes

Created on 15 Feb 2018  ·  3Comments  ·  Source: vuejs/vue-test-utils

Version

1.0.0-beta.11

Reproduction link

https://github.com/vwxyutarooo/vue-test-utils/blob/dev/types/test/wrapper.ts#L19

Steps to reproduce

Use wrapper.props().checked or wrapper.attributes().foo in TypeScript.

What is expected?

interface BaseWrapper issue.

What is actually happening?

      TS2339: Property 'checked' does not exist on type 'void | { [name: string]: any; }'.
  Property 'checked' does not exist on type 'void'.

void is unnecessary I suppose. This method always returns any type of data including undefined. Is it my misunderstanding or just bug?

Environments for just in case.

- [email protected]
- @vue/[email protected]
- [email protected]
- [email protected]

Most helpful comment

@kazupon Thanks, I've create it!

All 3 comments

@vwxyutarooo You can send PR :)

@kazupon Thanks, I've create it!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

maerteijn picture maerteijn  ·  3Comments

matt-sanders picture matt-sanders  ·  3Comments

vilarinholeo picture vilarinholeo  ·  3Comments

ParsonsProjects picture ParsonsProjects  ·  3Comments

alexanderstudte picture alexanderstudte  ·  3Comments