Skip to content

Second article

1 min read

If you need more control over the negative comparison

Custom negative comparators

If you need more control over the negative comparison (the not case) than the simple boolean inversion above, you can also have your matcher factory include another key, negativeCompare alongside compare, for which the value is a function to invoke when .not is used. This function/key is optional.

Register the custom matchers with Jasmine. All properties on the object passed in will be available as custom matchers (e.g., in this case toBeGoofy).

Sign Up for News

Match information, squad announcements, ticket releases and all the latest from the CommBank Socceroos.

+50k
Join the community

Upcoming match Socceroos vs Brazil

Get priority access to football

FA+ members get presale access to all Australian football matches, discounts on official merchandise and exclusive access to events.

  • Discounted tickets and presale access
  • Member pricing on official kit
  • Invitations to members only events
Membership $99/yr Join FA+ now