import assert from "assert"; jest.retryTimes(3); it("retry", () => { console.log("xxx", Date.now()); assert.ok(Math.random() > 0.3); }); ❯ yarn jest --testRunner='jest-circus/runner' src yarn run v1.17.3 PASS src/__tests__/retrySpecCheck.test.ts ● Console console.log src/__tests__/retrySpecCheck.test.ts:5 xxx 1568271139936 console.log src/__tests__/retrySpecCheck.test.ts:5 xxx 1568271139949 consol
![jest-circus と jest.retryTimes(n) で成功するまでリトライする - Qiita](https://cdn-ak-scissors.b.st-hatena.com/image/square/303a26c6ab5abec129d98b710f02f5bda15cf904/height=288;version=1;width=512/https%3A%2F%2Fqiita-user-contents.imgix.net%2Fhttps%253A%252F%252Fcdn.qiita.com%252Fassets%252Fpublic%252Farticle-ogp-background-9f5428127621718a910c8b63951390ad.png%3Fixlib%3Drb-4.0.0%26w%3D1200%26mark64%3DaHR0cHM6Ly9xaWl0YS11c2VyLWNvbnRlbnRzLmltZ2l4Lm5ldC9-dGV4dD9peGxpYj1yYi00LjAuMCZ3PTkxNiZ0eHQ9amVzdC1jaXJjdXMlMjAlRTMlODElQTglMjBqZXN0LnJldHJ5VGltZXMlMjhuJTI5JTIwJUUzJTgxJUE3JUU2JTg4JTkwJUU1JThBJTlGJUUzJTgxJTk5JUUzJTgyJThCJUUzJTgxJUJFJUUzJTgxJUE3JUUzJTgzJUFBJUUzJTgzJTg4JUUzJTgzJUE5JUUzJTgyJUE0JUUzJTgxJTk5JUUzJTgyJThCJnR4dC1jb2xvcj0lMjMyMTIxMjEmdHh0LWZvbnQ9SGlyYWdpbm8lMjBTYW5zJTIwVzYmdHh0LXNpemU9NTYmdHh0LWNsaXA9ZWxsaXBzaXMmdHh0LWFsaWduPWxlZnQlMkN0b3Amcz02NWM5MTRlMTQyNGI1NDhmYTE1MDgwYzQyZmI0NWU1MA%26mark-x%3D142%26mark-y%3D112%26blend64%3DaHR0cHM6Ly9xaWl0YS11c2VyLWNvbnRlbnRzLmltZ2l4Lm5ldC9-dGV4dD9peGxpYj1yYi00LjAuMCZ3PTYxNiZ0eHQ9JTQwbWl6Y2hpJnR4dC1jb2xvcj0lMjMyMTIxMjEmdHh0LWZvbnQ9SGlyYWdpbm8lMjBTYW5zJTIwVzYmdHh0LXNpemU9MzYmdHh0LWFsaWduPWxlZnQlMkN0b3Amcz04YTUwN2I0MDFmMDRhMzM1YzQ4NmVjMWRkMjZjZWJmOQ%26blend-x%3D142%26blend-y%3D491%26blend-mode%3Dnormal%26s%3Da2856a0bb739bb9a6fba79579c5eb7a9)