Skip to content

vitest expect matcher #41

@falentio

Description

@falentio

testing around the result type may need some extra work rather than normal value

so we need to extend expect matchers to help developer to testing Result
so working with Result would be similar as working with Promise
user would just use expect(val).resultOk.toBe("foo")

how if those helpers are included in package, something like "better-result/vitest"
this could be achieved by creating chai plugin, and add "@vitest/expect" as peer dependency
but the typescript types may need manually configured in user end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions