From 6bc7d6941d0d1fd37372a4f95265230ab46742f4 Mon Sep 17 00:00:00 2001 From: Ed Hager Date: Thu, 12 Oct 2017 10:38:46 -0700 Subject: [PATCH 1/6] WIP - Intern 4 update. --- intern.json | 87 + package-lock.json | 2399 +++++++++++++++++----------- package.json | 4 +- tests/intern-local.ts | 11 - tests/intern-saucelabs.ts | 16 - tests/intern.ts | 82 - tests/run.html | 2 +- tests/support/mocks/common/main.ts | 6 +- tests/unit/all.ts | 10 - tests/unit/cldr/load.ts | 83 +- tests/unit/cldr/load/default.ts | 209 +-- tests/unit/cldr/load/webpack.ts | 81 +- tests/unit/date.ts | 737 ++++----- tests/unit/i18n.ts | 752 ++++----- tests/unit/main.ts | 8 +- tests/unit/number.ts | 456 +++--- tests/unit/unit.ts | 118 +- tests/unit/util/globalize.ts | 127 +- tests/unit/util/main.ts | 7 +- 19 files changed, 2832 insertions(+), 2363 deletions(-) create mode 100644 intern.json delete mode 100644 tests/intern-local.ts delete mode 100644 tests/intern-saucelabs.ts delete mode 100644 tests/intern.ts delete mode 100644 tests/unit/all.ts diff --git a/intern.json b/intern.json new file mode 100644 index 0000000..c2dc46c --- /dev/null +++ b/intern.json @@ -0,0 +1,87 @@ +{ + "environments": [ + { "browserName": "node" } + ], + "suites": [ + "./_build/tests/unit/**/*.js" + ], + "functionalSuites": [ + "./_build/tests/functional/**/*.js" + ], + "loader": { + "script": "dojo2", + "options": { + "packages": [ + { "name": "src", "location": "_build/src" }, + { "name": "tests", "location": "_build/tests" }, + { "name": "cldr-data", "location": "node_modules/cldr-data" }, + { "name": "cldrjs", "location": "node_modules/cldrjs" }, + { "name": "@dojo", "location": "node_modules/@dojo" }, + { "name": "globalize", "location": "node_modules/globalize", "main": "dist/globalize" }, + { "name": "sinon", "location": "node_modules/sinon/pkg", "main": "sinon" }, + { "name": "grunt-dojo2", "location": "node_modules/grunt-dojo2" } + ], + "map": { + "globalize": { + "cldr": "cldrjs/dist/cldr", + "cldr/event": "cldrjs/dist/cldr/event", + "cldr/supplemental": "cldrjs/dist/cldr/supplemental", + "cldr/unresolved": "cldrjs/dist/cldr/unresolved" + } + } + } + }, + "configs": { + "coverage": { + "coverage": [ + "./_build/src/**/*.js" + ] + }, + "remoteCapabilities": { + "project": "Dojo 2", + "name": "@dojo/i18n" + }, + "local": { + "extends": [ "coverage" ], + "tunnel": "selenium", + "environments+": [ + { "browserName": "safari" } + ] + }, + "browserstack": { + "extends": [ "coverage", "remoteCapabilities" ], + + "tunnel": "browserstack", + "capabilities+": { + "browserstack.debug": false + }, + "environments+": [ + { "browserName": "internet explorer", "version": "11" }, + { "browserName": "edge" }, + { "browserName": "firefox", "platform": "WINDOWS" }, + { "browserName": "chrome", "platform": "WINDOWS" }, + { "browserName": "safari", "version": "9.1", "platform": "MAC" }, + { "browserName": "iPhone", "version": "9.1" } + ] + }, + "saucelabs": { + "extends": [ "coverage", "remoteCapabilities" ], + + "tunnel": "saucelabs", + "capabilities+": { + "fixSessionCapabilities": false + }, + + "defaultTimeout": 10000, + "environments+": [ + { "browserName": "internet explorer", "version": [ "10.0", "11.0" ], "platform": "Windows 7" }, + { "browserName": "microsoftedge", "platform": "Windows 10" }, + { "browserName": "firefox", "platform": "Windows 10" }, + { "browserName": "chrome", "platform": "Windows 10" }, + { "browserName": "safari", "version": "9", "platform": "OS X 10.11" }, + { "browserName": "iphone", "version": "9.3" } + ], + "maxConcurrency": 4 + } + } +} diff --git a/package-lock.json b/package-lock.json index efec729..eadb7cc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,9 +1,21 @@ { "name": "@dojo/i18n", - "version": "0.1.0", + "version": "0.1.1-pre", "lockfileVersion": 1, "requires": true, "dependencies": { + "@dojo/core": { + "version": "2.0.0-beta2.4", + "resolved": "https://registry.npmjs.org/@dojo/core/-/core-2.0.0-beta2.4.tgz", + "integrity": "sha1-AjZimDJ2QxZrtUITk2hJW1CLzBQ=", + "dev": true + }, + "@dojo/has": { + "version": "2.0.0-beta2.3", + "resolved": "https://registry.npmjs.org/@dojo/has/-/has-2.0.0-beta2.3.tgz", + "integrity": "sha1-faojdQXj7KN2EG1zmMTH3tg2oOE=", + "dev": true + }, "@dojo/interfaces": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/@dojo/interfaces/-/interfaces-0.1.0.tgz", @@ -16,29 +28,132 @@ "integrity": "sha512-3qoMKkewhIUqV99JzGiAkXdJuT3HUQkSviYut9828Cv4uKOqKqnb6znE8ofZhaAuv25ZU9anHTPiC8fepONfVQ==", "dev": true }, + "@dojo/shim": { + "version": "2.0.0-beta2.4", + "resolved": "https://registry.npmjs.org/@dojo/shim/-/shim-2.0.0-beta2.4.tgz", + "integrity": "sha1-TUjz2MMmxF5k3TRq+tAK61gmPZo=", + "dev": true + }, + "@theintern/digdug": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@theintern/digdug/-/digdug-2.0.0.tgz", + "integrity": "sha512-PDcflahjSPdnJnChtWhej3l5jknGDdDl15p1+7rNxjOpb2gpgnhoWzXCfkUFJvUL/q1DuAowRQNNh2hdUk5MGw==", + "dev": true, + "requires": { + "@dojo/core": "2.0.0-beta2.4", + "@dojo/has": "2.0.0-beta2.3", + "@dojo/interfaces": "2.0.0-beta2.4", + "@dojo/shim": "2.0.0-beta2.4", + "decompress": "4.2.0", + "semver": "5.4.1" + }, + "dependencies": { + "@dojo/interfaces": { + "version": "2.0.0-beta2.4", + "resolved": "https://registry.npmjs.org/@dojo/interfaces/-/interfaces-2.0.0-beta2.4.tgz", + "integrity": "sha1-OGXj9EQJMuCNJNJPgj5UFwaiKNM=", + "dev": true + }, + "semver": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", + "dev": true + } + } + }, + "@theintern/leadfoot": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@theintern/leadfoot/-/leadfoot-2.0.0.tgz", + "integrity": "sha512-kcC/tpbdaO8DplWdZ1BeOXwII5HCwiVk3Dck0dnmm/vdqtzRE4yApY5um062PAJh8TqzT1cdR/zy4k4HWo8dBQ==", + "dev": true, + "requires": { + "@dojo/core": "2.0.0-beta2.4", + "@dojo/has": "2.0.0-beta2.3", + "@dojo/interfaces": "2.0.0-beta2.4", + "@dojo/shim": "2.0.0-beta2.4", + "@types/jszip": "0.0.33", + "jszip": "3.1.4", + "tslib": "1.7.1" + }, + "dependencies": { + "@dojo/interfaces": { + "version": "2.0.0-beta2.4", + "resolved": "https://registry.npmjs.org/@dojo/interfaces/-/interfaces-2.0.0-beta2.4.tgz", + "integrity": "sha1-OGXj9EQJMuCNJNJPgj5UFwaiKNM=", + "dev": true + } + } + }, + "@types/babel-types": { + "version": "6.25.1", + "resolved": "https://registry.npmjs.org/@types/babel-types/-/babel-types-6.25.1.tgz", + "integrity": "sha512-7Z6r20+HE0viAFhsW0d/UrC1K2tTlpXzGpNlYm8MmCv8z5PbAacFIshrM/MjlGRa5SBqxu2socpy8FHntwZKng==", + "dev": true + }, + "@types/benchmark": { + "version": "1.0.30", + "resolved": "https://registry.npmjs.org/@types/benchmark/-/benchmark-1.0.30.tgz", + "integrity": "sha1-9r6gus6xeBVZaLmYT5RUb2NndZI=", + "dev": true + }, "@types/chai": { "version": "3.4.35", "resolved": "https://registry.npmjs.org/@types/chai/-/chai-3.4.35.tgz", "integrity": "sha1-6NZfg0ktKUT4FvxiB0GCHCioyQA=", "dev": true }, + "@types/charm": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@types/charm/-/charm-1.0.1.tgz", + "integrity": "sha512-F9OalGhk60p/DnACfa1SWtmVTMni0+w9t/qfb5Bu7CsurkEjZFN7Z+ii/VGmYpaViPz7o3tBahRQae9O7skFlQ==", + "dev": true, + "requires": { + "@types/node": "8.0.34" + } + }, + "@types/diff": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/@types/diff/-/diff-3.2.2.tgz", + "integrity": "sha512-q3zfJvaTroV5BjAAR+peTHEGAAhGrPX0z2EzCzpt2mwFA+qzUn2nigJLqSekXRtdULKmT8am7zjvTMZSapIgHw==", + "dev": true + }, + "@types/express": { + "version": "4.0.37", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.0.37.tgz", + "integrity": "sha512-tIULTLzQpFFs5/PKnFIAFOsXQxss76glppbVKR3/jddPK26SBsD5HF5grn5G2jOGtpRWSBvYmDYoduVv+3wOXg==", + "dev": true, + "requires": { + "@types/express-serve-static-core": "4.0.53", + "@types/serve-static": "1.7.32" + } + }, + "@types/express-serve-static-core": { + "version": "4.0.53", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.0.53.tgz", + "integrity": "sha512-zaGeOpEYp5G2EhjaUFdVwysDrfEYc6Q6iPhd3Kl4ip30x0tvVv7SuJvY3yzCUSuFlzAG8N5KsyY6BJg93/cn+Q==", + "dev": true, + "requires": { + "@types/node": "8.0.34" + } + }, "@types/fs-extra": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-0.0.33.tgz", "integrity": "sha1-qHGcQXsIDAEtNJeyjiKKwJdF/fI=", "dev": true, "requires": { - "@types/node": "8.0.28" + "@types/node": "8.0.34" } }, "@types/glob": { - "version": "5.0.32", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-5.0.32.tgz", - "integrity": "sha512-DMcj5b67Alb/e4KhpzyvphC5nVDHn1oCOGZao3oBddZVMH5vgI/cvdp+O/kcxZGZaPqs0ZLAsK4YrjbtZHO05g==", + "version": "5.0.33", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-5.0.33.tgz", + "integrity": "sha512-BcD4yyWz+qmCggaYMSFF0Xn7GkO6tgwm3Fh9Gxk/kQmEU3Z7flQTnVlMyKBUNvXXNTCCyjqK4XT4/2hLd1gQ2A==", "dev": true, "requires": { "@types/minimatch": "3.0.1", - "@types/node": "8.0.28" + "@types/node": "8.0.34" } }, "@types/grunt": { @@ -47,7 +162,7 @@ "integrity": "sha512-fKrWJ+uFq9j3tP2RLm9cY7Z50LhhPnSHQCliCZP5lPAWC7TydnU+BcLR0KQIHe9Gbn1oGfkRIq3u56MNCC1qyw==", "dev": true, "requires": { - "@types/node": "8.0.28" + "@types/node": "8.0.34" } }, "@types/handlebars": { @@ -62,10 +177,74 @@ "integrity": "sha512-3uQgLVw3ukDjrgi1h2qxSgsg2W7Sp/BN/P+IBgi8D019FdCcetJzJIxk0Wp1Qfcxzy3EreUnPI7/1HXhFNCRTg==", "dev": true }, + "@types/http-errors": { + "version": "1.5.34", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-1.5.34.tgz", + "integrity": "sha1-1qVvJde5XdBwR2gL+CVjLil5aBU=", + "dev": true + }, + "@types/istanbul-lib-coverage": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.0.tgz", + "integrity": "sha512-ohkhb9LehJy+PA40rDtGAji61NCgdtKLAlFoYp4cnuuQEswwdK3vz9SOIkkyc3wrk8dzjphQApNs56yyXLStaQ==", + "dev": true + }, + "@types/istanbul-lib-hook": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-hook/-/istanbul-lib-hook-1.0.0.tgz", + "integrity": "sha512-+kdaJ8hO/auIGcqPuSbd3cnTSzgM8ZW0zfYFZLP67vCmWkZV4LdC1XOXpMWnlONup+PChJMK8Q/+Qrh7WoxnUQ==", + "dev": true + }, + "@types/istanbul-lib-instrument": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-instrument/-/istanbul-lib-instrument-1.7.0.tgz", + "integrity": "sha512-BWj7zRtwVU5KzuYL/zNuVoSvYWIpT02smNMpQwQbJjwEyITEGSKsxVIT4b2bzXCWFMq76ss0sdY/5yw3NwTlIA==", + "dev": true, + "requires": { + "@types/babel-types": "6.25.1", + "@types/istanbul-lib-coverage": "1.1.0", + "@types/source-map": "0.1.29" + } + }, + "@types/istanbul-lib-report": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-1.1.0.tgz", + "integrity": "sha512-nW5QuzmMhr7fHPijtaGOemFFI8Ctrxb/dIXgouSlKmWT16RxWlGLEX/nGghIBOReKe9hPFZXoNh338nFQk2xcA==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "1.1.0" + } + }, + "@types/istanbul-lib-source-maps": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.0.tgz", + "integrity": "sha512-GxjyOSIZC/HETEo61MOjM72qdZH0F9UwfuXCKhmgqhVC7PSjE61BU2I/2eZwQ43+kSdkxKvnOBqqNZi1HHHNEA==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "1.1.0", + "@types/source-map": "0.1.29" + } + }, + "@types/istanbul-reports": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-1.1.0.tgz", + "integrity": "sha512-wrJUtE1+HuaRz0Le7fc5l1nMTermRh6wlEvOdQPilseNScyYgQK8MdgDP2cf/X8+6e1dtsX/zP4W4kH/jyHvFw==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "1.1.0", + "@types/istanbul-lib-report": "1.1.0" + } + }, + "@types/jszip": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/@types/jszip/-/jszip-0.0.33.tgz", + "integrity": "sha512-zAbqAUQmXP9/ryVysJO6XkogdIdtVIYYGmV7BzhKuagaS+75QZ6muJjeSaG5M8rdE5jQ8gyhkZ23r6l4ICmxyQ==", + "dev": true + }, "@types/lodash": { - "version": "4.14.74", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.74.tgz", - "integrity": "sha512-BZknw3E/z3JmCLqQVANcR17okqVTPZdlxvcIz0fJiJVLUCbSH1hK3zs9r634PVSmrzAxN+n/fxlVRiYoArdOIQ==", + "version": "4.14.77", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.77.tgz", + "integrity": "sha512-sRCTcVQkIiQqRoQcazgN2PvRLS7d9BnSl8elRZR5UYlpm6XgU8F4j/0csz8WoaKKTUqa6rSuOy3Vph7AHfX7KQ==", "dev": true }, "@types/marked": { @@ -74,6 +253,18 @@ "integrity": "sha1-RLp1Tp+lFDJYPo6zCnxN0km1L6o=", "dev": true }, + "@types/mime": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-2.0.0.tgz", + "integrity": "sha512-A2TAGbTFdBw9azHbpVd+/FkdW2T6msN1uct1O9bH3vTerEHKZhTXJUQXy+hNq1B0RagfU8U+KBdqiZpxjhOUQA==", + "dev": true + }, + "@types/mime-types": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/mime-types/-/mime-types-2.1.0.tgz", + "integrity": "sha1-nKUs2jY/aZxpRmwqbM2q2RPqenM=", + "dev": true + }, "@types/minimatch": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.1.tgz", @@ -81,9 +272,40 @@ "dev": true }, "@types/node": { - "version": "8.0.28", - "resolved": "https://registry.npmjs.org/@types/node/-/node-8.0.28.tgz", - "integrity": "sha512-HupkFXEv3O3KSzcr3Ylfajg0kaerBg1DyaZzRBBQfrU3NN1mTBRE7sCveqHwXLS5Yrjvww8qFzkzYQQakG9FuQ==", + "version": "8.0.34", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.0.34.tgz", + "integrity": "sha512-Jnmm57+nHqvJUPwUzt1CLoLzFtF2B2vgG7cWFut+a4nqTp9/L6pL0N+o0Jt3V7AQnCKMsPEqQpLFZYleBCdq3w==", + "dev": true + }, + "@types/platform": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@types/platform/-/platform-1.3.1.tgz", + "integrity": "sha512-XI6JKLFNBmkADRd2FtUYtEuq5LDKTNXwUIodV3ZfTNkA+g4yo+rXXXdZL3fTE24S92BjpiEVaL3f64Fxm2JOgg==", + "dev": true + }, + "@types/resolve": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-0.0.4.tgz", + "integrity": "sha1-m1htZalH3qiMS8JNoLkF/pUgoNU=", + "dev": true, + "requires": { + "@types/node": "8.0.34" + } + }, + "@types/serve-static": { + "version": "1.7.32", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.7.32.tgz", + "integrity": "sha512-WpI0g7M1FiOmJ/a97Qrjafq2I938tjAZ3hZr9O7sXyA6oUhH3bqUNZIt7r1KZg8TQAKxcvxt6JjQ5XuLfIBFvg==", + "dev": true, + "requires": { + "@types/express-serve-static-core": "4.0.53", + "@types/mime": "2.0.0" + } + }, + "@types/shell-quote": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@types/shell-quote/-/shell-quote-1.6.0.tgz", + "integrity": "sha512-BFonQx849sYB2YOJZBUEfbWdaJcqRb6+ASvgUBtcmg2JRTjBaV2Wgn0SD0gWNIZ+rd7KPysPCjLUOUXnBDUlBg==", "dev": true }, "@types/shelljs": { @@ -92,7 +314,7 @@ "integrity": "sha1-32E73biCJe0JzlyDX2INyq8VXms=", "dev": true, "requires": { - "@types/node": "8.0.28" + "@types/node": "8.0.34" } }, "@types/sinon": { @@ -101,12 +323,43 @@ "integrity": "sha1-dLtu15KFl8Gz+xsAkAXpTcbq41c=", "dev": true }, + "@types/source-map": { + "version": "0.1.29", + "resolved": "https://registry.npmjs.org/@types/source-map/-/source-map-0.1.29.tgz", + "integrity": "sha1-1wSKYBgLCfiqbVO9oxHGtRy9cBg=", + "dev": true + }, + "@types/statuses": { + "version": "1.2.28", + "resolved": "https://registry.npmjs.org/@types/statuses/-/statuses-1.2.28.tgz", + "integrity": "sha1-zF8Z0haUFtVWzcoFtZsp5F+kl+I=", + "dev": true + }, + "@types/ws": { + "version": "0.0.42", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-0.0.42.tgz", + "integrity": "sha512-+30f9gcx24GZRD9EqqiQM+I5pRf/MJiJoEqp2X62QRwfEjdqyn9mPmjxZAEXBUVunWotE5qkadIPqf2MMcDYNw==", + "dev": true, + "requires": { + "@types/node": "8.0.34" + } + }, "abbrev": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz", - "integrity": "sha1-0FVMIlZjbi9W58LlrRg/hZQo2B8=", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true }, + "accepts": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.4.tgz", + "integrity": "sha1-hiRnWMfdbSGmR0/whKR0DsBesh8=", + "dev": true, + "requires": { + "mime-types": "2.1.17", + "negotiator": "0.6.1" + } + }, "adm-zip": { "version": "0.4.4", "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.4.tgz", @@ -185,6 +438,15 @@ "normalize-path": "2.1.1" } }, + "append-transform": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-0.4.0.tgz", + "integrity": "sha1-126/jKlNJ24keja61EpLdKthGZE=", + "dev": true, + "requires": { + "default-require-extensions": "1.0.0" + } + }, "argparse": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", @@ -215,12 +477,36 @@ "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=", "dev": true }, + "array-filter": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz", + "integrity": "sha1-fajPLiZijtcygDWB/SH2fKzS7uw=", + "dev": true + }, "array-find-index": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", "dev": true }, + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=", + "dev": true + }, + "array-map": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz", + "integrity": "sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI=", + "dev": true + }, + "array-reduce": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz", + "integrity": "sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys=", + "dev": true + }, "array-uniq": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", @@ -285,10 +571,10 @@ "dev": true, "requires": { "browserslist": "1.7.7", - "caniuse-db": "1.0.30000733", + "caniuse-db": "1.0.30000746", "normalize-range": "0.1.2", "num2fraction": "1.2.2", - "postcss": "5.2.17", + "postcss": "5.2.18", "postcss-value-parser": "3.3.0" } }, @@ -315,12 +601,134 @@ "js-tokens": "3.0.2" } }, + "babel-generator": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.0.tgz", + "integrity": "sha1-rBriAHC3n248odMmlhMFN3TyDcU=", + "dev": true, + "requires": { + "babel-messages": "6.23.0", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "detect-indent": "4.0.0", + "jsesc": "1.3.0", + "lodash": "4.17.4", + "source-map": "0.5.7", + "trim-right": "1.0.1" + }, + "dependencies": { + "jsesc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", + "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", + "dev": true + } + } + }, + "babel-messages": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", + "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "dev": true, + "requires": { + "core-js": "2.5.1", + "regenerator-runtime": "0.11.0" + }, + "dependencies": { + "core-js": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.1.tgz", + "integrity": "sha1-rmh03GaTd4m4B1T/VCjfZoGcpQs=", + "dev": true + } + } + }, + "babel-template": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", + "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "lodash": "4.17.4" + } + }, + "babel-traverse": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", + "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", + "dev": true, + "requires": { + "babel-code-frame": "6.26.0", + "babel-messages": "6.23.0", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "debug": "2.6.9", + "globals": "9.18.0", + "invariant": "2.2.2", + "lodash": "4.17.4" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "babel-types": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", + "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "esutils": "2.0.2", + "lodash": "4.17.4", + "to-fast-properties": "1.0.3" + } + }, + "babylon": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", + "dev": true + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, + "base64-js": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-0.0.8.tgz", + "integrity": "sha1-EQHpVE9KdrG8OybUUsqW16NeeXg=", + "dev": true + }, "bcrypt-pbkdf": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", @@ -338,13 +746,13 @@ "dev": true }, "benchmark": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/benchmark/-/benchmark-2.1.1.tgz", - "integrity": "sha1-57X23NAhU67RMtScWWuBWlf2wHE=", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/benchmark/-/benchmark-2.1.4.tgz", + "integrity": "sha1-CfPeMckWQl1JjMLuVloOvzwqVik=", "dev": true, "requires": { "lodash": "4.17.4", - "platform": "1.3.1" + "platform": "1.3.4" } }, "big.js": { @@ -500,8 +908,19 @@ "integrity": "sha1-C9dnBCWL6CmyOYu1Dkti0aFmsLk=", "dev": true, "requires": { - "caniuse-db": "1.0.30000733", - "electron-to-chromium": "1.3.21" + "caniuse-db": "1.0.30000746", + "electron-to-chromium": "1.3.25" + } + }, + "buffer": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-3.6.0.tgz", + "integrity": "sha1-pyyTb3e5a/UvX357RnGAYoVR3vs=", + "dev": true, + "requires": { + "base64-js": "0.0.8", + "ieee754": "1.1.8", + "isarray": "1.0.0" } }, "buffer-crc32": { @@ -510,31 +929,6 @@ "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", "dev": true }, - "buffer-to-vinyl": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/buffer-to-vinyl/-/buffer-to-vinyl-1.1.0.tgz", - "integrity": "sha1-APFfruOreh3aLN5tkSG//dB7ImI=", - "dev": true, - "requires": { - "file-type": "3.9.0", - "readable-stream": "2.0.6", - "uuid": "2.0.3", - "vinyl": "1.2.0" - }, - "dependencies": { - "vinyl": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-1.2.0.tgz", - "integrity": "sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ=", - "dev": true, - "requires": { - "clone": "1.0.2", - "clone-stats": "0.0.1", - "replace-ext": "0.0.1" - } - } - } - }, "builtin-modules": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", @@ -570,15 +964,15 @@ "dev": true, "requires": { "browserslist": "1.7.7", - "caniuse-db": "1.0.30000733", + "caniuse-db": "1.0.30000746", "lodash.memoize": "4.1.2", "lodash.uniq": "4.5.0" } }, "caniuse-db": { - "version": "1.0.30000733", - "resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30000733.tgz", - "integrity": "sha1-OmJbxBx6n5nVnWRVKFfdGvDt2dQ=", + "version": "1.0.30000746", + "resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30000746.tgz", + "integrity": "sha1-UBCYxm9fu/Y0wC8lUIsF6ICZEPQ=", "dev": true }, "capture-stack-trace": { @@ -605,14 +999,17 @@ } }, "chai": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/chai/-/chai-3.5.0.tgz", - "integrity": "sha1-TQJjewZ/6Vi9v906QOxW/vc3Mkc=", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.0.2.tgz", + "integrity": "sha1-L3MnxN5vOF3XeHmZ4qsCaXoyuDs=", "dev": true, "requires": { "assertion-error": "1.0.2", - "deep-eql": "0.1.3", - "type-detect": "1.0.0" + "check-error": "1.0.2", + "deep-eql": "2.0.2", + "get-func-name": "2.0.0", + "pathval": "1.1.0", + "type-detect": "4.0.3" } }, "chalk": { @@ -629,9 +1026,18 @@ } }, "charm": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/charm/-/charm-0.2.0.tgz", - "integrity": "sha1-us0G2HF3WTYvemYqHpZ691N/2os=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/charm/-/charm-1.0.2.tgz", + "integrity": "sha1-it02cVOm2aWBMxBSxAkJkdqZXjU=", + "dev": true, + "requires": { + "inherits": "2.0.3" + } + }, + "check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", "dev": true }, "chokidar": { @@ -652,19 +1058,19 @@ } }, "cldr-data": { - "version": "30.0.4", - "resolved": "https://registry.npmjs.org/cldr-data/-/cldr-data-30.0.4.tgz", - "integrity": "sha1-w1SENFIgjoAJoJUJ8jZLNnNhN8I=", + "version": "31.0.2", + "resolved": "https://registry.npmjs.org/cldr-data/-/cldr-data-31.0.2.tgz", + "integrity": "sha1-z/zMBurHcA6VxjxdHqYcJUPUCG0=", "dev": true, "requires": { - "cldr-data-downloader": "0.2.5", + "cldr-data-downloader": "0.3.2", "glob": "5.0.15" } }, "cldr-data-downloader": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/cldr-data-downloader/-/cldr-data-downloader-0.2.5.tgz", - "integrity": "sha1-RUHhGgU8FYHjMKQ4qvwDUxavYJM=", + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/cldr-data-downloader/-/cldr-data-downloader-0.3.2.tgz", + "integrity": "sha1-jQyYNG0WSGJS/cmvo2pGVC/kZS8=", "dev": true, "requires": { "adm-zip": "0.4.4", @@ -921,7 +1327,7 @@ "oauth-sign": "0.4.0", "qs": "1.2.2", "stringstream": "0.0.5", - "tough-cookie": "2.3.2", + "tough-cookie": "2.3.3", "tunnel-agent": "0.4.3" } }, @@ -1069,16 +1475,34 @@ "xdg-basedir": "2.0.0" } }, + "content-disposition": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", + "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=", + "dev": true + }, "content-type": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", "dev": true }, - "convert-source-map": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.0.tgz", - "integrity": "sha1-ms1whRxtXf3ZPZKC5e35SgP/RrU=", + "cookie": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", + "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=", + "dev": true + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=", + "dev": true + }, + "core-js": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.3.0.tgz", + "integrity": "sha1-+rg/uwstjchfpjbEudNMdUIMbWU=", "dev": true }, "core-util-is": { @@ -1165,14 +1589,14 @@ } }, "css-color-function": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/css-color-function/-/css-color-function-1.3.0.tgz", - "integrity": "sha1-csdnuvl48BuKipT0Lxe6XSKndvw=", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/css-color-function/-/css-color-function-1.3.3.tgz", + "integrity": "sha1-jtJMLAIFBzM5+voAS8jBQfzLKC4=", "dev": true, "requires": { "balanced-match": "0.1.0", "color": "0.11.4", - "debug": "0.7.4", + "debug": "3.1.0", "rgb": "0.1.0" }, "dependencies": { @@ -1183,9 +1607,18 @@ "dev": true }, "debug": { - "version": "0.7.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-0.7.4.tgz", - "integrity": "sha1-BuHqgILCyxTjmAbiLi9vdX+Srzk=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true } } @@ -1302,262 +1735,107 @@ "dev": true }, "decompress": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/decompress/-/decompress-3.0.0.tgz", - "integrity": "sha1-rx3VDQbjv8QyRh033hGzjA2ZG+0=", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/decompress/-/decompress-4.2.0.tgz", + "integrity": "sha1-eu3YVCflqS2s/lVnSnxQXpbQH50=", "dev": true, "requires": { - "buffer-to-vinyl": "1.1.0", - "concat-stream": "1.6.0", - "decompress-tar": "3.1.0", - "decompress-tarbz2": "3.1.0", - "decompress-targz": "3.1.0", - "decompress-unzip": "3.4.0", - "stream-combiner2": "1.1.1", - "vinyl-assign": "1.2.1", - "vinyl-fs": "2.4.4" + "decompress-tar": "4.1.1", + "decompress-tarbz2": "4.1.1", + "decompress-targz": "4.1.1", + "decompress-unzip": "4.0.1", + "graceful-fs": "4.1.11", + "make-dir": "1.0.0", + "pify": "2.3.0", + "strip-dirs": "2.0.0" } }, "decompress-tar": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/decompress-tar/-/decompress-tar-3.1.0.tgz", - "integrity": "sha1-IXx4n5uURQ76rcXF5TeXj8MzxGY=", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/decompress-tar/-/decompress-tar-4.1.1.tgz", + "integrity": "sha512-JdJMaCrGpB5fESVyxwpCx4Jdj2AagLmv3y58Qy4GE6HMVjWz1FeVQk1Ct4Kye7PftcdOo/7U7UKzYBJgqnGeUQ==", "dev": true, "requires": { - "is-tar": "1.0.0", - "object-assign": "2.1.1", - "strip-dirs": "1.1.1", - "tar-stream": "1.5.4", - "through2": "0.6.5", - "vinyl": "0.4.6" - }, - "dependencies": { - "clone": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/clone/-/clone-0.2.0.tgz", - "integrity": "sha1-xhJqkK1Pctv1rNskPMN3JP6T/B8=", - "dev": true - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "object-assign": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-2.1.1.tgz", - "integrity": "sha1-Q8NuXVaf+OSBbE76i+AtJpZ8GKo=", - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "through2": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", - "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", - "dev": true, - "requires": { - "readable-stream": "1.0.34", - "xtend": "4.0.1" - } - }, - "vinyl": { - "version": "0.4.6", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.4.6.tgz", - "integrity": "sha1-LzVsh6VQolVGHza76ypbqL94SEc=", - "dev": true, - "requires": { - "clone": "0.2.0", - "clone-stats": "0.0.1" - } - } + "file-type": "5.2.0", + "is-stream": "1.1.0", + "tar-stream": "1.5.4" } }, "decompress-tarbz2": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/decompress-tarbz2/-/decompress-tarbz2-3.1.0.tgz", - "integrity": "sha1-iyOTVoE1X58YnYclag+L3ZbZZm0=", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/decompress-tarbz2/-/decompress-tarbz2-4.1.1.tgz", + "integrity": "sha512-s88xLzf1r81ICXLAVQVzaN6ZmX4A6U4z2nMbOwobxkLoIIfjVMBg7TeguTUXkKeXni795B6y5rnvDw7rxhAq9A==", "dev": true, "requires": { - "is-bzip2": "1.0.0", - "object-assign": "2.1.1", + "decompress-tar": "4.1.1", + "file-type": "6.2.0", + "is-stream": "1.1.0", "seek-bzip": "1.0.5", - "strip-dirs": "1.1.1", - "tar-stream": "1.5.4", - "through2": "0.6.5", - "vinyl": "0.4.6" + "unbzip2-stream": "1.2.5" }, "dependencies": { - "clone": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/clone/-/clone-0.2.0.tgz", - "integrity": "sha1-xhJqkK1Pctv1rNskPMN3JP6T/B8=", + "file-type": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-6.2.0.tgz", + "integrity": "sha512-YPcTBDV+2Tm0VqjybVd32MHdlEGAtuxS3VAYsumFokDSMG+ROT5wawGlnHDoz7bfMcMDt9hxuXvXwoKUx2fkOg==", "dev": true - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "object-assign": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-2.1.1.tgz", - "integrity": "sha1-Q8NuXVaf+OSBbE76i+AtJpZ8GKo=", - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "through2": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", - "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", - "dev": true, - "requires": { - "readable-stream": "1.0.34", - "xtend": "4.0.1" - } - }, - "vinyl": { - "version": "0.4.6", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.4.6.tgz", - "integrity": "sha1-LzVsh6VQolVGHza76ypbqL94SEc=", - "dev": true, - "requires": { - "clone": "0.2.0", - "clone-stats": "0.0.1" - } } } }, "decompress-targz": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/decompress-targz/-/decompress-targz-3.1.0.tgz", - "integrity": "sha1-ssE9+YFmJomRtxXWRH9kLpaW9aA=", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/decompress-targz/-/decompress-targz-4.1.1.tgz", + "integrity": "sha512-4z81Znfr6chWnRDNfFNqLwPvm4db3WuZkqV+UgXQzSngG3CEKdBkw5jrv3axjjL96glyiiKjsxJG3X6WBZwX3w==", "dev": true, "requires": { - "is-gzip": "1.0.0", - "object-assign": "2.1.1", - "strip-dirs": "1.1.1", - "tar-stream": "1.5.4", - "through2": "0.6.5", - "vinyl": "0.4.6" - }, - "dependencies": { - "clone": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/clone/-/clone-0.2.0.tgz", - "integrity": "sha1-xhJqkK1Pctv1rNskPMN3JP6T/B8=", - "dev": true - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "object-assign": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-2.1.1.tgz", - "integrity": "sha1-Q8NuXVaf+OSBbE76i+AtJpZ8GKo=", - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "through2": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", - "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", - "dev": true, - "requires": { - "readable-stream": "1.0.34", - "xtend": "4.0.1" - } - }, - "vinyl": { - "version": "0.4.6", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.4.6.tgz", - "integrity": "sha1-LzVsh6VQolVGHza76ypbqL94SEc=", - "dev": true, - "requires": { - "clone": "0.2.0", - "clone-stats": "0.0.1" - } - } + "decompress-tar": "4.1.1", + "file-type": "5.2.0", + "is-stream": "1.1.0" } }, "decompress-unzip": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/decompress-unzip/-/decompress-unzip-3.4.0.tgz", - "integrity": "sha1-YUdbQVIGa74/7hL51inRX+ZHjus=", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/decompress-unzip/-/decompress-unzip-4.0.1.tgz", + "integrity": "sha1-3qrM39FK6vhVePczroIQ+bSEj2k=", "dev": true, "requires": { - "is-zip": "1.0.0", - "read-all-stream": "3.1.0", - "stat-mode": "0.2.2", - "strip-dirs": "1.1.1", - "through2": "2.0.1", - "vinyl": "1.2.0", + "file-type": "3.9.0", + "get-stream": "2.3.1", + "pify": "2.3.0", "yauzl": "2.8.0" }, "dependencies": { - "vinyl": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-1.2.0.tgz", - "integrity": "sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ=", + "file-type": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz", + "integrity": "sha1-JXoHg4TR24CHvESdEH1SpSZyuek=", + "dev": true + }, + "get-stream": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-2.3.1.tgz", + "integrity": "sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4=", "dev": true, "requires": { - "clone": "1.0.2", - "clone-stats": "0.0.1", - "replace-ext": "0.0.1" + "object-assign": "4.1.1", + "pinkie-promise": "2.0.1" } } } }, "deep-eql": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-0.1.3.tgz", - "integrity": "sha1-71WKyrjeJSBs1xOQbXTlaTDrafI=", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-2.0.2.tgz", + "integrity": "sha1-sbrAblbwp2d3aG1Qyf63XC7XZ5o=", "dev": true, "requires": { - "type-detect": "0.1.1" + "type-detect": "3.0.0" }, "dependencies": { "type-detect": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-0.1.1.tgz", - "integrity": "sha1-C6XsKohWQORw6k6FBZcZANrFiCI=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-3.0.0.tgz", + "integrity": "sha1-RtDMhVOrt7E6NSsNbeov1Y8tm1U=", "dev": true } } @@ -1580,6 +1858,15 @@ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, + "default-require-extensions": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-1.0.0.tgz", + "integrity": "sha1-836hXT4T/9m0N9M+GnW1+5eHTLg=", + "dev": true, + "requires": { + "strip-bom": "2.0.0" + } + }, "defined": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/defined/-/defined-0.0.0.tgz", @@ -1598,6 +1885,12 @@ "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=", "dev": true }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", + "dev": true + }, "detect-indent": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", @@ -1613,22 +1906,6 @@ "integrity": "sha1-YOr9DSjukG5Oj/ClLBIpUhAzv5k=", "dev": true }, - "digdug": { - "version": "1.6.4", - "resolved": "https://registry.npmjs.org/digdug/-/digdug-1.6.4.tgz", - "integrity": "sha1-SRd/wJ/QH+vTlJc2MZ3Qh4bcXvA=", - "dev": true, - "requires": { - "decompress": "3.0.0", - "dojo": "2.0.0-alpha.7" - } - }, - "dojo": { - "version": "2.0.0-alpha.7", - "resolved": "https://registry.npmjs.org/dojo/-/dojo-2.0.0-alpha.7.tgz", - "integrity": "sha1-wrJdQ9j3LMycj+iaNJBqLSceXJE=", - "dev": true - }, "dot-prop": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-3.0.0.tgz", @@ -1714,18 +1991,6 @@ "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", "dev": true }, - "duplexify": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.1.tgz", - "integrity": "sha512-j5goxHTwVED1Fpe5hh3q9R93Kip0Bg2KVAt4f8CEYM3UEwYcPSvWbXaUQOzdX/HtiNomipv+gU7ASQPDbV7pGQ==", - "dev": true, - "requires": { - "end-of-stream": "1.4.0", - "inherits": "2.0.3", - "readable-stream": "2.0.6", - "stream-shift": "1.0.0" - } - }, "ecc-jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", @@ -1743,9 +2008,9 @@ "dev": true }, "electron-to-chromium": { - "version": "1.3.21", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.21.tgz", - "integrity": "sha1-qWfr3P6O0Ag/wkTRiUAiqOgRPqI=", + "version": "1.3.25", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.25.tgz", + "integrity": "sha1-RTshAJg20Jl9hgNWAf9srkeRxGA=", "dev": true }, "emojis-list": { @@ -1754,6 +2019,12 @@ "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", "dev": true }, + "encodeurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.1.tgz", + "integrity": "sha1-eePVhlU0aQn+bw9Fpd5oEDspTSA=", + "dev": true + }, "end-of-stream": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.0.tgz", @@ -1789,6 +2060,12 @@ "integrity": "sha1-8RLCn+paCZhTn8tqL9IUQ9KPBfc=", "dev": true }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", + "dev": true + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -1838,6 +2115,12 @@ "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", "dev": true }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", + "dev": true + }, "eventemitter2": { "version": "0.4.14", "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz", @@ -1882,6 +2165,65 @@ "fill-range": "2.2.3" } }, + "express": { + "version": "4.15.5", + "resolved": "https://registry.npmjs.org/express/-/express-4.15.5.tgz", + "integrity": "sha1-ZwI1ypWYiQpa6BcLg9tyK4Qu2Sc=", + "dev": true, + "requires": { + "accepts": "1.3.4", + "array-flatten": "1.1.1", + "content-disposition": "0.5.2", + "content-type": "1.0.4", + "cookie": "0.3.1", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "1.1.1", + "encodeurl": "1.0.1", + "escape-html": "1.0.3", + "etag": "1.8.1", + "finalhandler": "1.0.6", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "1.1.2", + "on-finished": "2.3.0", + "parseurl": "1.3.2", + "path-to-regexp": "0.1.7", + "proxy-addr": "1.1.5", + "qs": "6.5.0", + "range-parser": "1.2.0", + "send": "0.15.6", + "serve-static": "1.12.6", + "setprototypeof": "1.0.3", + "statuses": "1.3.1", + "type-is": "1.6.15", + "utils-merge": "1.0.0", + "vary": "1.1.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "qs": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.0.tgz", + "integrity": "sha512-fjVFjW9yhqMhVGwRExCXLhJKrLlkYSaxNWdyc9rmHlrVZbk35YHH312dFd7191uQeXkI3mKLZTIbSvIeFwFemg==", + "dev": true + } + } + }, "extend": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", @@ -1959,9 +2301,9 @@ "dev": true }, "file-type": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz", - "integrity": "sha1-JXoHg4TR24CHvESdEH1SpSZyuek=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-5.2.0.tgz", + "integrity": "sha1-LdvqfHP/42No365J3DOMBYwritY=", "dev": true }, "filename-regex": { @@ -1970,27 +2312,6 @@ "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", "dev": true }, - "fileset": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fileset/-/fileset-0.2.1.tgz", - "integrity": "sha1-WI74lzxmI7KnbfRlEFaWuWqsgGc=", - "dev": true, - "requires": { - "glob": "5.0.15", - "minimatch": "2.0.10" - }, - "dependencies": { - "minimatch": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", - "integrity": "sha1-jQh8OcazjAAbl/ynzm0OHoCvusc=", - "dev": true, - "requires": { - "brace-expansion": "1.1.8" - } - } - } - }, "fill-range": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", @@ -2004,6 +2325,38 @@ "repeat-string": "1.6.1" } }, + "finalhandler": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.0.6.tgz", + "integrity": "sha1-AHrqM9Gk0+QgF/YkhIrVjSEvgU8=", + "dev": true, + "requires": { + "debug": "2.6.9", + "encodeurl": "1.0.1", + "escape-html": "1.0.3", + "on-finished": "2.3.0", + "parseurl": "1.3.2", + "statuses": "1.3.1", + "unpipe": "1.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, "find-up": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", @@ -2023,12 +2376,6 @@ "glob": "5.0.15" } }, - "first-chunk-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/first-chunk-stream/-/first-chunk-stream-1.0.0.tgz", - "integrity": "sha1-Wb+1DNkF9g18OUzT2ayqtOatk04=", - "dev": true - }, "flatten": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/flatten/-/flatten-1.0.2.tgz", @@ -2076,6 +2423,18 @@ "samsam": "1.1.2" } }, + "forwarded": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=", + "dev": true + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", + "dev": true + }, "fs-exists-sync": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz", @@ -2147,6 +2506,12 @@ "loader-utils": "0.2.17" } }, + "get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "dev": true + }, "get-stdin": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", @@ -2256,75 +2621,13 @@ } } }, - "glob-stream": { - "version": "5.3.5", - "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-5.3.5.tgz", - "integrity": "sha1-pVZlqajM3EGRWofHAeMtTgFvrSI=", + "global-dirs": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.0.tgz", + "integrity": "sha1-ENNAOeDfBCcuJizyQiT3IJQ0308=", "dev": true, "requires": { - "extend": "3.0.1", - "glob": "5.0.15", - "glob-parent": "3.1.0", - "micromatch": "2.3.11", - "ordered-read-streams": "0.3.0", - "through2": "0.6.5", - "to-absolute-glob": "0.1.1", - "unique-stream": "2.2.1" - }, - "dependencies": { - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "dev": true, - "requires": { - "is-glob": "3.1.0", - "path-dirname": "1.0.2" - } - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "requires": { - "is-extglob": "2.1.1" - } - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "through2": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", - "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", - "dev": true, - "requires": { - "readable-stream": "1.0.34", - "xtend": "4.0.1" - } - } + "ini": "1.3.4" } }, "globalize": { @@ -2335,6 +2638,12 @@ "cldrjs": "0.4.8" } }, + "globals": { + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "dev": true + }, "globule": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/globule/-/globule-1.2.0.tgz", @@ -2532,9 +2841,9 @@ } }, "grunt-dojo2": { - "version": "2.0.0-beta2.4", - "resolved": "https://registry.npmjs.org/grunt-dojo2/-/grunt-dojo2-2.0.0-beta2.4.tgz", - "integrity": "sha512-lWak4E+LHGqhCltXH+z7G22Chvij9eOW9X/j8PdaJdEwqIBgdDslncWtef5D0Ng9Na4etJmNmM5bG5BDs+RFYg==", + "version": "2.0.0-beta2.5", + "resolved": "https://registry.npmjs.org/grunt-dojo2/-/grunt-dojo2-2.0.0-beta2.5.tgz", + "integrity": "sha512-+1C10LapI9CpKBucIqsOFdd0XqTLd98UoP7BzAHrT3Yxtzy9yYokhjrLMt2VYxL7xDozbTgk7goTsVu3koKI7g==", "dev": true, "requires": { "codecov.io": "0.1.6", @@ -2661,7 +2970,7 @@ "requires": { "chalk": "1.1.3", "diff": "2.2.3", - "postcss": "5.2.17" + "postcss": "5.2.18" } }, "grunt-text-replace": { @@ -2736,32 +3045,6 @@ "typings-core": "1.6.1" } }, - "gulp-sourcemaps": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/gulp-sourcemaps/-/gulp-sourcemaps-1.6.0.tgz", - "integrity": "sha1-uG/zSdgBzrVuHZ59x7vLS33uYAw=", - "dev": true, - "requires": { - "convert-source-map": "1.5.0", - "graceful-fs": "4.1.11", - "strip-bom": "2.0.0", - "through2": "2.0.1", - "vinyl": "1.2.0" - }, - "dependencies": { - "vinyl": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-1.2.0.tgz", - "integrity": "sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ=", - "dev": true, - "requires": { - "clone": "1.0.2", - "clone-stats": "0.0.1", - "replace-ext": "0.0.1" - } - } - } - }, "gulp-util": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/gulp-util/-/gulp-util-3.0.7.tgz", @@ -2968,9 +3251,9 @@ } }, "http-parser-js": { - "version": "0.4.6", - "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.4.6.tgz", - "integrity": "sha1-GVJz9YcExFLWcQdr4gEyndNB3FU=", + "version": "0.4.9", + "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.4.9.tgz", + "integrity": "sha1-6hoE+2St/wJC6ZdPKX3Uw8rSceE=", "dev": true }, "http-proxy-agent": { @@ -3018,6 +3301,18 @@ "integrity": "sha1-Bupvg2ead0njhs/h/oEq5dsiPe0=", "dev": true }, + "ieee754": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.8.tgz", + "integrity": "sha1-vjPUCsEO8ZJnAfbwii2G+/0a0+Q=", + "dev": true + }, + "immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=", + "dev": true + }, "import-lazy": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", @@ -3068,101 +3363,120 @@ "dev": true }, "intern": { - "version": "3.4.6", - "resolved": "https://registry.npmjs.org/intern/-/intern-3.4.6.tgz", - "integrity": "sha512-Blk3oIUR2X+tdAT8JoGitOjTwud68A1k+IW9Tmbzb4KfRaH4rCQSKhZXwIgrY6eAeL/LUwrLUpKPC66hieGl0g==", - "dev": true, - "requires": { - "@types/chai": "3.4.34", - "@types/node": "6.0.48", - "benchmark": "2.1.1", - "chai": "3.5.0", - "charm": "0.2.0", - "diff": "1.1.0", - "digdug": "1.6.4", - "dojo": "2.0.0-alpha.7", - "glob": "7.0.3", - "istanbul": "0.4.1", - "leadfoot": "1.7.4", - "lodash-amd": "4.16.4", - "mimetype": "0.0.8", - "platform": "1.3.1", - "source-map": "0.1.33" + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/intern/-/intern-4.0.1.tgz", + "integrity": "sha512-fI7p7l8NHDAhptkH5NFgpZNsamUx+n8xB4vrWNePRXVrAHoWK9JkTMVFet8NDUavdIrklYfgxWDFXa4sbvZB9w==", + "dev": true, + "requires": { + "@dojo/core": "2.0.0-beta2.4", + "@dojo/has": "2.0.0-beta2.3", + "@dojo/interfaces": "2.0.0-beta2.4", + "@dojo/shim": "2.0.0-beta2.4", + "@theintern/digdug": "2.0.0", + "@theintern/leadfoot": "2.0.0", + "@types/benchmark": "1.0.30", + "@types/chai": "4.0.4", + "@types/charm": "1.0.1", + "@types/diff": "3.2.2", + "@types/express": "4.0.37", + "@types/http-errors": "1.5.34", + "@types/istanbul-lib-coverage": "1.1.0", + "@types/istanbul-lib-hook": "1.0.0", + "@types/istanbul-lib-instrument": "1.7.0", + "@types/istanbul-lib-report": "1.1.0", + "@types/istanbul-lib-source-maps": "1.2.0", + "@types/istanbul-reports": "1.1.0", + "@types/lodash": "4.14.77", + "@types/mime-types": "2.1.0", + "@types/platform": "1.3.1", + "@types/resolve": "0.0.4", + "@types/shell-quote": "1.6.0", + "@types/source-map": "0.1.29", + "@types/statuses": "1.2.28", + "@types/ws": "0.0.42", + "benchmark": "2.1.4", + "body-parser": "1.17.2", + "chai": "4.0.2", + "charm": "1.0.2", + "diff": "3.2.0", + "express": "4.15.5", + "glob": "7.1.2", + "http-errors": "1.6.2", + "istanbul-lib-coverage": "1.1.1", + "istanbul-lib-hook": "1.0.7", + "istanbul-lib-instrument": "1.7.5", + "istanbul-lib-report": "1.1.1", + "istanbul-lib-source-maps": "1.2.1", + "istanbul-reports": "1.1.2", + "lodash": "4.17.4", + "mime-types": "2.1.17", + "minimatch": "3.0.4", + "platform": "1.3.4", + "resolve": "1.4.0", + "shell-quote": "1.6.1", + "source-map": "0.5.7", + "statuses": "1.3.1", + "ws": "2.3.1" }, "dependencies": { - "@types/chai": { - "version": "3.4.34", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-3.4.34.tgz", - "integrity": "sha1-1TNXkoI7sJzd1eOMPSEbcJGDhU0=", - "dev": true - }, - "@types/node": { - "version": "6.0.48", - "resolved": "https://registry.npmjs.org/@types/node/-/node-6.0.48.tgz", - "integrity": "sha1-hszBX2a3PLvF6zSDOYk2xYUSKzw=", + "@dojo/interfaces": { + "version": "2.0.0-beta2.4", + "resolved": "https://registry.npmjs.org/@dojo/interfaces/-/interfaces-2.0.0-beta2.4.tgz", + "integrity": "sha1-OGXj9EQJMuCNJNJPgj5UFwaiKNM=", "dev": true }, - "abbrev": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", - "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", + "@types/chai": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.0.4.tgz", + "integrity": "sha512-cvU0HomQ7/aGDQJZsbtJXqBQ7w4J4TqLB0Z/h8mKrpRjfeZEvTbygkfJEb7fWdmwpIeDeFmIVwAEqS0OYuUv3Q==", "dev": true }, - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", - "dev": true + "body-parser": { + "version": "1.17.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.17.2.tgz", + "integrity": "sha1-+IkqvI+eYn1Crtr7yma/WrmRBO4=", + "dev": true, + "requires": { + "bytes": "2.4.0", + "content-type": "1.0.4", + "debug": "2.6.7", + "depd": "1.1.1", + "http-errors": "1.6.2", + "iconv-lite": "0.4.15", + "on-finished": "2.3.0", + "qs": "6.4.0", + "raw-body": "2.2.0", + "type-is": "1.6.15" + } }, - "diff": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-1.1.0.tgz", - "integrity": "sha1-eYpJOBqkZBUem08Ob/Kwmooa0j8=", + "bytes": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-2.4.0.tgz", + "integrity": "sha1-fZcZb51br39pNeJZhVSe3SpsIzk=", "dev": true }, - "escodegen": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.7.1.tgz", - "integrity": "sha1-MOz89mypjcZ80v0WKr626vqM5vw=", + "debug": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.7.tgz", + "integrity": "sha1-krrR9tBbu2u6Isyoi80OyJTChh4=", "dev": true, "requires": { - "esprima": "1.2.5", - "estraverse": "1.9.3", - "esutils": "2.0.2", - "optionator": "0.5.0", - "source-map": "0.2.0" - }, - "dependencies": { - "esprima": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.2.5.tgz", - "integrity": "sha1-CZNQL+r2aBODJXVvMPmlH+7sEek=", - "dev": true - }, - "source-map": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", - "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", - "dev": true, - "optional": true, - "requires": { - "amdefine": "1.0.1" - } - } + "ms": "2.0.0" } }, - "fast-levenshtein": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-1.0.7.tgz", - "integrity": "sha1-AXjc3uAjuSkFGTrwlZ6KdjnP3Lk=", + "diff": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.2.0.tgz", + "integrity": "sha1-yc45Okt8vQsFinJck98pkCeGj/k=", "dev": true }, "glob": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.0.3.tgz", - "integrity": "sha1-CqI1kxpKlqwT1g/6wvuHe9btT1g=", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "requires": { + "fs.realpath": "1.0.0", "inflight": "1.0.6", "inherits": "2.0.3", "minimatch": "3.0.4", @@ -3170,76 +3484,54 @@ "path-is-absolute": "1.0.1" } }, - "istanbul": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/istanbul/-/istanbul-0.4.1.tgz", - "integrity": "sha1-zXMI6zSdBbnyGBYyukxKO1NNJyQ=", + "http-errors": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", + "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", "dev": true, "requires": { - "abbrev": "1.0.9", - "async": "1.5.2", - "escodegen": "1.7.1", - "esprima": "2.7.3", - "fileset": "0.2.1", - "handlebars": "4.0.10", - "js-yaml": "3.5.5", - "mkdirp": "0.5.0", - "nopt": "3.0.6", - "once": "1.3.3", - "resolve": "1.1.7", - "supports-color": "3.2.3", - "which": "1.2.14", - "wordwrap": "1.0.0" + "depd": "1.1.1", + "inherits": "2.0.3", + "setprototypeof": "1.0.3", + "statuses": "1.3.1" } }, - "levn": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.2.5.tgz", - "integrity": "sha1-uo0znQykphDjo/FFucr0iAcVUFQ=", - "dev": true, - "requires": { - "prelude-ls": "1.1.2", - "type-check": "0.3.2" - } + "iconv-lite": { + "version": "0.4.15", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.15.tgz", + "integrity": "sha1-/iZaIYrGpXz+hUkn6dBMGYJe3es=", + "dev": true }, - "optionator": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.5.0.tgz", - "integrity": "sha1-t1qJlaLUF98ltuTjhi9QqohlE2g=", - "dev": true, - "requires": { - "deep-is": "0.1.3", - "fast-levenshtein": "1.0.7", - "levn": "0.2.5", - "prelude-ls": "1.1.2", - "type-check": "0.3.2", - "wordwrap": "0.0.3" - }, - "dependencies": { - "wordwrap": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", - "dev": true - } - } + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true }, - "source-map": { - "version": "0.1.33", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.33.tgz", - "integrity": "sha1-xlkpenOvGMBzsKoufMkeMWtcVww=", + "qs": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", + "integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM=", + "dev": true + }, + "raw-body": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.2.0.tgz", + "integrity": "sha1-mUl2z2pQlqQRYoQEkvC9xdbn+5Y=", "dev": true, "requires": { - "amdefine": "1.0.1" + "bytes": "2.4.0", + "iconv-lite": "0.4.15", + "unpipe": "1.0.0" } }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "resolve": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.4.0.tgz", + "integrity": "sha512-aW7sVKPufyHqOmyyLzg/J+8606v5nevBgaliIlV7nUpVMsDnoBGV/cbSLNjZAg9q0Cfd/+easKVKQ8vOu8fn1Q==", "dev": true, "requires": { - "has-flag": "1.0.0" + "path-parse": "1.0.5" } } } @@ -3259,6 +3551,12 @@ "loose-envify": "1.3.1" } }, + "ipaddr.js": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.4.0.tgz", + "integrity": "sha1-KWrKh4qCGBbluF0KKFqZvP9FgvA=", + "dev": true + }, "is-absolute": { "version": "0.2.6", "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-0.2.6.tgz", @@ -3299,12 +3597,6 @@ "builtin-modules": "1.1.1" } }, - "is-bzip2": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-bzip2/-/is-bzip2-1.0.0.tgz", - "integrity": "sha1-XuWOqlounIDiFAe+3yOuWsCRs/w=", - "dev": true - }, "is-dotfile": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", @@ -3353,11 +3645,15 @@ "integrity": "sha1-tMZLgwPTkRRJKkYNNkzPsNPAoEU=", "dev": true }, - "is-gzip": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-gzip/-/is-gzip-1.0.0.tgz", - "integrity": "sha1-bKiwe5nHeZgCWQDlVc7Y7YCHmoM=", - "dev": true + "is-installed-globally": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.1.0.tgz", + "integrity": "sha1-Df2Y9akRFxbdU13aZJL2e/PSWoA=", + "dev": true, + "requires": { + "global-dirs": "0.1.0", + "is-path-inside": "1.0.0" + } }, "is-my-json-valid": { "version": "2.16.1", @@ -3372,9 +3668,9 @@ } }, "is-natural-number": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-natural-number/-/is-natural-number-2.1.1.tgz", - "integrity": "sha1-fUxXKDd+84bD4ZSpkRv1fG3DNec=", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-natural-number/-/is-natural-number-4.0.1.tgz", + "integrity": "sha1-q5124dtM7VHjXeDHLr7PCfc0zeg=", "dev": true }, "is-npm": { @@ -3398,6 +3694,15 @@ "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", "dev": true }, + "is-path-inside": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.0.tgz", + "integrity": "sha1-/AbloWg/vaE95mev9xe7wQpI838=", + "dev": true, + "requires": { + "path-is-inside": "1.0.2" + } + }, "is-plain-obj": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", @@ -3449,12 +3754,6 @@ "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", "dev": true }, - "is-tar": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-tar/-/is-tar-1.0.0.tgz", - "integrity": "sha1-L2suF5LB9bs2UZrKqdZcDSb+hT0=", - "dev": true - }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", @@ -3476,24 +3775,12 @@ "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", "dev": true }, - "is-valid-glob": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-0.3.0.tgz", - "integrity": "sha1-1LVcafUYhvm2XHDWwmItN+KfSP4=", - "dev": true - }, "is-windows": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-0.2.0.tgz", "integrity": "sha1-3hqm1j6indJIc3tp8f+LgALSEIw=", "dev": true }, - "is-zip": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-zip/-/is-zip-1.0.0.tgz", - "integrity": "sha1-R7Co/004p2QxzP2ZqOFaTIa6IyU=", - "dev": true - }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -3572,6 +3859,147 @@ } } }, + "istanbul-lib-coverage": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.1.tgz", + "integrity": "sha512-0+1vDkmzxqJIn5rcoEqapSB4DmPxE31EtI2dF2aCkV5esN9EWHxZ0dwgDClivMXJqE7zaYQxq30hj5L0nlTN5Q==", + "dev": true + }, + "istanbul-lib-hook": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-1.0.7.tgz", + "integrity": "sha512-3U2HB9y1ZV9UmFlE12Fx+nPtFqIymzrqCksrXujm3NVbAZIJg/RfYgO1XiIa0mbmxTjWpVEVlkIZJ25xVIAfkQ==", + "dev": true, + "requires": { + "append-transform": "0.4.0" + } + }, + "istanbul-lib-instrument": { + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-1.7.5.tgz", + "integrity": "sha1-rbWW+PDLi5XnOSBjUaOKWGryGx4=", + "dev": true, + "requires": { + "babel-generator": "6.26.0", + "babel-template": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "istanbul-lib-coverage": "1.1.1", + "semver": "5.4.1" + }, + "dependencies": { + "semver": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", + "dev": true + } + } + }, + "istanbul-lib-report": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-1.1.1.tgz", + "integrity": "sha512-tvF+YmCmH4thnez6JFX06ujIA19WPa9YUiwjc1uALF2cv5dmE3It8b5I8Ob7FHJ70H9Y5yF+TDkVa/mcADuw1Q==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "1.1.1", + "mkdirp": "0.5.1", + "path-parse": "1.0.5", + "supports-color": "3.2.3" + }, + "dependencies": { + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "supports-color": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "dev": true, + "requires": { + "has-flag": "1.0.0" + } + } + } + }, + "istanbul-lib-source-maps": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.1.tgz", + "integrity": "sha512-mukVvSXCn9JQvdJl8wP/iPhqig0MRtuWuD4ZNKo6vB2Ik//AmhAKe3QnPN02dmkRe3lTudFk3rzoHhwU4hb94w==", + "dev": true, + "requires": { + "debug": "2.6.9", + "istanbul-lib-coverage": "1.1.1", + "mkdirp": "0.5.1", + "rimraf": "2.6.2", + "source-map": "0.5.7" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.3.3", + "path-is-absolute": "1.0.1" + } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "7.1.2" + } + } + } + }, + "istanbul-reports": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-1.1.2.tgz", + "integrity": "sha1-D7Lj9qqZIr085F0F2KtNXo4HvU8=", + "dev": true, + "requires": { + "handlebars": "4.0.10" + } + }, "js-base64": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.3.2.tgz", @@ -3613,15 +4041,6 @@ "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", "dev": true }, - "json-stable-stringify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", - "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", - "dev": true, - "requires": { - "jsonify": "0.0.0" - } - }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", @@ -3676,12 +4095,24 @@ } }, "jszip": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/jszip/-/jszip-2.5.0.tgz", - "integrity": "sha1-dET9hVHd8+XacZj+oMkbyDCMwnQ=", + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.1.4.tgz", + "integrity": "sha512-z6w8iYIxZ/fcgul0j/OerkYnkomH8BZigvzbxVmr2h5HkZUrPtk2kjYtLkqR9wwQxEP6ecKNoKLsbhd18jfnGA==", "dev": true, "requires": { - "pako": "0.2.9" + "core-js": "2.3.0", + "es6-promise": "3.0.2", + "lie": "3.1.1", + "pako": "1.0.6", + "readable-stream": "2.0.6" + }, + "dependencies": { + "es6-promise": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.0.2.tgz", + "integrity": "sha1-AQ1YWEI6XxGJeWZfRkhqlcbuK7Y=", + "dev": true + } } }, "kind-of": { @@ -3709,25 +4140,6 @@ "dev": true, "optional": true }, - "lazystream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz", - "integrity": "sha1-9plf4PggOS9hOWvolGJAe7dxaOQ=", - "dev": true, - "requires": { - "readable-stream": "2.0.6" - } - }, - "leadfoot": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/leadfoot/-/leadfoot-1.7.4.tgz", - "integrity": "sha1-ojpuzqPRx/yrEk+jwpDwRz8UGtU=", - "dev": true, - "requires": { - "dojo": "2.0.0-alpha.7", - "jszip": "2.5.0" - } - }, "levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", @@ -3738,6 +4150,15 @@ "type-check": "0.3.2" } }, + "lie": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz", + "integrity": "sha1-mkNrLMd0bKWd56QfpGmz77dr2H4=", + "dev": true, + "requires": { + "immediate": "3.0.6" + } + }, "listify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/listify/-/listify-1.0.0.tgz", @@ -3787,12 +4208,6 @@ "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=", "dev": true }, - "lodash-amd": { - "version": "4.16.4", - "resolved": "https://registry.npmjs.org/lodash-amd/-/lodash-amd-4.16.4.tgz", - "integrity": "sha1-2qBiWlCNwH4jcoIkqiet1qJJlDQ=", - "dev": true - }, "lodash._basecopy": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", @@ -3868,12 +4283,6 @@ "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=", "dev": true }, - "lodash.isequal": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", - "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=", - "dev": true - }, "lodash.keys": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", @@ -4043,14 +4452,17 @@ } } }, - "merge-stream": { + "merge-descriptors": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-1.0.1.tgz", - "integrity": "sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE=", - "dev": true, - "requires": { - "readable-stream": "2.0.6" - } + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", + "dev": true + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", + "dev": true }, "micromatch": { "version": "2.3.11", @@ -4106,12 +4518,6 @@ "mime-db": "1.30.0" } }, - "mimetype": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/mimetype/-/mimetype-0.0.8.tgz", - "integrity": "sha1-+zACJ5S793Jct7Rt+CDofdkf0IY=", - "dev": true - }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -4164,6 +4570,12 @@ "integrity": "sha1-dDmFMW49tFkoG1hxaehFc1oFQ58=", "dev": true }, + "negotiator": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", + "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=", + "dev": true + }, "node-uuid": { "version": "1.4.8", "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.8.tgz", @@ -4176,7 +4588,7 @@ "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", "dev": true, "requires": { - "abbrev": "1.1.0" + "abbrev": "1.1.1" } }, "normalize-package-data": { @@ -4339,16 +4751,6 @@ "wordwrap": "1.0.0" } }, - "ordered-read-streams": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-0.3.0.tgz", - "integrity": "sha1-cTfmmzKYuzQiR6G77jiByA4v14s=", - "dev": true, - "requires": { - "is-stream": "1.1.0", - "readable-stream": "2.0.6" - } - }, "os-homedir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", @@ -4398,9 +4800,9 @@ } }, "pako": { - "version": "0.2.9", - "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", - "integrity": "sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU=", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.6.tgz", + "integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg==", "dev": true }, "parse-git-config": { @@ -4459,12 +4861,6 @@ "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=", "dev": true }, - "path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", - "dev": true - }, "path-exists": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", @@ -4480,12 +4876,30 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, "path-key": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/path-key/-/path-key-1.0.0.tgz", "integrity": "sha1-XVPVeAGWRsDWiADbThRua9wqx68=", "dev": true }, + "path-parse": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", + "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "dev": true + }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=", + "dev": true + }, "path-type": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", @@ -4497,6 +4911,12 @@ "pinkie-promise": "2.0.1" } }, + "pathval": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", + "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", + "dev": true + }, "pend": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", @@ -4531,7 +4951,7 @@ "dev": true, "requires": { "browserslist": "1.7.7", - "postcss": "5.2.17", + "postcss": "5.2.18", "reduce-css-calc": "1.3.0" } }, @@ -4545,9 +4965,9 @@ } }, "platform": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.1.tgz", - "integrity": "sha1-SSIQiSM1vTExwKCN2i2T7DVD5CM=", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.4.tgz", + "integrity": "sha1-bw+xftqqSPIUQrOpdcBjEw8cPr0=", "dev": true }, "pleeease-filters": { @@ -4557,7 +4977,7 @@ "dev": true, "requires": { "onecolor": "2.4.2", - "postcss": "5.2.17" + "postcss": "5.2.18" } }, "popsicle": { @@ -4572,7 +4992,7 @@ "form-data": "2.3.1", "make-error-cause": "1.2.2", "throwback": "1.1.1", - "tough-cookie": "2.3.2", + "tough-cookie": "2.3.3", "xtend": "4.0.1" }, "dependencies": { @@ -4622,9 +5042,9 @@ "dev": true }, "postcss": { - "version": "5.2.17", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.17.tgz", - "integrity": "sha1-z09Ze4ZNZcikkrLqvp1wbIecOIs=", + "version": "5.2.18", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", + "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", "dev": true, "requires": { "chalk": "1.1.3", @@ -4651,7 +5071,7 @@ "dev": true, "requires": { "balanced-match": "0.4.2", - "postcss": "5.2.17" + "postcss": "5.2.18" }, "dependencies": { "balanced-match": { @@ -4668,7 +5088,7 @@ "integrity": "sha1-zrc3d+EGFn6yM/GTjJvZ8uaXMI0=", "dev": true, "requires": { - "postcss": "5.2.17", + "postcss": "5.2.18", "postcss-selector-parser": "2.2.3" } }, @@ -4678,7 +5098,7 @@ "integrity": "sha1-d7rnypKK2FcW4v2kLyYb98HWW14=", "dev": true, "requires": { - "postcss": "5.2.17", + "postcss": "5.2.18", "postcss-message-helpers": "2.0.0", "reduce-css-calc": "1.3.0" } @@ -4689,8 +5109,8 @@ "integrity": "sha1-mtIm9VDop8f4uKd4YFRbbdf1UkE=", "dev": true, "requires": { - "css-color-function": "1.3.0", - "postcss": "5.2.17", + "css-color-function": "1.3.3", + "postcss": "5.2.18", "postcss-message-helpers": "2.0.0", "postcss-value-parser": "3.3.0" } @@ -4702,7 +5122,7 @@ "dev": true, "requires": { "color": "0.11.4", - "postcss": "5.2.17", + "postcss": "5.2.18", "postcss-message-helpers": "2.0.0", "reduce-function-call": "1.0.2" } @@ -4714,7 +5134,7 @@ "dev": true, "requires": { "color": "0.10.1", - "postcss": "5.2.17", + "postcss": "5.2.18", "postcss-message-helpers": "2.0.0" }, "dependencies": { @@ -4742,7 +5162,7 @@ "integrity": "sha1-9Tuxw0gxDOMHrYnjGBqGRzi15oc=", "dev": true, "requires": { - "postcss": "5.2.17", + "postcss": "5.2.18", "postcss-value-parser": "3.3.0", "units-css": "0.4.0" } @@ -4754,7 +5174,7 @@ "dev": true, "requires": { "color": "0.11.4", - "postcss": "5.2.17", + "postcss": "5.2.18", "postcss-message-helpers": "2.0.0", "reduce-function-call": "1.0.2" } @@ -4766,7 +5186,7 @@ "dev": true, "requires": { "color": "0.11.4", - "postcss": "5.2.17" + "postcss": "5.2.18" } }, "postcss-color-rgb": { @@ -4775,7 +5195,7 @@ "integrity": "sha1-8pJD4i6OjBNDRHQJI3LUzmBb6Lw=", "dev": true, "requires": { - "postcss": "5.2.17", + "postcss": "5.2.18", "postcss-value-parser": "3.3.0" } }, @@ -4785,7 +5205,7 @@ "integrity": "sha1-bSlJG+WZCpMXPUfnx29YELCUAro=", "dev": true, "requires": { - "postcss": "5.2.17", + "postcss": "5.2.18", "postcss-value-parser": "3.3.0", "rgb-hex": "1.0.0" } @@ -4801,7 +5221,7 @@ "chalk": "1.1.3", "pixrem": "3.0.2", "pleeease-filters": "3.0.1", - "postcss": "5.2.17", + "postcss": "5.2.18", "postcss-apply": "0.3.0", "postcss-attribute-case-insensitive": "1.0.1", "postcss-calc": "5.3.1", @@ -4835,7 +5255,7 @@ "integrity": "sha1-E40loYS/LrVN4S1VpsAcMKnYvYE=", "dev": true, "requires": { - "postcss": "5.2.17" + "postcss": "5.2.18" } }, "postcss-custom-properties": { @@ -4845,7 +5265,7 @@ "dev": true, "requires": { "balanced-match": "0.4.2", - "postcss": "5.2.17" + "postcss": "5.2.18" }, "dependencies": { "balanced-match": { @@ -4863,7 +5283,7 @@ "dev": true, "requires": { "balanced-match": "0.2.1", - "postcss": "5.2.17", + "postcss": "5.2.18", "postcss-selector-matches": "2.0.5" }, "dependencies": { @@ -4882,7 +5302,7 @@ "dev": true, "requires": { "lodash": "4.17.4", - "postcss": "5.2.17", + "postcss": "5.2.18", "postcss-value-parser": "3.3.0" } }, @@ -4892,7 +5312,7 @@ "integrity": "sha1-fKKRA/WfoCyjrOLKIrL3VoU9Tvg=", "dev": true, "requires": { - "postcss": "5.2.17" + "postcss": "5.2.18" } }, "postcss-image-set-polyfill": { @@ -4901,7 +5321,7 @@ "integrity": "sha1-Dxk0E3AM8fgr05Bm7wFtZaShgYE=", "dev": true, "requires": { - "postcss": "6.0.11", + "postcss": "6.0.13", "postcss-media-query-parser": "0.2.3" }, "dependencies": { @@ -4932,16 +5352,22 @@ "dev": true }, "postcss": { - "version": "6.0.11", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.11.tgz", - "integrity": "sha512-DsnIzznNRQprsGTALpkC0xjDygo+QcOd+qVjP9+RjyzrPiyYOXBGOwoJ4rAiiE4lu6JggQ/jW4niY24WLxuncg==", + "version": "6.0.13", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz", + "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==", "dev": true, "requires": { "chalk": "2.1.0", - "source-map": "0.5.7", + "source-map": "0.6.1", "supports-color": "4.4.0" } }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, "supports-color": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", @@ -4960,7 +5386,7 @@ "dev": true, "requires": { "object-assign": "4.1.1", - "postcss": "5.2.17", + "postcss": "5.2.18", "postcss-value-parser": "3.3.0", "promise-each": "2.2.0", "read-cache": "1.0.0", @@ -4974,7 +5400,7 @@ "dev": true, "requires": { "lodash.template": "4.4.0", - "postcss": "5.2.17" + "postcss": "5.2.18" } }, "postcss-media-minmax": { @@ -4983,7 +5409,7 @@ "integrity": "sha1-RExc+JJqteT9iiUJ6Sl+dRZJzfg=", "dev": true, "requires": { - "postcss": "5.2.17" + "postcss": "5.2.18" } }, "postcss-media-query-parser": { @@ -5006,7 +5432,7 @@ "requires": { "css-modules-loader-core": "1.1.0", "generic-names": "1.0.2", - "postcss": "5.2.17", + "postcss": "5.2.18", "string-hash": "1.1.3" } }, @@ -5016,7 +5442,7 @@ "integrity": "sha1-thTJcgvmgW6u41+zpfqh26agXds=", "dev": true, "requires": { - "postcss": "6.0.11" + "postcss": "6.0.13" }, "dependencies": { "ansi-styles": { @@ -5046,16 +5472,22 @@ "dev": true }, "postcss": { - "version": "6.0.11", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.11.tgz", - "integrity": "sha512-DsnIzznNRQprsGTALpkC0xjDygo+QcOd+qVjP9+RjyzrPiyYOXBGOwoJ4rAiiE4lu6JggQ/jW4niY24WLxuncg==", + "version": "6.0.13", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz", + "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==", "dev": true, "requires": { "chalk": "2.1.0", - "source-map": "0.5.7", + "source-map": "0.6.1", "supports-color": "4.4.0" } }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, "supports-color": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", @@ -5074,7 +5506,7 @@ "dev": true, "requires": { "css-selector-tokenizer": "0.7.0", - "postcss": "6.0.11" + "postcss": "6.0.13" }, "dependencies": { "ansi-styles": { @@ -5104,16 +5536,22 @@ "dev": true }, "postcss": { - "version": "6.0.11", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.11.tgz", - "integrity": "sha512-DsnIzznNRQprsGTALpkC0xjDygo+QcOd+qVjP9+RjyzrPiyYOXBGOwoJ4rAiiE4lu6JggQ/jW4niY24WLxuncg==", + "version": "6.0.13", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz", + "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==", "dev": true, "requires": { "chalk": "2.1.0", - "source-map": "0.5.7", + "source-map": "0.6.1", "supports-color": "4.4.0" } }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, "supports-color": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", @@ -5132,7 +5570,7 @@ "dev": true, "requires": { "css-selector-tokenizer": "0.7.0", - "postcss": "6.0.11" + "postcss": "6.0.13" }, "dependencies": { "ansi-styles": { @@ -5162,16 +5600,22 @@ "dev": true }, "postcss": { - "version": "6.0.11", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.11.tgz", - "integrity": "sha512-DsnIzznNRQprsGTALpkC0xjDygo+QcOd+qVjP9+RjyzrPiyYOXBGOwoJ4rAiiE4lu6JggQ/jW4niY24WLxuncg==", + "version": "6.0.13", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz", + "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==", "dev": true, "requires": { "chalk": "2.1.0", - "source-map": "0.5.7", + "source-map": "0.6.1", "supports-color": "4.4.0" } }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, "supports-color": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", @@ -5190,7 +5634,7 @@ "dev": true, "requires": { "icss-replace-symbols": "1.1.0", - "postcss": "6.0.11" + "postcss": "6.0.13" }, "dependencies": { "ansi-styles": { @@ -5220,16 +5664,22 @@ "dev": true }, "postcss": { - "version": "6.0.11", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.11.tgz", - "integrity": "sha512-DsnIzznNRQprsGTALpkC0xjDygo+QcOd+qVjP9+RjyzrPiyYOXBGOwoJ4rAiiE4lu6JggQ/jW4niY24WLxuncg==", + "version": "6.0.13", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz", + "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==", "dev": true, "requires": { "chalk": "2.1.0", - "source-map": "0.5.7", + "source-map": "0.6.1", "supports-color": "4.4.0" } }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, "supports-color": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", @@ -5247,7 +5697,7 @@ "integrity": "sha1-lKa2pO9wf77CCof+5clXdZtOAc8=", "dev": true, "requires": { - "postcss": "5.2.17" + "postcss": "5.2.18" } }, "postcss-pseudo-class-any-link": { @@ -5256,7 +5706,7 @@ "integrity": "sha1-kDI5GWQB0zX+c6x1YYb6YuaTryY=", "dev": true, "requires": { - "postcss": "5.2.17", + "postcss": "5.2.18", "postcss-selector-parser": "1.3.3" }, "dependencies": { @@ -5279,7 +5729,7 @@ "integrity": "sha1-bGghd8eQC6BTtt8X+MWQKEx7i7w=", "dev": true, "requires": { - "postcss": "5.2.17" + "postcss": "5.2.18" } }, "postcss-replace-overflow-wrap": { @@ -5288,7 +5738,7 @@ "integrity": "sha1-8KA7Meq5Y2ppNr/SEOKu8bQ0pkM=", "dev": true, "requires": { - "postcss": "5.2.17" + "postcss": "5.2.18" } }, "postcss-selector-matches": { @@ -5298,7 +5748,7 @@ "dev": true, "requires": { "balanced-match": "0.4.2", - "postcss": "5.2.17" + "postcss": "5.2.18" }, "dependencies": { "balanced-match": { @@ -5316,7 +5766,7 @@ "dev": true, "requires": { "balanced-match": "0.2.1", - "postcss": "5.2.17" + "postcss": "5.2.18" }, "dependencies": { "balanced-match": { @@ -5406,6 +5856,16 @@ "integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=", "dev": true }, + "proxy-addr": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-1.1.5.tgz", + "integrity": "sha1-ccDuOxAt4/IC87ZPYI0XP8uhqRg=", + "dev": true, + "requires": { + "forwarded": "0.1.2", + "ipaddr.js": "1.4.0" + } + }, "pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", @@ -5471,6 +5931,12 @@ } } }, + "range-parser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", + "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=", + "dev": true + }, "raw-body": { "version": "2.1.7", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.1.7.tgz", @@ -5516,16 +5982,6 @@ } } }, - "read-all-stream": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/read-all-stream/-/read-all-stream-3.1.0.tgz", - "integrity": "sha1-NcPhd/IHjveJ7kv6+kNzB06u9Po=", - "dev": true, - "requires": { - "pinkie-promise": "2.0.1", - "readable-stream": "2.0.6" - } - }, "read-cache": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", @@ -5678,6 +6134,12 @@ "integrity": "sha512-jVpo1GadrDAK59t/0jRx5VxYWQEDkkEKi6+HjE3joFVLfDOh9Xrdh0dF1eSq+BI/SwvTQ44gSscJ8N5zYL61sg==", "dev": true }, + "regenerator-runtime": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.0.tgz", + "integrity": "sha512-/aA0kLeRb5N9K0d4fw7ooEbI+xDe+DKD499EQqygGqeS8N3xto15p09uY2xj7ixP81sNPXvRLnAQIqdVStgb1A==", + "dev": true + }, "regex-cache": { "version": "0.4.4", "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", @@ -5804,7 +6266,7 @@ "oauth-sign": "0.8.2", "qs": "6.2.3", "stringstream": "0.0.5", - "tough-cookie": "2.3.2", + "tough-cookie": "2.3.3", "tunnel-agent": "0.4.3" } }, @@ -5927,6 +6389,80 @@ } } }, + "send": { + "version": "0.15.6", + "resolved": "https://registry.npmjs.org/send/-/send-0.15.6.tgz", + "integrity": "sha1-IPI6nJJbdiq4JwX+L52yUqzkfjQ=", + "dev": true, + "requires": { + "debug": "2.6.9", + "depd": "1.1.1", + "destroy": "1.0.4", + "encodeurl": "1.0.1", + "escape-html": "1.0.3", + "etag": "1.8.1", + "fresh": "0.5.2", + "http-errors": "1.6.2", + "mime": "1.3.4", + "ms": "2.0.0", + "on-finished": "2.3.0", + "range-parser": "1.2.0", + "statuses": "1.3.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "http-errors": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", + "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", + "dev": true, + "requires": { + "depd": "1.1.1", + "inherits": "2.0.3", + "setprototypeof": "1.0.3", + "statuses": "1.3.1" + } + }, + "mime": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", + "integrity": "sha1-EV+eO2s9rylZmDyzjxSaLUDrXVM=", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "serve-static": { + "version": "1.12.6", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.12.6.tgz", + "integrity": "sha1-uXN3P2NEmTTaVOW+ul4x2fQhFXc=", + "dev": true, + "requires": { + "encodeurl": "1.0.1", + "escape-html": "1.0.3", + "parseurl": "1.3.2", + "send": "0.15.6" + } + }, + "setprototypeof": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", + "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=", + "dev": true + }, "shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", @@ -5942,6 +6478,18 @@ "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true }, + "shell-quote": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", + "integrity": "sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=", + "dev": true, + "requires": { + "array-filter": "0.0.1", + "array-map": "0.0.0", + "array-reduce": "0.0.0", + "jsonify": "0.0.0" + } + }, "shelljs": { "version": "0.7.8", "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.8.tgz", @@ -6089,12 +6637,6 @@ } } }, - "stat-mode": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/stat-mode/-/stat-mode-0.2.2.tgz", - "integrity": "sha1-5sgLYjEj19gM8TLOU480YokHJQI=", - "dev": true - }, "statuses": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", @@ -6110,33 +6652,6 @@ "duplexer": "0.1.1" } }, - "stream-combiner2": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", - "integrity": "sha1-+02KFCDqNidk4hrUeAOXvry0HL4=", - "dev": true, - "requires": { - "duplexer2": "0.1.4", - "readable-stream": "2.0.6" - }, - "dependencies": { - "duplexer2": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", - "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", - "dev": true, - "requires": { - "readable-stream": "2.0.6" - } - } - } - }, - "stream-shift": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", - "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", - "dev": true - }, "string-hash": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/string-hash/-/string-hash-1.1.3.tgz", @@ -6206,51 +6721,13 @@ "is-utf8": "0.2.1" } }, - "strip-bom-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-bom-stream/-/strip-bom-stream-1.0.0.tgz", - "integrity": "sha1-5xRDmFd9Uaa+0PoZlPoF9D/ZiO4=", - "dev": true, - "requires": { - "first-chunk-stream": "1.0.0", - "strip-bom": "2.0.0" - } - }, "strip-dirs": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-1.1.1.tgz", - "integrity": "sha1-lgu9EoeETzl1pFWKoQOoJV4kVqA=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-2.0.0.tgz", + "integrity": "sha1-YQzbKSggDaAAT0HcuQ/JXNkZoLY=", "dev": true, "requires": { - "chalk": "1.1.3", - "get-stdin": "4.0.1", - "is-absolute": "0.1.7", - "is-natural-number": "2.1.1", - "minimist": "1.2.0", - "sum-up": "1.0.3" - }, - "dependencies": { - "is-absolute": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-0.1.7.tgz", - "integrity": "sha1-hHSREZ/MtftDYhfMc39/qtUPYD8=", - "dev": true, - "requires": { - "is-relative": "0.1.3" - } - }, - "is-relative": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-0.1.3.tgz", - "integrity": "sha1-kF/uiuhvRbPsYUvDwVyGnfCHboI=", - "dev": true - }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - } + "is-natural-number": "4.0.1" } }, "strip-eof": { @@ -6274,15 +6751,6 @@ "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true }, - "sum-up": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sum-up/-/sum-up-1.0.3.tgz", - "integrity": "sha1-HGYfZnBX9jvLeHWqFDi8FiUlFW4=", - "dev": true, - "requires": { - "chalk": "1.1.3" - } - }, "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", @@ -6395,16 +6863,6 @@ "xtend": "4.0.1" } }, - "through2-filter": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-2.0.0.tgz", - "integrity": "sha1-YLxVoNrLdghdsfna6Zq0P4PWIuw=", - "dev": true, - "requires": { - "through2": "2.0.1", - "xtend": "4.0.1" - } - }, "throwback": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/throwback/-/throwback-1.1.1.tgz", @@ -6448,14 +6906,11 @@ } } }, - "to-absolute-glob": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-0.1.1.tgz", - "integrity": "sha1-HN+kcqnvUMI57maZm2YsoOs5k38=", - "dev": true, - "requires": { - "extend-shallow": "2.0.1" - } + "to-fast-properties": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", + "dev": true }, "touch": { "version": "1.0.0", @@ -6472,15 +6927,15 @@ "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", "dev": true, "requires": { - "abbrev": "1.1.0" + "abbrev": "1.1.1" } } } }, "tough-cookie": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz", - "integrity": "sha1-8IH3bkyFcg5sN6X6ztc3FQ2EByo=", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.3.tgz", + "integrity": "sha1-C2GKVWW23qkL80JdBNVe3EdadWE=", "dev": true, "requires": { "punycode": "1.4.1" @@ -6492,6 +6947,18 @@ "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", "dev": true }, + "trim-right": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", + "dev": true + }, + "tslib": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.7.1.tgz", + "integrity": "sha1-vIAEFkaRkjp5/oN4u+s9ogF1OOw=", + "dev": true + }, "tslint": { "version": "4.5.1", "resolved": "https://registry.npmjs.org/tslint/-/tslint-4.5.1.tgz", @@ -6500,19 +6967,19 @@ "requires": { "babel-code-frame": "6.26.0", "colors": "1.1.2", - "diff": "3.3.1", + "diff": "3.4.0", "findup-sync": "0.3.0", "glob": "7.1.2", "optimist": "0.6.1", "resolve": "1.1.7", "tsutils": "1.9.1", - "update-notifier": "2.2.0" + "update-notifier": "2.3.0" }, "dependencies": { "diff": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.3.1.tgz", - "integrity": "sha512-MKPHZDMB0o6yHyDryUOScqZibp914ksXwAMYMTHj6KO8UeKsRYNJD3oNCKjTqZon+V488P7N/HzXF8t7ZR95ww==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.4.0.tgz", + "integrity": "sha512-QpVuMTEoJMF7cKzi6bvWhRulU1fZqZnvyVQgNhPaxxuTYwyjn/j1v9falseQ/uXWwPnO56RBfwtg4h/EQXmucA==", "dev": true }, "glob": { @@ -6560,9 +7027,9 @@ } }, "type-detect": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-1.0.0.tgz", - "integrity": "sha1-diIXzAbbJY7EiQihKY6LlRIejqI=", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.3.tgz", + "integrity": "sha1-Dj8mcLRAmbC0bChNE2p+9Jx0wuo=", "dev": true }, "type-is": { @@ -6590,7 +7057,7 @@ "@types/fs-extra": "0.0.33", "@types/handlebars": "4.0.36", "@types/highlight.js": "9.1.10", - "@types/lodash": "4.14.74", + "@types/lodash": "4.14.77", "@types/marked": "0.0.28", "@types/minimatch": "2.0.29", "@types/shelljs": "0.3.33", @@ -6758,12 +7225,28 @@ "integrity": "sha1-Wj2yPvXb1VuB/ODsmirG/M3ruB4=", "dev": true }, + "ultron": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.0.tgz", + "integrity": "sha1-sHoualQagV/Go0zNRTO67DB8qGQ=", + "dev": true + }, "umd-wrapper": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/umd-wrapper/-/umd-wrapper-0.1.0.tgz", "integrity": "sha1-iym4cLCCVDqas7Siooe0uNcVMt4=", "dev": true }, + "unbzip2-stream": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.2.5.tgz", + "integrity": "sha512-izD3jxT8xkzwtXRUZjtmRwKnZoeECrfZ8ra/ketwOcusbZEp4mjULMnJOCfTDZBgGQAAY1AJ/IgxcwkavcX9Og==", + "dev": true, + "requires": { + "buffer": "3.6.0", + "through": "2.3.8" + } + }, "unc-path-regex": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", @@ -6788,16 +7271,6 @@ "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=", "dev": true }, - "unique-stream": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-2.2.1.tgz", - "integrity": "sha1-WqADz76Uxf+GbE59ZouxxNuts2k=", - "dev": true, - "requires": { - "json-stable-stringify": "1.0.1", - "through2-filter": "2.0.0" - } - }, "unique-string": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-1.0.0.tgz", @@ -6830,21 +7303,42 @@ "dev": true }, "update-notifier": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-2.2.0.tgz", - "integrity": "sha1-G1g3z5DAc22IYncytmHBOPht5y8=", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-2.3.0.tgz", + "integrity": "sha1-TognpruRUUCrCTVZ1wFOPruDdFE=", "dev": true, "requires": { "boxen": "1.2.1", - "chalk": "1.1.3", + "chalk": "2.1.0", "configstore": "3.1.1", "import-lazy": "2.1.0", + "is-installed-globally": "0.1.0", "is-npm": "1.0.0", "latest-version": "3.1.0", "semver-diff": "2.1.0", "xdg-basedir": "3.0.0" }, "dependencies": { + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "1.9.0" + } + }, + "chalk": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz", + "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.4.0" + } + }, "configstore": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/configstore/-/configstore-3.1.1.tgz", @@ -6868,6 +7362,21 @@ "is-obj": "1.0.1" } }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "dev": true + }, + "supports-color": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", + "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", + "dev": true, + "requires": { + "has-flag": "2.0.0" + } + }, "write-file-atomic": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.3.0.tgz", @@ -6928,18 +7437,18 @@ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, + "utils-merge": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz", + "integrity": "sha1-ApT7kiu5N1FTVBxPcJYjHyh8ivg=", + "dev": true + }, "uuid": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.3.tgz", "integrity": "sha1-Z+LoY3lyFVMN/zGOW/nc6/1Hsho=", "dev": true }, - "vali-date": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz", - "integrity": "sha1-G5BKWWCfsyjvB4E4Qgk09rhnCaY=", - "dev": true - }, "validate-npm-package-license": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz", @@ -6950,6 +7459,12 @@ "spdx-expression-parse": "1.0.4" } }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", + "dev": true + }, "verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", @@ -6986,61 +7501,13 @@ "replace-ext": "0.0.1" } }, - "vinyl-assign": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/vinyl-assign/-/vinyl-assign-1.2.1.tgz", - "integrity": "sha1-TRmIkbVRWRHXcajNnFSApGoHSkU=", - "dev": true, - "requires": { - "object-assign": "4.1.1", - "readable-stream": "2.0.6" - } - }, - "vinyl-fs": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-2.4.4.tgz", - "integrity": "sha1-vm/zJwy1Xf19MGNkDegfJddTIjk=", - "dev": true, - "requires": { - "duplexify": "3.5.1", - "glob-stream": "5.3.5", - "graceful-fs": "4.1.11", - "gulp-sourcemaps": "1.6.0", - "is-valid-glob": "0.3.0", - "lazystream": "1.0.0", - "lodash.isequal": "4.5.0", - "merge-stream": "1.0.1", - "mkdirp": "0.5.0", - "object-assign": "4.1.1", - "readable-stream": "2.0.6", - "strip-bom": "2.0.0", - "strip-bom-stream": "1.0.0", - "through2": "2.0.1", - "through2-filter": "2.0.0", - "vali-date": "1.0.0", - "vinyl": "1.2.0" - }, - "dependencies": { - "vinyl": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-1.2.0.tgz", - "integrity": "sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ=", - "dev": true, - "requires": { - "clone": "1.0.2", - "clone-stats": "0.0.1", - "replace-ext": "0.0.1" - } - } - } - }, "websocket-driver": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.0.tgz", "integrity": "sha1-DK+dLXVdk67gSdS90NP+LMoqJOs=", "dev": true, "requires": { - "http-parser-js": "0.4.6", + "http-parser-js": "0.4.9", "websocket-extensions": "0.1.2" } }, @@ -7120,6 +7587,24 @@ "slide": "1.1.6" } }, + "ws": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-2.3.1.tgz", + "integrity": "sha1-a5Sz5EfLajY/eF6vlK9jWejoHIA=", + "dev": true, + "requires": { + "safe-buffer": "5.0.1", + "ultron": "1.1.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.0.1.tgz", + "integrity": "sha1-0mPKVGls2KMGtcplUekt5XkY++c=", + "dev": true + } + } + }, "xdg-basedir": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-2.0.0.tgz", diff --git a/package.json b/package.json index be78ecc..e7a5c0e 100644 --- a/package.json +++ b/package.json @@ -35,10 +35,10 @@ "@types/glob": "~5.0.0", "@types/grunt": "~0.4.0", "@types/sinon": "^1.16.31", - "cldr-data": "~30.0.2", + "cldr-data": "~31.0.2", "grunt": "^1.0.1", "grunt-dojo2": "latest", - "intern": "^3.4.1", + "intern": "^4.0.0", "sinon": "^1.17.6", "typescript": "~2.4.1" } diff --git a/tests/intern-local.ts b/tests/intern-local.ts deleted file mode 100644 index 4327144..0000000 --- a/tests/intern-local.ts +++ /dev/null @@ -1,11 +0,0 @@ -export * from './intern'; - -export const tunnel = 'SeleniumTunnel'; -export const tunnelOptions = { - hostname: 'localhost', - port: '4444' -}; - -export const environments = [ - { browserName: 'chrome' } -]; diff --git a/tests/intern-saucelabs.ts b/tests/intern-saucelabs.ts deleted file mode 100644 index 1f9f455..0000000 --- a/tests/intern-saucelabs.ts +++ /dev/null @@ -1,16 +0,0 @@ -export * from './intern'; - -export const environments = [ - { browserName: 'internet explorer', version: [ '10.0', '11.0' ], platform: 'Windows 7' }, - { browserName: 'microsoftedge', platform: 'Windows 10' }, - { browserName: 'firefox', platform: 'Windows 10' }, - { browserName: 'chrome', platform: 'Windows 10' }, - { browserName: 'safari', version: '9', platform: 'OS X 10.11' }, - // { browserName: 'android', deviceName: 'Google Nexus 7 HD Emulator' }, - { browserName: 'iphone', version: '9.3' } -]; - -/* SauceLabs supports more max concurrency */ -export const maxConcurrency = 4; - -export const tunnel = 'SauceLabsTunnel'; diff --git a/tests/intern.ts b/tests/intern.ts deleted file mode 100644 index 1ba1ef4..0000000 --- a/tests/intern.ts +++ /dev/null @@ -1,82 +0,0 @@ -export const proxyPort = 9000; - -// A fully qualified URL to the Intern proxy -export const proxyUrl = 'http://localhost:9000/'; - -// Default desired capabilities for all environments. Individual capabilities can be overridden by any of the -// specified browser environments in the `environments` array below as well. See -// https://code.google.com/p/selenium/wiki/DesiredCapabilities for standard Selenium capabilities and -// https://saucelabs.com/docs/additional-config#desired-capabilities for Sauce Labs capabilities. -// Note that the `build` capability will be filled in with the current commit ID from the Travis CI environment -// automatically -export const capabilities = { - 'browserstack.debug': false, - project: 'Dojo 2', - name: '@dojo/i18n', - fixSessionCapabilities: false -}; - -// Browsers to run integration testing against. Note that version numbers must be strings if used with Sauce -// OnDemand. Options that will be permutated are browserName, version, platform, and platformVersion; any other -// capabilities options specified for an environment will be copied as-is -export const environments = [ - { browserName: 'internet explorer', version: [ '10', '11' ], platform: 'WINDOWS' }, - { browserName: 'microsoftedge', platform: 'WINDOWS' }, - { browserName: 'firefox', platform: 'WINDOWS' }, - { browserName: 'chrome', platform: 'WINDOWS' }, - { browserName: 'safari', version: '9', platform: 'MAC' } -]; - -// Maximum number of simultaneous integration tests that should be executed on the remote WebDriver service -export const maxConcurrency = 1; - -// Name of the tunnel class to use for WebDriver tests -export const tunnel = 'BrowserStackTunnel'; - -// Support running unit tests from a web server that isn't the intern proxy -export const initialBaseUrl: string | null = (function () { - if (typeof location !== 'undefined' && location.pathname.indexOf('__intern/') > -1) { - return '/'; - } - return null; -})(); - -// The desired AMD loader to use when running unit tests (client.html/client.js). Omit to use the default Dojo -// loader -export const loaders = { - 'host-browser': 'node_modules/@dojo/loader/loader.min.js', - 'host-node': '@dojo/loader' -}; - -// Configuration options for the module loader; any AMD configuration options supported by the specified AMD loader -// can be used here -export const loaderOptions = { - // Packages that should be registered with the loader in each testing environment - packages: [ - { name: 'src', location: '_build/src' }, - { name: 'tests', location: '_build/tests' }, - { name: 'cldr-data', location: 'node_modules/cldr-data' }, - { name: 'cldrjs', location: 'node_modules/cldrjs' }, - { name: '@dojo', location: 'node_modules/@dojo' }, - { name: 'globalize', location: 'node_modules/globalize', main: 'dist/globalize' }, - { name: 'sinon', location: 'node_modules/sinon/pkg', main: 'sinon' }, - { name: 'grunt-dojo2', location: 'node_modules/grunt-dojo2' } - ], - map: { - globalize: { - 'cldr': 'cldrjs/dist/cldr', - 'cldr/event': 'cldrjs/dist/cldr/event', - 'cldr/supplemental': 'cldrjs/dist/cldr/supplemental', - 'cldr/unresolved': 'cldrjs/dist/cldr/unresolved' - } - } -}; - -// Non-functional test suite(s) to run in each browser -export const suites = [ 'tests/unit/all' ]; - -// Functional test suite(s) to run in each browser once non-functional tests are completed -export const functionalSuites = [ 'tests/functional/all' ]; - -// A regular expression matching URLs to files that should not be included in code coverage analysis -export const excludeInstrumentation = /(?:node_modules|bower_components|tests|_modules)[\/\\]/; diff --git a/tests/run.html b/tests/run.html index 872415e..a4f6d80 100644 --- a/tests/run.html +++ b/tests/run.html @@ -3,7 +3,7 @@ Intern suite - + Redirecting to Intern client diff --git a/tests/support/mocks/common/main.ts b/tests/support/mocks/common/main.ts index b111850..a2d9189 100644 --- a/tests/support/mocks/common/main.ts +++ b/tests/support/mocks/common/main.ts @@ -6,13 +6,9 @@ const locales = [ 'es' ]; -// TODO: The default loader attempts to use the native Node.js `require` when running on Node. However, the Intern -// suite uses the @dojo/loader, in which case the context for requires is the location of the loader module; or in -// this case, `node_modules/@dojo/loader/loader.min.js'. Is there a better, less hacky way to handle this? const hasHostNode = has('host-node'); const pathSeparator = hasHostNode ? require('path').sep : '/'; -const basePath = hasHostNode ? `..${pathSeparator}_build${pathSeparator}` : ''; -const bundlePath = `${basePath}tests${pathSeparator}support${pathSeparator}mocks${pathSeparator}common${pathSeparator}main`; +const bundlePath = `tests${pathSeparator}support${pathSeparator}mocks${pathSeparator}common${pathSeparator}main`; const messages = { hello: 'Hello', diff --git a/tests/unit/all.ts b/tests/unit/all.ts deleted file mode 100644 index 2f0617b..0000000 --- a/tests/unit/all.ts +++ /dev/null @@ -1,10 +0,0 @@ -import './cldr/load'; -import './cldr/load/default'; -import './cldr/load/webpack'; -import './date'; -import './i18n'; -import './main'; -import './number'; -import './unit'; -import './util/globalize'; -import './util/main'; diff --git a/tests/unit/cldr/load.ts b/tests/unit/cldr/load.ts index c2999bc..8384c07 100644 --- a/tests/unit/cldr/load.ts +++ b/tests/unit/cldr/load.ts @@ -1,6 +1,7 @@ import has from '@dojo/has/has'; -import * as registerSuite from 'intern!object'; -import * as assert from 'intern/chai!assert'; + +const { registerSuite } = intern.getInterface('object'); +const { assert } = intern.getPlugin('chai'); import * as sinon from 'sinon'; import loadCldrData, { isLoaded, @@ -15,59 +16,61 @@ import { supplementalPackages as utilSupplementalPackages } from '../../../src/cldr/load/default'; -registerSuite({ - name: 'cldr/load', +registerSuite('cldr/load', { afterEach() { reset(); }, - api() { - assert.strictEqual(isLoaded, utilIsLoaded, 'isLoaded should be re-exported'); - assert.strictEqual(mainPackages, utilMainPackages, 'mainPackages should be re-exported'); - assert.strictEqual(reset, utilReset, 'reset should be re-exported'); - assert.strictEqual(supplementalPackages, utilSupplementalPackages, 'supplementalPackages should be re-exported'); - }, - - loadCldrData: { - 'with a list of data URLs'() { - assert.isFalse(isLoaded('supplemental', 'likelySubtags')); + tests: { - return loadCldrData([ 'cldr-data/supplemental/likelySubtags.json' ]).then(() => { - assert.isTrue(isLoaded('supplemental', 'likelySubtags')); - }); + api() { + assert.strictEqual(isLoaded, utilIsLoaded, 'isLoaded should be re-exported'); + assert.strictEqual(mainPackages, utilMainPackages, 'mainPackages should be re-exported'); + assert.strictEqual(reset, utilReset, 'reset should be re-exported'); + assert.strictEqual(supplementalPackages, utilSupplementalPackages, 'supplementalPackages should be re-exported'); }, - 'with a CLDR data object'() { - assert.isFalse(isLoaded('supplemental', 'likelySubtags')); + loadCldrData: { + 'with a list of data URLs'() { + assert.isFalse(isLoaded('supplemental', 'likelySubtags')); - return loadCldrData({ - supplemental: { - likelySubtags: {} - } - }).then(() => { - assert.isTrue(isLoaded('supplemental', 'likelySubtags')); - }); - }, + return loadCldrData([ 'cldr-data/supplemental/likelySubtags.json' ]).then(() => { + assert.isTrue(isLoaded('supplemental', 'likelySubtags')); + }); + }, - 'with a require function'() { - assert.isFalse(isLoaded('supplemental', 'likelySubtags')); + 'with a CLDR data object'() { + assert.isFalse(isLoaded('supplemental', 'likelySubtags')); - const path = 'cldr-data/supplemental/likelySubtags.json'; + return loadCldrData({ + supplemental: { + likelySubtags: {} + } + }).then(() => { + assert.isTrue(isLoaded('supplemental', 'likelySubtags')); + }); + }, - if (has('host-browser')) { - sinon.spy(require, 'toUrl'); - } + 'with a require function'() { + assert.isFalse(isLoaded('supplemental', 'likelySubtags')); + + const path = 'cldr-data/supplemental/likelySubtags.json'; - return loadCldrData(require, [ path ]).then(() => { if (has('host-browser')) { - assert.isTrue(( require).toUrl.calledWith(path)); - ( require).toUrl.restore(); + sinon.spy(require, 'toUrl'); } - assert.isTrue(isLoaded('supplemental', 'likelySubtags')); - }, () => { - has('host-browser') && ( require).toUrl.restore(); - }); + + return loadCldrData(require, [ path ]).then(() => { + if (has('host-browser')) { + assert.isTrue(( require).toUrl.calledWith(path)); + ( require).toUrl.restore(); + } + assert.isTrue(isLoaded('supplemental', 'likelySubtags')); + }, () => { + has('host-browser') && ( require).toUrl.restore(); + }); + } } } }); diff --git a/tests/unit/cldr/load/default.ts b/tests/unit/cldr/load/default.ts index 83f8573..bd17322 100644 --- a/tests/unit/cldr/load/default.ts +++ b/tests/unit/cldr/load/default.ts @@ -1,5 +1,5 @@ -import * as registerSuite from 'intern!object'; -import * as assert from 'intern/chai!assert'; +const { registerSuite } = intern.getInterface('object'); +const { assert } = intern.getPlugin('chai'); import baseLoad, { isLoaded, mainPackages, @@ -7,134 +7,139 @@ import baseLoad, { supplementalPackages } from '../../../../src/cldr/load/default'; -registerSuite({ - name: 'cldr/load/default', +registerSuite('cldr/load/default', { afterEach() { reset(); }, - mainPackages() { - assert.isTrue(Object.isFrozen(mainPackages), 'Should be frozen.'); - assert.sameMembers(mainPackages as any[], [ - 'dates/calendars/gregorian', - 'dates/fields', - 'dates/timeZoneNames', - 'numbers', - 'numbers/currencies', - 'units' - ]); - }, - - supplementalPackages() { - assert.isTrue(Object.isFrozen(supplementalPackages), 'Should be frozen.'); - assert.sameMembers(supplementalPackages as any[], [ - 'currencyData', - 'likelySubtags', - 'numberingSystems', - 'plurals-type-cardinal', - 'plurals-type-ordinal', - 'timeData', - 'weekData' - ]); - }, + tests: { + + mainPackages() { + assert.isTrue(Object.isFrozen(mainPackages), 'Should be frozen.'); + assert.sameMembers(mainPackages as any[], [ + 'dates/calendars/gregorian', + 'dates/fields', + 'dates/timeZoneNames', + 'numbers', + 'numbers/currencies', + 'units' + ]); + }, - isLoaded: { - 'with an unloaded package'() { - assert.isFalse(isLoaded('supplemental', 'likelySubtags')); - assert.isFalse(isLoaded('main', 'en')); + supplementalPackages() { + assert.isTrue(Object.isFrozen(supplementalPackages), 'Should be frozen.'); + assert.sameMembers(supplementalPackages as any[], [ + 'currencyData', + 'likelySubtags', + 'numberingSystems', + 'plurals-type-cardinal', + 'plurals-type-ordinal', + 'timeData', + 'weekData' + ]); }, - 'with loaded pacakges'() { - baseLoad({ - main: { - zh: { - numbers: {} + isLoaded: { + 'with an unloaded package'() { + assert.isFalse(isLoaded('supplemental', 'likelySubtags')); + assert.isFalse(isLoaded('main', 'en')); + }, + + 'with loaded pacakges'() { + baseLoad({ + main: { + zh: { + numbers: {} + } + }, + + supplemental: { + likelySubtags: {} } - }, - - supplemental: { - likelySubtags: {} - } - }); + }); + + assert.isTrue(isLoaded('main')); + assert.isTrue(isLoaded('supplemental')); + assert.isTrue(isLoaded('main', 'zh')); + assert.isTrue(isLoaded('main', 'zh-MO')); + assert.isTrue(isLoaded('main', 'zh', 'numbers')); + assert.isTrue(isLoaded('supplemental', 'likelySubtags')); + }, + + 'with unknown packages'() { + baseLoad({ + main: { + arbitrary: {} + }, + supplemental: { + arbitrary: {} + } + }); - assert.isTrue(isLoaded('main')); - assert.isTrue(isLoaded('supplemental')); - assert.isTrue(isLoaded('main', 'zh')); - assert.isTrue(isLoaded('main', 'zh-MO')); - assert.isTrue(isLoaded('main', 'zh', 'numbers')); - assert.isTrue(isLoaded('supplemental', 'likelySubtags')); + assert.isFalse(isLoaded('main', 'arbitrary'), 'Unknown locale packages are ignored.'); + assert.isFalse(isLoaded('supplemental', 'arbitrary'), 'Unknown supplemental packages are ignored.'); + } }, - 'with unknown packages'() { + baseLoad() { + assert.isFalse(isLoaded('supplemental', 'likelySubtags')); + baseLoad({ - main: { - arbitrary: {} - }, supplemental: { - arbitrary: {} + likelySubtags: {} } }); - assert.isFalse(isLoaded('main', 'arbitrary'), 'Unknown locale packages are ignored.'); - assert.isFalse(isLoaded('supplemental', 'arbitrary'), 'Unknown supplemental packages are ignored.'); - } - }, - - baseLoad() { - assert.isFalse(isLoaded('supplemental', 'likelySubtags')); - - baseLoad({ - supplemental: { - likelySubtags: {} - } - }); - - assert.isTrue(isLoaded('supplemental', 'likelySubtags')); - }, + assert.isTrue(isLoaded('supplemental', 'likelySubtags')); + }, - reset: { - beforeEach() { - baseLoad({ - main: { - zh: { - numbers: {} + reset: { + beforeEach() { + baseLoad({ + main: { + zh: { + numbers: {} + } + }, + + supplemental: { + likelySubtags: {} } - }, + }); + }, - supplemental: { - likelySubtags: {} - } - }); - }, + tests: { - 'main only'() { - reset('main'); + 'main only'() { + reset('main'); - assert.isFalse(isLoaded('main', 'zh'), '"main" data should be cleared.'); - assert.isFalse(isLoaded('main', 'zh-MO'), '"main" data should be cleared.'); - assert.isFalse(isLoaded('main', 'zh', 'numbers'), '"main" data should be cleared.'); + assert.isFalse(isLoaded('main', 'zh'), '"main" data should be cleared.'); + assert.isFalse(isLoaded('main', 'zh-MO'), '"main" data should be cleared.'); + assert.isFalse(isLoaded('main', 'zh', 'numbers'), '"main" data should be cleared.'); - assert.isTrue(isLoaded('supplemental', 'likelySubtags'), '"supplemental" data should not be cleared.'); - }, + assert.isTrue(isLoaded('supplemental', 'likelySubtags'), '"supplemental" data should not be cleared.'); + }, - 'supplemental only'() { - reset('supplemental'); + 'supplemental only'() { + reset('supplemental'); - assert.isTrue(isLoaded('main', 'zh')); - assert.isTrue(isLoaded('main', 'zh-MO')); - assert.isTrue(isLoaded('main', 'zh', 'numbers')); + assert.isTrue(isLoaded('main', 'zh')); + assert.isTrue(isLoaded('main', 'zh-MO')); + assert.isTrue(isLoaded('main', 'zh', 'numbers')); - assert.isFalse(isLoaded('supplemental', 'likelySubtags'), '"supplemental" data should be cleared.'); - }, + assert.isFalse(isLoaded('supplemental', 'likelySubtags'), '"supplemental" data should be cleared.'); + }, - 'both main and supplmental'() { - reset(); + 'both main and supplmental'() { + reset(); - assert.isFalse(isLoaded('main', 'zh')); - assert.isFalse(isLoaded('main', 'zh-MO')); - assert.isFalse(isLoaded('main', 'zh', 'numbers')); - assert.isFalse(isLoaded('supplemental', 'likelySubtags')); + assert.isFalse(isLoaded('main', 'zh')); + assert.isFalse(isLoaded('main', 'zh-MO')); + assert.isFalse(isLoaded('main', 'zh', 'numbers')); + assert.isFalse(isLoaded('supplemental', 'likelySubtags')); + } + } } } }); diff --git a/tests/unit/cldr/load/webpack.ts b/tests/unit/cldr/load/webpack.ts index 592b068..5c93f2d 100644 --- a/tests/unit/cldr/load/webpack.ts +++ b/tests/unit/cldr/load/webpack.ts @@ -1,5 +1,5 @@ -import * as registerSuite from 'intern!object'; -import * as assert from 'intern/chai!assert'; +const { registerSuite } = intern.getInterface('object'); +const { assert } = intern.getPlugin('chai'); import global from '@dojo/shim/global'; import loadCldrData, { CldrData, @@ -16,8 +16,7 @@ import { let cldrData: CldrData | null; -registerSuite({ - name: 'cldr/load/webpack', +registerSuite('cldr/load/webpack', { setup() { cldrData = { @@ -42,46 +41,50 @@ registerSuite({ cldrData = null; }, - api() { - assert.strictEqual(mainPackages, utilMainPackages, 'mainPackages should be re-exported'); - assert.strictEqual(reset, utilReset, 'reset should be re-exported'); - assert.strictEqual(supplementalPackages, utilSupplementalPackages, 'supplementalPackages should be re-exported'); - }, - - isLoaded() { - assert.isTrue(isLoaded('main')); - assert.isTrue(isLoaded('supplemental')); - assert.isTrue(isLoaded('main', 'yue')); - assert.isTrue(isLoaded('main', 'yue', 'numbers')); - assert.isTrue(isLoaded('supplemental', 'likelySubtags')); - }, + tests: { - loadCldrData: { - 'with a list of data URLs'() { - return loadCldrData([ 'cldr-data/supplemental/currencyData' ]).then(() => { - assert.isFalse(isLoaded('supplemental', 'currencyData'), - 'The webpack load should ignore URLs.'); - }); + api() { + assert.strictEqual(mainPackages, utilMainPackages, 'mainPackages should be re-exported'); + assert.strictEqual(reset, utilReset, 'reset should be re-exported'); + assert.strictEqual(supplementalPackages, utilSupplementalPackages, 'supplementalPackages should be re-exported'); }, - 'with a CLDR data object'() { - return loadCldrData({ - main: { - tzm: {} - } - }).then(() => { - assert.isTrue(isLoaded('main', 'tzm'), 'CLDR data objects should be loaded.'); - }); + isLoaded() { + assert.isTrue(isLoaded('main')); + assert.isTrue(isLoaded('supplemental')); + assert.isTrue(isLoaded('main', 'yue')); + assert.isTrue(isLoaded('main', 'yue', 'numbers')); + assert.isTrue(isLoaded('supplemental', 'likelySubtags')); }, - 'with a require function'() { - return loadCldrData(() => {}, { - main: { - af: {} - } - }).then(() => { - assert.isTrue(isLoaded('main', 'af'), 'Require functions should be ignored.'); - }); + loadCldrData: { + 'with a list of data URLs'() { + return loadCldrData([ 'cldr-data/supplemental/currencyData' ]).then(() => { + assert.isFalse(isLoaded('supplemental', 'currencyData'), + 'The webpack load should ignore URLs.'); + }); + }, + + 'with a CLDR data object'() { + return loadCldrData({ + main: { + tzm: {} + } + }).then(() => { + assert.isTrue(isLoaded('main', 'tzm'), 'CLDR data objects should be loaded.'); + }); + }, + + 'with a require function'() { + return loadCldrData(() => { + }, { + main: { + af: {} + } + }).then(() => { + assert.isTrue(isLoaded('main', 'af'), 'Require functions should be ignored.'); + }); + } } } }); diff --git a/tests/unit/date.ts b/tests/unit/date.ts index 59201f0..4622b1e 100644 --- a/tests/unit/date.ts +++ b/tests/unit/date.ts @@ -1,7 +1,7 @@ import { around } from '@dojo/core/aspect'; import { padStart } from '@dojo/shim/string'; -import * as registerSuite from 'intern!object'; -import * as assert from 'intern/chai!assert'; +const { registerSuite } = intern.getInterface('object'); +const { assert } = intern.getPlugin('chai'); import { DateLength, formatDate, @@ -101,14 +101,13 @@ function getDateOptions(type: string, timezoneOffset?: number) { } }; - const enValues = ( values)['en'][type]; - const frValues = ( values)['fr'][type]; + const enValues = ( values)[ 'en' ][ type ]; + const frValues = ( values)[ 'fr' ][ type ]; return [ enValues, frValues ]; } -registerSuite({ - name: 'date', +registerSuite('date', { setup() { // Load the CLDR data for the locales used in the tests ('en' and 'fr'); @@ -121,419 +120,421 @@ registerSuite({ switchLocale(systemLocale); }, - getDateFormatter: { - 'assert without a locale'() { - const formatter = getDateFormatter(); - const date = new Date(1815, 11, 10); - assert.strictEqual(formatter(date), '12/10/1815'); - }, + tests: { + getDateFormatter: { + 'assert without a locale'() { + const formatter = getDateFormatter(); + const date = new Date(1815, 11, 10); + assert.strictEqual(formatter(date), '12/10/1815'); + }, - 'assert with a locale'() { - const formatter = getDateFormatter('fr'); - const date = new Date(1815, 11, 10); - assert.strictEqual(formatter(date), '10/12/1815'); + 'assert with a locale'() { + const formatter = getDateFormatter('fr'); + const date = new Date(1815, 11, 10); + assert.strictEqual(formatter(date), '10/12/1815'); + }, + + 'with options': (function () { + function getAssertion(type: string, timezoneOffset?: number) { + const date = getTimezoneDate(new Date(1815, 11, 10, 11, 27), timezoneOffset); + return function () { + const [ enValues, frValues ] = getDateOptions(type, timezoneOffset); + + Object.keys(enValues).forEach((key: DateLength) => { + const formatter = getDateFormatter({ [type]: key }); + assert.strictEqual(formatter(date), enValues[ key ]); + }); + + Object.keys(frValues).forEach((key: DateLength) => { + const formatter = getDateFormatter({ [type]: key }, 'fr'); + assert.strictEqual(formatter(date), frValues[ key ]); + }); + }; + } + + return { + 'assert "date" option': getAssertion('date'), + '"time" option': { + 'assert no timezone offset': getAssertion('time'), + 'assert with timezone offset': getAssertion('time', 6) + }, + '"datetime" option': { + 'assert no timezone offset': getAssertion('datetime'), + 'assert with timezone offset': getAssertion('datetime', 6) + }, + 'assert "skeleton" option': getAssertion('skeleton') + }; + })() }, - 'with options': (function () { - function getAssertion(type: string, timezoneOffset?: number) { - const date = getTimezoneDate(new Date(1815, 11, 10, 11, 27), timezoneOffset); - return function () { - const [ enValues, frValues ] = getDateOptions(type, timezoneOffset); + getDateParser: { + 'assert without a locale'() { + assert.strictEqual( + getDateParser()('12/10/1815').toISOString(), + new Date(1815, 11, 10).toISOString() + ); + }, + + 'assert with a locale'() { + assert.strictEqual( + getDateParser('fr')('10/12/1815').toISOString(), + new Date(1815, 11, 10).toISOString() + ); + }, + + 'with options': { + 'assert "date" option'() { + const date = new Date(1815, 11, 10); + const [ enValues, frValues ] = getDateOptions('date'); Object.keys(enValues).forEach((key: DateLength) => { - const formatter = getDateFormatter({ [type]: key }); - assert.strictEqual(formatter(date), enValues[key]); + // The expected "short" year format in English is the last two digits, + // with the current century assumed. + const expected = key === 'short' ? new Date(2015, 11, 10) : date; + assert.strictEqual( + getDateParser({ date: key })(enValues[ key ]).toISOString(), + expected.toISOString() + ); }); Object.keys(frValues).forEach((key: DateLength) => { - const formatter = getDateFormatter({ [type]: key }, 'fr'); - assert.strictEqual(formatter(date), frValues[key]); + assert.strictEqual( + getDateParser({ date: key }, 'fr')(frValues[ key ]).toISOString(), + date.toISOString() + ); }); - }; - } + }, + + 'assert "time" option'() { + const expected = new Date(); + expected.setHours(11); + expected.setMinutes(27); + expected.setSeconds(0); + expected.setMilliseconds(0); + + const [ gmtLong, gmtFull ] = getTimezones(expected); + const [ utcLong, utcFull ] = getTimezones(expected, 'UTC'); + const enValues = { + short: '11:27 AM', + medium: '11:27:00 AM', + long: `11:27:00 AM ${gmtLong}`, + full: `11:27:00 AM ${gmtFull}` + }; + const frValues = { + short: '11:27', + medium: '11:27:00', + long: `11:27:00 ${utcLong}`, + full: `11:27:00 ${utcFull}` + }; - return { - 'assert "date" option': getAssertion('date'), - '"time" option': { - 'assert no timezone offset': getAssertion('time'), - 'assert with timezone offset': getAssertion('time', 6) + Object.keys(enValues).forEach((key: DateLength) => { + assert.strictEqual( + getDateParser({ time: key })(( enValues)[ key ]).toISOString(), + expected.toISOString() + ); + }); + Object.keys(frValues).forEach((key: DateLength) => { + assert.strictEqual( + getDateParser({ time: key }, 'fr')(( frValues)[ key ]).toISOString(), + expected.toISOString() + ); + }); }, - '"datetime" option': { - 'assert no timezone offset': getAssertion('datetime'), - 'assert with timezone offset': getAssertion('datetime', 6) + + 'assert "datetime" option'() { + const expected = new Date(2015, 11, 10, 11, 27); + const [ gmtLong, gmtFull ] = getTimezones(expected); + const [ utcLong, utcFull ] = getTimezones(expected, 'UTC'); + const enValues = { + short: '12/10/15, 11:27 AM', + medium: 'Dec 10, 2015, 11:27:00 AM', + long: `December 10, 2015 at 11:27:00 AM ${gmtLong}`, + full: `Sunday, December 10, 2015 at 11:27:00 AM ${gmtFull}` + }; + const frValues = { + short: '10/12/2015 11:27', + medium: '10 déc. 2015 à 11:27:00', + long: `10 décembre 2015 à 11:27:00 ${utcLong}`, + full: `dimanche 10 décembre 2015 à 11:27:00 ${utcFull}` + }; + + Object.keys(enValues).forEach((key: DateLength) => { + assert.strictEqual( + getDateParser({ datetime: key })(( enValues)[ key ]).toISOString(), + expected.toISOString() + ); + }); + Object.keys(frValues).forEach((key: DateLength) => { + assert.strictEqual( + getDateParser({ datetime: key }, 'fr')(( frValues)[ key ]).toISOString(), + expected.toISOString() + ); + }); }, - 'assert "skeleton" option': getAssertion('skeleton') - }; - })() - }, - getDateParser: { - 'assert without a locale'() { - assert.strictEqual( - getDateParser()('12/10/1815').toISOString(), - new Date(1815, 11, 10).toISOString() - ); - }, + 'assert "skeleton" option'() { + const expected = new Date(1815, 11, 10).toISOString(); + const [ enValues, frValues ] = getDateOptions('skeleton'); - 'assert with a locale'() { - assert.strictEqual( - getDateParser('fr')('10/12/1815').toISOString(), - new Date(1815, 11, 10).toISOString() - ); + Object.keys(enValues).forEach((key) => { + const parser = getDateParser({ skeleton: 'GyMMMd' }); + assert.strictEqual(parser(enValues[ key ]).toISOString(), expected); + }); + + Object.keys(enValues).forEach((key) => { + const parser = getDateParser({ skeleton: 'GyMMMd' }, 'fr'); + assert.strictEqual(parser(frValues[ key ]).toISOString(), expected); + }); + } + } }, - 'with options': { - 'assert "date" option'() { - const date = new Date(1815, 11, 10); - const [ enValues, frValues ] = getDateOptions('date'); - - Object.keys(enValues).forEach((key: DateLength) => { - // The expected "short" year format in English is the last two digits, - // with the current century assumed. - const expected = key === 'short' ? new Date(2015, 11, 10) : date; - assert.strictEqual( - getDateParser({ date: key })(enValues[key]).toISOString(), - expected.toISOString() - ); - }); - - Object.keys(frValues).forEach((key: DateLength) => { - assert.strictEqual( - getDateParser({ date: key }, 'fr')(frValues[key]).toISOString(), - date.toISOString() - ); - }); + formatDate: { + 'assert without a locale'() { + assert.strictEqual(formatDate(new Date(1815, 11, 10)), '12/10/1815'); }, - 'assert "time" option'() { - const expected = new Date(); - expected.setHours(11); - expected.setMinutes(27); - expected.setSeconds(0); - expected.setMilliseconds(0); - - const [ gmtLong, gmtFull ] = getTimezones(expected); - const [ utcLong, utcFull ] = getTimezones(expected, 'UTC'); - const enValues = { - short: '11:27 AM', - medium: '11:27:00 AM', - long: `11:27:00 AM ${gmtLong}`, - full: `11:27:00 AM ${gmtFull}` - }; - const frValues = { - short: '11:27', - medium: '11:27:00', - long: `11:27:00 ${utcLong}`, - full: `11:27:00 ${utcFull}` - }; - - Object.keys(enValues).forEach((key: DateLength) => { - assert.strictEqual( - getDateParser({ time: key })(( enValues)[key]).toISOString(), - expected.toISOString() - ); - }); - Object.keys(frValues).forEach((key: DateLength) => { - assert.strictEqual( - getDateParser({ time: key }, 'fr')(( frValues)[key]).toISOString(), - expected.toISOString() - ); - }); + 'assert with a locale'() { + assert.strictEqual(formatDate(new Date(1815, 11, 10), 'fr'), '10/12/1815'); }, - 'assert "datetime" option'() { - const expected = new Date(2015, 11, 10, 11, 27); - const [ gmtLong, gmtFull ] = getTimezones(expected); - const [ utcLong, utcFull ] = getTimezones(expected, 'UTC'); - const enValues = { - short: '12/10/15, 11:27 AM', - medium: 'Dec 10, 2015, 11:27:00 AM', - long: `December 10, 2015 at 11:27:00 AM ${gmtLong}`, - full: `Sunday, December 10, 2015 at 11:27:00 AM ${gmtFull}` - }; - const frValues = { - short: '10/12/2015 11:27', - medium: '10 déc. 2015 à 11:27:00', - long: `10 décembre 2015 à 11:27:00 ${utcLong}`, - full: `dimanche 10 décembre 2015 à 11:27:00 ${utcFull}` + 'assert options': (function () { + function getAssertion(type: string, timezoneOffset?: number) { + const date = getTimezoneDate(new Date(1815, 11, 10, 11, 27), timezoneOffset); + + return function () { + const [ enValues, frValues ] = getDateOptions(type, timezoneOffset); + + Object.keys(enValues).forEach((key: DateLength) => { + assert.strictEqual(formatDate(date, { [type]: key }), ( enValues)[ key ]); + }); + Object.keys(frValues).forEach((key: DateLength) => { + assert.strictEqual(formatDate(date, { [type]: key }, 'fr'), ( frValues)[ key ]); + }); + }; + } + + return { + 'assert "date" option': getAssertion('date'), + '"time" values': { + 'assert no timezone offset': getAssertion('time'), + 'assert with timezone offset': getAssertion('time', 6) + }, + '"datetime" values': { + 'assert no timezone offset': getAssertion('datetime'), + 'assert with timezone offset': getAssertion('datetime', 6) + } }; + })() + }, - Object.keys(enValues).forEach((key: DateLength) => { - assert.strictEqual( - getDateParser({ datetime: key })(( enValues)[key]).toISOString(), - expected.toISOString() - ); - }); - Object.keys(frValues).forEach((key: DateLength) => { - assert.strictEqual( - getDateParser({ datetime: key }, 'fr')(( frValues)[key]).toISOString(), - expected.toISOString() - ); - }); + formatRelativeTime: { + 'assert without a locale'() { + assert.strictEqual(formatRelativeTime(-1, 'week'), 'last week'); + assert.strictEqual(formatRelativeTime(-3, 'week'), '3 weeks ago'); + assert.strictEqual(formatRelativeTime(1, 'week'), 'next week'); + assert.strictEqual(formatRelativeTime(3, 'week'), 'in 3 weeks'); }, - 'assert "skeleton" option'() { - const expected = new Date(1815, 11, 10).toISOString(); - const [ enValues, frValues ] = getDateOptions('skeleton'); + 'assert with a locale'() { + assert.strictEqual(formatRelativeTime(-1, 'week', 'fr'), 'la semaine dernière'); + assert.strictEqual(formatRelativeTime(-3, 'week', 'fr'), 'il y a 3 semaines'); + assert.strictEqual(formatRelativeTime(1, 'week', 'fr'), 'la semaine prochaine'); + assert.strictEqual(formatRelativeTime(3, 'week', 'fr'), 'dans 3 semaines'); + }, - Object.keys(enValues).forEach((key) => { - const parser = getDateParser({ skeleton: 'GyMMMd' }); - assert.strictEqual(parser(enValues[key]).toISOString(), expected); - }); + 'assert options': { + 'assert "short" option'() { + assert.strictEqual(formatRelativeTime(-1, 'week', { form: 'short' }), 'last wk.'); + assert.strictEqual(formatRelativeTime(-3, 'week', { form: 'short' }), '3 wk. ago'); + assert.strictEqual(formatRelativeTime(1, 'week', { form: 'short' }), 'next wk.'); + assert.strictEqual(formatRelativeTime(3, 'week', { form: 'short' }), 'in 3 wk.'); + + assert.strictEqual(formatRelativeTime(-1, 'week', { form: 'short' }, 'fr'), 'la semaine dernière'); + assert.strictEqual(formatRelativeTime(-3, 'week', { form: 'short' }, 'fr'), 'il y a 3 sem.'); + assert.strictEqual(formatRelativeTime(1, 'week', { form: 'short' }, 'fr'), 'la semaine prochaine'); + assert.strictEqual(formatRelativeTime(3, 'week', { form: 'short' }, 'fr'), 'dans 3 sem.'); + }, - Object.keys(enValues).forEach((key) => { - const parser = getDateParser({ skeleton: 'GyMMMd' }, 'fr'); - assert.strictEqual(parser(frValues[key]).toISOString(), expected); - }); - } - } - }, + 'assert "narrow" option'() { + assert.strictEqual(formatRelativeTime(-1, 'week', { form: 'narrow' }), 'last wk.'); + assert.strictEqual(formatRelativeTime(-3, 'week', { form: 'narrow' }), '3 wk. ago'); + assert.strictEqual(formatRelativeTime(1, 'week', { form: 'narrow' }), 'next wk.'); + assert.strictEqual(formatRelativeTime(3, 'week', { form: 'narrow' }), 'in 3 wk.'); - formatDate: { - 'assert without a locale'() { - assert.strictEqual(formatDate(new Date(1815, 11, 10)), '12/10/1815'); + assert.strictEqual(formatRelativeTime(-1, 'week', { form: 'narrow' }, 'fr'), 'la semaine dernière'); + assert.strictEqual(formatRelativeTime(-3, 'week', { form: 'narrow' }, 'fr'), '-3 sem.'); + assert.strictEqual(formatRelativeTime(1, 'week', { form: 'narrow' }, 'fr'), 'la semaine prochaine'); + assert.strictEqual(formatRelativeTime(3, 'week', { form: 'narrow' }, 'fr'), '+3 sem.'); + } + } }, - 'assert with a locale'() { - assert.strictEqual(formatDate(new Date(1815, 11, 10), 'fr'), '10/12/1815'); - }, + parseDate: { + 'assert without a locale'() { + assert.strictEqual( + parseDate('12/10/1815').toISOString(), + new Date(1815, 11, 10).toISOString() + ); + }, - 'assert options': (function () { - function getAssertion(type: string, timezoneOffset?: number) { - const date = getTimezoneDate(new Date(1815, 11, 10, 11, 27), timezoneOffset); + 'assert with a locale'() { + assert.strictEqual( + parseDate('10/12/1815', 'fr').toISOString(), + new Date(1815, 11, 10).toISOString() + ); + }, - return function () { - const [ enValues, frValues ] = getDateOptions(type, timezoneOffset); + 'with options': { + 'assert "date" option'() { + const date = new Date(1815, 11, 10); + const [ enValues, frValues ] = getDateOptions('date'); Object.keys(enValues).forEach((key: DateLength) => { - assert.strictEqual(formatDate(date, { [type]: key }), ( enValues)[key]); + // The expected "short" year format in English is the last two digits, + // with the current century assumed. + const expected = key === 'short' ? new Date(2015, 11, 10) : date; + assert.strictEqual( + parseDate(enValues[ key ], { date: key }).toISOString(), + expected.toISOString() + ); }); + Object.keys(frValues).forEach((key: DateLength) => { - assert.strictEqual(formatDate(date, { [type]: key }, 'fr'), ( frValues)[key]); + assert.strictEqual( + parseDate(frValues[ key ], { date: key }, 'fr').toISOString(), + date.toISOString() + ); }); - }; - } - - return { - 'assert "date" option': getAssertion('date'), - '"time" values': { - 'assert no timezone offset': getAssertion('time'), - 'assert with timezone offset': getAssertion('time', 6) }, - '"datetime" values': { - 'assert no timezone offset': getAssertion('datetime'), - 'assert with timezone offset': getAssertion('datetime', 6) - } - }; - })() - }, - formatRelativeTime: { - 'assert without a locale'() { - assert.strictEqual(formatRelativeTime(-1, 'week'), 'last week'); - assert.strictEqual(formatRelativeTime(-3, 'week'), '3 weeks ago'); - assert.strictEqual(formatRelativeTime(1, 'week'), 'next week'); - assert.strictEqual(formatRelativeTime(3, 'week'), 'in 3 weeks'); - }, + 'assert "time" option'() { + const expected = new Date(); + expected.setHours(11); + expected.setMinutes(27); + expected.setSeconds(0); + expected.setMilliseconds(0); + + const [ gmtLong, gmtFull ] = getTimezones(expected); + const [ utcLong, utcFull ] = getTimezones(expected, 'UTC'); + const enValues = { + short: '11:27 AM', + medium: '11:27:00 AM', + long: `11:27:00 AM ${gmtLong}`, + full: `11:27:00 AM ${gmtFull}` + }; + const frValues = { + short: '11:27', + medium: '11:27:00', + long: `11:27:00 ${utcLong}`, + full: `11:27:00 ${utcFull}` + }; - 'assert with a locale'() { - assert.strictEqual(formatRelativeTime(-1, 'week', 'fr'), 'la semaine dernière'); - assert.strictEqual(formatRelativeTime(-3, 'week', 'fr'), 'il y a 3 semaines'); - assert.strictEqual(formatRelativeTime(1, 'week', 'fr'), 'la semaine prochaine'); - assert.strictEqual(formatRelativeTime(3, 'week', 'fr'), 'dans 3 semaines'); - }, + Object.keys(enValues).forEach((key: DateLength) => { + assert.strictEqual( + parseDate(( enValues)[ key ], { time: key }).toISOString(), + expected.toISOString() + ); + }); + Object.keys(frValues).forEach((key: DateLength) => { + assert.strictEqual( + parseDate(( frValues)[ key ], { time: key }, 'fr').toISOString(), + expected.toISOString() + ); + }); + }, - 'assert options': { - 'assert "short" option'() { - assert.strictEqual(formatRelativeTime(-1, 'week', { form: 'short' }), 'last wk.'); - assert.strictEqual(formatRelativeTime(-3, 'week', { form: 'short' }), '3 wk. ago'); - assert.strictEqual(formatRelativeTime(1, 'week', { form: 'short' }), 'next wk.'); - assert.strictEqual(formatRelativeTime(3, 'week', { form: 'short' }), 'in 3 wk.'); - - assert.strictEqual(formatRelativeTime(-1, 'week', { form: 'short' }, 'fr'), 'la semaine dernière'); - assert.strictEqual(formatRelativeTime(-3, 'week', { form: 'short' }, 'fr'), 'il y a 3 sem.'); - assert.strictEqual(formatRelativeTime(1, 'week', { form: 'short' }, 'fr'), 'la semaine prochaine'); - assert.strictEqual(formatRelativeTime(3, 'week', { form: 'short' }, 'fr'), 'dans 3 sem.'); - }, + 'assert "datetime" option'() { + const expected = new Date(2015, 11, 10, 11, 27); + const [ gmtLong, gmtFull ] = getTimezones(expected); + const [ utcLong, utcFull ] = getTimezones(expected, 'UTC'); + const enValues = { + short: '12/10/15, 11:27 AM', + medium: 'Dec 10, 2015, 11:27:00 AM', + long: `December 10, 2015 at 11:27:00 AM ${gmtLong}`, + full: `Sunday, December 10, 2015 at 11:27:00 AM ${gmtFull}` + }; + const frValues = { + short: '10/12/2015 11:27', + medium: '10 déc. 2015 à 11:27:00', + long: `10 décembre 2015 à 11:27:00 ${utcLong}`, + full: `dimanche 10 décembre 2015 à 11:27:00 ${utcFull}` + }; - 'assert "narrow" option'() { - assert.strictEqual(formatRelativeTime(-1, 'week', { form: 'narrow' }), 'last wk.'); - assert.strictEqual(formatRelativeTime(-3, 'week', { form: 'narrow' }), '3 wk. ago'); - assert.strictEqual(formatRelativeTime(1, 'week', { form: 'narrow' }), 'next wk.'); - assert.strictEqual(formatRelativeTime(3, 'week', { form: 'narrow' }), 'in 3 wk.'); + Object.keys(enValues).forEach((key: DateLength) => { + assert.strictEqual( + parseDate(( enValues)[ key ], { datetime: key }).toISOString(), + expected.toISOString() + ); + }); + Object.keys(frValues).forEach((key: DateLength) => { + assert.strictEqual( + parseDate(( frValues)[ key ], { datetime: key }, 'fr').toISOString(), + expected.toISOString() + ); + }); + }, - assert.strictEqual(formatRelativeTime(-1, 'week', { form: 'narrow' }, 'fr'), 'la semaine dernière'); - assert.strictEqual(formatRelativeTime(-3, 'week', { form: 'narrow' }, 'fr'), '-3 sem.'); - assert.strictEqual(formatRelativeTime(1, 'week', { form: 'narrow' }, 'fr'), 'la semaine prochaine'); - assert.strictEqual(formatRelativeTime(3, 'week', { form: 'narrow' }, 'fr'), '+3 sem.'); - } - } - }, + 'assert "skeleton" option'() { + const expected = new Date(1815, 11, 10).toISOString(); + const [ enValues, frValues ] = getDateOptions('skeleton'); - parseDate: { - 'assert without a locale'() { - assert.strictEqual( - parseDate('12/10/1815').toISOString(), - new Date(1815, 11, 10).toISOString() - ); - }, + Object.keys(enValues).forEach((key) => { + assert.strictEqual(parseDate(enValues[ key ], { skeleton: 'GyMMMd' }).toISOString(), expected); + }); - 'assert with a locale'() { - assert.strictEqual( - parseDate('10/12/1815', 'fr').toISOString(), - new Date(1815, 11, 10).toISOString() - ); + Object.keys(enValues).forEach((key) => { + assert.strictEqual(parseDate(frValues[ key ], { skeleton: 'GyMMMd' }, 'fr').toISOString(), expected); + }); + } + } }, - 'with options': { - 'assert "date" option'() { - const date = new Date(1815, 11, 10); - const [ enValues, frValues ] = getDateOptions('date'); - - Object.keys(enValues).forEach((key: DateLength) => { - // The expected "short" year format in English is the last two digits, - // with the current century assumed. - const expected = key === 'short' ? new Date(2015, 11, 10) : date; - assert.strictEqual( - parseDate(enValues[key], { date: key }).toISOString(), - expected.toISOString() - ); - }); - - Object.keys(frValues).forEach((key: DateLength) => { - assert.strictEqual( - parseDate(frValues[key], { date: key }, 'fr').toISOString(), - date.toISOString() - ); - }); + getRelativeTimeFormatter: { + 'assert without a locale'() { + const formatter = getRelativeTimeFormatter('week'); + assert.strictEqual(formatter(-1), 'last week'); + assert.strictEqual(formatter(-3), '3 weeks ago'); + assert.strictEqual(formatter(1), 'next week'); + assert.strictEqual(formatter(3), 'in 3 weeks'); }, - 'assert "time" option'() { - const expected = new Date(); - expected.setHours(11); - expected.setMinutes(27); - expected.setSeconds(0); - expected.setMilliseconds(0); - - const [ gmtLong, gmtFull ] = getTimezones(expected); - const [ utcLong, utcFull ] = getTimezones(expected, 'UTC'); - const enValues = { - short: '11:27 AM', - medium: '11:27:00 AM', - long: `11:27:00 AM ${gmtLong}`, - full: `11:27:00 AM ${gmtFull}` - }; - const frValues = { - short: '11:27', - medium: '11:27:00', - long: `11:27:00 ${utcLong}`, - full: `11:27:00 ${utcFull}` - }; - - Object.keys(enValues).forEach((key: DateLength) => { - assert.strictEqual( - parseDate(( enValues)[key], { time: key }).toISOString(), - expected.toISOString() - ); - }); - Object.keys(frValues).forEach((key: DateLength) => { - assert.strictEqual( - parseDate(( frValues)[key], { time: key }, 'fr').toISOString(), - expected.toISOString() - ); - }); + 'assert with a locale'() { + const formatter = getRelativeTimeFormatter('week', 'fr'); + assert.strictEqual(formatter(-1), 'la semaine dernière'); + assert.strictEqual(formatter(-3), 'il y a 3 semaines'); + assert.strictEqual(formatter(1), 'la semaine prochaine'); + assert.strictEqual(formatter(3), 'dans 3 semaines'); }, - 'assert "datetime" option'() { - const expected = new Date(2015, 11, 10, 11, 27); - const [ gmtLong, gmtFull ] = getTimezones(expected); - const [ utcLong, utcFull ] = getTimezones(expected, 'UTC'); - const enValues = { - short: '12/10/15, 11:27 AM', - medium: 'Dec 10, 2015, 11:27:00 AM', - long: `December 10, 2015 at 11:27:00 AM ${gmtLong}`, - full: `Sunday, December 10, 2015 at 11:27:00 AM ${gmtFull}` - }; - const frValues = { - short: '10/12/2015 11:27', - medium: '10 déc. 2015 à 11:27:00', - long: `10 décembre 2015 à 11:27:00 ${utcLong}`, - full: `dimanche 10 décembre 2015 à 11:27:00 ${utcFull}` - }; - - Object.keys(enValues).forEach((key: DateLength) => { - assert.strictEqual( - parseDate(( enValues)[key], { datetime: key }).toISOString(), - expected.toISOString() - ); - }); - Object.keys(frValues).forEach((key: DateLength) => { - assert.strictEqual( - parseDate(( frValues)[key], { datetime: key }, 'fr').toISOString(), - expected.toISOString() - ); - }); - }, - - 'assert "skeleton" option'() { - const expected = new Date(1815, 11, 10).toISOString(); - const [ enValues, frValues ] = getDateOptions('skeleton'); - - Object.keys(enValues).forEach((key) => { - assert.strictEqual(parseDate(enValues[key], { skeleton: 'GyMMMd' }).toISOString(), expected); - }); - - Object.keys(enValues).forEach((key) => { - assert.strictEqual(parseDate(frValues[key], { skeleton: 'GyMMMd' }, 'fr').toISOString(), expected); - }); - } - } - }, - - getRelativeTimeFormatter: { - 'assert without a locale'() { - const formatter = getRelativeTimeFormatter('week'); - assert.strictEqual(formatter(-1), 'last week'); - assert.strictEqual(formatter(-3), '3 weeks ago'); - assert.strictEqual(formatter(1), 'next week'); - assert.strictEqual(formatter(3), 'in 3 weeks'); - }, - - 'assert with a locale'() { - const formatter = getRelativeTimeFormatter('week', 'fr'); - assert.strictEqual(formatter(-1), 'la semaine dernière'); - assert.strictEqual(formatter(-3), 'il y a 3 semaines'); - assert.strictEqual(formatter(1), 'la semaine prochaine'); - assert.strictEqual(formatter(3), 'dans 3 semaines'); - }, - - 'assert options': { - 'assert "short" option'() { - const enFormatter = getRelativeTimeFormatter('week', { form: 'short' }); - assert.strictEqual(enFormatter(-1), 'last wk.'); - assert.strictEqual(enFormatter(-3), '3 wk. ago'); - assert.strictEqual(enFormatter(1), 'next wk.'); - assert.strictEqual(enFormatter(3), 'in 3 wk.'); - - const frFormatter = getRelativeTimeFormatter('week', { form: 'short' }, 'fr'); - assert.strictEqual(frFormatter(-1), 'la semaine dernière'); - assert.strictEqual(frFormatter(-3), 'il y a 3 sem.'); - assert.strictEqual(frFormatter(1), 'la semaine prochaine'); - assert.strictEqual(frFormatter(3), 'dans 3 sem.'); - }, + 'assert options': { + 'assert "short" option'() { + const enFormatter = getRelativeTimeFormatter('week', { form: 'short' }); + assert.strictEqual(enFormatter(-1), 'last wk.'); + assert.strictEqual(enFormatter(-3), '3 wk. ago'); + assert.strictEqual(enFormatter(1), 'next wk.'); + assert.strictEqual(enFormatter(3), 'in 3 wk.'); + + const frFormatter = getRelativeTimeFormatter('week', { form: 'short' }, 'fr'); + assert.strictEqual(frFormatter(-1), 'la semaine dernière'); + assert.strictEqual(frFormatter(-3), 'il y a 3 sem.'); + assert.strictEqual(frFormatter(1), 'la semaine prochaine'); + assert.strictEqual(frFormatter(3), 'dans 3 sem.'); + }, - 'assert "narrow" option'() { - const enFormatter = getRelativeTimeFormatter('week', { form: 'narrow' }); - assert.strictEqual(enFormatter(-1), 'last wk.'); - assert.strictEqual(enFormatter(-3), '3 wk. ago'); - assert.strictEqual(enFormatter(1), 'next wk.'); - assert.strictEqual(enFormatter(3), 'in 3 wk.'); - - const frFormatter = getRelativeTimeFormatter('week', { form: 'narrow' }, 'fr'); - assert.strictEqual(frFormatter(-1), 'la semaine dernière'); - assert.strictEqual(frFormatter(-3), '-3 sem.'); - assert.strictEqual(frFormatter(1), 'la semaine prochaine'); - assert.strictEqual(frFormatter(3), '+3 sem.'); + 'assert "narrow" option'() { + const enFormatter = getRelativeTimeFormatter('week', { form: 'narrow' }); + assert.strictEqual(enFormatter(-1), 'last wk.'); + assert.strictEqual(enFormatter(-3), '3 wk. ago'); + assert.strictEqual(enFormatter(1), 'next wk.'); + assert.strictEqual(enFormatter(3), 'in 3 wk.'); + + const frFormatter = getRelativeTimeFormatter('week', { form: 'narrow' }, 'fr'); + assert.strictEqual(frFormatter(-1), 'la semaine dernière'); + assert.strictEqual(frFormatter(-3), '-3 sem.'); + assert.strictEqual(frFormatter(1), 'la semaine prochaine'); + assert.strictEqual(frFormatter(3), '+3 sem.'); + } } } } diff --git a/tests/unit/i18n.ts b/tests/unit/i18n.ts index 41d89ac..94bb5be 100644 --- a/tests/unit/i18n.ts +++ b/tests/unit/i18n.ts @@ -2,8 +2,8 @@ import has from '@dojo/core/has'; import { assign } from '@dojo/core/lang'; import global from '@dojo/shim/global'; import * as Globalize from 'globalize'; -import * as registerSuite from 'intern!object'; -import * as assert from 'intern/chai!assert'; +const { registerSuite } = intern.getInterface('object'); +const { assert } = intern.getPlugin('chai'); import * as sinon from 'sinon'; import { fetchCldrData } from '../support/util'; import * as cldrLoad from '../../src/cldr/load'; @@ -21,8 +21,7 @@ import i18n, { import bundle from '../support/mocks/common/main'; import partyBundle from '../support/mocks/common/party'; -registerSuite({ - name: 'i18n', +registerSuite('i18n', { setup() { // Load the CLDR data for the locales used in the tests ('en' and 'fr'); @@ -41,465 +40,472 @@ registerSuite({ switchLocale(systemLocale); }, - systemLocale() { - let expected = 'en'; + tests: { - if (has('host-browser')) { - const navigator = global.navigator; - expected = navigator.language || navigator.userLanguage; - } - else if (has('host-node')) { - expected = process.env.LANG || expected; - } + systemLocale() { + let expected = 'en'; - assert.strictEqual(systemLocale, expected.replace(/^([^.]+).*/, '$1').replace(/_/g, '-')); - }, - - formatMessage: { - 'without CLDR data': { - setup() { - cldrLoad.reset(); - }, + if (has('host-browser')) { + const navigator = global.navigator; + expected = navigator.language || navigator.userLanguage; + } + else if (has('host-node')) { + expected = process.env.LANG || expected; + } - teardown() { - return fetchCldrData([ 'en', 'fr' ]); - }, + assert.strictEqual(systemLocale, expected.replace(/^([^.]+).*/, '$1').replace(/_/g, '-')); + }, - 'assert without loaded messages'() { - assert.throws(() => { - formatMessage('path/to/make-believe', 'messageKey'); - }, Error, 'The bundle "path/to/make-believe" has not been registered.'); - }, + formatMessage: { + 'without CLDR data': { + setup() { + cldrLoad.reset(); + }, + + teardown() { + return fetchCldrData([ 'en', 'fr' ]); + }, + + tests: { + 'assert without loaded messages'() { + assert.throws(() => { + formatMessage('path/to/make-believe', 'messageKey'); + }, Error, 'The bundle "path/to/make-believe" has not been registered.'); + }, + + 'assert tokens replaced'() { + return i18n(partyBundle).then(() => { + const formatted = formatMessage(partyBundle.bundlePath, 'simpleGuestInfo', { + host: 'Nita', + guest: 'Bryan' + }); + assert.strictEqual(formatted, 'Nita invites Bryan to a party.'); + + assert.throws(() => { + formatMessage(partyBundle.bundlePath, 'simpleGuestInfo', { + host: 'Nita' + }); + }, Error, 'Missing property guest'); + }); + }, - 'assert tokens replaced'() { - return i18n(partyBundle).then(() => { - const formatted = formatMessage(partyBundle.bundlePath, 'simpleGuestInfo', { - host: 'Nita', - guest: 'Bryan' - }); - assert.strictEqual(formatted, 'Nita invites Bryan to a party.'); + 'assert message without tokens'() { + return i18n(bundle).then(() => { + const formatted = formatMessage(bundle.bundlePath, 'hello'); + assert.strictEqual(formatted, 'Hello'); + }); + }, - assert.throws(() => { - formatMessage(partyBundle.bundlePath, 'simpleGuestInfo', { - host: 'Nita' + 'assert default locale used'() { + switchLocale('ar'); + return i18n(bundle, 'ar').then(() => { + const formatted = formatMessage(bundle.bundlePath, 'hello'); + assert.strictEqual(formatted, 'السلام عليكم'); }); - }, Error, 'Missing property guest'); - }); + } + } }, - 'assert message without tokens'() { - return i18n(bundle).then(() => { - const formatted = formatMessage(bundle.bundlePath, 'hello'); - assert.strictEqual(formatted, 'Hello'); - }); - }, + 'with CLDR data': { + 'assert without a locale'() { + return i18n(partyBundle).then(() => { + let formatted = formatMessage(partyBundle.bundlePath, 'guestInfo', { + host: 'Nita', + guestCount: 0 + }); + assert.strictEqual(formatted, 'Nita does not host a party.'); - 'assert default locale used'() { - switchLocale('ar'); - return i18n(bundle, 'ar').then(() => { - const formatted = formatMessage(bundle.bundlePath, 'hello'); - assert.strictEqual(formatted, 'السلام عليكم'); - }); - } - }, + formatted = formatMessage(partyBundle.bundlePath, 'guestInfo', { + host: 'Nita', + gender: 'female', + guestCount: 1, + guest: 'Bryan' + }); + assert.strictEqual(formatted, 'Nita invites Bryan to her party.'); - 'with CLDR data': { - 'assert without a locale'() { - return i18n(partyBundle).then(() => { - let formatted = formatMessage(partyBundle.bundlePath, 'guestInfo', { - host: 'Nita', - guestCount: 0 - }); - assert.strictEqual(formatted, 'Nita does not host a party.'); + formatted = formatMessage(partyBundle.bundlePath, 'guestInfo', { + host: 'Nita', + gender: 'female', + guestCount: 2, + guest: 'Bryan' + }); + assert.strictEqual(formatted, 'Nita invites Bryan and one other person to her party.'); - formatted = formatMessage(partyBundle.bundlePath, 'guestInfo', { - host: 'Nita', - gender: 'female', - guestCount: 1, - guest: 'Bryan' + formatted = formatMessage(partyBundle.bundlePath, 'guestInfo', { + host: 'Nita', + gender: 'female', + guestCount: 42, + guest: 'Bryan' + }); + assert.strictEqual(formatted, 'Nita invites Bryan and 41 other people to her party.'); }); - assert.strictEqual(formatted, 'Nita invites Bryan to her party.'); + }, - formatted = formatMessage(partyBundle.bundlePath, 'guestInfo', { - host: 'Nita', - gender: 'female', - guestCount: 2, - guest: 'Bryan' + 'assert supported locale'() { + return i18n(bundle, 'ar').then(() => { + assert.strictEqual(formatMessage(bundle.bundlePath, 'hello', {}, 'ar'), 'السلام عليكم'); }); - assert.strictEqual(formatted, 'Nita invites Bryan and one other person to her party.'); + }, - formatted = formatMessage(partyBundle.bundlePath, 'guestInfo', { - host: 'Nita', - gender: 'female', - guestCount: 42, - guest: 'Bryan' + 'assert unsupported locale'() { + return i18n(bundle, 'fr').then(() => { + assert.strictEqual(formatMessage(bundle.bundlePath, 'hello', {}, 'fr'), 'Hello'); }); - assert.strictEqual(formatted, 'Nita invites Bryan and 41 other people to her party.'); - }); + } + } + }, + + getCachedMessages: { + 'assert unregistered locale'() { + assert.isUndefined(getCachedMessages(bundle, 'ar')); }, 'assert supported locale'() { return i18n(bundle, 'ar').then(() => { - assert.strictEqual(formatMessage(bundle.bundlePath, 'hello', {}, 'ar'), 'السلام عليكم'); + assert.deepEqual(getCachedMessages(bundle, 'ar'), { + hello: 'السلام عليكم', + helloReply: 'و عليكم السام', + goodbye: 'مع السلامة' + }, 'Locale messages can be retrieved with a bundle object.'); }); }, - 'assert unsupported locale'() { - return i18n(bundle, 'fr').then(() => { - assert.strictEqual(formatMessage(bundle.bundlePath, 'hello', {}, 'fr'), 'Hello'); - }); - } - } - }, - - getCachedMessages: { - 'assert unregistered locale'() { - assert.isUndefined(getCachedMessages(bundle, 'ar')); - }, - - 'assert supported locale'() { - return i18n(bundle, 'ar').then(() => { - assert.deepEqual(getCachedMessages(bundle, 'ar'), { - hello: 'السلام عليكم', - helloReply: 'و عليكم السام', - goodbye: 'مع السلامة' - }, 'Locale messages can be retrieved with a bundle object.'); - }); - }, + 'assert unsupported locale'(this: any) { + const cached = getCachedMessages(bundle, 'un-SU-pported'); + assert.deepEqual(cached, bundle.messages, 'Default messages returned for unsupported locale.'); + }, - 'assert unsupported locale'(this: any) { - const cached = getCachedMessages(bundle, 'un-SU-pported'); - assert.deepEqual(cached, bundle.messages, 'Default messages returned for unsupported locale.'); - }, + 'assert unsupported locale added with `setLocaleMessages`'() { + const messages = { hello: 'Oy' }; + setLocaleMessages(bundle, messages, 'en-GB'); - 'assert unsupported locale added with `setLocaleMessages`'() { - const messages = { hello: 'Oy' }; - setLocaleMessages(bundle, messages, 'en-GB'); + const cached = getCachedMessages(bundle, 'en-GB'); + assert.deepEqual(cached, assign({}, bundle.messages, messages), + 'Messages added with `setLocaleMessages` are returned.'); + }, - const cached = getCachedMessages(bundle, 'en-GB'); - assert.deepEqual(cached, assign({}, bundle.messages, messages), - 'Messages added with `setLocaleMessages` are returned.'); + 'assert most specific supported locale returned'() { + return i18n(bundle, 'ar').then(() => { + const cached = getCachedMessages(bundle, 'ar'); + assert.deepEqual(getCachedMessages(bundle, 'ar-IR'), cached, + 'Messages are returned for the most specific supported locale.'); + }); + } }, - 'assert most specific supported locale returned'() { - return i18n(bundle, 'ar').then(() => { - const cached = getCachedMessages(bundle, 'ar'); - assert.deepEqual(getCachedMessages(bundle, 'ar-IR'), cached, - 'Messages are returned for the most specific supported locale.'); - }); - } - }, + getMessageFormatter: { + 'without CLDR data': { + setup() { + cldrLoad.reset(); + }, + + teardown() { + return fetchCldrData([ 'en', 'fr' ]); + }, + + tests: { + 'assert without loaded messages'() { + assert.throws(() => { + getMessageFormatter('path/to/make-believe', 'messageKey')(); + }, Error, 'The bundle "path/to/make-believe" has not been registered.'); + }, + + 'assert tokens replaced'() { + return i18n(partyBundle).then(() => { + const formatter = getMessageFormatter(partyBundle.bundlePath, 'simpleGuestInfo'); + const formatted = formatter({ + host: 'Nita', + guest: 'Bryan' + }); + assert.strictEqual(formatted, 'Nita invites Bryan to a party.'); + + assert.throws(() => { + formatter({ + host: 'Nita' + }); + }, Error, 'Missing property guest'); + }); + }, - getMessageFormatter: { - 'without CLDR data': { - setup() { - cldrLoad.reset(); + 'assert message without tokens'() { + return i18n(bundle).then(() => { + const formatter = getMessageFormatter(bundle.bundlePath, 'hello'); + assert.strictEqual(formatter(), 'Hello'); + }); + } + } }, - teardown() { - return fetchCldrData([ 'en', 'fr' ]); - }, + 'with CLDR data': { + 'assert without a locale'() { + return i18n(partyBundle).then(() => { + const formatter = getMessageFormatter(partyBundle.bundlePath, 'guestInfo'); + let formatted = formatter({ + host: 'Nita', + guestCount: 0 + }); + assert.strictEqual(formatted, 'Nita does not host a party.'); - 'assert without loaded messages'() { - assert.throws(() => { - getMessageFormatter('path/to/make-believe', 'messageKey')(); - }, Error, 'The bundle "path/to/make-believe" has not been registered.'); - }, + formatted = formatter({ + host: 'Nita', + gender: 'female', + guestCount: 1, + guest: 'Bryan' + }); + assert.strictEqual(formatted, 'Nita invites Bryan to her party.'); - 'assert tokens replaced'() { - return i18n(partyBundle).then(() => { - const formatter = getMessageFormatter(partyBundle.bundlePath, 'simpleGuestInfo'); - const formatted = formatter({ - host: 'Nita', - guest: 'Bryan' - }); - assert.strictEqual(formatted, 'Nita invites Bryan to a party.'); + formatted = formatter({ + host: 'Nita', + gender: 'female', + guestCount: 2, + guest: 'Bryan' + }); + assert.strictEqual(formatted, 'Nita invites Bryan and one other person to her party.'); - assert.throws(() => { - formatter({ - host: 'Nita' + formatted = formatter({ + host: 'Nita', + gender: 'female', + guestCount: 42, + guest: 'Bryan' }); - }, Error, 'Missing property guest'); - }); - }, + assert.strictEqual(formatted, 'Nita invites Bryan and 41 other people to her party.'); + }); + }, - 'assert message without tokens'() { - return i18n(bundle).then(() => { - const formatter = getMessageFormatter(bundle.bundlePath, 'hello'); - assert.strictEqual(formatter(), 'Hello'); - }); + 'assert supported locale'() { + return i18n(bundle, 'ar').then(() => { + const formatter = getMessageFormatter(bundle.bundlePath, 'hello', 'ar'); + assert.strictEqual(formatter(), 'السلام عليكم'); + }); + }, + + 'assert unsupported locale'() { + return i18n(bundle, 'fr').then(() => { + const formatter = getMessageFormatter(bundle.bundlePath, 'hello', 'fr'); + assert.strictEqual(formatter(), 'Hello'); + }); + } } }, - 'with CLDR data': { - 'assert without a locale'() { - return i18n(partyBundle).then(() => { - const formatter = getMessageFormatter(partyBundle.bundlePath, 'guestInfo'); - let formatted = formatter({ - host: 'Nita', - guestCount: 0 - }); - assert.strictEqual(formatted, 'Nita does not host a party.'); + i18n: { + 'assert invalid path'() { + const pathless = { + bundlePath: 'path', + messages: {}, + locales: [] + }; + + return i18n(pathless, 'en').then(function () { + throw new Error('Load promise should not resolve.'); + }, function (error: Error) { + const expected = 'Invalid i18n bundle path. Bundle maps must adhere to the format ' + + '"{basePath}{separator}{bundleName}" so that locale bundles can be resolved.'; + assert.strictEqual(error.message, expected); + }); + }, - formatted = formatter({ - host: 'Nita', - gender: 'female', - guestCount: 1, - guest: 'Bryan' + 'assert system locale used as default'() { + return i18n(bundle).then(function (messages: Messages) { + assert.deepEqual(messages, { + hello: 'Hello', + helloReply: 'Hello', + goodbye: 'Goodbye' }); - assert.strictEqual(formatted, 'Nita invites Bryan to her party.'); + }); + }, - formatted = formatter({ - host: 'Nita', - gender: 'female', - guestCount: 2, - guest: 'Bryan' - }); - assert.strictEqual(formatted, 'Nita invites Bryan and one other person to her party.'); + 'assert with string locale'() { + return i18n(bundle, 'ar').then(function (messages: Messages) { + assert.deepEqual(messages, { + hello: 'السلام عليكم', + helloReply: 'و عليكم السام', + goodbye: 'مع السلامة' + }, 'Locale dictionary is used.'); + }); + }, - formatted = formatter({ - host: 'Nita', - gender: 'female', - guestCount: 42, - guest: 'Bryan' - }); - assert.strictEqual(formatted, 'Nita invites Bryan and 41 other people to her party.'); + 'assert with nested locale'() { + return i18n(bundle, 'ar-JO').then(function (messages: Messages) { + // ar-JO is missing "goodbye" key + assert.deepEqual(messages, { + hello: 'مرحبا', + helloReply: 'مرحبتين', + goodbye: 'مع السلامة' + }, 'Most specific dictionary is used with fallbacks provided.'); }); }, - 'assert supported locale'() { - return i18n(bundle, 'ar').then(() => { - const formatter = getMessageFormatter(bundle.bundlePath, 'hello', 'ar'); - assert.strictEqual(formatter(), 'السلام عليكم'); + 'assert with invalid locale'() { + return i18n(bundle, 'ar-JO-').then(function (messages: Messages) { + assert.deepEqual(messages, { + hello: 'مرحبا', + helloReply: 'مرحبتين', + goodbye: 'مع السلامة' + }, 'Only non-empty locale segments are considered.'); }); }, 'assert unsupported locale'() { - return i18n(bundle, 'fr').then(() => { - const formatter = getMessageFormatter(bundle.bundlePath, 'hello', 'fr'); - assert.strictEqual(formatter(), 'Hello'); + return i18n(bundle, 'fr-CA').then(function (messages: Messages) { + assert.deepEqual(messages, { + hello: 'Hello', + helloReply: 'Hello', + goodbye: 'Goodbye' + }); }); - } - } - }, + }, - i18n: { - 'assert invalid path'() { - const pathless = { - bundlePath: 'path', - messages: {}, - locales: [] - }; - - return i18n(pathless, 'en').then(function () { - throw new Error('Load promise should not resolve.'); - }, function (error: Error) { - const expected = 'Invalid i18n bundle path. Bundle maps must adhere to the format ' + - '"{basePath}{separator}{bundleName}" so that locale bundles can be resolved.'; - assert.strictEqual(error.message, expected); - }); - }, + 'assert bundle without locales'() { + const { bundlePath, messages } = bundle; + const localeless = { bundlePath, messages }; - 'assert system locale used as default'() { - return i18n(bundle).then(function (messages: Messages) { - assert.deepEqual(messages, { - hello: 'Hello', - helloReply: 'Hello', - goodbye: 'Goodbye' + return i18n(localeless, 'ar').then(function (messages: Messages) { + assert.deepEqual(messages, { + hello: 'Hello', + helloReply: 'Hello', + goodbye: 'Goodbye' + }, 'Default messages returned when bundle provides no locales.'); }); - }); - }, - - 'assert with string locale'() { - return i18n(bundle, 'ar').then(function (messages: Messages) { - assert.deepEqual(messages, { - hello: 'السلام عليكم', - helloReply: 'و عليكم السام', - goodbye: 'مع السلامة' - }, 'Locale dictionary is used.'); - }); - }, + }, - 'assert with nested locale'() { - return i18n(bundle, 'ar-JO').then(function (messages: Messages) { - // ar-JO is missing "goodbye" key - assert.deepEqual(messages, { - hello: 'مرحبا', - helloReply: 'مرحبتين', - goodbye: 'مع السلامة' - }, 'Most specific dictionary is used with fallbacks provided.'); - }); - }, + 'assert no default export'() { + return i18n(bundle, 'es').then(function (messages: Messages) { + assert.deepEqual(messages, { + hello: 'Hola', + helloReply: 'Hola', + goodbye: 'Adiós' + }, 'The entire exported module should be used when no default is provided.'); + }); + }, - 'assert with invalid locale'() { - return i18n(bundle, 'ar-JO-').then(function (messages: Messages) { - assert.deepEqual(messages, { - hello: 'مرحبا', - helloReply: 'مرحبتين', - goodbye: 'مع السلامة' - }, 'Only non-empty locale segments are considered.'); - }); - }, + 'assert messages cached'() { + return i18n(bundle, 'ar-JO').then(function () { + return i18n(bundle, 'ar-JO'); + }).then((messages: Messages) => { + const cached = getCachedMessages(bundle, 'ar-JO'); - 'assert unsupported locale'() { - return i18n(bundle, 'fr-CA').then(function (messages: Messages) { - assert.deepEqual(messages, { - hello: 'Hello', - helloReply: 'Hello', - goodbye: 'Goodbye' + assert.strictEqual(cached, messages, 'Message dictionaries are cached.'); }); - }); - }, + }, - 'assert bundle without locales'() { - const { bundlePath, messages } = bundle; - const localeless = { bundlePath, messages }; - - return i18n(localeless, 'ar').then(function (messages: Messages) { - assert.deepEqual(messages, { - hello: 'Hello', - helloReply: 'Hello', - goodbye: 'Goodbye' - }, 'Default messages returned when bundle provides no locales.'); - }); - }, + 'assert message dictionaries are frozen'() { + return i18n(bundle, 'ar-JO').then(function () { + const cached = getCachedMessages(bundle, 'ar-JO'); - 'assert no default export'() { - return i18n(bundle, 'es').then(function (messages: Messages) { - assert.deepEqual(messages, { - hello: 'Hola', - helloReply: 'Hola', - goodbye: 'Adiós' - }, 'The entire exported module should be used when no default is provided.'); - }); + assert.throws(() => { + cached![ 'hello' ] = 'Hello'; + }); + }); + } }, - 'assert messages cached'() { - return i18n(bundle, 'ar-JO').then(function () { - return i18n(bundle, 'ar-JO'); - }).then((messages: Messages) => { - const cached = getCachedMessages(bundle, 'ar-JO'); + invalidate: { + 'assert with a bundle path'() { + return i18n(bundle, 'ar').then((messages: Messages) => { + invalidate(bundle.bundlePath); + assert.isUndefined(getCachedMessages(bundle, 'ar'), 'The cache is invalidated for the specified bundle.'); + }); + }, - assert.strictEqual(cached, messages, 'Message dictionaries are cached.'); - }); + 'assert without a bundle path'() { + return i18n(bundle, 'ar').then((messages: Messages) => { + invalidate(); + assert.isUndefined(getCachedMessages(bundle, 'ar'), 'The cache is invalidated for all bundles.'); + }); + } }, - 'assert message dictionaries are frozen'() { - return i18n(bundle, 'ar-JO').then(function () { - const cached = getCachedMessages(bundle, 'ar-JO'); + observeLocale: { + 'assert observer notified of locale change'() { + const next = sinon.spy(); + const subscription = observeLocale({ next }); - assert.throws(() => { - cached!['hello'] = 'Hello'; - }); - }); - } - }, - - invalidate: { - 'assert with a bundle path'() { - return i18n(bundle, 'ar').then((messages: Messages) => { - invalidate(bundle.bundlePath); - assert.isUndefined(getCachedMessages(bundle, 'ar'), 'The cache is invalidated for the specified bundle.'); - }); - }, + switchLocale('ar'); + subscription.unsubscribe(); - 'assert without a bundle path'() { - return i18n(bundle, 'ar').then((messages: Messages) => { - invalidate(); - assert.isUndefined(getCachedMessages(bundle, 'ar'), 'The cache is invalidated for all bundles.'); - }); - } - }, + assert.isTrue(next.calledWith('ar'), '`observer.next` called with new locale.'); + }, - observeLocale: { - 'assert observer notified of locale change'() { - const next = sinon.spy(); - const subscription = observeLocale({ next }); + 'assert observer not notified after unsubscribe'() { + const observer = { next: sinon.spy() }; + const subscription = observeLocale(observer); - switchLocale('ar'); - subscription.unsubscribe(); + subscription.unsubscribe(); + switchLocale('ar'); - assert.isTrue(next.calledWith('ar'), '`observer.next` called with new locale.'); + assert.isFalse(observer.next.called, '`observer.next` not called after unsubscribe.'); + } }, - 'assert observer not notified after unsubscribe'() { - const observer = { next: sinon.spy() }; - const subscription = observeLocale(observer); + setLocaleMessages() { + sinon.stub(Globalize, 'loadMessages'); + const french = { hello: 'Bonjour', goodbye: 'Au revoir' }; + const czech = { hello: 'Ahoj', goodbye: 'Ahoj' }; - subscription.unsubscribe(); - switchLocale('ar'); + setLocaleMessages(bundle, french, 'fr'); + setLocaleMessages(bundle, czech, 'cz'); - assert.isFalse(observer.next.called, '`observer.next` not called after unsubscribe.'); - } - }, + const path = '..-_build-tests-support-mocks-common-main'; + const first = ( Globalize).loadMessages.args[ 0 ][ 0 ].fr[ path ]; + const second = ( Globalize).loadMessages.args[ 1 ][ 0 ].cz[ path ]; - setLocaleMessages() { - sinon.stub(Globalize, 'loadMessages'); - const french = { hello: 'Bonjour', goodbye: 'Au revoir' }; - const czech = { hello: 'Ahoj', goodbye: 'Ahoj' }; + assert.isFrozen(first, 'locale messages should be frozen'); + assert.isFrozen(second, 'locale messages should be frozen'); - setLocaleMessages(bundle, french, 'fr'); - setLocaleMessages(bundle, czech, 'cz'); + assert.deepEqual(getCachedMessages(bundle, 'fr'), assign({}, french, { helloReply: 'Hello' }), + 'Default messages should be included where not overridden'); + assert.deepEqual(getCachedMessages(bundle, 'cz'), assign({}, czech, { helloReply: 'Hello' }), + 'Default messages should be included where not overridden'); - const path = '..-_build-tests-support-mocks-common-main'; - const first = ( Globalize).loadMessages.args[0][0].fr[path]; - const second = ( Globalize).loadMessages.args[1][0].cz[path]; + ( Globalize).loadMessages.restore(); + }, - assert.isFrozen(first, 'locale messages should be frozen'); - assert.isFrozen(second, 'locale messages should be frozen'); + switchLocale: { + 'assert root locale updated'() { + switchLocale('en'); + switchLocale('ar'); - assert.deepEqual(getCachedMessages(bundle, 'fr'), assign({}, french, { helloReply: 'Hello' }), - 'Default messages should be included where not overridden'); - assert.deepEqual(getCachedMessages(bundle, 'cz'), assign({}, czech, { helloReply: 'Hello' }), - 'Default messages should be included where not overridden'); + assert.strictEqual(i18n.locale, 'ar'); + }, - ( Globalize).loadMessages.restore(); - }, + 'assert observers not updated when locale remains the same'() { + const next = sinon.spy(); + observeLocale({ next }); - switchLocale: { - 'assert root locale updated'() { - switchLocale('en'); - switchLocale('ar'); + switchLocale('ar'); + switchLocale('ar'); - assert.strictEqual(i18n.locale, 'ar'); - }, + assert.isFalse(next.calledTwice); + }, - 'assert observers not updated when locale remains the same'() { - const next = sinon.spy(); - observeLocale({ next }); + 'assert new locale passed to Globalize'() { + sinon.spy(Globalize, 'locale'); - switchLocale('ar'); - switchLocale('ar'); + return fetchCldrData([ 'fr' ]).then(() => { + switchLocale('fr'); + assert.isTrue(( Globalize).locale.calledWith('fr'), 'Locale should be passed to Globalize.'); - assert.isFalse(next.calledTwice); + cldrLoad.reset(); + switchLocale('en'); + assert.strictEqual(( Globalize).locale.callCount, 1, 'Locale should not be passed to Globalize.'); + ( Globalize).locale.restore(); + }, (error: Error) => { + ( Globalize).locale.restore(); + throw error; + }); + } }, - 'assert new locale passed to Globalize'() { - sinon.spy(Globalize, 'locale'); + locale: { + 'assert defaults to system locale'() { + assert.strictEqual(i18n.locale, systemLocale, '`i18n.locale` defaults to the system locale.'); + }, - return fetchCldrData([ 'fr' ]).then(() => { + 'assert reflects current locale'() { switchLocale('fr'); - assert.isTrue(( Globalize).locale.calledWith('fr'), 'Locale should be passed to Globalize.'); - - cldrLoad.reset(); - switchLocale('en'); - assert.strictEqual(( Globalize).locale.callCount, 1, 'Locale should not be passed to Globalize.'); - ( Globalize).locale.restore(); - }, (error: Error) => { - ( Globalize).locale.restore(); - throw error; - }); - } - }, - - locale: { - 'assert defaults to system locale'() { - assert.strictEqual(i18n.locale, systemLocale, '`i18n.locale` defaults to the system locale.'); - }, - - 'assert reflects current locale'() { - switchLocale('fr'); - assert.strictEqual(i18n.locale, 'fr', '`i18n.locale` is the current locale.'); + assert.strictEqual(i18n.locale, 'fr', '`i18n.locale` is the current locale.'); + } } } }); diff --git a/tests/unit/main.ts b/tests/unit/main.ts index 47352a1..abab62f 100644 --- a/tests/unit/main.ts +++ b/tests/unit/main.ts @@ -1,5 +1,5 @@ -import * as registerSuite from 'intern!object'; -import * as assert from 'intern/chai!assert'; +const { registerSuite } = intern.getInterface('object'); +const { assert } = intern.getPlugin('chai'); import i18n, { formatCurrency, formatDate, @@ -29,9 +29,7 @@ import i18n, { systemLocale } from '../../src/main'; -registerSuite({ - name: 'main', - +registerSuite('main', { i18n() { assert.isFunction(formatCurrency, 'formatCurrency is exported.'); assert.isFunction(formatDate, 'formatDate is exported.'); diff --git a/tests/unit/number.ts b/tests/unit/number.ts index 35f70d7..aa04cd6 100644 --- a/tests/unit/number.ts +++ b/tests/unit/number.ts @@ -1,5 +1,5 @@ -import * as registerSuite from 'intern!object'; -import * as assert from 'intern/chai!assert'; +const { registerSuite } = intern.getInterface('object'); +const { assert } = intern.getPlugin('chai'); import { fetchCldrData } from '../support/util'; import { formatCurrency, @@ -13,9 +13,7 @@ import { } from '../../src/number'; import { switchLocale, systemLocale } from '../../src/i18n'; -registerSuite({ - name: 'number', - +registerSuite('number', { setup() { // Load the CLDR data for the locales used in the tests ('en' and 'fr'); return fetchCldrData([ 'en', 'fr' ]).then(() => { @@ -27,243 +25,245 @@ registerSuite({ return switchLocale(systemLocale); }, - formatCurrency: { - 'assert without a locale'() { - assert.strictEqual(formatCurrency(12.37, 'USD'), '$12.37'); - assert.strictEqual(formatCurrency(12.37, 'USD', { style: 'accounting' }), '$12.37'); - assert.strictEqual(formatCurrency(12.37, 'USD', { style: 'code' }), '12.37 USD'); - assert.strictEqual(formatCurrency(12.37, 'USD', { style: 'name' }), '12.37 US dollars'); - }, - - 'assert with a locale'() { - assert.strictEqual(formatCurrency(12.37, 'EUR', 'fr'), '12,37\u00A0€'); - assert.strictEqual(formatCurrency(12.37, 'EUR', { style: 'accounting' }, 'fr'), '12,37\u00A0€'); - assert.strictEqual(formatCurrency(12.37, 'EUR', { style: 'code' }, 'fr'), '12,37 EUR'); - assert.strictEqual(formatCurrency(12.37, 'EUR', { style: 'name' }, 'fr'), '12,37 euros'); - } - }, - - formatNumber: { - 'assert without a locale'() { - assert.strictEqual(formatNumber(12.37), '12.37'); - assert.strictEqual(formatNumber(12.37, { style: 'percent' }), '1,237%'); - assert.strictEqual(formatNumber(12.37, { minimumIntegerDigits: 3 }), '012.37'); - assert.strictEqual(formatNumber(12.37, { minimumFractionDigits: 3 }), '12.370'); - assert.strictEqual(formatNumber(12.37, { maximumFractionDigits: 1 }), '12.4'); - assert.strictEqual(formatNumber(12.33, { maximumFractionDigits: 1 }), '12.3'); - assert.strictEqual(formatNumber(12.37, { - minimumSignificantDigits: 3, - maximumSignificantDigits: 5 - }), '12.37'); - - assert.strictEqual(formatNumber(12.33, { - maximumFractionDigits: 1, - round: 'ceil' - }), '12.4'); - assert.strictEqual(formatNumber(12.33, { - maximumFractionDigits: 1, - round: 'floor' - }), '12.3'); - assert.strictEqual(formatNumber(12.33, { - maximumFractionDigits: 1, - round: 'truncate' - }), '12.3'); - - assert.strictEqual(formatNumber(1234567890), '1,234,567,890'); - assert.strictEqual(formatNumber(1234567890, { useGrouping: false }), '1234567890'); + tests: { + formatCurrency: { + 'assert without a locale'() { + assert.strictEqual(formatCurrency(12.37, 'USD'), '$12.37'); + assert.strictEqual(formatCurrency(12.37, 'USD', { style: 'accounting' }), '$12.37'); + assert.strictEqual(formatCurrency(12.37, 'USD', { style: 'code' }), '12.37 USD'); + assert.strictEqual(formatCurrency(12.37, 'USD', { style: 'name' }), '12.37 US dollars'); + }, + + 'assert with a locale'() { + assert.strictEqual(formatCurrency(12.37, 'EUR', 'fr'), '12,37\u00A0€'); + assert.strictEqual(formatCurrency(12.37, 'EUR', { style: 'accounting' }, 'fr'), '12,37\u00A0€'); + assert.strictEqual(formatCurrency(12.37, 'EUR', { style: 'code' }, 'fr'), '12,37 EUR'); + assert.strictEqual(formatCurrency(12.37, 'EUR', { style: 'name' }, 'fr'), '12,37 euros'); + } }, - 'assert with a locale'() { - assert.strictEqual(formatNumber(12.37, 'fr'), '12,37'); - assert.strictEqual(formatNumber(12.37, { style: 'percent' }, 'fr'), '1\u00A0237\u00A0%'); - assert.strictEqual(formatNumber(12.37, { minimumIntegerDigits: 3 }, 'fr'), '012,37'); - assert.strictEqual(formatNumber(12.37, { minimumFractionDigits: 3 }, 'fr'), '12,370'); - assert.strictEqual(formatNumber(12.37, { maximumFractionDigits: 1 }, 'fr'), '12,4'); - assert.strictEqual(formatNumber(12.33, { maximumFractionDigits: 1 }, 'fr'), '12,3'); - assert.strictEqual(formatNumber(12.37, { - minimumSignificantDigits: 3, - maximumSignificantDigits: 5 - }, 'fr'), '12,37'); - - assert.strictEqual(formatNumber(12.33, { - maximumFractionDigits: 1, - round: 'ceil' - }, 'fr'), '12,4'); - assert.strictEqual(formatNumber(12.33, { - maximumFractionDigits: 1, - round: 'floor' - }, 'fr'), '12,3'); - assert.strictEqual(formatNumber(12.33, { - maximumFractionDigits: 1, - round: 'truncate' - }, 'fr'), '12,3'); - - assert.strictEqual(formatNumber(1234567890, 'fr'), '1\u00A0234\u00A0567\u00A0890'); - assert.strictEqual(formatNumber(1234567890, { useGrouping: false }, 'fr'), '1234567890'); - } - }, - - getCurrencyFormatter: { - 'assert without a locale'() { - assert.strictEqual(getCurrencyFormatter('USD')(12.37), '$12.37'); - assert.strictEqual(getCurrencyFormatter('USD', { style: 'accounting' })(12.37), '$12.37'); - assert.strictEqual(getCurrencyFormatter('USD', { style: 'code' })(12.37), '12.37 USD'); - assert.strictEqual(getCurrencyFormatter('USD', { style: 'name' })(12.37), '12.37 US dollars'); + formatNumber: { + 'assert without a locale'() { + assert.strictEqual(formatNumber(12.37), '12.37'); + assert.strictEqual(formatNumber(12.37, { style: 'percent' }), '1,237%'); + assert.strictEqual(formatNumber(12.37, { minimumIntegerDigits: 3 }), '012.37'); + assert.strictEqual(formatNumber(12.37, { minimumFractionDigits: 3 }), '12.370'); + assert.strictEqual(formatNumber(12.37, { maximumFractionDigits: 1 }), '12.4'); + assert.strictEqual(formatNumber(12.33, { maximumFractionDigits: 1 }), '12.3'); + assert.strictEqual(formatNumber(12.37, { + minimumSignificantDigits: 3, + maximumSignificantDigits: 5 + }), '12.37'); + + assert.strictEqual(formatNumber(12.33, { + maximumFractionDigits: 1, + round: 'ceil' + }), '12.4'); + assert.strictEqual(formatNumber(12.33, { + maximumFractionDigits: 1, + round: 'floor' + }), '12.3'); + assert.strictEqual(formatNumber(12.33, { + maximumFractionDigits: 1, + round: 'truncate' + }), '12.3'); + + assert.strictEqual(formatNumber(1234567890), '1,234,567,890'); + assert.strictEqual(formatNumber(1234567890, { useGrouping: false }), '1234567890'); + }, + + 'assert with a locale'() { + assert.strictEqual(formatNumber(12.37, 'fr'), '12,37'); + assert.strictEqual(formatNumber(12.37, { style: 'percent' }, 'fr'), '1\u00A0237\u00A0%'); + assert.strictEqual(formatNumber(12.37, { minimumIntegerDigits: 3 }, 'fr'), '012,37'); + assert.strictEqual(formatNumber(12.37, { minimumFractionDigits: 3 }, 'fr'), '12,370'); + assert.strictEqual(formatNumber(12.37, { maximumFractionDigits: 1 }, 'fr'), '12,4'); + assert.strictEqual(formatNumber(12.33, { maximumFractionDigits: 1 }, 'fr'), '12,3'); + assert.strictEqual(formatNumber(12.37, { + minimumSignificantDigits: 3, + maximumSignificantDigits: 5 + }, 'fr'), '12,37'); + + assert.strictEqual(formatNumber(12.33, { + maximumFractionDigits: 1, + round: 'ceil' + }, 'fr'), '12,4'); + assert.strictEqual(formatNumber(12.33, { + maximumFractionDigits: 1, + round: 'floor' + }, 'fr'), '12,3'); + assert.strictEqual(formatNumber(12.33, { + maximumFractionDigits: 1, + round: 'truncate' + }, 'fr'), '12,3'); + + assert.strictEqual(formatNumber(1234567890, 'fr'), '1\u00A0234\u00A0567\u00A0890'); + assert.strictEqual(formatNumber(1234567890, { useGrouping: false }, 'fr'), '1234567890'); + } }, - 'assert with a locale'() { - assert.strictEqual(getCurrencyFormatter('EUR', 'fr')(12.37), '12,37\u00A0€'); - assert.strictEqual(getCurrencyFormatter('EUR', { style: 'accounting' }, 'fr')(12.37), '12,37\u00A0€'); - assert.strictEqual(getCurrencyFormatter('EUR', { style: 'code' }, 'fr')(12.37), '12,37 EUR'); - assert.strictEqual(getCurrencyFormatter('EUR', { style: 'name' }, 'fr')(12.37), '12,37 euros'); - } - }, - - getNumberFormatter: { - 'assert without a locale'() { - assert.strictEqual(getNumberFormatter()(12.37), '12.37'); - assert.strictEqual(getNumberFormatter({ style: 'percent' })(12.37), '1,237%'); - assert.strictEqual(getNumberFormatter({ minimumIntegerDigits: 3 })(12.37), '012.37'); - assert.strictEqual(getNumberFormatter({ minimumFractionDigits: 3 })(12.37), '12.370'); - assert.strictEqual(getNumberFormatter({ maximumFractionDigits: 1 })(12.37), '12.4'); - assert.strictEqual(getNumberFormatter({ maximumFractionDigits: 1 })(12.33), '12.3'); - assert.strictEqual(getNumberFormatter({ - minimumSignificantDigits: 3, - maximumSignificantDigits: 5 - })(12.37), '12.37'); - - assert.strictEqual(getNumberFormatter({ - maximumFractionDigits: 1, - round: 'ceil' - })(12.33), '12.4'); - assert.strictEqual(getNumberFormatter({ - maximumFractionDigits: 1, - round: 'floor' - })(12.33), '12.3'); - assert.strictEqual(getNumberFormatter({ - maximumFractionDigits: 1, - round: 'truncate' - })(12.33), '12.3'); - - assert.strictEqual(getNumberFormatter()(1234567890), '1,234,567,890'); - assert.strictEqual(getNumberFormatter({ useGrouping: false })(1234567890), '1234567890'); + getCurrencyFormatter: { + 'assert without a locale'() { + assert.strictEqual(getCurrencyFormatter('USD')(12.37), '$12.37'); + assert.strictEqual(getCurrencyFormatter('USD', { style: 'accounting' })(12.37), '$12.37'); + assert.strictEqual(getCurrencyFormatter('USD', { style: 'code' })(12.37), '12.37 USD'); + assert.strictEqual(getCurrencyFormatter('USD', { style: 'name' })(12.37), '12.37 US dollars'); + }, + + 'assert with a locale'() { + assert.strictEqual(getCurrencyFormatter('EUR', 'fr')(12.37), '12,37\u00A0€'); + assert.strictEqual(getCurrencyFormatter('EUR', { style: 'accounting' }, 'fr')(12.37), '12,37\u00A0€'); + assert.strictEqual(getCurrencyFormatter('EUR', { style: 'code' }, 'fr')(12.37), '12,37 EUR'); + assert.strictEqual(getCurrencyFormatter('EUR', { style: 'name' }, 'fr')(12.37), '12,37 euros'); + } }, - 'assert with a locale'() { - assert.strictEqual(getNumberFormatter('fr')(12.37), '12,37'); - assert.strictEqual(getNumberFormatter({ style: 'percent' }, 'fr')(12.37), '1\u00A0237\u00A0%'); - assert.strictEqual(getNumberFormatter({ minimumIntegerDigits: 3 }, 'fr')(12.37), '012,37'); - assert.strictEqual(getNumberFormatter({ minimumFractionDigits: 3 }, 'fr')(12.37), '12,370'); - assert.strictEqual(getNumberFormatter({ maximumFractionDigits: 1 }, 'fr')(12.37), '12,4'); - assert.strictEqual(getNumberFormatter({ maximumFractionDigits: 1 }, 'fr')(12.33), '12,3'); - assert.strictEqual(getNumberFormatter({ - minimumSignificantDigits: 3, - maximumSignificantDigits: 5 - }, 'fr')(12.37), '12,37'); - - assert.strictEqual(getNumberFormatter({ - maximumFractionDigits: 1, - round: 'ceil' - }, 'fr')(12.33), '12,4'); - assert.strictEqual(getNumberFormatter({ - maximumFractionDigits: 1, - round: 'floor' - }, 'fr')(12.33), '12,3'); - assert.strictEqual(getNumberFormatter({ - maximumFractionDigits: 1, - round: 'truncate' - }, 'fr')(12.33), '12,3'); - - assert.strictEqual(getNumberFormatter('fr')(1234567890), '1\u00A0234\u00A0567\u00A0890'); - assert.strictEqual(getNumberFormatter({ useGrouping: false }, 'fr')(1234567890), '1234567890'); - } - }, - - getNumberParser: { - 'assert without a locale'() { - assert.strictEqual(getNumberParser()('12.37'), 12.37); - assert.strictEqual(getNumberParser({ style: 'decimal' })('12.37'), 12.37); - assert.strictEqual(getNumberParser({ style: 'percent' })('1,237%'), 12.37); + getNumberFormatter: { + 'assert without a locale'() { + assert.strictEqual(getNumberFormatter()(12.37), '12.37'); + assert.strictEqual(getNumberFormatter({ style: 'percent' })(12.37), '1,237%'); + assert.strictEqual(getNumberFormatter({ minimumIntegerDigits: 3 })(12.37), '012.37'); + assert.strictEqual(getNumberFormatter({ minimumFractionDigits: 3 })(12.37), '12.370'); + assert.strictEqual(getNumberFormatter({ maximumFractionDigits: 1 })(12.37), '12.4'); + assert.strictEqual(getNumberFormatter({ maximumFractionDigits: 1 })(12.33), '12.3'); + assert.strictEqual(getNumberFormatter({ + minimumSignificantDigits: 3, + maximumSignificantDigits: 5 + })(12.37), '12.37'); + + assert.strictEqual(getNumberFormatter({ + maximumFractionDigits: 1, + round: 'ceil' + })(12.33), '12.4'); + assert.strictEqual(getNumberFormatter({ + maximumFractionDigits: 1, + round: 'floor' + })(12.33), '12.3'); + assert.strictEqual(getNumberFormatter({ + maximumFractionDigits: 1, + round: 'truncate' + })(12.33), '12.3'); + + assert.strictEqual(getNumberFormatter()(1234567890), '1,234,567,890'); + assert.strictEqual(getNumberFormatter({ useGrouping: false })(1234567890), '1234567890'); + }, + + 'assert with a locale'() { + assert.strictEqual(getNumberFormatter('fr')(12.37), '12,37'); + assert.strictEqual(getNumberFormatter({ style: 'percent' }, 'fr')(12.37), '1\u00A0237\u00A0%'); + assert.strictEqual(getNumberFormatter({ minimumIntegerDigits: 3 }, 'fr')(12.37), '012,37'); + assert.strictEqual(getNumberFormatter({ minimumFractionDigits: 3 }, 'fr')(12.37), '12,370'); + assert.strictEqual(getNumberFormatter({ maximumFractionDigits: 1 }, 'fr')(12.37), '12,4'); + assert.strictEqual(getNumberFormatter({ maximumFractionDigits: 1 }, 'fr')(12.33), '12,3'); + assert.strictEqual(getNumberFormatter({ + minimumSignificantDigits: 3, + maximumSignificantDigits: 5 + }, 'fr')(12.37), '12,37'); + + assert.strictEqual(getNumberFormatter({ + maximumFractionDigits: 1, + round: 'ceil' + }, 'fr')(12.33), '12,4'); + assert.strictEqual(getNumberFormatter({ + maximumFractionDigits: 1, + round: 'floor' + }, 'fr')(12.33), '12,3'); + assert.strictEqual(getNumberFormatter({ + maximumFractionDigits: 1, + round: 'truncate' + }, 'fr')(12.33), '12,3'); + + assert.strictEqual(getNumberFormatter('fr')(1234567890), '1\u00A0234\u00A0567\u00A0890'); + assert.strictEqual(getNumberFormatter({ useGrouping: false }, 'fr')(1234567890), '1234567890'); + } }, - 'assert with a locale'() { - assert.strictEqual(getNumberParser('fr')('12,37'), 12.37); - assert.strictEqual(getNumberParser({ style: 'decimal' }, 'fr')('12,37'), 12.37); - assert.strictEqual(getNumberParser({ style: 'percent' }, 'fr')('1\u00A0237\u00A0%'), 12.37); - } - }, - - getPluralGenerator: { - 'assert without a locale'() { - assert.strictEqual(getPluralGenerator()(0), 'other'); - assert.strictEqual(getPluralGenerator()(1), 'one'); - assert.strictEqual(getPluralGenerator()(2), 'other'); - - assert.strictEqual(getPluralGenerator({ type: 'cardinal' })(0), 'other'); - assert.strictEqual(getPluralGenerator({ type: 'cardinal' })(1), 'one'); - assert.strictEqual(getPluralGenerator({ type: 'cardinal' })(2), 'other'); - - assert.strictEqual(getPluralGenerator({ type: 'ordinal' })(0), 'other'); - assert.strictEqual(getPluralGenerator({ type: 'ordinal' })(1), 'one'); - assert.strictEqual(getPluralGenerator({ type: 'ordinal' })(2), 'two'); + getNumberParser: { + 'assert without a locale'() { + assert.strictEqual(getNumberParser()('12.37'), 12.37); + assert.strictEqual(getNumberParser({ style: 'decimal' })('12.37'), 12.37); + assert.strictEqual(getNumberParser({ style: 'percent' })('1,237%'), 12.37); + }, + + 'assert with a locale'() { + assert.strictEqual(getNumberParser('fr')('12,37'), 12.37); + assert.strictEqual(getNumberParser({ style: 'decimal' }, 'fr')('12,37'), 12.37); + assert.strictEqual(getNumberParser({ style: 'percent' }, 'fr')('1\u00A0237\u00A0%'), 12.37); + } }, - 'assert with a locale'() { - assert.strictEqual(getPluralGenerator('fr')(0), 'one'); - assert.strictEqual(getPluralGenerator('fr')(1), 'one'); - assert.strictEqual(getPluralGenerator('fr')(2), 'other'); - - assert.strictEqual(getPluralGenerator({ type: 'cardinal' }, 'fr')(0), 'one'); - assert.strictEqual(getPluralGenerator({ type: 'cardinal' }, 'fr')(1), 'one'); - assert.strictEqual(getPluralGenerator({ type: 'cardinal' }, 'fr')(2), 'other'); - - assert.strictEqual(getPluralGenerator({ type: 'ordinal' }, 'fr')(0), 'other'); - assert.strictEqual(getPluralGenerator({ type: 'ordinal' }, 'fr')(1), 'one'); - assert.strictEqual(getPluralGenerator({ type: 'ordinal' }, 'fr')(2), 'other'); - } - }, - - parseNumber: { - 'assert without a locale'() { - assert.strictEqual(parseNumber('12.37'), 12.37); - assert.strictEqual(parseNumber('12.37', { style: 'decimal' }), 12.37); - assert.strictEqual(parseNumber('1,237%', { style: 'percent' }), 12.37); + getPluralGenerator: { + 'assert without a locale'() { + assert.strictEqual(getPluralGenerator()(0), 'other'); + assert.strictEqual(getPluralGenerator()(1), 'one'); + assert.strictEqual(getPluralGenerator()(2), 'other'); + + assert.strictEqual(getPluralGenerator({ type: 'cardinal' })(0), 'other'); + assert.strictEqual(getPluralGenerator({ type: 'cardinal' })(1), 'one'); + assert.strictEqual(getPluralGenerator({ type: 'cardinal' })(2), 'other'); + + assert.strictEqual(getPluralGenerator({ type: 'ordinal' })(0), 'other'); + assert.strictEqual(getPluralGenerator({ type: 'ordinal' })(1), 'one'); + assert.strictEqual(getPluralGenerator({ type: 'ordinal' })(2), 'two'); + }, + + 'assert with a locale'() { + assert.strictEqual(getPluralGenerator('fr')(0), 'one'); + assert.strictEqual(getPluralGenerator('fr')(1), 'one'); + assert.strictEqual(getPluralGenerator('fr')(2), 'other'); + + assert.strictEqual(getPluralGenerator({ type: 'cardinal' }, 'fr')(0), 'one'); + assert.strictEqual(getPluralGenerator({ type: 'cardinal' }, 'fr')(1), 'one'); + assert.strictEqual(getPluralGenerator({ type: 'cardinal' }, 'fr')(2), 'other'); + + assert.strictEqual(getPluralGenerator({ type: 'ordinal' }, 'fr')(0), 'other'); + assert.strictEqual(getPluralGenerator({ type: 'ordinal' }, 'fr')(1), 'one'); + assert.strictEqual(getPluralGenerator({ type: 'ordinal' }, 'fr')(2), 'other'); + } }, - 'assert with a locale'() { - assert.strictEqual(parseNumber('12,37', 'fr'), 12.37); - assert.strictEqual(parseNumber('12,37', { style: 'decimal' }, 'fr'), 12.37); - assert.strictEqual(parseNumber('1\u00A0237\u00A0%', { style: 'percent' }, 'fr'), 12.37); - } - }, - - pluralize: { - 'assert without a locale'() { - assert.strictEqual(pluralize(0), 'other'); - assert.strictEqual(pluralize(1), 'one'); - assert.strictEqual(pluralize(2), 'other'); - - assert.strictEqual(pluralize(0, { type: 'cardinal' }), 'other'); - assert.strictEqual(pluralize(1, { type: 'cardinal' }), 'one'); - assert.strictEqual(pluralize(2, { type: 'cardinal' }), 'other'); - - assert.strictEqual(pluralize(0, { type: 'ordinal' }), 'other'); - assert.strictEqual(pluralize(1, { type: 'ordinal' }), 'one'); - assert.strictEqual(pluralize(2, { type: 'ordinal' }), 'two'); + parseNumber: { + 'assert without a locale'() { + assert.strictEqual(parseNumber('12.37'), 12.37); + assert.strictEqual(parseNumber('12.37', { style: 'decimal' }), 12.37); + assert.strictEqual(parseNumber('1,237%', { style: 'percent' }), 12.37); + }, + + 'assert with a locale'() { + assert.strictEqual(parseNumber('12,37', 'fr'), 12.37); + assert.strictEqual(parseNumber('12,37', { style: 'decimal' }, 'fr'), 12.37); + assert.strictEqual(parseNumber('1\u00A0237\u00A0%', { style: 'percent' }, 'fr'), 12.37); + } }, - 'assert with a locale'() { - assert.strictEqual(pluralize(0, 'fr'), 'one'); - assert.strictEqual(pluralize(1, 'fr'), 'one'); - assert.strictEqual(pluralize(2, 'fr'), 'other'); - - assert.strictEqual(pluralize(0, { type: 'cardinal' }, 'fr'), 'one'); - assert.strictEqual(pluralize(1, { type: 'cardinal' }, 'fr'), 'one'); - assert.strictEqual(pluralize(2, { type: 'cardinal' }, 'fr'), 'other'); - - assert.strictEqual(pluralize(0, { type: 'ordinal' }, 'fr'), 'other'); - assert.strictEqual(pluralize(1, { type: 'ordinal' }, 'fr'), 'one'); - assert.strictEqual(pluralize(2, { type: 'ordinal' }, 'fr'), 'other'); + pluralize: { + 'assert without a locale'() { + assert.strictEqual(pluralize(0), 'other'); + assert.strictEqual(pluralize(1), 'one'); + assert.strictEqual(pluralize(2), 'other'); + + assert.strictEqual(pluralize(0, { type: 'cardinal' }), 'other'); + assert.strictEqual(pluralize(1, { type: 'cardinal' }), 'one'); + assert.strictEqual(pluralize(2, { type: 'cardinal' }), 'other'); + + assert.strictEqual(pluralize(0, { type: 'ordinal' }), 'other'); + assert.strictEqual(pluralize(1, { type: 'ordinal' }), 'one'); + assert.strictEqual(pluralize(2, { type: 'ordinal' }), 'two'); + }, + + 'assert with a locale'() { + assert.strictEqual(pluralize(0, 'fr'), 'one'); + assert.strictEqual(pluralize(1, 'fr'), 'one'); + assert.strictEqual(pluralize(2, 'fr'), 'other'); + + assert.strictEqual(pluralize(0, { type: 'cardinal' }, 'fr'), 'one'); + assert.strictEqual(pluralize(1, { type: 'cardinal' }, 'fr'), 'one'); + assert.strictEqual(pluralize(2, { type: 'cardinal' }, 'fr'), 'other'); + + assert.strictEqual(pluralize(0, { type: 'ordinal' }, 'fr'), 'other'); + assert.strictEqual(pluralize(1, { type: 'ordinal' }, 'fr'), 'one'); + assert.strictEqual(pluralize(2, { type: 'ordinal' }, 'fr'), 'other'); + } } } }); diff --git a/tests/unit/unit.ts b/tests/unit/unit.ts index 125bd65..86ff220 100644 --- a/tests/unit/unit.ts +++ b/tests/unit/unit.ts @@ -1,13 +1,11 @@ -import * as registerSuite from 'intern!object'; -import * as assert from 'intern/chai!assert'; +const { registerSuite } = intern.getInterface('object'); +const { assert } = intern.getPlugin('chai'); import { fetchCldrData } from '../support/util'; import { getNumberFormatter } from '../../src/number'; import { getUnitFormatter, formatUnit } from '../../src/unit'; import { switchLocale, systemLocale } from '../../src/i18n'; -registerSuite({ - name: 'number', - +registerSuite('number units', { setup() { // Load the CLDR data for the locales used in the tests ('en' and 'fr'); return fetchCldrData([ 'en', 'fr' ]).then(() => { @@ -19,63 +17,65 @@ registerSuite({ return switchLocale(systemLocale); }, - formatUnit: { - 'assert without a locale'() { - assert.strictEqual(formatUnit(1, 'foot'), '1 foot'); - assert.strictEqual(formatUnit(5280, 'foot'), '5,280 feet'); - assert.strictEqual(formatUnit(1, 'foot', { form: 'long' }), '1 foot'); - assert.strictEqual(formatUnit(5280, 'foot', { form: 'long' }), '5,280 feet'); - assert.strictEqual(formatUnit(1, 'foot', { form: 'short' }), '1 ft'); - assert.strictEqual(formatUnit(5280, 'foot', { form: 'short' }), '5,280 ft'); - assert.strictEqual(formatUnit(1, 'foot', { form: 'narrow' }), '1′'); - assert.strictEqual(formatUnit(5280, 'foot', { form: 'narrow' }), '5,280′'); - assert.strictEqual(formatUnit(5280, 'foot', { - numberFormatter: getNumberFormatter({ useGrouping: false }) - }), '5280 feet'); - }, - - 'assert with a locale'() { - assert.strictEqual(formatUnit(1, 'meter', 'fr'), '1 mètre'); - assert.strictEqual(formatUnit(1000, 'meter', 'fr'), '1\u00A0000 mètres'); - assert.strictEqual(formatUnit(1, 'meter', { form: 'long' }, 'fr'), '1 mètre'); - assert.strictEqual(formatUnit(1000, 'meter', { form: 'long' }, 'fr'), '1\u00A0000 mètres'); - assert.strictEqual(formatUnit(1, 'meter', { form: 'short' }, 'fr'), '1 m'); - assert.strictEqual(formatUnit(1000, 'meter', { form: 'short' }, 'fr'), '1\u00A0000 m'); - assert.strictEqual(formatUnit(1, 'meter', { form: 'narrow' }, 'fr'), '1m'); - assert.strictEqual(formatUnit(1000, 'meter', { form: 'narrow' }, 'fr'), '1\u00A0000m'); - assert.strictEqual(formatUnit(1000, 'meter', { - numberFormatter: getNumberFormatter({ useGrouping: false }) - }, 'fr'), '1000 mètres'); - } - }, + tests: { + formatUnit: { + 'assert without a locale'() { + assert.strictEqual(formatUnit(1, 'foot'), '1 foot'); + assert.strictEqual(formatUnit(5280, 'foot'), '5,280 feet'); + assert.strictEqual(formatUnit(1, 'foot', { form: 'long' }), '1 foot'); + assert.strictEqual(formatUnit(5280, 'foot', { form: 'long' }), '5,280 feet'); + assert.strictEqual(formatUnit(1, 'foot', { form: 'short' }), '1 ft'); + assert.strictEqual(formatUnit(5280, 'foot', { form: 'short' }), '5,280 ft'); + assert.strictEqual(formatUnit(1, 'foot', { form: 'narrow' }), '1′'); + assert.strictEqual(formatUnit(5280, 'foot', { form: 'narrow' }), '5,280′'); + assert.strictEqual(formatUnit(5280, 'foot', { + numberFormatter: getNumberFormatter({ useGrouping: false }) + }), '5280 feet'); + }, - getUnitFormatter: { - 'assert without a locale'() { - assert.strictEqual(getUnitFormatter('foot')(1), '1 foot'); - assert.strictEqual(getUnitFormatter('foot')(5280), '5,280 feet'); - assert.strictEqual(getUnitFormatter('foot', { form: 'long' })(1), '1 foot'); - assert.strictEqual(getUnitFormatter('foot', { form: 'long' })(5280), '5,280 feet'); - assert.strictEqual(getUnitFormatter('foot', { form: 'short' })(1), '1 ft'); - assert.strictEqual(getUnitFormatter('foot', { form: 'short' })(5280), '5,280 ft'); - assert.strictEqual(getUnitFormatter('foot', { form: 'narrow' })(1), '1′'); - assert.strictEqual(getUnitFormatter('foot', { form: 'narrow' })(5280), '5,280′'); - assert.strictEqual(getUnitFormatter('foot', { - numberFormatter: getNumberFormatter({ useGrouping: false }) - })(5280), '5280 feet'); + 'assert with a locale'() { + assert.strictEqual(formatUnit(1, 'meter', 'fr'), '1 mètre'); + assert.strictEqual(formatUnit(1000, 'meter', 'fr'), '1\u00A0000 mètres'); + assert.strictEqual(formatUnit(1, 'meter', { form: 'long' }, 'fr'), '1 mètre'); + assert.strictEqual(formatUnit(1000, 'meter', { form: 'long' }, 'fr'), '1\u00A0000 mètres'); + assert.strictEqual(formatUnit(1, 'meter', { form: 'short' }, 'fr'), '1 m'); + assert.strictEqual(formatUnit(1000, 'meter', { form: 'short' }, 'fr'), '1\u00A0000 m'); + assert.strictEqual(formatUnit(1, 'meter', { form: 'narrow' }, 'fr'), '1m'); + assert.strictEqual(formatUnit(1000, 'meter', { form: 'narrow' }, 'fr'), '1\u00A0000m'); + assert.strictEqual(formatUnit(1000, 'meter', { + numberFormatter: getNumberFormatter({ useGrouping: false }) + }, 'fr'), '1000 mètres'); + } }, - 'assert with a locale'() { - assert.strictEqual(getUnitFormatter('meter', 'fr')(1), '1 mètre'); - assert.strictEqual(getUnitFormatter('meter', 'fr')(1000), '1\u00A0000 mètres'); - assert.strictEqual(getUnitFormatter('meter', { form: 'long' }, 'fr')(1), '1 mètre'); - assert.strictEqual(getUnitFormatter('meter', { form: 'long' }, 'fr')(1000), '1\u00A0000 mètres'); - assert.strictEqual(getUnitFormatter('meter', { form: 'short' }, 'fr')(1), '1 m'); - assert.strictEqual(getUnitFormatter('meter', { form: 'short' }, 'fr')(1000), '1\u00A0000 m'); - assert.strictEqual(getUnitFormatter('meter', { form: 'narrow' }, 'fr')(1), '1m'); - assert.strictEqual(getUnitFormatter('meter', { form: 'narrow' }, 'fr')(1000), '1\u00A0000m'); - assert.strictEqual(getUnitFormatter('meter', { - numberFormatter: getNumberFormatter({ useGrouping: false }) - }, 'fr')(1000), '1000 mètres'); + getUnitFormatter: { + 'assert without a locale'() { + assert.strictEqual(getUnitFormatter('foot')(1), '1 foot'); + assert.strictEqual(getUnitFormatter('foot')(5280), '5,280 feet'); + assert.strictEqual(getUnitFormatter('foot', { form: 'long' })(1), '1 foot'); + assert.strictEqual(getUnitFormatter('foot', { form: 'long' })(5280), '5,280 feet'); + assert.strictEqual(getUnitFormatter('foot', { form: 'short' })(1), '1 ft'); + assert.strictEqual(getUnitFormatter('foot', { form: 'short' })(5280), '5,280 ft'); + assert.strictEqual(getUnitFormatter('foot', { form: 'narrow' })(1), '1′'); + assert.strictEqual(getUnitFormatter('foot', { form: 'narrow' })(5280), '5,280′'); + assert.strictEqual(getUnitFormatter('foot', { + numberFormatter: getNumberFormatter({ useGrouping: false }) + })(5280), '5280 feet'); + }, + + 'assert with a locale'() { + assert.strictEqual(getUnitFormatter('meter', 'fr')(1), '1 mètre'); + assert.strictEqual(getUnitFormatter('meter', 'fr')(1000), '1\u00A0000 mètres'); + assert.strictEqual(getUnitFormatter('meter', { form: 'long' }, 'fr')(1), '1 mètre'); + assert.strictEqual(getUnitFormatter('meter', { form: 'long' }, 'fr')(1000), '1\u00A0000 mètres'); + assert.strictEqual(getUnitFormatter('meter', { form: 'short' }, 'fr')(1), '1 m'); + assert.strictEqual(getUnitFormatter('meter', { form: 'short' }, 'fr')(1000), '1\u00A0000 m'); + assert.strictEqual(getUnitFormatter('meter', { form: 'narrow' }, 'fr')(1), '1m'); + assert.strictEqual(getUnitFormatter('meter', { form: 'narrow' }, 'fr')(1000), '1\u00A0000m'); + assert.strictEqual(getUnitFormatter('meter', { + numberFormatter: getNumberFormatter({ useGrouping: false }) + }, 'fr')(1000), '1000 mètres'); + } } } }); diff --git a/tests/unit/util/globalize.ts b/tests/unit/util/globalize.ts index 16f3855..9d6d9c6 100644 --- a/tests/unit/util/globalize.ts +++ b/tests/unit/util/globalize.ts @@ -1,18 +1,17 @@ import * as Globalize from 'globalize'; import 'globalize/dist/globalize/date'; -import * as registerSuite from 'intern!object'; -import * as assert from 'intern/chai!assert'; +import 'globalize/dist/globalize/relative-time'; +const { registerSuite } = intern.getInterface('object'); +const { assert } = intern.getPlugin('chai'); import { fetchCldrData } from '../../support/util'; import { DateFormatter, DateFormatterOptions, RelativeTimeFormatterOptions } from '../../../src/date'; import { switchLocale, systemLocale } from '../../../src/i18n'; import getGlobalize, { globalizeDelegator } from '../../../src/util/globalize'; -registerSuite({ - name: 'util/globalize', +registerSuite('util/globalize', { - setup() { - // Load the CLDR data for the locales used in the tests ('en' and 'fr'); - return fetchCldrData([ 'en', 'fr' ]).then(() => { + setup() {return fetchCldrData([ 'en', 'fr' ]).then(() => { + switchLocale('en'); switchLocale('en'); }); }, @@ -21,68 +20,74 @@ registerSuite({ switchLocale(systemLocale); }, - getGlobalize() { - assert.strictEqual(getGlobalize(), Globalize, 'The main globalize object is returned.'); - assert.instanceOf(getGlobalize('fr'), Globalize, 'A Globalize instance is returned.'); - assert.notEqual(getGlobalize('fr'), Globalize, 'The main globalize object is not returned.'); - }, - - globalizeDelegator: { - 'assert method that takes a value'() { - const locale = 'fr'; - const value = new Date(); - const options: DateFormatterOptions = { datetime: 'full' }; + tests: { - assert.strictEqual(globalizeDelegator('formatDate', { value }), Globalize.formatDate(value)); - assert.strictEqual(globalizeDelegator('formatDate', { - optionsOrLocale: options, - value - }), Globalize.formatDate(value, options)); - assert.strictEqual(globalizeDelegator('formatDate', { - locale, - optionsOrLocale: options, - value - }), new Globalize('fr').formatDate(value, options)); + getGlobalize() { + assert.strictEqual(getGlobalize(), Globalize, 'The main globalize object is returned.'); + assert.instanceOf(getGlobalize('fr'), Globalize, 'A Globalize instance is returned.'); + assert.notEqual(getGlobalize('fr'), Globalize, 'The main globalize object is not returned.'); }, - 'assert method that takes a value and a unit'() { - const locale = 'fr'; - const unit = 'week'; - const value = 5; - const options: RelativeTimeFormatterOptions = { form: 'short' }; + globalizeDelegator: { + 'assert method that takes a value'() { + const locale = 'fr'; + const value = new Date(); + const options: DateFormatterOptions = { datetime: 'full' }; - assert.strictEqual(globalizeDelegator('formatRelativeTime', { unit, value }), Globalize.formatRelativeTime(value, unit)); - assert.strictEqual(globalizeDelegator('formatRelativeTime', { - optionsOrLocale: options, - unit, - value - }), Globalize.formatRelativeTime(value, unit, options)); - assert.strictEqual(globalizeDelegator('formatRelativeTime', { - locale, - optionsOrLocale: options, - unit, - value - }), new Globalize('fr').formatRelativeTime(value, unit, options)); - }, + assert.strictEqual(globalizeDelegator('formatDate', { value }), Globalize.formatDate(value)); + assert.strictEqual(globalizeDelegator('formatDate', { + optionsOrLocale: options, + value + }), Globalize.formatDate(value, options)); + assert.strictEqual(globalizeDelegator('formatDate', { + locale, + optionsOrLocale: options, + value + }), new Globalize('fr').formatDate(value, options)); + }, + + 'assert method that takes a value and a unit'() { + const locale = 'fr'; + const unit = 'week'; + const value = 5; + const options: RelativeTimeFormatterOptions = { form: 'short' }; + + assert.strictEqual(globalizeDelegator('formatRelativeTime', { + unit, + value + }), Globalize.formatRelativeTime(value, unit)); + assert.strictEqual(globalizeDelegator('formatRelativeTime', { + optionsOrLocale: options, + unit, + value + }), Globalize.formatRelativeTime(value, unit, options)); + assert.strictEqual(globalizeDelegator('formatRelativeTime', { + locale, + optionsOrLocale: options, + unit, + value + }), new Globalize('fr').formatRelativeTime(value, unit, options)); + }, - 'assert method returns a method'() { - const locale = 'fr'; - const value = new Date(); - const options: DateFormatterOptions = { datetime: 'full' }; + 'assert method returns a method'() { + const locale = 'fr'; + const value = new Date(); + const options: DateFormatterOptions = { datetime: 'full' }; - let formatter = globalizeDelegator('dateFormatter', {}); - assert.strictEqual(formatter(value), Globalize.dateFormatter()(value)); + let formatter = globalizeDelegator('dateFormatter', {}); + assert.strictEqual(formatter(value), Globalize.dateFormatter()(value)); - formatter = globalizeDelegator('dateFormatter', { - optionsOrLocale: options - }); - assert.strictEqual(formatter(value), Globalize.dateFormatter(options)(value)); + formatter = globalizeDelegator('dateFormatter', { + optionsOrLocale: options + }); + assert.strictEqual(formatter(value), Globalize.dateFormatter(options)(value)); - formatter = globalizeDelegator('dateFormatter', { - locale, - optionsOrLocale: options - }); - assert.strictEqual(formatter(value), new Globalize('fr').dateFormatter(options)(value)); + formatter = globalizeDelegator('dateFormatter', { + locale, + optionsOrLocale: options + }); + assert.strictEqual(formatter(value), new Globalize('fr').dateFormatter(options)(value)); + } } } }); diff --git a/tests/unit/util/main.ts b/tests/unit/util/main.ts index 6f5b1cd..32b055f 100644 --- a/tests/unit/util/main.ts +++ b/tests/unit/util/main.ts @@ -1,9 +1,8 @@ -import * as registerSuite from 'intern!object'; -import * as assert from 'intern/chai!assert'; +const { registerSuite } = intern.getInterface('object'); +const { assert } = intern.getPlugin('chai'); import { generateLocales, normalizeLocale, validateLocale } from '../../../src/util/main'; -registerSuite({ - name: 'util/main', +registerSuite('util/main', { generateLocales() { assert.sameMembers(generateLocales('en'), [ 'en' ]); From 311d38b39e93f41f9aed71a9d47c15c0d9ab064e Mon Sep 17 00:00:00 2001 From: Ed Hager Date: Thu, 12 Oct 2017 12:00:37 -0700 Subject: [PATCH 2/6] Update Grunt config to use Intern 4. --- Gruntfile.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Gruntfile.js b/Gruntfile.js index 11ca65e..51888ae 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -4,6 +4,9 @@ module.exports = function (grunt) { options: { ignoreCompilerErrors: true // Remove this once compile errors are resolved } + }, + intern: { + version: 4 } }); }; From 5ffd5adbddeb6646350be329dbf5c876df64a836 Mon Sep 17 00:00:00 2001 From: Ed Hager Date: Thu, 12 Oct 2017 12:01:17 -0700 Subject: [PATCH 3/6] Disable iOS testing on remote services. --- intern.json | 10 +++++----- package-lock.json | 18 +++++++++--------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/intern.json b/intern.json index c2dc46c..4b1b077 100644 --- a/intern.json +++ b/intern.json @@ -45,7 +45,7 @@ "extends": [ "coverage" ], "tunnel": "selenium", "environments+": [ - { "browserName": "safari" } + { "browserName": "chrome" } ] }, "browserstack": { @@ -60,8 +60,9 @@ { "browserName": "edge" }, { "browserName": "firefox", "platform": "WINDOWS" }, { "browserName": "chrome", "platform": "WINDOWS" }, - { "browserName": "safari", "version": "9.1", "platform": "MAC" }, - { "browserName": "iPhone", "version": "9.1" } + { "browserName": "safari", "version": "9.1", "platform": "MAC" } + // BrowserStack uses iOS 9.1 and some of the tests fail. I looks like a missing locale problem + // { "browserName": "iPhone" } ] }, "saucelabs": { @@ -78,8 +79,7 @@ { "browserName": "microsoftedge", "platform": "Windows 10" }, { "browserName": "firefox", "platform": "Windows 10" }, { "browserName": "chrome", "platform": "Windows 10" }, - { "browserName": "safari", "version": "9", "platform": "OS X 10.11" }, - { "browserName": "iphone", "version": "9.3" } + { "browserName": "safari", "version": "9", "platform": "OS X 10.11" } ], "maxConcurrency": 4 } diff --git a/package-lock.json b/package-lock.json index eadb7cc..27b1b4a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2841,9 +2841,9 @@ } }, "grunt-dojo2": { - "version": "2.0.0-beta2.5", - "resolved": "https://registry.npmjs.org/grunt-dojo2/-/grunt-dojo2-2.0.0-beta2.5.tgz", - "integrity": "sha512-+1C10LapI9CpKBucIqsOFdd0XqTLd98UoP7BzAHrT3Yxtzy9yYokhjrLMt2VYxL7xDozbTgk7goTsVu3koKI7g==", + "version": "2.0.0-beta2.7", + "resolved": "https://registry.npmjs.org/grunt-dojo2/-/grunt-dojo2-2.0.0-beta2.7.tgz", + "integrity": "sha512-cLWcCZBX0nXtmxHxT1ymkIImO56SHINio07dTtQEwfL+Ese0J4/iwvyJrUZohw63hioA6jdhpvS1qBNkZ92xNQ==", "dev": true, "requires": { "codecov.io": "0.1.6", @@ -6652,6 +6652,12 @@ "duplexer": "0.1.1" } }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + }, "string-hash": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/string-hash/-/string-hash-1.1.3.tgz", @@ -6691,12 +6697,6 @@ } } }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - }, "stringstream": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", From fda59cd4f9e1c1376403037abdffbb84e7caec08 Mon Sep 17 00:00:00 2001 From: Ed Hager Date: Thu, 12 Oct 2017 13:15:00 -0700 Subject: [PATCH 4/6] Replace deprecated unit test methods. --- package-lock.json | 12 ++++++------ tests/support/util.ts | 5 ++--- tests/unit/cldr/load/webpack.ts | 4 ++-- tests/unit/date.ts | 4 ++-- tests/unit/i18n.ts | 12 ++++++------ tests/unit/number.ts | 4 ++-- tests/unit/unit.ts | 4 ++-- tests/unit/util/globalize.ts | 8 +++++--- 8 files changed, 27 insertions(+), 26 deletions(-) diff --git a/package-lock.json b/package-lock.json index 27b1b4a..d237dc8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6652,12 +6652,6 @@ "duplexer": "0.1.1" } }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - }, "string-hash": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/string-hash/-/string-hash-1.1.3.tgz", @@ -6697,6 +6691,12 @@ } } }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + }, "stringstream": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", diff --git a/tests/support/util.ts b/tests/support/util.ts index fdc960a..b9cd5fa 100644 --- a/tests/support/util.ts +++ b/tests/support/util.ts @@ -1,4 +1,3 @@ -import Promise from '@dojo/shim/Promise'; import loadCldrData, { isLoaded } from '../../src/cldr/load'; /** @@ -23,7 +22,7 @@ export function throwImmediatly() { /** * Load into Globalize.js all CLDR data for the specified locales. */ -export function fetchCldrData(locales: string | string[]): Promise { +export async function fetchCldrData(locales: string | string[]): Promise { locales = Array.isArray(locales) ? locales : [ locales ]; const promises = locales.map((locale: string) => { @@ -49,5 +48,5 @@ export function fetchCldrData(locales: string | string[]): Promise { promises.push(loadCldrData(supplementalPaths)); } - return Promise.all(promises); + await Promise.all(promises); } diff --git a/tests/unit/cldr/load/webpack.ts b/tests/unit/cldr/load/webpack.ts index 5c93f2d..8f755e6 100644 --- a/tests/unit/cldr/load/webpack.ts +++ b/tests/unit/cldr/load/webpack.ts @@ -18,7 +18,7 @@ let cldrData: CldrData | null; registerSuite('cldr/load/webpack', { - setup() { + before() { cldrData = { main: { yue: { @@ -37,7 +37,7 @@ registerSuite('cldr/load/webpack', { reset(); }, - teardown() { + after() { cldrData = null; }, diff --git a/tests/unit/date.ts b/tests/unit/date.ts index 4622b1e..a5cbeb4 100644 --- a/tests/unit/date.ts +++ b/tests/unit/date.ts @@ -109,14 +109,14 @@ function getDateOptions(type: string, timezoneOffset?: number) { registerSuite('date', { - setup() { + before() { // Load the CLDR data for the locales used in the tests ('en' and 'fr'); return fetchCldrData([ 'en', 'fr' ]).then(() => { switchLocale('en'); }); }, - teardown() { + after() { switchLocale(systemLocale); }, diff --git a/tests/unit/i18n.ts b/tests/unit/i18n.ts index 94bb5be..332ed2e 100644 --- a/tests/unit/i18n.ts +++ b/tests/unit/i18n.ts @@ -23,7 +23,7 @@ import partyBundle from '../support/mocks/common/party'; registerSuite('i18n', { - setup() { + before() { // Load the CLDR data for the locales used in the tests ('en' and 'fr'); return fetchCldrData([ 'en', 'fr' ]).then(() => { switchLocale('en'); @@ -58,12 +58,12 @@ registerSuite('i18n', { formatMessage: { 'without CLDR data': { - setup() { + before() { cldrLoad.reset(); }, - teardown() { - return fetchCldrData([ 'en', 'fr' ]); + after() { + return > fetchCldrData([ 'en', 'fr' ]); }, tests: { @@ -195,11 +195,11 @@ registerSuite('i18n', { getMessageFormatter: { 'without CLDR data': { - setup() { + before() { cldrLoad.reset(); }, - teardown() { + after() { return fetchCldrData([ 'en', 'fr' ]); }, diff --git a/tests/unit/number.ts b/tests/unit/number.ts index aa04cd6..50a5dea 100644 --- a/tests/unit/number.ts +++ b/tests/unit/number.ts @@ -14,14 +14,14 @@ import { import { switchLocale, systemLocale } from '../../src/i18n'; registerSuite('number', { - setup() { + before() { // Load the CLDR data for the locales used in the tests ('en' and 'fr'); return fetchCldrData([ 'en', 'fr' ]).then(() => { switchLocale('en'); }); }, - teardown() { + after() { return switchLocale(systemLocale); }, diff --git a/tests/unit/unit.ts b/tests/unit/unit.ts index 86ff220..605bbcb 100644 --- a/tests/unit/unit.ts +++ b/tests/unit/unit.ts @@ -6,14 +6,14 @@ import { getUnitFormatter, formatUnit } from '../../src/unit'; import { switchLocale, systemLocale } from '../../src/i18n'; registerSuite('number units', { - setup() { + before() { // Load the CLDR data for the locales used in the tests ('en' and 'fr'); return fetchCldrData([ 'en', 'fr' ]).then(() => { switchLocale('en'); }); }, - teardown() { + after() { return switchLocale(systemLocale); }, diff --git a/tests/unit/util/globalize.ts b/tests/unit/util/globalize.ts index 9d6d9c6..cad5b47 100644 --- a/tests/unit/util/globalize.ts +++ b/tests/unit/util/globalize.ts @@ -1,6 +1,7 @@ import * as Globalize from 'globalize'; import 'globalize/dist/globalize/date'; import 'globalize/dist/globalize/relative-time'; + const { registerSuite } = intern.getInterface('object'); const { assert } = intern.getPlugin('chai'); import { fetchCldrData } from '../../support/util'; @@ -10,13 +11,14 @@ import getGlobalize, { globalizeDelegator } from '../../../src/util/globalize'; registerSuite('util/globalize', { - setup() {return fetchCldrData([ 'en', 'fr' ]).then(() => { - switchLocale('en'); + before() { + return fetchCldrData([ 'en', 'fr' ]).then(() => { + switchLocale('en'); switchLocale('en'); }); }, - teardown() { + after() { switchLocale(systemLocale); }, From 764e456bfe813340c12c14fafaa00caf0bdb3005 Mon Sep 17 00:00:00 2001 From: Ed Hager Date: Fri, 13 Oct 2017 08:43:52 -0700 Subject: [PATCH 5/6] Update to Intern 4.0.2. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e7a5c0e..4fe3a1e 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "cldr-data": "~31.0.2", "grunt": "^1.0.1", "grunt-dojo2": "latest", - "intern": "^4.0.0", + "intern": "^4.0.2", "sinon": "^1.17.6", "typescript": "~2.4.1" } From ed8d5567e4da491075b229ebf7dca5bfc677e635 Mon Sep 17 00:00:00 2001 From: Ed Hager Date: Fri, 13 Oct 2017 16:21:18 -0700 Subject: [PATCH 6/6] Update Travis config for Intern 4. --- .travis.yml | 4 +-- package-lock.json | 78 ++++++++++++++++++++++++++++++++++------------- 2 files changed, 58 insertions(+), 24 deletions(-) diff --git a/.travis.yml b/.travis.yml index af39542..f4b88a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,9 +17,7 @@ install: - travis_retry npm install script: - grunt -- grunt intern:node --combined -- grunt intern:saucelabs --combined -- grunt remapIstanbul:ci +- grunt intern:saucelabs - grunt uploadCoverage - grunt doc notifications: diff --git a/package-lock.json b/package-lock.json index d237dc8..f4411b7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,18 +4,6 @@ "lockfileVersion": 1, "requires": true, "dependencies": { - "@dojo/core": { - "version": "2.0.0-beta2.4", - "resolved": "https://registry.npmjs.org/@dojo/core/-/core-2.0.0-beta2.4.tgz", - "integrity": "sha1-AjZimDJ2QxZrtUITk2hJW1CLzBQ=", - "dev": true - }, - "@dojo/has": { - "version": "2.0.0-beta2.3", - "resolved": "https://registry.npmjs.org/@dojo/has/-/has-2.0.0-beta2.3.tgz", - "integrity": "sha1-faojdQXj7KN2EG1zmMTH3tg2oOE=", - "dev": true - }, "@dojo/interfaces": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/@dojo/interfaces/-/interfaces-0.1.0.tgz", @@ -28,12 +16,6 @@ "integrity": "sha512-3qoMKkewhIUqV99JzGiAkXdJuT3HUQkSviYut9828Cv4uKOqKqnb6znE8ofZhaAuv25ZU9anHTPiC8fepONfVQ==", "dev": true }, - "@dojo/shim": { - "version": "2.0.0-beta2.4", - "resolved": "https://registry.npmjs.org/@dojo/shim/-/shim-2.0.0-beta2.4.tgz", - "integrity": "sha1-TUjz2MMmxF5k3TRq+tAK61gmPZo=", - "dev": true - }, "@theintern/digdug": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@theintern/digdug/-/digdug-2.0.0.tgz", @@ -48,12 +30,30 @@ "semver": "5.4.1" }, "dependencies": { + "@dojo/core": { + "version": "2.0.0-beta2.4", + "resolved": "https://registry.npmjs.org/@dojo/core/-/core-2.0.0-beta2.4.tgz", + "integrity": "sha1-AjZimDJ2QxZrtUITk2hJW1CLzBQ=", + "dev": true + }, + "@dojo/has": { + "version": "2.0.0-beta2.3", + "resolved": "https://registry.npmjs.org/@dojo/has/-/has-2.0.0-beta2.3.tgz", + "integrity": "sha1-faojdQXj7KN2EG1zmMTH3tg2oOE=", + "dev": true + }, "@dojo/interfaces": { "version": "2.0.0-beta2.4", "resolved": "https://registry.npmjs.org/@dojo/interfaces/-/interfaces-2.0.0-beta2.4.tgz", "integrity": "sha1-OGXj9EQJMuCNJNJPgj5UFwaiKNM=", "dev": true }, + "@dojo/shim": { + "version": "2.0.0-beta2.4", + "resolved": "https://registry.npmjs.org/@dojo/shim/-/shim-2.0.0-beta2.4.tgz", + "integrity": "sha1-TUjz2MMmxF5k3TRq+tAK61gmPZo=", + "dev": true + }, "semver": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", @@ -77,11 +77,29 @@ "tslib": "1.7.1" }, "dependencies": { + "@dojo/core": { + "version": "2.0.0-beta2.4", + "resolved": "https://registry.npmjs.org/@dojo/core/-/core-2.0.0-beta2.4.tgz", + "integrity": "sha1-AjZimDJ2QxZrtUITk2hJW1CLzBQ=", + "dev": true + }, + "@dojo/has": { + "version": "2.0.0-beta2.3", + "resolved": "https://registry.npmjs.org/@dojo/has/-/has-2.0.0-beta2.3.tgz", + "integrity": "sha1-faojdQXj7KN2EG1zmMTH3tg2oOE=", + "dev": true + }, "@dojo/interfaces": { "version": "2.0.0-beta2.4", "resolved": "https://registry.npmjs.org/@dojo/interfaces/-/interfaces-2.0.0-beta2.4.tgz", "integrity": "sha1-OGXj9EQJMuCNJNJPgj5UFwaiKNM=", "dev": true + }, + "@dojo/shim": { + "version": "2.0.0-beta2.4", + "resolved": "https://registry.npmjs.org/@dojo/shim/-/shim-2.0.0-beta2.4.tgz", + "integrity": "sha1-TUjz2MMmxF5k3TRq+tAK61gmPZo=", + "dev": true } } }, @@ -3363,9 +3381,9 @@ "dev": true }, "intern": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/intern/-/intern-4.0.1.tgz", - "integrity": "sha512-fI7p7l8NHDAhptkH5NFgpZNsamUx+n8xB4vrWNePRXVrAHoWK9JkTMVFet8NDUavdIrklYfgxWDFXa4sbvZB9w==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/intern/-/intern-4.0.2.tgz", + "integrity": "sha512-tq18nBU51DT36E2+jVD6T2LdfpJ2uydT/hLtbf92qUgSgj5pTOgvQWOUwiWmJ1Wc/Mz8bYTOk9YCDPFC8+6J2g==", "dev": true, "requires": { "@dojo/core": "2.0.0-beta2.4", @@ -3419,12 +3437,30 @@ "ws": "2.3.1" }, "dependencies": { + "@dojo/core": { + "version": "2.0.0-beta2.4", + "resolved": "https://registry.npmjs.org/@dojo/core/-/core-2.0.0-beta2.4.tgz", + "integrity": "sha1-AjZimDJ2QxZrtUITk2hJW1CLzBQ=", + "dev": true + }, + "@dojo/has": { + "version": "2.0.0-beta2.3", + "resolved": "https://registry.npmjs.org/@dojo/has/-/has-2.0.0-beta2.3.tgz", + "integrity": "sha1-faojdQXj7KN2EG1zmMTH3tg2oOE=", + "dev": true + }, "@dojo/interfaces": { "version": "2.0.0-beta2.4", "resolved": "https://registry.npmjs.org/@dojo/interfaces/-/interfaces-2.0.0-beta2.4.tgz", "integrity": "sha1-OGXj9EQJMuCNJNJPgj5UFwaiKNM=", "dev": true }, + "@dojo/shim": { + "version": "2.0.0-beta2.4", + "resolved": "https://registry.npmjs.org/@dojo/shim/-/shim-2.0.0-beta2.4.tgz", + "integrity": "sha1-TUjz2MMmxF5k3TRq+tAK61gmPZo=", + "dev": true + }, "@types/chai": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.0.4.tgz",