Skip to content

Bug: Optional props are typed as | undefined #2256

Open
@DesselBane

Description

@DesselBane

Describe the bug
When using the .props() method on a VueWrapper for a prop which is not required but has a default value the returned type includes undefined.

To Reproduce
https://github.com/DesselBane/test-utils-reproduction/blob/master/src/components/foo.spec.ts

Expected behavior
I would argue that the type should not include undefined since it has a default value and this default value is returned at runtime.

Related information:
This happened on an update from v2.4.1 to v2.4.2, most likely somewhere in this PR: #2137 (but I'm not sure)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions