Skip to content

Instantly share code, notes, and snippets.

@patoi
Last active April 3, 2018 09:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patoi/74dbbe29ba0b75e3d3d1e010217691dc to your computer and use it in GitHub Desktop.
Save patoi/74dbbe29ba0b75e3d3d1e010217691dc to your computer and use it in GitHub Desktop.
it('is not OK - better way', async function() {
let result, error
try {
result = await testFunction(false)
} catch (err) {
error = err
} finally {
expect(result).to.be.undefined() // guard: handling code flaw
expect(error.message).to.be.equal('not OK')
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment