How to Enhance your Tests
Make These Tests Even Better!
After generating tests with EarlyAI, you now have the ability to refine and enhance those tests directly within your IDE using the new prompt feature.
This capability gives you control to guide the AI to improve, restructure, or extend the generated unit tests—no need to start from scratch or manually rework the code.
✨ What It Does
Once your test is generated, you'll see a section titled "Make These Tests Even Better!" in the side panel.
There, you’ll find:
- A text prompt input where you can describe how you’d like to adjust the generated test.
- A list of example prompts to help you get started.
- A regenerate button that applies your prompt and updates the test automatically.

📂 Output Options
When the refined test is ready, you can choose how to view or use the updated code. EarlyAI offers three flexible options:
1. Create a New Code File
This option will save the refined test in a new file in your workspace. It’s ideal when:
- You want to compare versions side by side.
- You don’t want to overwrite your original test yet.
- You're experimenting with multiple variations.
2. Override the Previous Test (coming soon)
This replaces the most recent test file created by EarlyAI with the newly refined version.
Choose this if:
- You’re satisfied with the changes and want to keep your workspace clean.
- You’re iterating quickly on a specific test.
⚠️ This will overwrite the previous file created by EarlyAI. Use with care if you haven't committed your previous version.
3. Preview in Side Pane
This option shows the refined test in the side pane without writing to disk. It’s perfect for:
- Reviewing the result before deciding to save it.
- Trying out multiple refinements quickly.
- Getting inspiration or ideas without making any changes to your files.
💬 Example Prompts
Here are some ideas to inspire you:
"Add more edge cases, especially for invalid inputs."
"Refactor the tests to use beforeEach for setup."
"Improve mock usage to avoid unnecessary function calls."
"Add test cases for when the API call fails."
"Use Jest.each to test with multiple input values."
"Rewrite tests using async/await syntax."
"Group related test cases under describe blocks."
These are just starting points—you can experiment with anything you'd naturally ask a teammate to help with in your test code.
🛠 Tips for Better Results
- Be specific when asking for improvements.
- Try iterative changes: start with one improvement, then add more.
- You can re-run the prompt as many times as needed to refine the output.
🚀 Why It Matters
Test generation is just the beginning. With this prompt-based enhancement flow and flexible output options, EarlyAI becomes an active collaborator in helping you ship high-quality, maintainable code with less effort.
Take the tests we generate, and make them yours.
📩 Need Help?
If you're having trouble or want to suggest new ideas for prompt enhancements, reach out to us at support@startearly.ai.