react-hex icon indicating copy to clipboard operation
react-hex copied to clipboard

Tests failing locally

Open casey-speer opened this issue 8 years ago • 1 comments

Looks like some rounding errors:


  gridPoint
    ✓ should return center point of pointy-topped hexagonal grid system
    1) should return center point of flat-topped hexagonal grid system

  gridPoints
    ✓ should return sequential gridPoints (pointy-topped)
    ✓ should return sequential gridPoints (flat-topped)


  3 passing (42ms)
  1 failing

  1) gridPoint should return center point of flat-topped hexagonal grid system:

      AssertionError: { props: { type: 'flat-topped', x: 0, y: 0, size: 100 },
  gridX: 0,
  gridY: 0,
  corners: 
   [ [ 100, 0 ],
     [ 50.00000000 deepEqual { corners: 
   [ [ 100, 0 ],
     [ 50.000000000000014, 86.60254037844386 ],
     [ -49.99999999999998, 86.60254037844388 ],
   
      + expected - actual

             1.2246467991473532e-14
           ]
           [
             -50.00000000000004
      -      -86.60254037844385
      +      -86.60254037844383
           ]
           [
             50.000000000000014
             -86.60254037844386
      
      at Context.<anonymous> (test/utils.js:177:12)

casey-speer avatar Apr 09 '17 23:04 casey-speer

Sorry, this is a problem about environmentally dependent floating-point calculation maybe so difficult to resolve it.

airtoxin avatar Apr 17 '17 04:04 airtoxin