testing - How to use sinon.stub with ava? -


any suggestion how use sinon ava ? when run ava, stub.called false

target.js

const foo = () => { bar() } const bar = () => { }  module.exports = { foo, bar } 

target.test.js

import test 'ava'; import sinon 'sinon'; import * target './target';  test('foo', t=>{     const stub = sinon.stub(target, 'bar')         target.foo();     t.true(stub.called) }) 


Comments

Popular posts from this blog

sql - Time in datatime field -

javascript - How to split the success output from an Ajax post? -

java - sharing object across different classes -