ava: `after.always` doesn't run if there are uncaught exceptions
Hi! This is the second time I read the documentation at README.md and find that the feature I’m using is not yet released (after some debugging). I’m not sure what it was last time, but this time it is after.always
found in commits since release.
Any thoughts about stabilizing/syncing the docs with the release cycle?
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 16 (14 by maintainers)
Commits related to this issue
- readme: add note about uncaught exceptions fixes issue #917 — committed to arve0/ava by arve0 8 years ago
- readme: add note about uncaught exceptions fixes issue #917 — committed to arve0/ava by arve0 8 years ago
- readme: add note about uncaught exceptions (#918) fixes issue #917 — committed to avajs/ava by arve0 8 years ago
@fcastilloec you could use
t.try()
(though I don’t recall if that’s available in hooks). It lets you observe the outcome and should let you set a separate timeout. That way if there’s an error or a timeout you can then run some other code before proceeding with the failure.Does anybody know of a workaround for this? In my case, a process in the
before
hook might not load and hence timeout. This program only outputs errors and messages to a file (there’s no console whatsoever). I was counting on using theafter.always
hook to read the error file and print it on the terminal even if mybefore
hook timeouts or errors. I could run a program doing this ifava
fails but I really would like to have it integrated as part of my test. Any way to forceava
to run something at the end, no matter what?Hey @Githubber2021, I think this comment still stands: