【文件属性】:
文件名称:stub:具有diff支持的最简单的sinon.stub替代
文件大小:7KB
文件格式:ZIP
更新时间:2021-05-10 03:41:10
nodejs javascript tdd test stub
存根
最简单的替代方案。 在calleddWith上显示diff的支持。
安装
npm i @cloudcmd/stub
原料药
存根([impl])
impl存根实现
const stub = require ( '@cloudcmd/stub' ) ;
const fn = stub ( ) ;
// fn contains stubbed function
const asyncFn = stub ( async ( ) => {
throw Error ( 'hi' ) ;
} ) ;
// asyncFn contains stub async function
stub()。returns([value])
const fn = stub ( ) . returns ( 'hello' ) ;
fn ( ) ;
// returns
'hello' ;
stub(
【文件预览】:
stub-master
----.eslintrc.json(155B)
----lib()
--------stub.js(2KB)
--------called-with.js(542B)
----.npmignore(34B)
----.travis.yml(199B)
----LICENSE(1KB)
----test()
--------stub.js(4KB)
----README.md(3KB)
----.madrun.mjs(427B)
----.putout.json(88B)
----.gitignore(43B)
----ChangeLog(2KB)
----package.json(1KB)