Sha256: 81b4c888ab1aa45ef3694d7fdc510327f64b2cf2b6531ca684db9eaef215a1c9
Contents?: true
Size: 1.97 KB
Versions: 19
Compression:
Stored size: 1.97 KB
Contents
import { module, test } from '../qunit'; import moment from '../../moment'; module('normalize units'); test('normalize units', function (assert) { var fullKeys = [ 'year', 'quarter', 'month', 'isoWeek', 'week', 'day', 'hour', 'minute', 'second', 'millisecond', 'date', 'dayOfYear', 'weekday', 'isoWeekday', 'weekYear', 'isoWeekYear', ], aliases = [ 'y', 'Q', 'M', 'W', 'w', 'd', 'h', 'm', 's', 'ms', 'D', 'DDD', 'e', 'E', 'gg', 'GG', ], length = fullKeys.length, fullKey, fullKeyCaps, fullKeyPlural, fullKeyCapsPlural, alias, index; for (index = 0; index < length; index += 1) { fullKey = fullKeys[index]; fullKeyCaps = fullKey.toUpperCase(); fullKeyPlural = fullKey + 's'; fullKeyCapsPlural = fullKeyCaps + 's'; alias = aliases[index]; assert.equal( moment.normalizeUnits(fullKey), fullKey, 'Testing full key ' + fullKey ); assert.equal( moment.normalizeUnits(fullKeyCaps), fullKey, 'Testing full key capitalised ' + fullKey ); assert.equal( moment.normalizeUnits(fullKeyPlural), fullKey, 'Testing full key plural ' + fullKey ); assert.equal( moment.normalizeUnits(fullKeyCapsPlural), fullKey, 'Testing full key capitalised and plural ' + fullKey ); assert.equal( moment.normalizeUnits(alias), fullKey, 'Testing alias ' + fullKey ); } });
Version data entries
19 entries across 19 versions & 1 rubygems