From b893503aa81a76903520812470efd9a94fbb4eae Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Fri, 10 Aug 2018 15:35:04 -0400 Subject: [PATCH] Intl.DateTimeFormat: formatToParts nitpicking --- .../prototype/formatToParts/main.js | 55 +++++++++---------- 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/test/intl402/DateTimeFormat/prototype/formatToParts/main.js b/test/intl402/DateTimeFormat/prototype/formatToParts/main.js index 75e7686f3d..b89711dac6 100644 --- a/test/intl402/DateTimeFormat/prototype/formatToParts/main.js +++ b/test/intl402/DateTimeFormat/prototype/formatToParts/main.js @@ -40,37 +40,34 @@ compareFTPtoFormat(['ar'], { }, Date.now()); const actualPartTypes = new Intl.DateTimeFormat('en-us', { - weekday: 'long', - era: 'long', - year: 'numeric', - month: 'numeric', - day: 'numeric', - hour: 'numeric', - minute: 'numeric', - second: 'numeric', - hour12: true, - timeZone: 'UTC', - timeZoneName: 'long' + weekday: 'long', + era: 'long', + year: 'numeric', + month: 'numeric', + day: 'numeric', + hour: 'numeric', + minute: 'numeric', + second: 'numeric', + hour12: true, + timeZone: 'UTC', + timeZoneName: 'long' }).formatToParts(Date.UTC(2012, 11, 17, 3, 0, 42)) - .map(function (part) { return part.type; }); + .map(part => part.type); const legalPartTypes = [ - "weekday", - "era", - "year", - "month", - "day", - "hour", - "minute", - "second", - "literal", - "dayPeriod", - "timeZoneName" + 'weekday', + 'era', + 'year', + 'month', + 'day', + 'hour', + 'minute', + 'second', + 'literal', + 'dayPeriod', + 'timeZoneName', ]; -actualPartTypes.forEach( - function (type) { - assert( - legalPartTypes.indexOf(type) !== -1, - type + " is not a legal type"); - }); +actualPartTypes.forEach(function(type) { + assert(legalPartTypes.includes(type), `${type} is not a legal type`); +});