Unmask flaky tests with style
A powerful CLI tool to detect flaky tests by running them multiple times with beautiful real-time progress tracking and detailed failure analysis.
Flaky tests are a nightmare. They pass sometimes and fail other times, making your CI/CD unreliable. Flakify helps you identify these tests by running them multiple times and tracking their behavior.
- 🔄 Run tests multiple times - Sequential or parallel execution
- 📊 Real-time progress tracking - Watch your tests run with live stats
- 🎨 Beautiful UI - Animated spinners and color-coded results
- 📝 Detailed failure reports - See exactly which tests failed, in which file, and at which line
- 🎯 Flaky test detection - Automatically identifies tests that pass sometimes and fail other times
- 🚀 Works with any test runner - Jest, Vitest, Mocha, and more
npm install -g flakify
Run your tests multiple times:
flakify "yarn test" 10
Run tests in parallel for faster execution:
flakify "npm test" 5 --parallel
# Run Jest tests 10 times
flakify "yarn test" 10
# Run Vitest tests 20 times in parallel
flakify "yarn test:storybook" 20 --parallel
# Run specific test file 5 times
flakify "npm test -- Button.test.ts" 5
╔═══════════════════════════════════════════════════════════╗
║ ⚡ Flakify - Unmask Flaky Tests ║
╚═══════════════════════════════════════════════════════════╝
Command: yarn test
Runs: 10
Mode: → Sequential
✓ Run #1: Passed [147/147 files 560/560 tests]
✓ Run #2: Passed [147/147 files 560/560 tests]
⠹ Run #3: Running 5.3s [45/147 files]
○ Run #4: Pending
...
╔═══════════════════════════════════════════════════════════╗
║ Summary ║
╚═══════════════════════════════════════════════════════════╝
✓ Passed: 7/10
✗ Failed: 3/10
◈ Success Rate: 70.00%
⏱ Duration: 182.50s
🔥 FLAKY TEST DETECTED!
Failed Tests by Run:
Run #4:
✗ Button should handle click events
src/components/Button.test.ts:42
Unique Failed Tests:
✗ Button should handle click events
File: src/components/Button.test.ts:42
Failed in run(s): 4, 7, 9
💡 Tip: yarn test src/components/Button.test.ts
| Option | Description | Default |
|---|---|---|
<command> |
Test command to run (in quotes) | Required |
<times> |
Number of times to run | Required |
--parallel |
Run tests in parallel | Sequential |
- ✅ Jest
- ✅ Vitest
- ✅ Mocha
- ✅ Any test runner that outputs to stdout
- 5-10 runs: Quick check for obvious flakiness
- 20-50 runs: Thorough investigation
- 100+ runs: Extreme cases or CI environment testing
- Sequential (default): Safer, prevents resource contention, easier to debug
- Parallel (
--parallel): Faster, good for independent tests, may stress system resources
- Start with sequential mode to understand the flakiness pattern
- Use parallel mode once you've identified the problematic tests
- Run flaky tests in isolation to debug more easily
- Fix root causes (timing issues, shared state, race conditions)
Contributions are welcome! Please feel free to submit a Pull Request.
MIT © Marco Trevisani
Built with love to make testing more reliable for everyone.
Made with ⚡ by Marco Trevisani