Add a toHaveBeenCalledOnceWith matcher

This commit is contained in:
Maksym Kobieliev
2020-03-13 20:41:24 +02:00
parent 83b336d9d1
commit e13fd13529
4 changed files with 162 additions and 0 deletions

View File

@@ -425,6 +425,22 @@ describe('Matchers (Integration)', function() {
});
});
describe('toHaveBeenCalledOnceWith', function() {
verifyPasses(function(env) {
var spy = env.createSpy();
spy('5', 3);
env.addCustomEqualityTester(function(a, b) {
return a.toString() === b.toString();
});
env.expect(spy).toHaveBeenCalledOnceWith(5, 3);
});
verifyFails(function(env) {
var spy = env.createSpy();
env.expect(spy).toHaveBeenCalledOnceWith(5, 3);
});
});
describe('toHaveClass', function() {
beforeEach(function() {
this.domHelpers = jasmine.getEnv().domHelpers();