Skip to content

Jasmine / Jest matchers #1254

Closed
Closed
@winniehell

Description

@winniehell

What problem does this feature solve?

Custom matchers help to make tests more readable and can provide easier to understand error messages.

What does the proposed API look like?

Instead of

expect(wrapper.exists()).toBe(true)

use

expect(wrapper).toExist()

for example. After #1135 is resolved, this could provide the selector in the error message if the assertion fails.


Documenting the use of custom matchers was previously discussed in #634. However here I want to suggest providing matchers as part of vue-test-utils rather than documenting how to do it yourself.


See also

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions