diff --git a/packages/core/src/libs/lohyphen/__tests__/is_equal.test.ts b/packages/core/src/libs/lohyphen/__tests__/is_equal.test.ts index aa878c3b1..42ed46c44 100644 --- a/packages/core/src/libs/lohyphen/__tests__/is_equal.test.ts +++ b/packages/core/src/libs/lohyphen/__tests__/is_equal.test.ts @@ -112,4 +112,21 @@ describe('isEqual', () => { expect(isEqual(weirdObject1, weirdObject2)).toBe(true); }); }); + + describe('Custom objects', () => { + class MyValueObject { + constructor(private value: number) {} + valueOf() { + return this.value; + } + } + + test('same', () => { + expect(isEqual(new MyValueObject(1), new MyValueObject(1))).toBe(true); + }); + + test('different', () => { + expect(isEqual(new MyValueObject(1), new MyValueObject(2))).toBe(false); + }); + }); });