Skip to content

Invalid typescript declarations #306

Closed
@tahq69

Description

@tahq69

Version

1.0.0-beta.9

Reproduction link

https://github.com/crip-home/vue-test-utils-issue

Steps to reproduce

  1. Clone repo: https://github.com/crip-home/vue-test-utils-issue
  2. Run test: npm run test

What is expected?

Get defined component property

What is actually happening?

TS2339: Property 'prop1' does not exist on type 'Vue'.


If change in typings from:

export declare function mount<V extends Vue, Ctor extends VueClass<V> = VueClass<V>> (component: Ctor, options?: MountOptions<V>): Wrapper<V>

To:

export declare function mount<V extends Vue> (component: VueClass<V>, options?: MountOptions<V>): Wrapper<V>

Works as expected. I am new to typescript and I do not get why there is additional type in declaration.

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