Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: chai.spy.callsBackWith #65

Open
nickcarenza opened this issue Apr 17, 2017 · 0 comments
Open

Feature: chai.spy.callsBackWith #65

nickcarenza opened this issue Apr 17, 2017 · 0 comments

Comments

@nickcarenza
Copy link

nickcarenza commented Apr 17, 2017

chai.spy.callsBackWith simply creates a spy that expects the last argument it was called with to be a callback function and calls it with the arguments provided in its constructor.

var methodA = chai.spy.callsBackWith(new Error('foo'));
methodA(cb);
// cb would be called with one argument: new Error('foo')
var methodB = chai.spy.callsBackWith(null, {id:12});
methodB(cb);
// cb would be called with two arguments: null and {id:12}
nickcarenza added a commit to nickcarenza/chai-spies that referenced this issue Apr 17, 2017
nickcarenza added a commit to nickcarenza/chai-spies that referenced this issue Jan 12, 2018
nickcarenza added a commit to nickcarenza/chai-spies that referenced this issue Jan 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant