Resolve "Transient karma failure on master for `Date time utils timeFor returns remaining time when in the future`"

This commit is contained in:
Mike Greiling 2017-06-20 07:56:48 +00:00 committed by Phil Hughes
parent 5214e507b0
commit a67130655a
1 changed files with 4 additions and 0 deletions

View File

@ -16,6 +16,10 @@ import { timeIntervalInWords } from '~/lib/utils/datetime_utility';
const date = new Date();
date.setFullYear(date.getFullYear() + 1);
// Add a day to prevent a transient error. If date is even 1 second
// short of a full year, timeFor will return '11 months remaining'
date.setDate(date.getDate() + 1);
expect(
gl.utils.timeFor(date),
).toBe('1 year remaining');