The JavaScript Applications course introduces first steps for build web front-end application, using a back-end server (Node.js/Business clouds/etc...). The topics covered include HTTP, AJAX (both native and with frameworks), asynchronous paradigms using callbacks and promises and more...
[ Slides](https://rawgit.com/TelerikAcademy/JavaScript-Applications/master/Topics/09. Unit testing - Spies and Mocks with Sinon/index.html) / [ Demos](/Topics/09. Unit testing - Spies and Mocks with Sinon/demos) / [ Tasks](/Topics/09. Unit testing - Spies and Mocks with Sinon/homework) / [ Videos](/Topics/09. Unit testing - Spies and Mocks with Sinon/VIDEOS.md)
In 04.Underscore.js/homework/task-3-tests. The resulting double value is evaluated to be equal to the expected. This can lead to false negatives because it depends on the way the final value is calculated. Doubles have certain precision that must be taken into account when comparing them.
For example - to calculate the average mark the tests expects first to sum all the marks of the student and after that to divide the sum by their count.
I summed each mark divided by the total marks count (which is mathematically also correct) but when using double floating point produces slightly different result (by 0.0000000000001).
So the last test expects 7.0006000000001 and my result is 7.006. The test should pass, instead it fails.
To correct this compare the absolute difference of the expected and actual result to be smaller than some tolerance value - epsilon.
I don`t know how to use mocha yet, so I cannot create pull request.