Skip to content

Instantly share code, notes, and snippets.

@patoi
Created April 2, 2018 17:45
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/aad4a3cc020613f7ed4ee9ad7e6ae38b to your computer and use it in GitHub Desktop.
Save patoi/aad4a3cc020613f7ed4ee9ad7e6ae38b to your computer and use it in GitHub Desktop.
it('is not OK - not bad, but it could be better', async () => {
try {
let result = await testFunction(false)
expect.fail()
// flawed test throws an ugly error:
} catch (err) {
// ...'AssertionError: expected 'expect.fail()' to equal 'not OK''
expect(err.message).to.be.equal('not OK')
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment