toHaveSize

This commit is contained in:
Francois Wauquier
2020-02-28 18:18:14 +01:00
committed by Gregg Van Hove
parent f1eac6fb04
commit c521b4d47c
6 changed files with 250 additions and 80 deletions

View File

@@ -0,0 +1,21 @@
describe('toHaveSize', function() {
'use strict';
it('delegates to equals function', function() {
var matchersUtil = {
equals: jasmine.createSpy('delegated-equals').and.returnValue(true),
buildFailureMessage: function() {
return 'does not matter';
},
DiffBuilder: new jasmineUnderTest.DiffBuilder()
},
matcher = jasmineUnderTest.matchers.toHaveSize(matchersUtil),
result;
result = matcher.compare([1], 1);
expect(matchersUtil.equals).toHaveBeenCalledWith(1, 1, jasmine.anything(), jasmine.anything());
expect(result.pass).toBe(true);
});
});