Revert removal of compare nesting
Since we want the user to be able to pass a negative comparison function, the extra layer of wrapping is now needed
This commit is contained in:
@@ -3,10 +3,10 @@ describe("toEqual", function() {
|
||||
var util = {
|
||||
equals: jasmine.createSpy('delegated-equals').and.returnValue(true)
|
||||
},
|
||||
matcherComparator = j$.matchers.toEqual(util),
|
||||
matcher = j$.matchers.toEqual(util),
|
||||
result;
|
||||
|
||||
result = matcherComparator(1, 1);
|
||||
result = matcher.compare(1, 1);
|
||||
|
||||
expect(util.equals).toHaveBeenCalledWith(1, 1, []);
|
||||
expect(result.pass).toBe(true);
|
||||
@@ -17,10 +17,10 @@ describe("toEqual", function() {
|
||||
equals: jasmine.createSpy('delegated-equals').and.returnValue(true)
|
||||
},
|
||||
customEqualityTesters = ['a', 'b'],
|
||||
matcherComparator = j$.matchers.toEqual(util, customEqualityTesters),
|
||||
matcher = j$.matchers.toEqual(util, customEqualityTesters),
|
||||
result;
|
||||
|
||||
result = matcherComparator(1, 1);
|
||||
result = matcher.compare(1, 1);
|
||||
|
||||
expect(util.equals).toHaveBeenCalledWith(1, 1, ['a', 'b']);
|
||||
expect(result.pass).toBe(true);
|
||||
|
||||
Reference in New Issue
Block a user