Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript: typing error with props and attributes #432

Closed
vwxyutarooo opened this issue Feb 15, 2018 · 3 comments
Closed

TypeScript: typing error with props and attributes #432

vwxyutarooo opened this issue Feb 15, 2018 · 3 comments

Comments

@vwxyutarooo
Copy link
Contributor

vwxyutarooo commented Feb 15, 2018

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.

- Vue@2.5.13
- @vue/test-utils@1.0.0-beta.11
- jest@22.3.0
- typescript@2.6.2
@vwxyutarooo vwxyutarooo changed the title TypeScript: Prorerty 'checked' does not exist on type 'void | { [name: string: nay; }'. Property 'checked' does not exist on type 'void' TypeScript: typing error with props an attributes Feb 15, 2018
@vwxyutarooo
Copy link
Contributor Author

I'm trying to fix it.

https://github.com/vwxyutarooo/vue-test-utils/blob/dev/types/index.d.ts#L52

@kazupon
Copy link
Member

kazupon commented Feb 15, 2018

@vwxyutarooo You can send PR :)

@vwxyutarooo
Copy link
Contributor Author

@kazupon Thanks, I've create it!

@vwxyutarooo vwxyutarooo changed the title TypeScript: typing error with props an attributes TypeScript: typing error with props and attributes Feb 16, 2018
eddyerburgh pushed a commit that referenced this issue Feb 16, 2018
* test: add attributes() and props() to type test

* fix: type props and attributes in BaseWrapper #432
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants