sinon-called-with-diff

3.1.1 • Public • Published

Sinon called with diff License NPM version Dependency Status Build Status Coverage Status

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

Package Sidebar

Install

npm i sinon-called-with-diff

Weekly Downloads

11

Version

3.1.1

License

MIT

Unpacked Size

6.94 kB

Total Files

5

Last publish

Collaborators

  • coderaiser