Add negative test for isInteger

Signed-off-by: Pascal Syma <pascal@syma.dev>
This commit is contained in:
2024-12-13 14:52:35 +01:00
parent a38f17f757
commit 85b7336a54
+2
View File
@@ -108,6 +108,8 @@ describe('coordinates utils', () => {
expect(isInteger([1, 2, 3])).toBeTrue(); expect(isInteger([1, 2, 3])).toBeTrue();
expect(isInteger([0, 0])).toBeTrue(); expect(isInteger([0, 0])).toBeTrue();
expect(isInteger([0, 10.001])).toBeFalse(); expect(isInteger([0, 10.001])).toBeFalse();
expect(isInteger([-1, -3])).toBeTrue();
expect(isInteger([0, -222])).toBeTrue();
expect(isInteger([472.2948292, 10.001])).toBeFalse(); expect(isInteger([472.2948292, 10.001])).toBeFalse();
expect(isInteger([-472.2948292, 10.001])).toBeFalse(); expect(isInteger([-472.2948292, 10.001])).toBeFalse();
expect(isInteger([-472.2948292, -10.001])).toBeFalse(); expect(isInteger([-472.2948292, -10.001])).toBeFalse();