Skip to content

Instantly share code, notes, and snippets.

@patoi
Created April 3, 2018 09:54
Embed
What would you like to do?
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