Updated arrayContaining to require actual values to be arrays
If the actual value of a test was a string, this was matching against arrays that contained the strings. This was due to the use of the contains matcher, which against string looks for substrings, when it was intended to look for array elements.
This commit is contained in:
@@ -31,6 +31,12 @@ describe("ArrayContaining", function() {
|
||||
expect(containing.asymmetricMatch(["bar"])).toBe(false);
|
||||
});
|
||||
|
||||
it("does not match when the actual is not an array", function() {
|
||||
var containing = new jasmineUnderTest.ArrayContaining(["foo"]);
|
||||
|
||||
expect(containing.asymmetricMatch("foo")).toBe(false);
|
||||
});
|
||||
|
||||
it("jasmineToStrings itself", function() {
|
||||
var containing = new jasmineUnderTest.ArrayContaining([]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user