hard
Unit Test Generation
Write unit tests to validate edge cases for a specific function.
📝 Contenido del prompt
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)); }