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 diff support for 'calledWith*' matchers #141

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

kuceb
Copy link

@kuceb kuceb commented Jun 6, 2019

fix #124

allows:

spy('foo1')
spy('foo2')
expect(spy).calledWith('bar')
// actual: ['foo2']
// expected: ['bar']

expect(spy.firstCall).calledWith('bar')
// actual: ['foo1']
// expected: ['bar']

expect(neverCalledSpy).calledWith('bar')
// actual: undefined
// expected: ['bar']

tasks

  • support calledOnceWith* matchers

lib/sinon-chai.js Outdated Show resolved Hide resolved
@karthikbeam
Copy link

Tested, works well.

@eugenet8k
Copy link

Please merge, having diff printed is such a godsend

@sandinmyjoints
Copy link

Bump for review.

@lnfel
Copy link

lnfel commented Feb 15, 2023

This is nice

@robaca
Copy link

robaca commented Dec 1, 2023

May I ask what's blocking this PR?

@robaca
Copy link

robaca commented Dec 1, 2023

Ok, just tried it out by myself. It didn't solve the issue for me that IntelliJ doesn't show a nice diff view.

My current workaround: expect(....firstCall.args).to.deep.equal([...])

@eliasm307
Copy link

Also waiting on this PR as better sinon diff would greatly improve the testing experience

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.

Add better diffing for calledWith and calledWithExactly failures
8 participants