Closed RubenVerborgh closed 12 years ago
Since include uses indexOf, it cannot test for equality.
include
indexOf
I have added an includeEql method that tests whether an object equal to the specified one is present in the array.
includeEql
One prominent case occurs when testing an array of arrays:
[[1],[2],[3]].should.not.include([3]) [[1],[2],[3]].should.not.include([2]) [[1],[2],[3]].should.not.include([4])
But, thanks to this extension:
[[1],[2],[3]].should.includeEql([3]) [[1],[2],[3]].should.includeEql([2]) [[1],[2],[3]].should.not.includeEql([4])
Since
include
usesindexOf
, it cannot test for equality.I have added an
includeEql
method that tests whether an object equal to the specified one is present in the array.One prominent case occurs when testing an array of arrays:
But, thanks to this extension: