Runs a function after a test finishes, including after all afterEach hooks.
This is useful for cleanup tasks that need to run at the very end of a test, after all other hooks have completed.
Can only be called inside a test, not in describe blocks.
function
Runs a function after a test finishes, including after all afterEach hooks.
This is useful for cleanup tasks that need to run at the very end of a test, after all other hooks have completed.
Can only be called inside a test, not in describe blocks.
the function to run
test("my test", () => {
onTestFinished(() => {
// This runs after all afterEach hooks
console.log("Test finished!");
});
});