Home > @wixc3/mostly-equal > defineSame
Creates a symbol for usage in mostlyEqual, Comparing the resulting value in any place it is used as the value
Signature:
defineSame: (name: string, skipUndefined?: boolean) => import("./types").MarkerSymbol
Parameter | Type | Description |
---|---|---|
name | string | error display name |
skipUndefined | boolean | _(Optional)_ ignores undefined values, even for multiple instances |
Returns:
import(“./types”).MarkerSymbol
const id = defineSame('id');
expect({
a: 'a',
b: 'b',
}).to.mostlyEqual({
a: id,
b: id
}); // will fail