sinon-called-with-diff

2018-10-23 admin

sinon-called-with-diff是什么

什么是sinon-called-with-diff,add diff to calledWith output of sinon

sinon-called-with-diff使用教程帮助文档

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

Add ability to show diff when args are different in sinon.

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

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-43439.html

文章标题:sinon-called-with-diff

回到顶部