question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support to spy on parameters

See original GitHub issue

Example 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:closed
  • Created 11 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
meakucommented, Feb 24, 2014

👍 for adding to the docs.

1reaction
jhnnscommented, Feb 14, 2014

Could you add this to the docs on http://chaijs.com/plugins/chai-spies?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found