Last active
August 29, 2015 14:26
-
-
Save edysegura/9feab3b8becc05670216 to your computer and use it in GitHub Desktop.
[JS] How to test many method calls in Jasmine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it('should test many calls', function() { | |
// GIVEN | |
spyOn(YourObject, 'yourMethod'); | |
// WHEN | |
Something.happens(); | |
// THEN | |
[ | |
'HTML', | |
'CSS', | |
'JavaScript' | |
] | |
.forEach(function(status) { | |
expect(YourObject.yourMethod).toHaveBeenCalledWith(status); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment