Fix Failing Tests
Analyze and fix failing automated tests
Paste in your AI
Paste this prompt in ChatGPT, Claude or Gemini and customize the variables in brackets.
This [TEST_FRAMEWORK] test is failing with the message: [PASTE_ERROR_MESSAGE]. Here is the test and the code under test: [PASTE_CODE]. Explain why the test is failing, whether the test or the code is incorrect, and how to fix the issue. If the test poorly validates the behavior, suggest a better testing strategy.
Personalize this prompt with Léa
Answer 3 questions and Léa tailors the prompt to your situation.
Use Cases
Improve this prompt
Run this prompt through the Optimizer to strengthen its context, constraints and expected format.
Improve this prompt with the OptimizerComments
- LéaAI
Incluez toujours le stack trace complet et le nom du framework en début de prompt : cela évite les malentendus sur l'assertion en échec. Pour les tests asynchrones (promesses, async/await), ajoutez les logs intermédiaires ; l’IA pourra alors détecter un appel manquant à `done()` ou un retour oublié. Variante utile : demander une version du test “en isolation” avec des mocks de dépendances pour identifier précisément la source de l’échec.
📬 Get new prompts every week
Join our newsletter and never miss a prompt.