ava
ava copied to clipboard
Add `t.unorderedEqual()` assertion
Closes #3020
Adds a new assertion for testing equality in an unordered manner between two Map
s or two Set
s/Array
s:
test('unorderedEqual', t => {
t.unorderedEqual([1, 2, 3], new Set([2, 3, 1]));
t.unorderedEqual(
new Map([['a', 1], ['b', 2], ['c', 3]]),
new Map([['b', 2], ['c', 3], ['a', 1]]),
'Map keys should be equal!',
);
});
Todos:
- Improve error messages, format values with
concordance
- Improve types (e.g.
Actual extends Map | Set | Array
)- Add type tests
- Fix failing tests
Please re-open if you have a chance to return to this.
@novemberborn I don't think I can reopen by myself.
I don't think I can reopen by myself.
@tommy-mitchell done!