Ad
  • Custom User Avatar

    I think tests are still wrong.

    For example. From your tests:

    consolidate([ 4, 8 ], [ 5, 6 ], [ 9, 11 ], [ 2, 5 ] ])
    Result lengths should match. [Expected 1 got 2]
    expected result: [9,11]
    

    In the kata description you say that the result of this test should be: [[2,8],[9,11]]

    I think you need to decide if two contiguous time intervals must be consolidated in one or not.

    Another example:

    consolidate( [ [ -2, 0 ],
    [ 0, 0 ],
    [ 4, 11 ],
    [ 22, 500 ],
    [ 1, 11 ],
    [ -1, -1 ],
    [ 7, 8 ],
    [ 500, 500 ] ]));
    

    I think the result should be: [ [ -2, 11 ], [ 22, 500 ] ]

    But your tests say that: Result lengths should match. [Expected 1 got 2]
    expected result: [22,500]

    My guess is that your solution is wrong.