easy5 pts · first answer countstest-automationjestassertions
Comparing decimal results
A function adds 18% GST on two items of ₹0.1 and ₹0.2 as JavaScript numbers. expect(result).toBe(0.054) fails because result is 0.05399999999999999. What is the right assertion?
Discussion 0
Join free to post in the discussion.
Related questions
- toBe versus toEqualAutomation Test Engineer
- Arrange, Act, AssertAutomation Test Engineer
- An upside-down test pyramidAutomation Test Engineer
- Sharing fixtures in pytestAutomation Test Engineer
- Asserting that an error is raisedAutomation Test Engineer
- Running pytest in parallelAutomation Test Engineer
- A keyword-driven frameworkAutomation Test Engineer
- Layers in a test frameworkAutomation Test Engineer