Last active
April 3, 2018 09:33
-
-
Save patoi/74dbbe29ba0b75e3d3d1e010217691dc 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
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