Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
RunKit + npm: sinon
node v6.17.1
version:
master
endpoint
share
tweet
const _ = require('lodash') const sinon = require('sinon@2.0.0-pre.4') , match = sinon.match , __ = match.any
const id = Symbol('id') , Node = class {} function rand(){ return _.random(0, Number.MAX_SAFE_INTEGER).toString() } var foo = new Node(); foo[id] = rand() var bar = new Node(); bar[id] = rand()
const filter = sinon.stub() filter.returns(true) filter.withArgs(foo).returns(false)
filter(foo)
filter(bar)
Loading…
no comments
sign in
to comment