Created
October 21, 2016 08:31
-
-
Save simonrenoult/449fb64da818da86d79b01cfbb948cc9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sinon = require('sinon') | |
const chai = require('chai') | |
const expect = chai.expect | |
const foo = callback => { | |
return Promise.resolve().then(() => { | |
setTimeout(() => { | |
callback() | |
}, 5000) | |
}) | |
} | |
describe('foo', () => { | |
describe('when promise is not returned', () => { | |
const spy = sinon.spy() | |
before(() => { | |
foo(spy) // not returned | |
}) | |
it('should not call the callback', () => { | |
expect(spy.called).to.be.false | |
}) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment