RunKit + npm: sinon

node v10.24.1
endpointsharetweet
var sinon = require("sinon") var object = { get test() { return 1; }, set test(value) { } }; var stub = sinon.spy(object, "test",['get','set']); console.log('1',stub.get.wrappedMethod) console.log('2', stub.set.wrappedMethod) console.log('3', stub.wrappedMethod) stub.restore() var stub = sinon.spy(object, "test",['set','get']); console.log('4', stub.wrappedMethod)
Created from: https://npm.runkit.com/sinon
Loading…