javascript-time-ago
Version:
Localized relative date/time formatting
35 lines • 950 B
JavaScript
import { describe, it } from 'mocha';
import { expect } from 'chai';
import renameLegacyProperties from './renameLegacyProperties.js';
describe('steps/renameLegacyProperties', function () {
it('should rename legacy properties', function () {
expect(renameLegacyProperties({
formatAs: 'now',
minTime: 1
})).to.deep.equal({
unit: 'now',
threshold: 1
});
});
it('should rename legacy properties (minTime: undefined)', function () {
expect(renameLegacyProperties({
formatAs: 'now'
})).to.deep.equal({
unit: 'now'
});
});
it('should rename legacy properties (`minTime` is an object)', function () {
expect(renameLegacyProperties({
formatAs: 'now',
minTime: {
week: 2,
"default": 1
}
})).to.deep.equal({
unit: 'now',
threshold: 1,
threshold_for_week: 2
});
});
});
//# sourceMappingURL=renameLegacyProperties.test.js.map