Support to spy on parameters
See original GitHub issueExample on how it could work:
var add = function (a, b) {
return a + b;
}
spy = chai.spy(add);
add(40, 2);
spy.should.have.been.called.with(40, 2)
Issue Analytics
- State:
- Created 11 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Any way to modify Jasmine spies based on arguments?
I'd like to mock this external API out with a Jasmine spy, and return different things based on the parameters. Is there any...
Read more >Spies - Basics - RSpec Mocks - Relish
Spies are an alternate type of test double that support this pattern by allowing you to expect that a message has been received...
Read more >spyOn() & jasmine.createSpyObj() - Angular - GitBook
This spy acts as any other spy - tracking calls, arguments, etc. But there is no implementation behind it. Spies are JavaScript objects...
Read more >ES6 Class Mocks - Jest
mock('./sound-player ') returns a useful "automatic mock" you can use to spy on calls to the class constructor and all of its methods....
Read more >Mockito - Using Spies - Baeldung
On the other hand, the spy will wrap an existing instance. It will still behave in the same way as the normal instance;...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
👍 for adding to the docs.
Could you add this to the docs on http://chaijs.com/plugins/chai-spies?