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

Add Sinon.assert.calledOnceWithExactly() #2080

Merged

Conversation

dpmott
Copy link
Contributor

@dpmott dpmott commented Aug 28, 2019

Purpose

Fix issue #2006 by implementing Sinon.assert.calledOnceWithExactly()

Solution

This solution implements Sinon.assert.calledOnceWithExactly()
Note that no other calledOnce* methods appear to work with spyCall, so no such tests have been added (e.g. "works with spyCall" or "fails when spyCall failed"). This seems appropriate because the end-user would just use calledWithExactly on a spyCall.

How to verify

  1. Check out this branch
  2. npm install
  3. npm test

@fatso83 fatso83 merged commit bf26967 into sinonjs:master Sep 23, 2019
@fatso83
Copy link
Contributor

fatso83 commented Sep 23, 2019

Thanks, David! Great work.

@mroderick
Copy link
Member

This has been published as v7.5.0

@rhodgkins
Copy link
Contributor

I'm not getting any autocomplete for this in VS code - I'm using sinon v8.1.1. Is there anything I need to do to pick up this extra signature? Thanks!

@mroderick
Copy link
Member

I'm not getting any autocomplete for this in VS code - I'm using sinon v8.1.1. Is there anything I need to do to pick up this extra signature? Thanks!

You may need to configure your VSCode to pick up JavaScript as well as TypeScript: https://medium.com/@trukrs/type-safe-javascript-with-jsdoc-7a2a63209b76

@fatso83
Copy link
Contributor

fatso83 commented Feb 20, 2020

@rhodgkins VS Code (probably) makes use of the @types/sinon package, which needs to be in sync (up to date) with Sinon's advances. It probably lacks signatures for this method, but this is not a package we maintain, so I would simply supply a PR to Definitely Typed.

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

Successfully merging this pull request may close these issues.

4 participants