Skip to content

Think about 'not' matchers #10

@dirv

Description

@dirv

It'd be nice to just have a single not matcher that runs the chained matcher and fails if that matcher does not throw an error.

For example:

expect(actual).not.toEqual("foo");

Should run toEqual(actual, "foo") and catch any ExpectationError. If one isn't thrown then it should also throw.

The challenge will be what's the right message to display here. If it could just say something like "Expected not to equal ".

However, getting a 100% correct exception message is less important than having a concise not implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions