Last active
April 3, 2018 09:33
-
-
Save patoi/9854f8b10022e9dd836d2aa016069626 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 OK - better way', async function() { | |
let result, error | |
try { | |
result = await testFunction(true) | |
} catch (err) { | |
error = err | |
} finally { | |
expect(error).to.be.undefined() // guard: handling code flaw | |
expect(result).to.be.equal('OK') | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment