Fix January unit test (#1417)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
const { test, given } = require('sazerac');
|
||||
const moment = require('moment');
|
||||
const sinon = require('sinon');
|
||||
const {
|
||||
starRating,
|
||||
currencyFromCode,
|
||||
@@ -76,6 +76,15 @@ describe('Text formatters', function() {
|
||||
|
||||
test(formatDate, () => {
|
||||
given(1465513200000).describe('when given a timestamp in june 2016').expect('june 2016');
|
||||
given(moment().startOf('year')).describe('when given the beginning of this year').expect('january');
|
||||
});
|
||||
|
||||
context('in october', function () {
|
||||
beforeEach(function () {
|
||||
sinon.useFakeTimers(new Date(2017, 9, 15).getTime());
|
||||
});
|
||||
|
||||
test(formatDate, () => {
|
||||
given(new Date(2017, 0, 1).getTime()).describe('when given the beginning of this year').expect('january');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user