Closed
Description
I was hoping to get this case to work:
describe('JSON Diff with Superdiff', () => {
const options = { referenceProperty: 'id', ignoreArrayOrder: false };
it('should ignore position changes in arrays', () => {
const original = [{ id: 1, name: 'Alice' }, { id: 2, name: 'Bob' }];
const updated = [{ id: 2, name: 'Bob' }, { id: 1, name: 'Alice' }];
const diff = getObjectDiff(original, updated, options);
expect(diff.status).toBe('equal');
});
But instead it will list both array items as updated. Is there a way to make superdiff disregard changes of items position in an array completely?
Metadata
Metadata
Assignees
Labels
No labels