fill-tank:master#321
Conversation
test: add unit tests for fillTank function
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your test file demonstrates solid coverage for the fillTank function. All core requirements are properly tested including funding limitations, rounding behavior (fuel to 1 decimal, price to 2 decimals), the minimum 2-liter threshold, tank capacity constraints, and return value verification. The structure follows Jest best practices with well-organized describe blocks. Minor improvements to consider (not blocking): - The "should not exceed tank capacity" test only verifies fuel state but doesn't check money deduction consistency. Adding a money assertion would align it with other tests. - While default full-tank behavior is indirectly tested through edge cases, an explicit dedicated test would improve clarity and documentation. These are low-priority suggestions and do not prevent the tests from validating the core functionality. Your implementation successfully covers all essential requirements from the task description.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Добавлены unit-тесты для функции
fillTankЧто сделано
amountКак запустить тесты
npm test