Created
April 3, 2018 09:54
-
-
Save patoi/81255d2a14413e31fbdde772f9220ee1 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('your test', async function() { | |
let args = ... // your test data | |
let result, error // variables: test and guard in the finally block | |
try { | |
result = await testFunction(args) | |
} catch (err) { | |
error = err | |
} finally { | |
expect(error).to.be.undefined() // guard: error (or result) | |
expect(result).to.be... // test: result (or error) | |
// ... more test | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment