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: called with reports actual arguments #116

Open
alex-Symbroson opened this issue Jul 30, 2022 · 0 comments
Open

Feature: called with reports actual arguments #116

alex-Symbroson opened this issue Jul 30, 2022 · 0 comments

Comments

@alex-Symbroson
Copy link

alex-Symbroson commented Jul 30, 2022

Please include a report to get the called.with assertions which shows which arguments were actually called.

This is a suggestion I came up with:
in spy.js, for any called.with assertion, add the argument spy.calls.find(args => !_.eql(args, expArgs))
not sure if its possible to react to negations - that would be the only problem

      this.assert(
          passed > 0
        , 'expected ' + this._obj + ' to have been called with #{exp}'
        , 'expected ' + this._obj + ' to have not been called with #{exp} but got ' + passed + ' times'
        , expArgs
        , spy.calls.find(args => !_.eql(args, expArgs))
      );

thanks and best regards

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