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.
It'd be nice to just have a single
notmatcher 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 anyExpectationError. 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
notimplementation.