Advertisement
Guest User

Untitled

a guest
Dec 18th, 2017
907
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. sinon = require('sinon')
  2. Test = require('./Test')
  3. Foo = require('./Foo')
  4.  
  5. var sandbox = sinon.createSandbox()
  6.  
  7. var stub = sandbox.createStubInstance(Foo)
  8. stub.hello.callsFake(() => {
  9.   console.log('stubbed hello')
  10. })
  11.  
  12. stub.hello()
  13. console.log('=====================================')
  14. new Test().func()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement