Ghost/ghost/admin/tests/unit/helpers/gh-format-timeago-test.js
Kevin Ansfield e74e2e039e Update code to match eslint rules
no issue
- switch `jscs` and `jshint` inline config to `eslint` config
- fix eslint errors, predominantly in tests where the config now the main app config more closely
2016-11-14 13:26:00 +00:00

26 lines
656 B
JavaScript

/* jshint expr:true */
import {expect} from 'chai';
import {
describe,
it
} from 'mocha';
import {
timeAgo
} from 'ghost-admin/helpers/gh-format-timeago';
import sinon from 'sinon';
describe('Unit: Helper: gh-format-timeago', function () {
// eslint-disable-next-line no-unused-vars
let mockDate, utcStub;
it('calculates the correct time difference', function () {
mockDate = '2016-05-30T10:00:00.000Z';
utcStub = sinon.stub(moment, 'utc').returns('2016-05-30T11:00:00.000Z');
let result = timeAgo([mockDate]);
expect(result).to.be.equal('an hour ago');
moment.utc.restore();
});
});