Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
JS: Node v12 should be used along with its appropiate assertion tools (Mocha + Chai).
Refer to this and this
This comment is hidden because it contains spoiler information about the solution
Sample and fixed tests print the solution's output as an additional error message.
This comment is hidden because it contains spoiler information about the solution
I like the idea of testing operator precedence, but it would be great to include more equations (in other words, open it up outside of just the temperature equation, so you can test the user on more examples).
Floating point errors.
You should use
Test.assertApproxEquals
to compare two floats.Add a test where you pass
NaN
as the value to convert. Decide what to return in that case and write it in the instructions if returningNaN
is not what you want.Do not use
Test.assertEquals
to test floating point numbers. UseTest.assertApproxEquals
.This is another of the mistakes countless people have made before you.
Missing a test
Test.assertApproxequals( celsiusToFahrenheit( -17-7/9 ), 0 )
.Why are you doing all that work then?