sinon-called-with-diff

add diff to calledWith output of sinon

MIT 15 个版本
安装
npm install sinon-called-with-diff
yarn add sinon-called-with-diff
pnpm add sinon-called-with-diff
bun add sinon-called-with-diff
README

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

版本列表
3.1.1 2018-11-29
3.1.0 2018-11-23
3.0.0 2018-11-05
2.2.2 2018-10-31
2.2.1 2018-09-24
2.2.0 2018-09-13
2.1.3 2018-06-27
2.1.2 2018-06-27
2.1.1 2018-05-11
2.1.0 2018-05-11
2.0.1 2018-05-03
2.0.0 2018-02-14
1.0.2 2017-08-14
1.0.1 2017-07-10
1.0.0 2017-04-07