sinon-called-with-diff
v3.1.1
Published
add diff to calledWith output of sinon
Downloads
30
Maintainers
Readme
Sinon called with diff
![Coverage Status](https://coveralls.io/repos/coderaiser/sinon-called-with-diff/badge.svg?branch=master&service=github)
Add ability to show diff when args are different in sinon.
You can also replace sinon
with stub wich is drop-in replacement of sinon.stub()
with diff support.
Install
npm i sinon sinon-called-with-diff --save
How to use?
const diff = require('sinon-called-with-diff');
const sinon = diff(require('sinon'));
const stub = sinon.stub();
stub('hello');
stub.calledWith('world');
// returns
false
Will produce output:
wrong arguments in functionStub
actual: [
"hello"
]
expected: [
"world"
]
License
MIT