UNPKG

javascript-time-ago

Version:

Localized relative date/time formatting

38 lines (37 loc) 1.2 kB
"use strict"; var _mocha = require("mocha"); var _chai = require("chai"); var _renameLegacyProperties = _interopRequireDefault(require("./renameLegacyProperties.js")); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } (0, _mocha.describe)('steps/renameLegacyProperties', function () { (0, _mocha.it)('should rename legacy properties', function () { (0, _chai.expect)((0, _renameLegacyProperties["default"])({ formatAs: 'now', minTime: 1 })).to.deep.equal({ unit: 'now', threshold: 1 }); }); (0, _mocha.it)('should rename legacy properties (minTime: undefined)', function () { (0, _chai.expect)((0, _renameLegacyProperties["default"])({ formatAs: 'now' })).to.deep.equal({ unit: 'now' }); }); (0, _mocha.it)('should rename legacy properties (`minTime` is an object)', function () { (0, _chai.expect)((0, _renameLegacyProperties["default"])({ formatAs: 'now', minTime: { week: 2, "default": 1 } })).to.deep.equal({ unit: 'now', threshold: 1, threshold_for_week: 2 }); }); }); //# sourceMappingURL=renameLegacyProperties.test.js.map