Skip to content

add diff support for 'calledWith*' matchers#141

Open
kuceb wants to merge 4 commits intochaijs:masterfrom
kuceb:add-diff-support
Open

add diff support for 'calledWith*' matchers#141
kuceb wants to merge 4 commits intochaijs:masterfrom
kuceb:add-diff-support

Conversation

@kuceb
Copy link
Copy Markdown

@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

Comment thread lib/sinon-chai.js Outdated
@karthikbeam
Copy link
Copy Markdown

Tested, works well.

@eugenet8k
Copy link
Copy Markdown

Please merge, having diff printed is such a godsend

@sandinmyjoints
Copy link
Copy Markdown

Bump for review.

@lnfel
Copy link
Copy Markdown

lnfel commented Feb 15, 2023

This is nice

@robaca
Copy link
Copy Markdown

robaca commented Dec 1, 2023

May I ask what's blocking this PR?

@robaca
Copy link
Copy Markdown

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
Copy Markdown

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