Skip to content

Commit

Permalink
Improve unit testing for new formatters ✌️
Browse files Browse the repository at this point in the history
  • Loading branch information
Edson Hilios committed Aug 8, 2016
1 parent e746fe4 commit f4dd04b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 5 additions & 1 deletion test/unit/event_test.js
Expand Up @@ -37,9 +37,13 @@ test('event.offset object has {seconds, minutes, hours, days, ' +
ok(event.offset.hasOwnProperty('days'));
ok(event.offset.hasOwnProperty('daysToWeek'));
ok(event.offset.hasOwnProperty('daysToMonth'));
ok(event.offset.hasOwnProperty('totalDays'));
ok(event.offset.hasOwnProperty('weeks'));
ok(event.offset.hasOwnProperty('weeksToMonth'));
ok(event.offset.hasOwnProperty('years'));
ok(event.offset.hasOwnProperty('totalDays'));
ok(event.offset.hasOwnProperty('totalHours'));
ok(event.offset.hasOwnProperty('totalMinutes'));
ok(event.offset.hasOwnProperty('totalSeconds'));
});
$clock.tick(500);
});
Expand Down
10 changes: 9 additions & 1 deletion test/unit/math_test.js
Expand Up @@ -14,7 +14,15 @@ test('time offset calculation', function() {
ok(event.offset.hours === 3);
ok(event.offset.minutes === 4);
ok(event.offset.seconds === 5);
ok(event.offset.totalDays === 9);
// Offset values
ok(event.offset.daysToWeek === 2);
ok(event.offset.daysToMonth === 9);
ok(event.offset.weeksToMonth === 1);
// Test total count
ok(event.offset.totalDays === 9);
ok(event.offset.totalHours === 9 * 24 + 3);
ok(event.offset.totalMinutes === 9 * 24 * 60 + 3 * 60 + 4);
ok(event.offset.totalSeconds === (9 * 24 * 60 + 3 * 60 + 4) * 60 + 5);
});

$clock.tick(500);
Expand Down

0 comments on commit f4dd04b

Please sign in to comment.