function
test.onTestFinished
fn: () => void | Promise<unknown> | (done: (err?: unknown) => void) => void,
options?: HookOptions
): void;
Runs a function after the test finishes, once all afterEach hooks have completed.
Can only be called inside a test, not in describe blocks.
@param fn
the function to run
test("my test", () => {
onTestFinished(() => {
// This runs after all afterEach hooks
console.log("Test finished!");
});
});