Ad
  • Custom User Avatar

    JS: No random tests

  • Custom User Avatar

    No sample tests.

  • Custom User Avatar

    You need to check spans which include the days when Daylight Savings Time begins and ends. Solutions which naively add 24-hour intervals will give the wrong result.

    Test.assertEquals(nextFiveDays(new Date(2012, 10, 2)),
      '11/3/2012, 11/4/2012, 11/5/2012, 11/6/2012, 11/7/2012',
      'Should give correct result when Daylight Savings Time ends');
    Test.assertEquals(nextFiveDays(new Date(2013, 2, 7, 23, 59)),
      '3/8/2013, 3/9/2013, 3/10/2013, 3/11/2013, 3/12/2013',
      'Should give correct result when Daylight Savings Time begins');
    

    I know, I know... dates are hard.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution