Skip to content

failing async test ends in timeout instead of go to catch clause #3311

Closed Answered by novemberborn
sombriks asked this question in Q&A
Discussion options

You must be logged in to vote

The database isn't destroyed when the test fails. This code doesn't run after failures:

test.after(async t => {
  await database.destroy()
})

Use the .always modifier instead:

test.after.always(async t => {
  await database.destroy()
})

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@sombriks
Comment options

Answer selected by sombriks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants
Converted from issue

This discussion was converted from issue #3310 on February 27, 2024 21:06.