Replies: 1 comment 2 replies
-
Well, we do have |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I often write my tests cases in isolation, using hooks concept. It would be great if we could use a callback like
onCleanup
orafter
inside of a test to register a teardown function.Example:
it would be cool if inside
mockTmpFolder
I could use teardown callback to remove the tmp folder after the test is finished (even if errored).I am aware I could use
afterEach
but with that I need to use a shared context, egthis
and then maintain it across my functions.I assume the test is already aware of a context and it would be possible to use
onCleanup/after
to register functions that would be executed when finished before all other after callbacks. So the usage could look like:I am curios what the community think about it. Maybe such a solution already exists?
Beta Was this translation helpful? Give feedback.
All reactions