Skip to content

Expectation::toHaveUniqueValues ​

Member of Expectation

idl
Expectation.toHaveUniqueValues, $
  /_expect_failure

Verifies that the expectation value (an array or list) has no duplicate items. Items are compared as described for idl toContainEqual, and strings are case sensitive.

Examples ​

idl
(it.expects([1, 2, 3])).toHaveUniqueValues
(it.expects(['a', 'A'])).toHaveUniqueValues
(it.expects([1, 2, 2]))._not_.toHaveUniqueValues

Keywords ​

_expect_failure {#kw-_expect_failure} ​

optionalinputtype=Boolean

If the test fails for some reason, set this to force passing because we expected failure. This keyword is for internal use only.

Licensed under MIT.