Skip to content

TypeScript: typing error with props and attributes #432

Closed
@vwxyutarooo

Description

@vwxyutarooo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions