mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 19:08:50 +00:00
Fixes #16051, Fixes ENG-21437 Implements retry/repeats ```ts test("my test", () => { if (Math.random() < 0.1) throw new Error("uh oh!"); }, {repeats: 20}); ``` ``` Error: uh oh! ✗ my test ``` ```ts test("my test", () => { if (Math.random() < 0.1) throw new Error("uh oh!"); }, {retry: 5}); ``` ``` Error: uh oh! ✓ my test (attempt 2) ``` Also fixes a bug where onTestFinished inside a test would not run if the test failed ```ts test("abc", () => { onTestFinished(() => { console.log("hello" }); throw new Error("uh oh!"); }); ``` ``` Error: uh oh! hello ``` --------- Co-authored-by: Claude Bot <claude-bot@bun.sh> Co-authored-by: pfg <pfg@pfg.pw> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>