---
title: "Discussion on \"How to run a (flaky) test multiple times using Jest\" | Hashnode"
description: "Discussion on \"How to run a (flaky) test multiple times using Jest\". When you discover that your test is flaky - it might be a good idea to run it multiple times to further validate that what you've done to fix actually (maybe) fixes it.\nUsing Jest it's pretty easy.\nYou can replace\ntest(\"it was flaky\", () => {})\nwith:..."
url: "https://hashnode.com/posts/how-to-run-a-flaky-test-multiple-times-using-jest/62ffdfee67b2030c206c2c33"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to run a (flaky) test multiple times using Jest](https://blog.olek.it/how-to-run-a-flaky-test-multiple-times-using-jest?utm_source=hashnode&utm_medium=feed)

When you discover that your test is flaky - it might be a good idea to run it multiple times to further validate that what you've done to fix actually (maybe) fixes it. Using Jest it's pretty easy. You can replace test("it was flaky", () => {}) with:...

Aug 19, 2022 · 1 min read · blog.olek.it  
Read the article

-   [#shorts](https://hashnode.com/tag/shorts)
-   [#jest](https://hashnode.com/tag/jest)
-   [#testing](https://hashnode.com/tag/testing)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#flaky](https://hashnode.com/tag/flaky)

## Written by

[Jakub Olek](https://hashnode.com/@hakubo)

@hakubo · Poznań, PL

  
[View profile](https://hashnode.com/@hakubo)

Simple Software Engineer

## Responses 1

Markdown supported · ⌘↵ to post

[Dylan Lacey](https://hashnode.com/@gentlehacker)

[Aug 22, 2022](https://hashnode.com/posts/how-to-run-a-flaky-test-multiple-times-using-jest/62ffdfee67b2030c206c2c33/comment/6303082714c73b2c3b9145eb)

I was a bit worried here that you'd advocate for just re-running flaky tests and not doing anything else, but this is a neat trick!
