Skip to content

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

@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