How can I test floating-point equality using chai?
I was looking for this too, and apart from this question, I also found this discussion regarding a feature request that led to the addition of closeTo. With that you can specify a value and a +/- delta, so basically it lets you specify the precision with which to check the result. percentage.should.be.closeTo(6.666, 0.001); or … Read more