I second that. @swellep good job with the random tests but your test cases should allow for floating point errors in JavaScript. Usually this can be done using Test.expect() with a specified error range but since this Kata requires the user to return a string you should probably ask the user to round the result to a number of decimal places before using it in the return string.
i don't understand what's being asked of me
Fixed sample tests and updated description in all languages. Though it's still kind of low quality and pretty much a duplicate...
mostly fixed
This should be fixed.
assuming the user reads the unit tests or knows how to read them...
What's the desired precision in JS?
Actually, just use
Test.assertApproxEquals
overNumber
( and check return value type separately ).Rounding is not the correct answer to floating point inaccuracy.
Not really an issue if it's just your preference... You can always delete the comments yourself -- they're not necessary for a valid solution.
I prefer that there are no comments within the function to be worked on
Hi
codeepic
,fixed.
Hi
dnepro
,fixed.
Hi
nbeck
,fixed.
Hi
JohanWiltink
,fixed.
I second that. @swellep good job with the random tests but your test cases should allow for floating point errors in JavaScript. Usually this can be done using
Test.expect()
with a specified error range but since this Kata requires the user to return a string you should probably ask the user to round the result to a number of decimal places before using it in the return string.Loading more items...