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

Missing Stub Invocation API #19

Open
jonathan-benn opened this issue Oct 18, 2017 · 1 comment
Open

Missing Stub Invocation API #19

jonathan-benn opened this issue Oct 18, 2017 · 1 comment

Comments

@jonathan-benn
Copy link

The following stub invocation API functions are missing:

stub.yield([arg1, arg2, ...])
# Invoke callbacks passed to the stub with the given arguments.
# If the stub was never called with a function argument, yield throws an error.
# Also aliased as invokeCallback.

stub.yieldTo(callback, [arg1, arg2, ...])
# Invokes callbacks passed as a property of an object to the stub.
# Like yield, yieldTo grabs the first matching argument, finds the callback and 
# calls it with the (optional) arguments.

stub.callArg(argNum)
# Like yield, but with an explicit argument number specifying which callback to call.
# Useful if a function is called with more than one callback, and simply calling the
# first callback is not desired.

stub.callArgWith(argNum, [arg1, arg2, ...])
# Like callArg, but with arguments.
@note35
Copy link
Owner

note35 commented Oct 22, 2017

This is related to #18, they can be implemented at the same time.

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

2 participants