with set semantics

  • <array-like> with set semantics <assertion?>

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 [ 321 ] with set semantics to satisfy Set([ 12 ])
 
Set([
  
3
//
 
should be removed
  
2,
  
1
])