Skip to content

Latest commit

 

History

History
24 lines (19 loc) · 566 Bytes

with-set-semantics.md

File metadata and controls

24 lines (19 loc) · 566 Bytes

Converts an array-like object to a Set (or Set polyfill), then delegates to another assertion.

The purpose is to make the assertions defined for Set instances easily accessible when you need to make assertions about an array without considering the order or duplicate items.

expect([3, 2, 1], 'with set semantics to satisfy', new Set([1, 2, 3]));
expect([3, 2, 1], 'with set semantics to satisfy', new Set([1, 2]));
expected [ 3, 2, 1 ] with set semantics to satisfy Set([ 1, 2 ])

Set([
  3, // should be removed
  2,
  1
])