VIP 👤
🏠 Inicio
Pruebas de rendimiento
📊 Todos los benchmarks 🦖 Dinosaurio v1 🦖 Dinosaurio v2 ✅ Aplicaciones To-Do List 🎨 Páginas libres creativas 🎯 FSACB - Showcase definitivo 🌍 Benchmark de traducción
Modelos
🏆 Top 10 modelos 🆓 Modelos gratuitos 📋 Todos los modelos ⚙️ Kilo Code
Recursos
💬 Biblioteca de prompts 📖 Glosario de IA 🔗 Enlaces útiles 🔌 API y routers
hard

Unit Test Generation

#testing #coding #quality-assurance

Write unit tests to validate edge cases for a specific function.

Write a comprehensive set of unit tests using a standard testing framework for the following function. Ensure to cover edge cases such as empty input, negative numbers, and null values: function calculateDiscount(price, discountPercentage) { if (!price || price < 0) return 0; return price - (price * (discountPercentage / 100)); }