Skip to content

Incorrect closeTo result #1481

Open
@Tb0

Description

Hello,
I've an issue with the method closeTo.

expect(1682.6).to.be.closeTo(1682.7, 0.1) returns an error ❌ while I was expecting the test to pass.

It seems to me that when you have a number with more than 3 digits this fails ❌ .

expect(168.6).to.be.closeTo(168.7, 0.1) is passing ✅ , while expect(1682.6).to.be.closeTo(1682.7, 0.1) doesn't ❌.

In the meantime, expect(1682.6).to.be.closeTo(1682.7, 0.2) is passing ✅.

Can you please tell me what's going on or if I misunderstand something?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions