marchaos / jest-mock-extended

Type safe mocking extensions for Jest https://www.npmjs.com/package/jest-mock-extended
MIT License
836 stars 57 forks source link

it will be cool to have an equality matcher #23

Open regevbr opened 4 years ago

regevbr commented 4 years ago

Instead of creating a custom matcher, it will be cool to include one built in. For example:

import { Matcher } from 'jest-mock-extended';
import { equals } from 'expect/build/jasmineUtils';

export const isEqual = <T>(expectedValue: T) =>
  new Matcher<T>((actualValue: T) => {
    return equals(actualValue, expectedValue);
  });