From 5bbbab71837e5c1f3e07a25e6dd62ac3c1160869 Mon Sep 17 00:00:00 2001 From: Cristiano Rastelli Date: Tue, 2 Oct 2018 00:38:36 +0100 Subject: [PATCH] Jest testing (#133) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * moved all the existing tests to Jest * finalised Jest tests for “utils” removing assert dependency * finalised Jest tests for “register” removing assert dependency + moved tests under correct folder * finalised Jest tests for “transform” removing assert dependency + moved tests under correct folder + removed extra file * updated path for “service” files/folders * removed output folder * updated the paths to ignore in the Jest config in package.json * finalised Jest tests for “clean” removing assert dependency + other small changes * added “__output” to the list of folders ignored by Jest * some tunings + more tests * more tests cleanup * fixed test for exportPlatform * fixed last tests, and now all tests are green! * Added first snapshot tests! Yay! * added mock for dates to avoid failing snapshots tests * updated tests * first attempt to fix the UTC date problem on CI (reference: https://github.com/boblauer/MockDate/issues/9) * second attempt to fix the UTC date problem on CI * removed the TZ=UTC env environment to test if is really needed * updated all the occurrences of new Date in the templates * restored linting before running the tests suite * code style fix * fixed wrong porting of the test for buildAllPlatforms --- .../__assets}/images/hdpi/flag_us_base.png | Bin .../__assets}/images/hdpi/flag_us_small.png | Bin .../__assets}/images/mdpi/flag_us_base.png | Bin .../__assets}/images/mdpi/flag_us_small.png | Bin .../__assets}/images/xhdpi/flag_us_base.png | Bin .../__assets}/images/xhdpi/flag_us_small.png | Bin .../__assets}/images/xxhdpi/flag_us_base.png | Bin .../__assets}/images/xxhdpi/flag_us_small.png | Bin .../__configs}/include.json | 0 {test/configs => __tests__/__configs}/test.js | 0 .../configs => __tests__/__configs}/test.json | 12 +- test/helpers.js => __tests__/__helpers.js | 2 +- .../__json_files}/array.json | 0 .../__json_files}/broken/broken.json | 0 .../__json_files}/circular.json | 0 .../__json_files}/circular_2.json | 0 .../__json_files}/circular_3.json | 0 .../__json_files}/circular_4.json | 0 .../__json_files}/module_exports_object.js | 0 .../multiple_reference_errors.json | 0 .../__json_files}/nested_pointers.json | 0 .../__json_files}/nested_pointers_2.json | 0 .../__json_files}/nested_pointers_3.json | 0 .../__json_files}/nested_pointers_4.json | 0 .../__json_files}/nested_references.json | 0 .../__json_files}/no_reference.json | 0 .../__json_files}/non_existent.json | 0 .../__json_files}/reference_type.json | 0 .../__json_files}/shallow/1.json | 0 .../__json_files}/shallow/2.json | 0 .../__json_files}/simple.json | 0 .../__json_files}/test/directory.json | 0 .../__properties}/borders.json | 0 .../__properties}/colors.json | 0 .../__properties}/comment.json | 0 __tests__/__properties/font.json | 9 + .../__properties}/font_sizes.json | 0 .../__properties}/icons.json | 0 __tests__/__properties/images/flags/us.json | 22 + .../__properties}/nonPropertyNode.json | 0 .../__properties}/nonString.json | 0 .../__properties}/paddings.json | 0 __tests__/buildAllPlatforms.test.js | 40 + __tests__/buildFile.test.js | 59 + .../buildFiles.test.js | 66 +- __tests__/buildPlatform.test.js | 172 ++ .../cleanAction.test.js | 47 +- __tests__/cleanAllPlatforms.test.js | 36 + __tests__/cleanDir.test.js | 41 + .../cleanDirs.test.js | 34 +- .../cleanFile.test.js | 25 +- .../cleanFiles.test.js | 28 +- __tests__/cleanPlatform.test.js | 54 + __tests__/cliBuild.test.js | 38 + __tests__/common/transforms.test.js | 441 ++++ __tests__/exportPlatform.test.js | 79 + __tests__/extend.test.js | 146 ++ .../filterProperties.test.js | 57 +- .../formats/__snapshots__/all.test.js.snap | 136 ++ .../all.js => __tests__/formats/all.test.js | 34 +- .../formats/es6Constants.test.js | 21 +- .../formats/javascriptModule.test.js | 29 +- .../formats/javascriptObject.test.js | 14 +- .../formats/javascriptUmd.test.js | 29 +- .../json.js => __tests__/formats/json.test.js | 29 +- .../formats/lessIcons.test.js | 20 +- .../formats/lessVariables.test.js | 19 +- .../formats/scssIcons.test.js | 18 +- .../formats/scssVariables.test.js | 17 +- .../performAction.test.js | 48 +- __tests__/register/action.test.js | 108 + __tests__/register/format.test.js | 99 + __tests__/register/transform.test.js | 88 + __tests__/register/transformGroup.test.js | 109 + .../transform/property.test.js | 21 +- __tests__/transform/propertySetup.test.js | 93 + __tests__/utils/combineJSON.test.js | 72 + __tests__/utils/convertToBase64.test.js | 40 + __tests__/utils/deepExtend.test.js | 78 + __tests__/utils/resolveObject.test.js | 249 +++ .../__tests__/index.android.js | 12 - .../__tests__/index.ios.js | 12 - lib/common/templates/android/colors.template | 2 +- lib/common/templates/android/dimens.template | 2 +- .../templates/android/fontDimens.template | 2 +- .../templates/android/integers.template | 2 +- lib/common/templates/android/strings.template | 2 +- package.json | 22 +- test/buildAllPlatforms.js | 36 - test/buildFile.js | 67 - test/buildPlatform.js | 176 -- test/cleanAllPlatforms.js | 33 - test/cleanDir.js | 36 - test/cleanPlatform.js | 51 - test/cliBuild.js | 34 - test/exportPlatform.js | 94 - test/extend.js | 165 -- test/index.js | 19 - test/properties/font.json | 9 - test/properties/images/flags/us.json | 22 - test/propertySetup.js | 96 - test/registerAction.js | 125 -- test/registerFormat.js | 113 - test/registerTransform.js | 95 - test/registerTransformGroup.js | 131 -- test/transforms.js | 439 ---- test/utils/combineJSON.js | 74 - test/utils/convertToBase64.js | 47 - test/utils/deepExtend.js | 78 - test/utils/resolveObject.js | 296 --- yarn.lock | 1811 ++++++++++++++++- 111 files changed, 4329 insertions(+), 2553 deletions(-) rename {test/assets => __tests__/__assets}/images/hdpi/flag_us_base.png (100%) rename {test/assets => __tests__/__assets}/images/hdpi/flag_us_small.png (100%) rename {test/assets => __tests__/__assets}/images/mdpi/flag_us_base.png (100%) rename {test/assets => __tests__/__assets}/images/mdpi/flag_us_small.png (100%) rename {test/assets => __tests__/__assets}/images/xhdpi/flag_us_base.png (100%) rename {test/assets => __tests__/__assets}/images/xhdpi/flag_us_small.png (100%) rename {test/assets => __tests__/__assets}/images/xxhdpi/flag_us_base.png (100%) rename {test/assets => __tests__/__assets}/images/xxhdpi/flag_us_small.png (100%) rename {test/configs => __tests__/__configs}/include.json (100%) rename {test/configs => __tests__/__configs}/test.js (100%) rename {test/configs => __tests__/__configs}/test.json (85%) rename test/helpers.js => __tests__/__helpers.js (96%) rename {test/json_files => __tests__/__json_files}/array.json (100%) rename {test/json_files => __tests__/__json_files}/broken/broken.json (100%) rename {test/json_files => __tests__/__json_files}/circular.json (100%) rename {test/json_files => __tests__/__json_files}/circular_2.json (100%) rename {test/json_files => __tests__/__json_files}/circular_3.json (100%) rename {test/json_files => __tests__/__json_files}/circular_4.json (100%) rename {test/json_files => __tests__/__json_files}/module_exports_object.js (100%) rename {test/json_files => __tests__/__json_files}/multiple_reference_errors.json (100%) rename {test/json_files => __tests__/__json_files}/nested_pointers.json (100%) rename {test/json_files => __tests__/__json_files}/nested_pointers_2.json (100%) rename {test/json_files => __tests__/__json_files}/nested_pointers_3.json (100%) rename {test/json_files => __tests__/__json_files}/nested_pointers_4.json (100%) rename {test/json_files => __tests__/__json_files}/nested_references.json (100%) rename {test/json_files => __tests__/__json_files}/no_reference.json (100%) rename {test/json_files => __tests__/__json_files}/non_existent.json (100%) rename {test/json_files => __tests__/__json_files}/reference_type.json (100%) rename {test/json_files => __tests__/__json_files}/shallow/1.json (100%) rename {test/json_files => __tests__/__json_files}/shallow/2.json (100%) rename {test/json_files => __tests__/__json_files}/simple.json (100%) rename {test/json_files => __tests__/__json_files}/test/directory.json (100%) rename {test/properties => __tests__/__properties}/borders.json (100%) rename {test/properties => __tests__/__properties}/colors.json (100%) rename {test/properties => __tests__/__properties}/comment.json (100%) create mode 100644 __tests__/__properties/font.json rename {test/properties => __tests__/__properties}/font_sizes.json (100%) rename {test/properties => __tests__/__properties}/icons.json (100%) create mode 100644 __tests__/__properties/images/flags/us.json rename {test/properties => __tests__/__properties}/nonPropertyNode.json (100%) rename {test/properties => __tests__/__properties}/nonString.json (100%) rename {test/properties => __tests__/__properties}/paddings.json (100%) create mode 100644 __tests__/buildAllPlatforms.test.js create mode 100644 __tests__/buildFile.test.js rename test/buildFiles.js => __tests__/buildFiles.test.js (59%) create mode 100644 __tests__/buildPlatform.test.js rename test/cleanAction.js => __tests__/cleanAction.test.js (52%) create mode 100644 __tests__/cleanAllPlatforms.test.js create mode 100644 __tests__/cleanDir.test.js rename test/cleanDirs.js => __tests__/cleanDirs.test.js (59%) rename test/cleanFile.js => __tests__/cleanFile.test.js (56%) rename test/cleanFiles.js => __tests__/cleanFiles.test.js (67%) create mode 100644 __tests__/cleanPlatform.test.js create mode 100644 __tests__/cliBuild.test.js create mode 100644 __tests__/common/transforms.test.js create mode 100644 __tests__/exportPlatform.test.js create mode 100644 __tests__/extend.test.js rename test/filterProperties.js => __tests__/filterProperties.test.js (57%) create mode 100644 __tests__/formats/__snapshots__/all.test.js.snap rename test/formats/all.js => __tests__/formats/all.test.js (56%) rename test/formats/es6Constants.js => __tests__/formats/es6Constants.test.js (79%) rename test/formats/javascriptModule.js => __tests__/formats/javascriptModule.test.js (62%) rename test/formats/javascriptObject.js => __tests__/formats/javascriptObject.test.js (80%) rename test/formats/javascriptUmd.js => __tests__/formats/javascriptUmd.test.js (62%) rename test/formats/json.js => __tests__/formats/json.test.js (59%) rename test/formats/lessIcons.js => __tests__/formats/lessIcons.test.js (78%) rename test/formats/lessVariables.js => __tests__/formats/lessVariables.test.js (78%) rename test/formats/scssIcons.js => __tests__/formats/scssIcons.test.js (80%) rename test/formats/scssVariables.js => __tests__/formats/scssVariables.test.js (80%) rename test/performAction.js => __tests__/performAction.test.js (52%) create mode 100644 __tests__/register/action.test.js create mode 100644 __tests__/register/format.test.js create mode 100644 __tests__/register/transform.test.js create mode 100644 __tests__/register/transformGroup.test.js rename test/property.js => __tests__/transform/property.test.js (73%) create mode 100644 __tests__/transform/propertySetup.test.js create mode 100644 __tests__/utils/combineJSON.test.js create mode 100644 __tests__/utils/convertToBase64.test.js create mode 100644 __tests__/utils/deepExtend.test.js create mode 100644 __tests__/utils/resolveObject.test.js delete mode 100644 example/react/native/StyleDictionaryExample/__tests__/index.android.js delete mode 100644 example/react/native/StyleDictionaryExample/__tests__/index.ios.js delete mode 100644 test/buildAllPlatforms.js delete mode 100644 test/buildFile.js delete mode 100644 test/buildPlatform.js delete mode 100644 test/cleanAllPlatforms.js delete mode 100644 test/cleanDir.js delete mode 100644 test/cleanPlatform.js delete mode 100644 test/cliBuild.js delete mode 100644 test/exportPlatform.js delete mode 100644 test/extend.js delete mode 100644 test/index.js delete mode 100644 test/properties/font.json delete mode 100644 test/properties/images/flags/us.json delete mode 100644 test/propertySetup.js delete mode 100644 test/registerAction.js delete mode 100644 test/registerFormat.js delete mode 100644 test/registerTransform.js delete mode 100644 test/registerTransformGroup.js delete mode 100644 test/transforms.js delete mode 100644 test/utils/combineJSON.js delete mode 100644 test/utils/convertToBase64.js delete mode 100644 test/utils/deepExtend.js delete mode 100644 test/utils/resolveObject.js diff --git a/test/assets/images/hdpi/flag_us_base.png b/__tests__/__assets/images/hdpi/flag_us_base.png similarity index 100% rename from test/assets/images/hdpi/flag_us_base.png rename to __tests__/__assets/images/hdpi/flag_us_base.png diff --git a/test/assets/images/hdpi/flag_us_small.png b/__tests__/__assets/images/hdpi/flag_us_small.png similarity index 100% rename from test/assets/images/hdpi/flag_us_small.png rename to __tests__/__assets/images/hdpi/flag_us_small.png diff --git a/test/assets/images/mdpi/flag_us_base.png b/__tests__/__assets/images/mdpi/flag_us_base.png similarity index 100% rename from test/assets/images/mdpi/flag_us_base.png rename to __tests__/__assets/images/mdpi/flag_us_base.png diff --git a/test/assets/images/mdpi/flag_us_small.png b/__tests__/__assets/images/mdpi/flag_us_small.png similarity index 100% rename from test/assets/images/mdpi/flag_us_small.png rename to __tests__/__assets/images/mdpi/flag_us_small.png diff --git a/test/assets/images/xhdpi/flag_us_base.png b/__tests__/__assets/images/xhdpi/flag_us_base.png similarity index 100% rename from test/assets/images/xhdpi/flag_us_base.png rename to __tests__/__assets/images/xhdpi/flag_us_base.png diff --git a/test/assets/images/xhdpi/flag_us_small.png b/__tests__/__assets/images/xhdpi/flag_us_small.png similarity index 100% rename from test/assets/images/xhdpi/flag_us_small.png rename to __tests__/__assets/images/xhdpi/flag_us_small.png diff --git a/test/assets/images/xxhdpi/flag_us_base.png b/__tests__/__assets/images/xxhdpi/flag_us_base.png similarity index 100% rename from test/assets/images/xxhdpi/flag_us_base.png rename to __tests__/__assets/images/xxhdpi/flag_us_base.png diff --git a/test/assets/images/xxhdpi/flag_us_small.png b/__tests__/__assets/images/xxhdpi/flag_us_small.png similarity index 100% rename from test/assets/images/xxhdpi/flag_us_small.png rename to __tests__/__assets/images/xxhdpi/flag_us_small.png diff --git a/test/configs/include.json b/__tests__/__configs/include.json similarity index 100% rename from test/configs/include.json rename to __tests__/__configs/include.json diff --git a/test/configs/test.js b/__tests__/__configs/test.js similarity index 100% rename from test/configs/test.js rename to __tests__/__configs/test.js diff --git a/test/configs/test.json b/__tests__/__configs/test.json similarity index 85% rename from test/configs/test.json rename to __tests__/__configs/test.json index b3ce43d8f..f8cde2eeb 100644 --- a/test/configs/test.json +++ b/__tests__/__configs/test.json @@ -1,10 +1,10 @@ { - "source": ["test/properties/**/*.json"], + "source": ["__tests__/__properties/**/*.json"], "platforms": { "web": { "transformGroup": "web", "prefix": "smop", - "buildPath": "test/output/web/", + "buildPath": "__tests__/__output/web/", "files": [ { "destination": "_icons.css", @@ -21,7 +21,7 @@ "scss": { "transformGroup": "scss", "prefix": "smop", - "buildPath": "test/output/scss/", + "buildPath": "__tests__/__output/scss/", "files": [ { "destination": "_icons.scss", @@ -35,7 +35,7 @@ "less": { "transformGroup": "less", "prefix": "smop", - "buildPath": "test/output/less/", + "buildPath": "__tests__/__output/less/", "files": [ { "destination": "_icons.less", @@ -48,7 +48,7 @@ }, "android": { "transformGroup": "android", - "buildPath": "test/output/", + "buildPath": "__tests__/__output/", "files": [ { "destination": "android/colors.xml", @@ -67,7 +67,7 @@ }, "ios": { "transformGroup": "ios", - "buildPath": "test/output/ios/", + "buildPath": "__tests__/__output/ios/", "files": [ { "destination": "style_dictionary.plist", diff --git a/test/helpers.js b/__tests__/__helpers.js similarity index 96% rename from test/helpers.js rename to __tests__/__helpers.js index 307d7d8bd..8b3f6a12f 100644 --- a/test/helpers.js +++ b/__tests__/__helpers.js @@ -15,7 +15,7 @@ var fs = require('fs-extra'); module.exports = { clearOutput: function() { - fs.emptyDirSync('test/output'); + fs.emptyDirSync('__tests__/__output'); }, fileToJSON: function(path) { diff --git a/test/json_files/array.json b/__tests__/__json_files/array.json similarity index 100% rename from test/json_files/array.json rename to __tests__/__json_files/array.json diff --git a/test/json_files/broken/broken.json b/__tests__/__json_files/broken/broken.json similarity index 100% rename from test/json_files/broken/broken.json rename to __tests__/__json_files/broken/broken.json diff --git a/test/json_files/circular.json b/__tests__/__json_files/circular.json similarity index 100% rename from test/json_files/circular.json rename to __tests__/__json_files/circular.json diff --git a/test/json_files/circular_2.json b/__tests__/__json_files/circular_2.json similarity index 100% rename from test/json_files/circular_2.json rename to __tests__/__json_files/circular_2.json diff --git a/test/json_files/circular_3.json b/__tests__/__json_files/circular_3.json similarity index 100% rename from test/json_files/circular_3.json rename to __tests__/__json_files/circular_3.json diff --git a/test/json_files/circular_4.json b/__tests__/__json_files/circular_4.json similarity index 100% rename from test/json_files/circular_4.json rename to __tests__/__json_files/circular_4.json diff --git a/test/json_files/module_exports_object.js b/__tests__/__json_files/module_exports_object.js similarity index 100% rename from test/json_files/module_exports_object.js rename to __tests__/__json_files/module_exports_object.js diff --git a/test/json_files/multiple_reference_errors.json b/__tests__/__json_files/multiple_reference_errors.json similarity index 100% rename from test/json_files/multiple_reference_errors.json rename to __tests__/__json_files/multiple_reference_errors.json diff --git a/test/json_files/nested_pointers.json b/__tests__/__json_files/nested_pointers.json similarity index 100% rename from test/json_files/nested_pointers.json rename to __tests__/__json_files/nested_pointers.json diff --git a/test/json_files/nested_pointers_2.json b/__tests__/__json_files/nested_pointers_2.json similarity index 100% rename from test/json_files/nested_pointers_2.json rename to __tests__/__json_files/nested_pointers_2.json diff --git a/test/json_files/nested_pointers_3.json b/__tests__/__json_files/nested_pointers_3.json similarity index 100% rename from test/json_files/nested_pointers_3.json rename to __tests__/__json_files/nested_pointers_3.json diff --git a/test/json_files/nested_pointers_4.json b/__tests__/__json_files/nested_pointers_4.json similarity index 100% rename from test/json_files/nested_pointers_4.json rename to __tests__/__json_files/nested_pointers_4.json diff --git a/test/json_files/nested_references.json b/__tests__/__json_files/nested_references.json similarity index 100% rename from test/json_files/nested_references.json rename to __tests__/__json_files/nested_references.json diff --git a/test/json_files/no_reference.json b/__tests__/__json_files/no_reference.json similarity index 100% rename from test/json_files/no_reference.json rename to __tests__/__json_files/no_reference.json diff --git a/test/json_files/non_existent.json b/__tests__/__json_files/non_existent.json similarity index 100% rename from test/json_files/non_existent.json rename to __tests__/__json_files/non_existent.json diff --git a/test/json_files/reference_type.json b/__tests__/__json_files/reference_type.json similarity index 100% rename from test/json_files/reference_type.json rename to __tests__/__json_files/reference_type.json diff --git a/test/json_files/shallow/1.json b/__tests__/__json_files/shallow/1.json similarity index 100% rename from test/json_files/shallow/1.json rename to __tests__/__json_files/shallow/1.json diff --git a/test/json_files/shallow/2.json b/__tests__/__json_files/shallow/2.json similarity index 100% rename from test/json_files/shallow/2.json rename to __tests__/__json_files/shallow/2.json diff --git a/test/json_files/simple.json b/__tests__/__json_files/simple.json similarity index 100% rename from test/json_files/simple.json rename to __tests__/__json_files/simple.json diff --git a/test/json_files/test/directory.json b/__tests__/__json_files/test/directory.json similarity index 100% rename from test/json_files/test/directory.json rename to __tests__/__json_files/test/directory.json diff --git a/test/properties/borders.json b/__tests__/__properties/borders.json similarity index 100% rename from test/properties/borders.json rename to __tests__/__properties/borders.json diff --git a/test/properties/colors.json b/__tests__/__properties/colors.json similarity index 100% rename from test/properties/colors.json rename to __tests__/__properties/colors.json diff --git a/test/properties/comment.json b/__tests__/__properties/comment.json similarity index 100% rename from test/properties/comment.json rename to __tests__/__properties/comment.json diff --git a/__tests__/__properties/font.json b/__tests__/__properties/font.json new file mode 100644 index 000000000..3a961ac39 --- /dev/null +++ b/__tests__/__properties/font.json @@ -0,0 +1,9 @@ +{ + "asset": { + "font": { + "icon": { + "value": "./test/__assets/fonts/scapp_icons-regular.ttf" + } + } + } +} \ No newline at end of file diff --git a/test/properties/font_sizes.json b/__tests__/__properties/font_sizes.json similarity index 100% rename from test/properties/font_sizes.json rename to __tests__/__properties/font_sizes.json diff --git a/test/properties/icons.json b/__tests__/__properties/icons.json similarity index 100% rename from test/properties/icons.json rename to __tests__/__properties/icons.json diff --git a/__tests__/__properties/images/flags/us.json b/__tests__/__properties/images/flags/us.json new file mode 100644 index 000000000..b6fa75b75 --- /dev/null +++ b/__tests__/__properties/images/flags/us.json @@ -0,0 +1,22 @@ +{ + "asset": { + "image": { + "flag": { + "us": { + "mdpi": { + "value": "__tests__/__assets/images/mdpi/flag_us_base.png" + }, + "hdpi": { + "value": "__tests__/__assets/images/hdpi/flag_us_base.png" + }, + "xhdpi": { + "value": "__tests__/__assets/images/xhdpi/flag_us_base.png" + }, + "xxhdpi": { + "value": "__tests__/__assets/images/xxhdpi/flag_us_base.png" + } + } + } + } + } +} \ No newline at end of file diff --git a/test/properties/nonPropertyNode.json b/__tests__/__properties/nonPropertyNode.json similarity index 100% rename from test/properties/nonPropertyNode.json rename to __tests__/__properties/nonPropertyNode.json diff --git a/test/properties/nonString.json b/__tests__/__properties/nonString.json similarity index 100% rename from test/properties/nonString.json rename to __tests__/__properties/nonString.json diff --git a/test/properties/paddings.json b/__tests__/__properties/paddings.json similarity index 100% rename from test/properties/paddings.json rename to __tests__/__properties/paddings.json diff --git a/__tests__/buildAllPlatforms.test.js b/__tests__/buildAllPlatforms.test.js new file mode 100644 index 000000000..81f53d7c3 --- /dev/null +++ b/__tests__/buildAllPlatforms.test.js @@ -0,0 +1,40 @@ +/* + * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with + * the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +var helpers = require('./__helpers'); +var StyleDictionary = require('../index'); + +describe('buildAllPlatforms', () => { + + beforeEach(() => { + helpers.clearOutput(); + }); + + afterEach(() => { + helpers.clearOutput(); + }); + + it('should work with json config', () => { + var StyleDictionaryExtended = StyleDictionary.extend(__dirname + '/__configs/test.json'); + StyleDictionaryExtended.buildAllPlatforms(); + expect(helpers.fileExists('./__tests__/__output/web/_icons.css')).toBeTruthy(); + expect(helpers.fileExists('./__tests__/__output/android/colors.xml')).toBeTruthy(); + }); + + it('should work with js config', () => { + var StyleDictionaryExtended = StyleDictionary.extend(__dirname + '/__configs/test.js'); + StyleDictionaryExtended.buildAllPlatforms(); + expect(helpers.fileExists('./__tests__/__output/web/_icons.css')).toBeTruthy(); + expect(helpers.fileExists('./__tests__/__output/android/colors.xml')).toBeTruthy(); + }); +}); diff --git a/__tests__/buildFile.test.js b/__tests__/buildFile.test.js new file mode 100644 index 000000000..8e742d222 --- /dev/null +++ b/__tests__/buildFile.test.js @@ -0,0 +1,59 @@ +/* + * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with + * the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +var buildFile = require('../lib/buildFile'); +var helpers = require('./__helpers'); + +function format() { + return "hi"; +} + +describe('buildFile', () => { + + beforeEach(() => { + helpers.clearOutput(); + }); + + afterEach(() => { + helpers.clearOutput(); + }); + + it('should error if format doesnt exist or isnt a function', () => { + expect( + buildFile.bind(null, '__tests__/__output/test.txt', {}, {}, {}) + ).toThrow('Please enter a valid file format'); + expect( + buildFile.bind(null, '__tests__/__output/test.txt', [], {}, {}) + ).toThrow('Please enter a valid file format'); + expect( + buildFile.bind(null, '__tests__/__output/test.txt', null, {}, {}) + ).toThrow('Please enter a valid file format'); + }); + + it('should error if destination doesnt exist or isnt a string', () => { + expect( + buildFile.bind(null, {}, format, {}, {}) + ).toThrow('Please enter a valid destination'); + expect( + buildFile.bind(null, [], format, {}, {}) + ).toThrow('Please enter a valid destination'); + expect( + buildFile.bind(null, null, format, {}, {}) + ).toThrow('Please enter a valid destination'); + }); + + it('should write to a file properly', () => { + buildFile('test.txt', format, {buildPath: '__tests__/__output/'}, {}); + expect(helpers.fileExists('./__tests__/__output/test.txt')).toBeTruthy(); + }); +}); diff --git a/test/buildFiles.js b/__tests__/buildFiles.test.js similarity index 59% rename from test/buildFiles.js rename to __tests__/buildFiles.test.js index ec1987e2e..2e4e972d4 100644 --- a/test/buildFiles.js +++ b/__tests__/buildFiles.test.js @@ -11,10 +11,9 @@ * and limitations under the License. */ -var assert = require('chai').assert, - expect = require('chai').expect, - helpers = require('./helpers'), - buildFiles = require('../lib/buildFiles'); +var buildFiles = require('../lib/buildFiles'); +var helpers = require('./__helpers'); +var _ = require('lodash'); var dictionary = { properties: { @@ -26,7 +25,7 @@ var dictionary = { var platform = { files: [ { - destination: 'test/output/test.json', + destination: '__tests__/__output/test.json', format: function(dictionary) { return JSON.stringify(dictionary.properties) } @@ -35,7 +34,7 @@ var platform = { }; var platformWithBuildPath = { - buildPath: 'test/output/', + buildPath: '__tests__/__output/', files: [ { destination: 'test.json', @@ -47,7 +46,7 @@ var platformWithBuildPath = { }; var platformWithFilter = { - buildPath: 'test/output/', + buildPath: '__tests__/__output/', files: [ { destination: 'test.json', @@ -62,7 +61,7 @@ var platformWithFilter = { }; var platformWithoutFormatter = { - buildPath: 'test/output/', + buildPath: '__tests__/__output/', files: [ { destination: 'test.json', @@ -71,7 +70,7 @@ var platformWithoutFormatter = { }; var platformWithBadBuildPath = { - buildPath: 'test/output', + buildPath: '__tests__/__output', files: [ { destination: 'test.json', @@ -82,42 +81,47 @@ var platformWithBadBuildPath = { ] }; -describe('buildFiles', function() { - beforeEach(function() { +describe('buildFiles', () => { + + beforeEach(() => { helpers.clearOutput(); }); - it('should throw if build path doesn\'t have a trailing slash', function() { - assert.throws( + afterEach(() => { + helpers.clearOutput(); + }); + + it('should throw if build path doesn\'t have a trailing slash', () => { + expect( buildFiles.bind(null, dictionary, platformWithBadBuildPath), - Error, - 'Build path must end in a trailing slash or you will get weird file names.' - ); + ).toThrow('Build path must end in a trailing slash or you will get weird file names.'); }); - it('should throw if template or formatter missing', function() { - assert.throws( + it('should throw if template or formatter missing', () => { + expect( buildFiles.bind(null, dictionary, platformWithoutFormatter), - Error, - 'Please supply a template or formatter' - ); + ).toThrow('Please supply a template or formatter'); }); - it('should work without buildPath', function() { + it('should work without buildPath', () => { buildFiles( dictionary, platform ); - assert(helpers.fileExists('./test/output/test.json')); + expect(helpers.fileExists('./__tests__/__output/test.json')).toBeTruthy(); }); - it('should work with buildPath', function() { + it('should work with buildPath', () => { buildFiles( dictionary, platformWithBuildPath ); - assert(helpers.fileExists('./test/output/test.json')); + expect(helpers.fileExists('./__tests__/__output/test.json')).toBeTruthy(); }); - it('should work with a filter', function() { - buildFiles( dictionary, platformWithFilter ); - assert(helpers.fileExists('./test/output/test.json')); - var output = require("./output/test.json") - expect(output).to.not.have.any.keys("foo") - expect(output).to.have.all.keys("bingo") + it('should work with a filter', () => { + buildFiles(dictionary, platformWithFilter); + expect(helpers.fileExists('./__tests__/__output/test.json')).toBeTruthy(); + var output = require("./__output/test.json") + expect(output).toHaveProperty('bingo'); + expect(output).not.toHaveProperty('foo'); + _.each(output, function(property) { + expect(property.value).toBe('bango'); + }); }); + }); diff --git a/__tests__/buildPlatform.test.js b/__tests__/buildPlatform.test.js new file mode 100644 index 000000000..1f9d2a472 --- /dev/null +++ b/__tests__/buildPlatform.test.js @@ -0,0 +1,172 @@ +/* + * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with + * the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +var helpers = require('./__helpers'); +var config = helpers.fileToJSON(__dirname + '/__configs/test.json'); +var StyleDictionary = require('../index'); +var StyleDictionaryExtended = StyleDictionary.extend(config); + +describe('buildPlatform', () => { + + beforeEach(() => { + helpers.clearOutput(); + }); + + it('should throw if passed a platform that doesn\'t exist', () => { + expect( + StyleDictionaryExtended.buildPlatform.bind(test, 'foobar'), + ).toThrow('Platform foobar doesn\'t exist'); + + expect( + function() { + StyleDictionaryExtended.buildPlatform('web'); + } + ).not.toThrow(); + }); + + it('should build web platform files', () => { + StyleDictionaryExtended.buildPlatform('web'); + expect(helpers.fileExists('./__tests__/__output/web/_icons.css')).toBeTruthy(); + expect(helpers.fileExists('./__tests__/__output/web/_styles.js')).toBeTruthy(); + expect(helpers.fileExists('./__tests__/__output/web/_variables.css')).toBeTruthy(); + }); + + it('should build scss platform files', () => { + StyleDictionaryExtended.buildPlatform('scss'); + expect(helpers.fileExists('./__tests__/__output/scss/_icons.scss')).toBeTruthy(); + expect(helpers.fileExists('./__tests__/__output/scss/_variables.scss')).toBeTruthy(); + }); + + it('should build less platform files', () => { + StyleDictionaryExtended.buildPlatform('less'); + expect(helpers.fileExists('./__tests__/__output/less/_icons.less')).toBeTruthy(); + expect(helpers.fileExists('./__tests__/__output/less/_variables.less')).toBeTruthy(); + }); + + it('should do android stuff', () => { + StyleDictionaryExtended.buildPlatform('android'); + expect(helpers.fileExists('./__tests__/__output/android/main/res/drawable-hdpi/flag_us.png')).toBeTruthy(); + expect(helpers.fileExists('./__tests__/__output/android/main/res/drawable-xhdpi/flag_us.png')).toBeTruthy(); + expect(helpers.fileExists('./__tests__/__output/android/colors.xml')).toBeTruthy(); + expect(helpers.fileExists('./__tests__/__output/android/dimens.xml')).toBeTruthy(); + expect(helpers.fileExists('./__tests__/__output/android/font_dimen.xml')).toBeTruthy(); + }); + + it('should do ios stuff', () => { + StyleDictionaryExtended.buildPlatform('ios'); + expect(helpers.fileExists('./__tests__/__output/ios/style_dictionary.plist')).toBeTruthy(); + expect(helpers.fileExists('./__tests__/__output/ios/style_dictionary.h')).toBeTruthy(); + }); + + it('should handle non-string values in properties', () => { + var StyleDictionaryExtended = StyleDictionary.extend({ + source: ['__tests__/__properties/nonString.json'], + platforms: { + test: { + buildPath: "__tests__/__output/", + transforms: ["attribute/cti","size/px","color/hex"], + files: [ + { + "destination": "output.json", + "format": "json" + } + ] + } + } + }); + StyleDictionaryExtended.buildPlatform('test'); + expect(helpers.fileExists('./__tests__/__output/output.json')).toBeTruthy(); + // var input = helpers.fileToJSON('./__tests__/__properties/nonString.json'); + var output = helpers.fileToJSON('./__tests__/__output/output.json'); + + // Make sure transforms run on non-string values as they normally would + expect(output).toHaveProperty('color.red.value', output.color.otherRed.value); + expect(output).toHaveProperty('color.red.value', "#ff0000"); + expect(output).toHaveProperty('size.large.value', output.size.otherLarge.value); + expect(output).toHaveProperty('size.large.value', "20px"); + + expect(output.number.test.value).toEqual(output.number.otherTest.value); + expect(typeof output.number.otherTest.value).toBe('number'); + expect(output.array.test.value).toEqual(output.array.otherTest.value); + expect(Array.isArray(output.array.otherTest.value)).toBeTruthy(); + expect(output.object.test.value).toMatchObject(output.object.otherTest.value); + expect(typeof output.object.otherTest.value).toBe('object'); + }); + + it('should handle non-property nodes', () => { + var StyleDictionaryExtended = StyleDictionary.extend({ + source: ['__tests__/__properties/nonPropertyNode.json'], + platforms: { + test: { + buildPath: "__tests__/__output/", + transformGroup: "scss", + files: [ + { + "destination": "output.json", + "format": "json" + } + ] + } + } + }); + StyleDictionaryExtended.buildPlatform('test'); + expect(helpers.fileExists('./__tests__/__output/output.json')).toBeTruthy(); + var input = helpers.fileToJSON('./__tests__/__properties/nonPropertyNode.json'); + var output = helpers.fileToJSON('./__tests__/__output/output.json'); + expect(output.color.key1).toEqual(input.color.key1); + expect(output.color.base.red.key2).toEqual(input.color.base.red.key2); + expect(output.color.base.attributes.key3).toEqual(input.color.base.attributes.key3); + }); + + it('should handle comments', () => { + var StyleDictionaryExtended = StyleDictionary.extend({ + source: ['__tests__/__properties/comment.json'], + platforms: { + test: { + buildPath: "__tests__/__output/", + transformGroup: "scss", + files: [ + { + "destination": "output.json", + "format": "json" + } + ] + } + } + }); + StyleDictionaryExtended.buildPlatform('test'); + expect(helpers.fileExists('./__tests__/__output/output.json')).toBeTruthy(); + var input = helpers.fileToJSON('./__tests__/__properties/comment.json'); + var output = helpers.fileToJSON('./__tests__/__output/output.json'); + expect(output.size.large.comment).toEqual(input.size.large.comment); + }); + + it('should throw an error if given a transformGroup that doesn\'t exist', () => { + var StyleDictionaryExtended = StyleDictionary.extend({ + source: ['__properties/**/*.json'], + platforms: { + foo: { + transformGroup: 'bar', + files: [{ + destination: '__tests__/__output/test.css', + format: 'css/variables' + }] + } + } + }); + expect( + StyleDictionaryExtended.buildPlatform.bind(StyleDictionaryExtended, 'foo'), + ).toThrow('transformGroup bar doesn\'t exist'); + }); + +}); diff --git a/test/cleanAction.js b/__tests__/cleanAction.test.js similarity index 52% rename from test/cleanAction.js rename to __tests__/cleanAction.test.js index e1fcf040b..b6eea86c4 100644 --- a/test/cleanAction.js +++ b/__tests__/cleanAction.test.js @@ -11,39 +11,44 @@ * and limitations under the License. */ -var assert = require('chai').assert, - helpers = require('./helpers'), - fs = require('fs-extra'), - StyleDictionary = require('../index'); +var helpers = require('./__helpers'); +var fs = require('fs-extra'); +var StyleDictionary = require('../index'); +var StyleDictionaryExtended = StyleDictionary.extend({ + "platforms": { + "android": { + "actions": ["test"] + } + } +}); -StyleDictionary.registerAction({ +StyleDictionaryExtended.registerAction({ name: 'test', do: function() { - fs.writeFileSync('./test/output/action.txt', 'hi') + fs.writeFileSync('./__tests__/__output/action.txt', 'hi') }, undo: function() { - fs.removeSync('./test/output/action.txt') + fs.removeSync('./__tests__/__output/action.txt') } }); -var test = StyleDictionary.extend({ - "platforms": { - "android": { - "actions": ["test"] - } - } -}); +describe('cleanAction', () => { + + describe('clean actions', () => { -describe('cleanPlatform', function() { - describe('clean actions', function() { - beforeEach(function() { + beforeEach(() => { helpers.clearOutput(); }); - it('should delete a file properly', function() { - test.buildPlatform('android'); - test.cleanPlatform('android'); - assert(helpers.fileDoesNotExist('./test/output/action.txt')); + afterEach(() => { + helpers.clearOutput(); + }); + + it('should delete a file properly', () => { + StyleDictionaryExtended.buildPlatform('android'); + StyleDictionaryExtended.cleanPlatform('android'); + expect(helpers.fileDoesNotExist('./__tests__/__output/action.txt')).toBeTruthy(); }); }); + }); diff --git a/__tests__/cleanAllPlatforms.test.js b/__tests__/cleanAllPlatforms.test.js new file mode 100644 index 000000000..27436eefb --- /dev/null +++ b/__tests__/cleanAllPlatforms.test.js @@ -0,0 +1,36 @@ +/* + * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with + * the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +var helpers = require('./__helpers'); +var config = helpers.fileToJSON(__dirname + '/__configs/test.json'); +var StyleDictionary = require('../index'); +var StyleDictionaryExtended = StyleDictionary.extend(config); + +describe('cleanAllPlatforms', () => { + + beforeEach(() => { + helpers.clearOutput(); + }); + + afterEach(() => { + helpers.clearOutput(); + }); + + it('should work', () => { + StyleDictionaryExtended.buildAllPlatforms(); + StyleDictionaryExtended.cleanAllPlatforms(); + expect(helpers.fileDoesNotExist('./__tests__/__output/web/_icons.scss')).toBeTruthy(); + expect(helpers.fileDoesNotExist('./__tests__/__output/android/colors.xml')).toBeTruthy(); + }); + +}); diff --git a/__tests__/cleanDir.test.js b/__tests__/cleanDir.test.js new file mode 100644 index 000000000..57508e165 --- /dev/null +++ b/__tests__/cleanDir.test.js @@ -0,0 +1,41 @@ +/* + * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with + * the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +var helpers = require('./__helpers'); +var buildFile = require('../lib/buildFile'); +var cleanFile = require('../lib/cleanFile'); +var cleanDir = require('../lib/cleanDir'); + +function format() { + return "hi"; +} + +describe('cleanDir', () => { + + beforeEach(() => { + helpers.clearOutput(); + }); + + afterEach(() => { + helpers.clearOutput(); + }); + + it('should delete a dir properly', () => { + buildFile('test.txt', format, {buildPath: '__tests__/__output/extradir1/extradir2/'}, {}); + cleanFile('test.txt', format, {buildPath: '__tests__/__output/extradir1/extradir2/'}, {}); + cleanDir('test.txt', format, {buildPath: '__tests__/__output/extradir1/extradir2/'}, {}); + expect(helpers.dirDoesNotExist('./__tests__/__output/extradir1/extradir2')).toBeTruthy(); + expect(helpers.dirDoesNotExist('./__tests__/__output/extradir1')).toBeTruthy(); + }); + +}); diff --git a/test/cleanDirs.js b/__tests__/cleanDirs.test.js similarity index 59% rename from test/cleanDirs.js rename to __tests__/cleanDirs.test.js index b691a5603..eb547fd0b 100644 --- a/test/cleanDirs.js +++ b/__tests__/cleanDirs.test.js @@ -11,11 +11,10 @@ * and limitations under the License. */ -var assert = require('chai').assert, - helpers = require('./helpers'), - buildFiles = require('../lib/buildFiles'), - cleanFiles = require('../lib/cleanFiles'), - cleanDirs = require('../lib/cleanDirs'); +var helpers = require('./__helpers'); +var buildFiles = require('../lib/buildFiles'); +var cleanFiles = require('../lib/cleanFiles'); +var cleanDirs = require('../lib/cleanDirs'); var dictionary = { properties: { @@ -26,7 +25,7 @@ var dictionary = { var platform = { files: [ { - destination: 'test/output/extradir1/extradir2/extradir1/extradir2/test.json', + destination: '__tests__/__output/extradir1/extradir2/extradir1/extradir2/test.json', format: function(dictionary) { return JSON.stringify(dictionary.properties) } @@ -35,7 +34,7 @@ var platform = { }; var platformWithBuildPath = { - buildPath: 'test/output/extradir1/extradir2/', + buildPath: '__tests__/__output/extradir1/extradir2/', files: [ { destination: 'test.json', @@ -46,24 +45,29 @@ var platformWithBuildPath = { ] }; -describe('cleanDirs', function() { - beforeEach(function() { +describe('cleanDirs', () => { + + beforeEach(() => { + helpers.clearOutput(); + }); + + afterEach(() => { helpers.clearOutput(); }); - it('should delete without buildPath', function() { + it('should delete without buildPath', () => { buildFiles( dictionary, platform ); cleanFiles( dictionary, platform ); cleanDirs( dictionary, platform ); - assert(helpers.dirDoesNotExist('./test/output/extradir1/extradir2')); - assert(helpers.dirDoesNotExist('./test/output/extradir1')); + expect(helpers.dirDoesNotExist('./__tests__/__output/extradir1/extradir2')).toBeTruthy(); + expect(helpers.dirDoesNotExist('./__tests__/__output/extradir1')).toBeTruthy(); }); - it('should delete with buildPath', function() { + it('should delete with buildPath', () => { buildFiles( dictionary, platformWithBuildPath ); cleanFiles( dictionary, platformWithBuildPath ); cleanDirs( dictionary, platformWithBuildPath ); - assert(helpers.dirDoesNotExist('./test/output/extradir1/extradir2')); - assert(helpers.dirDoesNotExist('./test/output/extradir1')); + expect(helpers.dirDoesNotExist('./__tests__/__output/extradir1/extradir2')).toBeTruthy(); + expect(helpers.dirDoesNotExist('./__tests__/__output/extradir1')).toBeTruthy(); }); }); diff --git a/test/cleanFile.js b/__tests__/cleanFile.test.js similarity index 56% rename from test/cleanFile.js rename to __tests__/cleanFile.test.js index ccb83e78c..ffcdee164 100644 --- a/test/cleanFile.js +++ b/__tests__/cleanFile.test.js @@ -11,23 +11,28 @@ * and limitations under the License. */ -var assert = require('chai').assert, - helpers = require('./helpers'), - buildFile = require('../lib/buildFile'), - cleanFile = require('../lib/cleanFile'); +var helpers = require('./__helpers'); +var buildFile = require('../lib/buildFile'); +var cleanFile = require('../lib/cleanFile'); function format() { return "hi"; } -describe('cleanFile', function() { - beforeEach(function() { +describe('cleanFile', () => { + + beforeEach(() => { helpers.clearOutput(); }); - it('should delete a file properly', function() { - buildFile('test.txt', format, {buildPath: 'test/output/'}, {}); - cleanFile('test.txt', format, {buildPath: 'test/output/'}, {}); - assert(helpers.fileDoesNotExist('./test/output/test.txt')); + afterEach(() => { + helpers.clearOutput(); }); + + it('should delete a file properly', () => { + buildFile('test.txt', format, {buildPath: '__tests__/__output/'}, {}); + cleanFile('test.txt', format, {buildPath: '__tests__/__output/'}, {}); + expect(helpers.fileDoesNotExist('./__tests__/__output/test.txt')).toBeTruthy(); + }); + }); diff --git a/test/cleanFiles.js b/__tests__/cleanFiles.test.js similarity index 67% rename from test/cleanFiles.js rename to __tests__/cleanFiles.test.js index 33afe5c88..cf9bd1e27 100644 --- a/test/cleanFiles.js +++ b/__tests__/cleanFiles.test.js @@ -11,10 +11,9 @@ * and limitations under the License. */ -var assert = require('chai').assert, - helpers = require('./helpers'), - buildFiles = require('../lib/buildFiles'), - cleanFiles = require('../lib/cleanFiles'); +var helpers = require('./__helpers'); +var buildFiles = require('../lib/buildFiles'); +var cleanFiles = require('../lib/cleanFiles'); var dictionary = { properties: { @@ -25,7 +24,7 @@ var dictionary = { var platform = { files: [ { - destination: 'test/output/test.json', + destination: '__tests__/__output/test.json', format: function(dictionary) { return JSON.stringify(dictionary.properties) } @@ -34,7 +33,7 @@ var platform = { }; var platformWithBuildPath = { - buildPath: 'test/output/', + buildPath: '__tests__/__output/', files: [ { destination: 'test.json', @@ -45,20 +44,25 @@ var platformWithBuildPath = { ] }; -describe('cleanFiles', function() { - beforeEach(function() { +describe('cleanFiles', () => { + + beforeEach(() => { + helpers.clearOutput(); + }); + + afterEach(() => { helpers.clearOutput(); }); - it('should delete without buildPath', function() { + it('should delete without buildPath', () => { buildFiles( dictionary, platform ); cleanFiles( dictionary, platform ); - assert(helpers.fileDoesNotExist('./test/output/test.json')); + expect(helpers.fileDoesNotExist('./__tests__/__output/test.json')).toBeTruthy(); }); - it('should delete with buildPath', function() { + it('should delete with buildPath', () => { buildFiles( dictionary, platformWithBuildPath ); cleanFiles( dictionary, platformWithBuildPath ); - assert(helpers.fileDoesNotExist('./test/output/test.json')); + expect(helpers.fileDoesNotExist('./__tests__/__output/test.json')).toBeTruthy(); }); }); diff --git a/__tests__/cleanPlatform.test.js b/__tests__/cleanPlatform.test.js new file mode 100644 index 000000000..fbb6e39cf --- /dev/null +++ b/__tests__/cleanPlatform.test.js @@ -0,0 +1,54 @@ +/* + * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with + * the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +var helpers = require('./__helpers'); +var config = helpers.fileToJSON(__dirname + '/__configs/test.json'); +var StyleDictionary = require('../index'); +var StyleDictionaryExtended = StyleDictionary.extend(config); + +describe('cleanPlatform', () => { + + beforeEach(() => { + helpers.clearOutput(); + }); + + afterEach(() => { + helpers.clearOutput(); + }); + + it('should delete the proper files', () => { + StyleDictionaryExtended.buildPlatform('web'); + StyleDictionaryExtended.cleanPlatform('web'); + expect(helpers.fileDoesNotExist('./__tests__/__output/web/_icons.scss')).toBeTruthy(); + expect(helpers.fileDoesNotExist('./__tests__/__output/web/_styles.js')).toBeTruthy(); + expect(helpers.fileDoesNotExist('./__tests__/__output/web/_variables.scss')).toBeTruthy(); + }); + + it('should delete android stuff', () => { + StyleDictionaryExtended.buildPlatform('android'); + StyleDictionaryExtended.cleanPlatform('android'); + expect(helpers.fileDoesNotExist('./__tests__/__output/android/main/res/drawable-hdpi/flag_us.png')).toBeTruthy(); + expect(helpers.fileDoesNotExist('./__tests__/__output/android/main/res/drawable-xhdpi/flag_us.png')).toBeTruthy(); + expect(helpers.fileDoesNotExist('./__tests__/__output/android/colors.xml')).toBeTruthy(); + expect(helpers.fileDoesNotExist('./__tests__/__output/android/dimens.xml')).toBeTruthy(); + expect(helpers.fileDoesNotExist('./__tests__/__output/android/font_dimen.xml')).toBeTruthy(); + }); + + it('should delete ios stuff', () => { + StyleDictionaryExtended.buildPlatform('ios'); + StyleDictionaryExtended.cleanPlatform('ios'); + expect(helpers.fileDoesNotExist('./__tests__/__output/ios/style_dictionary.plist')).toBeTruthy(); + expect(helpers.fileDoesNotExist('./__tests__/__output/ios/style_dictionary.h')).toBeTruthy(); + }); + +}); diff --git a/__tests__/cliBuild.test.js b/__tests__/cliBuild.test.js new file mode 100644 index 000000000..9062a8afb --- /dev/null +++ b/__tests__/cliBuild.test.js @@ -0,0 +1,38 @@ +/* + * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with + * the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +var childProcess = require("child_process"); +var helpers = require('./__helpers'); + +describe('cliBuildWithJsConfig', () => { + + beforeAll(() => { + helpers.clearOutput(); + childProcess.execSync("node ./bin/style-dictionary build --config ./__tests__/__configs/test.js") + }); + + afterAll(() => { + helpers.clearOutput(); + }); + + it('should work with json config', () => { + expect(helpers.fileExists('./__tests__/__output/web/_icons.css')).toBeTruthy(); + expect(helpers.fileExists('./__tests__/__output/android/colors.xml')).toBeTruthy(); + }); + + it('should work with javascript config', () => { + expect(helpers.fileExists('./__tests__/__output/web/_icons.css')).toBeTruthy(); + expect(helpers.fileExists('./__tests__/__output/android/colors.xml')).toBeTruthy(); + }); + +}); diff --git a/__tests__/common/transforms.test.js b/__tests__/common/transforms.test.js new file mode 100644 index 000000000..bcb8aff1a --- /dev/null +++ b/__tests__/common/transforms.test.js @@ -0,0 +1,441 @@ +/* + * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with + * the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +var transforms = require('../../lib/common/transforms'); +var path = require('path'); + +describe('common', () => { + describe('transforms', () => { + + describe('name/cti/camel', () => { + it('should handle prefix', () => { + expect(transforms["name/cti/camel"].transformer( + { + path: ['one','two','three'] + },{ + prefix: 'prefix' + } + )).toBe('prefixOneTwoThree'); + }); + + it('should handle no prefix', () => { + expect(transforms["name/cti/camel"].transformer( + { + path: ['one','two','three'] + },{ + } + )).toBe('oneTwoThree'); + }); + }); + + + describe('name/cti/kebab', () => { + it('should handle prefix', () => { + expect(transforms["name/cti/kebab"].transformer( + { + path: ['one','two','three'] + },{ + prefix: 'prefix' + } + )).toBe('prefix-one-two-three'); + }); + + it('should handle no prefix', () => { + expect(transforms["name/cti/kebab"].transformer( + { + path: ['one','two','three'] + },{ + } + )).toBe('one-two-three'); + }); + }); + + describe('name/cti/snake', () => { + it('should handle prefix', () => { + expect(transforms["name/cti/snake"].transformer( + { + path: ['one','two','three'] + },{ + prefix: 'prefix' + } + )).toBe('prefix_one_two_three'); + }); + + it('should handle no prefix', () => { + expect(transforms["name/cti/snake"].transformer( + { + path: ['one','two','three'] + },{ + } + )).toBe('one_two_three'); + }); + }); + + describe('name/cti/constant', () => { + it('should handle prefix', () => { + expect(transforms["name/cti/constant"].transformer( + { + path: ['one','two','three'] + },{ + prefix: 'prefix' + } + )).toBe('PREFIX_ONE_TWO_THREE'); + }); + + it('should handle no prefix', () => { + expect(transforms["name/cti/constant"].transformer( + { + path: ['one','two','three'] + },{ + } + )).toBe('ONE_TWO_THREE'); + }); + }); + + describe('name/ti/constant', () => { + it('should handle prefix', () => { + expect(transforms["name/ti/constant"].transformer( + { + path: ['one','two','three'] + },{ + prefix: 'prefix' + } + )).toBe('PREFIX_TWO_THREE'); + }); + + it('should handle no prefix', () => { + expect(transforms["name/ti/constant"].transformer( + { + path: ['one','two','three'] + },{ + } + )).toBe('TWO_THREE'); + }); + }); + + describe('attribute/color', () => { + it('should handle normal colors', () => { + var attributes = transforms["attribute/color"].transformer({ + value: "#aaaaaa" + }); + expect(attributes).toHaveProperty('rgb.a', 1); + expect(attributes).toHaveProperty('rgb.r', 170); + expect(attributes).toHaveProperty('hsl.s', 0); + }); + it('should handle colors with transparency', () => { + var attributes = transforms["attribute/color"].transformer({ + value: "#aaaaaa99" + }); + var attributes2 = transforms["attribute/color"].transformer({ + value: "rgba(170,170,170,0.6)" + }); + expect(attributes).toHaveProperty('rgb.a', 0.6); + expect(attributes).toHaveProperty('rgb.r', 170); + expect(attributes).toHaveProperty('hsl.s', 0); + expect(attributes2).toHaveProperty('rgb.a', 0.6); + expect(attributes2).toHaveProperty('rgb.r', 170); + expect(attributes2).toHaveProperty('hsl.s', 0); + }); + }); + + describe('color/hex', () => { + it('should handle hex colors', () => { + var value = transforms["color/hex"].transformer({ + value: "#aaaaaa" + }); + expect(value).toBe("#aaaaaa"); + }); + + it('should handle hex8 colors', () => { + var value = transforms["color/hex"].transformer({ + value: "#aaaaaaaa" + }); + expect(value).toBe("#aaaaaa"); + }); + + it('should handle rgb colors', () => { + var value = transforms["color/hex"].transformer({ + value: "rgb(170,170,170)" + }); + expect(value).toBe("#aaaaaa"); + }); + + it('should handle rgb (object) colors', () => { + var value = transforms["color/hex"].transformer({ + value: { + r: '170', + g: '170', + b: '170' + } + }); + var value2 = transforms["color/hex"].transformer({ + value: "rgb(170,170,170)" + }); + expect(value).toBe("#aaaaaa"); + expect(value2).toBe("#aaaaaa"); + }); + + it('should handle hsl colors', () => { + var value = transforms["color/hex"].transformer({ + value: { + h: '0', + s: '0', + l: '0.5' + } + }); + var value2 = transforms["color/hex"].transformer({ + value: "hsl(0,0,0.5)" + }); + expect(value).toBe("#808080"); + expect(value2).toBe("#808080"); + }); + }); + + + describe('color/hex8', () => { + it('should handle hex colors', () => { + var value = transforms["color/hex8"].transformer({ + value: "#aaaaaa" + }); + expect(value).toBe("#aaaaaaff"); + }); + + it('should handle rgb colors', () => { + var value = transforms["color/hex8"].transformer({ + value: "rgb(170,170,170)" + }); + expect(value).toBe("#aaaaaaff"); + }); + + it('should handle rgb colors', () => { + var value = transforms["color/hex8"].transformer({ + value: "rgb(170,170,170)" + }); + var value2 = transforms["color/hex8"].transformer({ + value: "rgba(170,170,170,0.6)" + }); + expect(value).toBe("#aaaaaaff"); + expect(value2).toBe("#aaaaaa99"); + }); + }); + + describe('color/hex8android', () => { + it('should handle colors without alpha', () => { + var value = transforms["color/hex8android"].transformer({ + value: "#aaaaaa" + }); + expect(value).toBe("#ffaaaaaa"); + }); + + it('should handle colors with alpha', () => { + var value = transforms["color/hex8android"].transformer({ + value: "#aaaaaa99" + }); + expect(value).toBe("#99aaaaaa"); + }); + }); + + describe('color/rgb', () => { + it('should handle normal colors', () => { + var value = transforms["color/rgb"].transformer({ + value: "#aaaaaa" + }); + expect(value).toBe("rgb(170, 170, 170)"); + }); + + it('should handle colors with transparency', () => { + var value = transforms["color/rgb"].transformer({ + value: "#aaaaaa99" + }); + expect(value).toBe("rgba(170, 170, 170, 0.6)"); + }); + }); + + describe('color/UIColor', () => { + it('should handle normal colors', () => { + var value = transforms["color/UIColor"].transformer({ + value: "#aaaaaa" + }); + expect(value).toBe("[UIColor colorWithRed:0.67f green:0.67f blue:0.67f alpha:1.00f]"); + }); + + it('should handle colors with transparency', () => { + var value = transforms["color/UIColor"].transformer({ + value: "#aaaaaa99" + }); + expect(value).toBe("[UIColor colorWithRed:0.67f green:0.67f blue:0.67f alpha:0.60f]"); + }); + }); + + + describe('color/css', () => { + it('should handle normal colors', () => { + var value = transforms["color/css"].transformer({ + value: "rgb(170, 170, 170)" + }); + expect(value).toBe("#aaaaaa"); + }); + + it('should handle colors with transparency', () => { + var value = transforms["color/css"].transformer({ + value: "#aaaaaa99" + }); + expect(value).toBe("rgba(170, 170, 170, 0.6)"); + }); + }); + + describe('size/sp', () => { + it('should work', () => { + var value = transforms["size/sp"].transformer({ + value: "12px" + }); + var value2 = transforms["size/sp"].transformer({ + value: "12" + }); + expect(value).toBe("12.00sp"); + expect(value2).toBe("12.00sp"); + }); + }); + + describe('size/dp', () => { + it('should work', () => { + var value = transforms["size/dp"].transformer({ + value: "12px" + }); + var value2 = transforms["size/dp"].transformer({ + value: "12" + }); + expect(value).toBe("12.00dp"); + expect(value2).toBe("12.00dp"); + }); + }); + + describe('size/remToSp', () => { + it('should work', () => { + var value = transforms["size/remToSp"].transformer({ + value: "1" + }); + expect(value).toBe("16.00sp"); + }); + }); + + describe('size/remToDp', () => { + it('should work', () => { + var value = transforms["size/remToDp"].transformer({ + value: "1" + }); + expect(value).toBe("16.00dp"); + }); + }); + + describe('size/px', () => { + it('should work', () => { + var value = transforms["size/px"].transformer({ + value: "10" + }); + expect(value).toBe("10px"); + }); + }); + + describe('size/remToPt', () => { + it('should work', () => { + var value = transforms["size/remToPt"].transformer({ + value: "1" + }); + expect(value).toBe("16.00f"); + }); + }); + + describe('size/remToPx', () => { + it('should work', () => { + var value = transforms["size/remToPx"].transformer({ + value: "1" + }); + expect(value).toBe("16px"); + }); + }); + + describe('size/rem', () => { + it('should work', () => { + var value = transforms["size/rem"].transformer({ + value: "1" + }); + expect(value).toBe("1rem"); + }); + }); + + describe('content/quote', () => { + it('should work', () => { + var value = transforms["content/quote"].transformer({ + value: "hello" + }); + expect(value).toBe("'hello'"); + }); + }); + + describe('content/icon', () => { + it('should work', () => { + var value = transforms["content/icon"].transformer({ + value: "" + }); + expect(value).toBe("'\\E001'"); + }); + }); + + describe('content/objC/literal', () => { + it('should work', () => { + var value = transforms["content/objC/literal"].transformer({ + value: "hello" + }); + expect(value).toBe('@"hello"'); + }); + }); + + describe('asset/objC/literal', () => { + it('should work', () => { + var value = transforms["asset/objC/literal"].transformer({ + value: "hello" + }); + expect(value).toBe('@"hello"'); + }); + }); + + describe('font/objC/literal', () => { + it('should work', () => { + var value = transforms["font/objC/literal"].transformer({ + value: "hello" + }); + expect(value).toBe('@"hello"'); + }); + }); + + describe('time/seconds', () => { + it('should work', () => { + var value = transforms["time/seconds"].transformer({ + value: "1000" + }); + expect(value).toBe("1.00s"); + }); + }); + + describe('asset/path', () => { + it('should work', () => { + var value = transforms["asset/path"].transformer({ + value: "foo.json" + }); + expect(value).toBe(path.join(process.cwd(), "foo.json")); + }); + }); + + }); +}); diff --git a/__tests__/exportPlatform.test.js b/__tests__/exportPlatform.test.js new file mode 100644 index 000000000..62f961805 --- /dev/null +++ b/__tests__/exportPlatform.test.js @@ -0,0 +1,79 @@ +/* + * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with + * the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +var helpers = require('./__helpers'); +var keys = require('lodash/keys'); +var config = helpers.fileToJSON(__dirname + '/__configs/test.json'); +var StyleDictionary = require('../index').extend(config); + +describe('exportPlatform', () => { + + it('should throw if not given a platform', () => { + expect( + function(){ + StyleDictionary.exportPlatform() + } + ).toThrow(); + }); + + it('should throw if not given a proper platform', () => { + expect( + function(){ + StyleDictionary.exportPlatform('foo'); + } + ).toThrow(); + }); + + it('should not throw if given a proper platform', () => { + expect( + function(){ + StyleDictionary.exportPlatform('web'); + } + ).not.toThrow(); + }); + + it('should return an object', () => { + var dictionary = StyleDictionary.exportPlatform('web'); + expect(typeof dictionary).toBe('object'); + }); + + it('should have the same structure as the original properties', () => { + var dictionary = StyleDictionary.exportPlatform('web'); + expect(keys(dictionary)).toEqual(keys(StyleDictionary.properties)); + }); + + it('should have resolved references', () => { + var dictionary = StyleDictionary.exportPlatform('web'); + expect(dictionary.color.font.link.value).toEqual(dictionary.color.base.blue['100'].value); + }); + + it('should have applied transforms', () => { + var dictionary = StyleDictionary.exportPlatform('web'); + expect(dictionary.size.padding.base.value.indexOf('px')).toBeGreaterThan(0); + }); + + it('should not have mutated the original properties', () => { + var dictionary = StyleDictionary.exportPlatform('web'); + expect(dictionary.color.font.link.value).not.toEqual(StyleDictionary.properties.color.font.link.value); + expect(StyleDictionary.properties.size.padding.base.value.indexOf('px')).toBe(-1); + }); + + // Make sure when we perform transforms and resolve references + // we don't mutate the original object added to the property. + it('properties should have original value untouched', () => { + var dictionary = StyleDictionary.exportPlatform('web'); + var properties = helpers.fileToJSON(__dirname + '/__properties/colors.json'); + expect(dictionary.color.font.link.original.value).toEqual(properties.color.font.link.value); + }); + +}); diff --git a/__tests__/extend.test.js b/__tests__/extend.test.js new file mode 100644 index 000000000..b0121b867 --- /dev/null +++ b/__tests__/extend.test.js @@ -0,0 +1,146 @@ +/* + * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with + * the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +var helpers = require('./__helpers'); +var StyleDictionary = require('../index'); +var _ = require('lodash'); + +var test_props = { + size: { + padding: { + tiny: {value:'0'} + } + } +}; + +describe('extend', () => { + + describe('method signature', () => { + it('should accept a string as a path to a JSON file', () => { + var StyleDictionaryExtended = StyleDictionary.extend(__dirname + '/__configs/test.json'); + expect(StyleDictionaryExtended).toHaveProperty('platforms.web'); + }); + + it('should accept an object as options', () => { + var config = helpers.fileToJSON(__dirname + '/__configs/test.json'); + var StyleDictionaryExtended = StyleDictionary.extend(config); + expect(StyleDictionaryExtended).toHaveProperty('platforms.web'); + }); + + it('should override attributes', () => { + var StyleDictionaryExtended = StyleDictionary.extend({ + properties: { + foo: 'bar' + } + }); + expect(StyleDictionaryExtended).toHaveProperty('properties.foo', 'bar'); + }); + + it('should have all same properties', () => { + var StyleDictionaryExtended = StyleDictionary.extend({}); + _.each(_.keys(StyleDictionaryExtended), function(property) { + expect(StyleDictionaryExtended).toHaveProperty(property); + }); + }); + }); + + describe('includes', () => { + it('should throw if include isnt an array', () => { + expect( + StyleDictionary.extend.bind(null, {include: {}}) + ).toThrow('include must be an array'); + }); + + it('should throw if a path in the includes array doesnt resolve', () => { + expect( + StyleDictionary.extend.bind(null, {include: ['foo']}) + ).toThrow("Cannot find module 'foo'"); + }); + + it('should update properties if there are includes', () => { + var StyleDictionaryExtended = StyleDictionary.extend({ + include: [__dirname + '/__configs/include.json'] + }); + expect(typeof StyleDictionaryExtended.properties.size.padding.tiny).toBe('object'); + }); + + it('should override existing properties if there are includes', () => { + var StyleDictionaryExtended = StyleDictionary.extend({ + properties: test_props, + include: [__dirname + '/__configs/include.json'] + }); + expect(StyleDictionaryExtended).toHaveProperty('properties.size.padding.tiny.value', '3'); + }); + }); + + + describe('source', () => { + it('should throw if source isnt an array', () => { + expect( + StyleDictionary.extend.bind(null, {source: {}}) + ).toThrow('source must be an array'); + }); + + it('should throw if a path in the source array doesnt resolve', () => { + expect( + StyleDictionary.extend.bind(null, {include: ['foo']}) + ).toThrow("Cannot find module 'foo'"); + }); + + it('should build the properties object if a source is given', () => { + var StyleDictionaryExtended = StyleDictionary.extend({ + "source": [__dirname + "/__properties/paddings.json"] + }); + expect(StyleDictionaryExtended.properties).toEqual(helpers.fileToJSON(__dirname + "/__properties/paddings.json")); + }); + + it('should override existing properties source is given', () => { + var StyleDictionaryExtended = StyleDictionary.extend({ + properties: test_props, + source: [__dirname + "/__properties/paddings.json"] + }); + expect(StyleDictionaryExtended.properties).toEqual(helpers.fileToJSON(__dirname + "/__properties/paddings.json")); + }); + }); + + + // This is to allow style dictionaries to depend on other style dictionaries and + // override properties. Useful for skinning + it('should not throw a collision error if a source file collides with an include', () => { + var StyleDictionaryExtended = StyleDictionary.extend({ + include: [__dirname + "/__properties/paddings.json"], + source: [__dirname + "/__properties/paddings.json"], + log: 'error' + }); + expect(StyleDictionaryExtended.properties).toEqual(helpers.fileToJSON(__dirname + "/__properties/paddings.json")); + }); + + it('should throw a error if the collision is in source files and log is set to error', () => { + expect( + StyleDictionary.extend.bind(null, { + source: [__dirname + "/__properties/paddings.json", __dirname + "/__properties/paddings.json"], + log: 'error' + }) + ).toThrow('Collision detected at:'); + }); + + it('should throw a warning if the collision is in source files and log is set to warn', () => { + expect( + StyleDictionary.extend.bind(null, { + source: [__dirname + "/__properties/paddings.json", __dirname + "/__properties/paddings.json"], + log: 'warn' + }) + ).not.toThrow(); + }); + +}); diff --git a/test/filterProperties.js b/__tests__/filterProperties.test.js similarity index 57% rename from test/filterProperties.js rename to __tests__/filterProperties.test.js index 9968aa250..35657833f 100644 --- a/test/filterProperties.js +++ b/__tests__/filterProperties.test.js @@ -11,11 +11,10 @@ * and limitations under the License. */ -var assert = require('chai').assert, - expect = require('chai').expect, - helpers = require('./helpers'), - flattenProperties = require("../lib/utils/flattenProperties"), - filterProperties = require('../lib/filterProperties'); +var filterProperties = require('../lib/filterProperties'); +var helpers = require('./__helpers'); +var flattenProperties = require("../lib/utils/flattenProperties"); +var _ = require('lodash'); var colorRed = { "value": "#FF0000", @@ -85,32 +84,44 @@ var dictionary = { "allProperties": flattenProperties(properties) } -describe('filterProperties', function() { - beforeEach(function() { +describe('filterProperties', () => { + + beforeEach(() => { helpers.clearOutput(); }); - it('should return the original dictionary if no filter is provided', function() { - assert.equal(dictionary, filterProperties(dictionary)) + afterEach(() => { + helpers.clearOutput(); }); - it('should work with a filter function', function() { + it('should return the original dictionary if no filter is provided', () => { + expect(dictionary).toMatchObject(filterProperties(dictionary)); + }); + + it('should work with a filter function', () => { var filter = function(property) { - return property.path.includes("size") + return property.path.includes("size"); } - var filteredDictionary = filterProperties(dictionary, filter) - expect(filteredDictionary.allProperties).to.not.have.any.members([colorRed, colorBlue]) - expect(filteredDictionary.allProperties).to.have.all.members([sizeSmall, sizeLarge]) - expect(filteredDictionary.properties).to.not.have.any.keys("color") - expect(filteredDictionary.properties).to.have.all.keys("size") + var filteredDictionary = filterProperties(dictionary, filter); + _.each(filteredDictionary.allProperties, function(property) { + expect(property).not.toBe(colorRed); + expect(property).not.toBe(colorBlue); + }); + expect(filteredDictionary.allProperties).toEqual([sizeSmall, sizeLarge]); + expect(filteredDictionary.properties).toHaveProperty('size'); + expect(filteredDictionary.properties).not.toHaveProperty('color'); }); - it('should work with a filter object', function() { - var filter = { "attributes": { "category": "size" } } - var filteredDictionary = filterProperties(dictionary, filter) - expect(filteredDictionary.allProperties).to.not.have.any.members([colorRed, colorBlue]) - expect(filteredDictionary.allProperties).to.have.all.members([sizeSmall, sizeLarge]) - expect(filteredDictionary.properties).to.not.have.any.keys("color") - expect(filteredDictionary.properties).to.have.all.keys("size") + it('should work with a filter object', () => { + var filter = { "attributes": { "category": "size" } }; + var filteredDictionary = filterProperties(dictionary, filter); + _.each(filteredDictionary.allProperties, function(property) { + expect(property).not.toBe(colorRed); + expect(property).not.toBe(colorBlue); + }); + expect(filteredDictionary.allProperties).toEqual([sizeSmall, sizeLarge]); + expect(filteredDictionary.properties).toHaveProperty('size'); + expect(filteredDictionary.properties).not.toHaveProperty('color'); + }); }); diff --git a/__tests__/formats/__snapshots__/all.test.js.snap b/__tests__/formats/__snapshots__/all.test.js.snap new file mode 100644 index 000000000..e1801fb67 --- /dev/null +++ b/__tests__/formats/__snapshots__/all.test.js.snap @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`formats all should return css/variables as a string 1`] = ` +"/** + * Do not edit directly + * Generated on Sat, 01 Jan 2000 00:00:00 GMT + */ + +:root { + +} +" +`; + +exports[`formats all should return javascript/es6 as a string 1`] = ` +"/** + * Do not edit directly + * Generated on Sat, 01 Jan 2000 00:00:00 GMT + */ + +" +`; + +exports[`formats all should return javascript/module as a string 1`] = ` +"/** + * Do not edit directly + * Generated on Sat, 01 Jan 2000 00:00:00 GMT + */ + +module.exports = { + \\"color\\": { + \\"red\\": { + \\"value\\": \\"#FF0000\\" + } + } +};" +`; + +exports[`formats all should return javascript/object as a string 1`] = ` +"/** + * Do not edit directly + * Generated on Sat, 01 Jan 2000 00:00:00 GMT + */ + +var _styleDictionary = { + \\"color\\": { + \\"red\\": { + \\"value\\": \\"#FF0000\\" + } + } +};" +`; + +exports[`formats all should return javascript/umd as a string 1`] = ` +"/** + * Do not edit directly + * Generated on Sat, 01 Jan 2000 00:00:00 GMT + */ + +(function(root, factory) { + if (typeof module === \\"object\\" && module.exports) { + module.exports = factory(); + } else if (typeof exports === \\"object\\") { + exports[\\"_styleDictionary\\"] = factory(); + } else if (typeof define === \\"function\\" && define.amd) { + define([], factory); + } else { + root[\\"_styleDictionary\\"] = factory(); + } +}(this, function() { + return { + \\"color\\": { + \\"red\\": { + \\"value\\": \\"#FF0000\\" + } + } +}; +})) +" +`; + +exports[`formats all should return json as a string 1`] = ` +"{ + \\"color\\": { + \\"red\\": { + \\"value\\": \\"#FF0000\\" + } + } +}" +`; + +exports[`formats all should return json/asset as a string 1`] = `"{}"`; + +exports[`formats all should return less/icons as a string 1`] = ` +"/** + * Do not edit directly + * Generated on Sat, 01 Jan 2000 00:00:00 GMT + */ + +" +`; + +exports[`formats all should return less/variables as a string 1`] = ` +"/** + * Do not edit directly + * Generated on Sat, 01 Jan 2000 00:00:00 GMT + */ + +" +`; + +exports[`formats all should return scss/icons as a string 1`] = ` +"/** + * Do not edit directly + * Generated on Sat, 01 Jan 2000 00:00:00 GMT + */ + +" +`; + +exports[`formats all should return scss/variables as a string 1`] = ` +"/** + * Do not edit directly + * Generated on Sat, 01 Jan 2000 00:00:00 GMT + */ + +" +`; + +exports[`formats all should return sketch/palette as a string 1`] = ` +"{ + \\"compatibleVersion\\": \\"1.0\\", + \\"pluginVersion\\": \\"1.1\\", + \\"colors\\": [] +}" +`; diff --git a/test/formats/all.js b/__tests__/formats/all.test.js similarity index 56% rename from test/formats/all.js rename to __tests__/formats/all.test.js index acbd4598e..294dac1e2 100644 --- a/test/formats/all.js +++ b/__tests__/formats/all.test.js @@ -11,12 +11,14 @@ * and limitations under the License. */ -var assert = require('chai').assert, - _ = require('lodash'), - formats = require('../../lib/common/formats'); +var formats = require('../../lib/common/formats'); +var helpers = require('../__helpers'); +var _ = require('lodash'); + +var MockDate = require('mockdate'); var file = { - "destination": "output/", + "destination": "__output/", "format": "javascript/es6", "filter": { "attributes": { @@ -33,11 +35,25 @@ var dictionary = { } }; -describe('formats', function() { - _.each(_.keys(formats), function(key) { - it(key + ' should return a string', function() { - var formatter = formats[key].bind(file); - assert.isString( formatter(dictionary, file) ); +describe('formats', () => { + + beforeAll(() => { + MockDate.set('1/1/2000'); + }); + + afterAll(() => { + MockDate.reset(); + }); + + describe('all', () => { + _.each(_.keys(formats), function(key) { + it('should return ' + key + ' as a string', () => { + var formatter = formats[key].bind(file); + var output = formatter(dictionary, file); + expect(typeof output).toBe('string'); + expect(output).toMatchSnapshot(); + }); }); }); + }); diff --git a/test/formats/es6Constants.js b/__tests__/formats/es6Constants.test.js similarity index 79% rename from test/formats/es6Constants.js rename to __tests__/formats/es6Constants.test.js index e7f80855a..0d667cb7f 100644 --- a/test/formats/es6Constants.js +++ b/__tests__/formats/es6Constants.test.js @@ -11,11 +11,10 @@ * and limitations under the License. */ -var assert = require('chai').assert, - formats = require('../../lib/common/formats'); +var formats = require('../../lib/common/formats'); var file = { - "destination": "output/", + "destination": "__output/", "format": "javascript/es6", "filter": { "attributes": { @@ -48,12 +47,22 @@ var dictionary = { var formatter = formats['javascript/es6'].bind(file); -describe('formats', function() { - describe('es6Constants', function() { - it('should be a valid JS file', function() { +describe('formats', () => { + + // beforeEach(() => { + // helpers.clearOutput(); + // }); + + // afterEach(() => { + // helpers.clearOutput(); + // }); + + describe('es6Constants', () => { + it('should be a valid JS file', () => { // TODO: add tests here, // Because this is a normal JS module we can't // test outputting an ES6 JS file by importing it. }); }); + }); diff --git a/test/formats/javascriptModule.js b/__tests__/formats/javascriptModule.test.js similarity index 62% rename from test/formats/javascriptModule.js rename to __tests__/formats/javascriptModule.test.js index ad69e2b2b..6d561ff12 100644 --- a/test/formats/javascriptModule.js +++ b/__tests__/formats/javascriptModule.test.js @@ -11,13 +11,12 @@ * and limitations under the License. */ -var assert = require('chai').assert, - fs = require('fs-extra'), - helpers = require('../helpers'), - formats = require('../../lib/common/formats'); +var fs = require('fs-extra'); +var helpers = require('../__helpers'); +var formats = require('../../lib/common/formats'); var file = { - "destination": "output/", + "destination": "__output/", "format": "javascript/module", "filter": { "attributes": { @@ -36,16 +35,22 @@ var dictionary = { var formatter = formats['javascript/module'].bind(file); -describe('formats', function() { - describe('javascript/module', function() { - beforeEach(function() { +describe('formats', () => { + describe('javascript/module', () => { + + beforeEach(() => { helpers.clearOutput(); }); - it('should be a valid JS file', function() { - fs.writeFileSync('./test/output/output.js', formatter(dictionary) ); - var test = require('../output/output.js'); - assert.equal( test.color.red.value, dictionary.properties.color.red.value ); + afterEach(() => { + helpers.clearOutput(); }); + + it('should be a valid JS file', () => { + fs.writeFileSync('./__tests__/__output/output.js', formatter(dictionary) ); + var test = require('../__output/output.js'); + expect(test.color.red.value).toEqual(dictionary.properties.color.red.value); + }); + }); }); diff --git a/test/formats/javascriptObject.js b/__tests__/formats/javascriptObject.test.js similarity index 80% rename from test/formats/javascriptObject.js rename to __tests__/formats/javascriptObject.test.js index 0cfaa4dc3..94ad8500f 100644 --- a/test/formats/javascriptObject.js +++ b/__tests__/formats/javascriptObject.test.js @@ -11,11 +11,11 @@ * and limitations under the License. */ -var vm = require('vm'), - formats = require('../../lib/common/formats'); +var formats = require('../../lib/common/formats'); +var vm = require('vm'); var file = { - "destination": "output/", + "destination": "__output/", "format": "javascript/object", "name": "foo" }; @@ -30,9 +30,10 @@ var dictionary = { var formatter = formats['javascript/object'].bind(file); -describe('formats', function() { - describe('javascript/object', function() { - it('should be valid JS syntax', function(done){ +describe('formats', () => { + describe('javascript/object', () => { + + it('should be valid JS syntax', done => { try { vm.runInNewContext(formatter(dictionary)) return done(); @@ -40,5 +41,6 @@ describe('formats', function() { return done(new Error(err)); } }); + }); }); diff --git a/test/formats/javascriptUmd.js b/__tests__/formats/javascriptUmd.test.js similarity index 62% rename from test/formats/javascriptUmd.js rename to __tests__/formats/javascriptUmd.test.js index f35ec0864..91752177e 100644 --- a/test/formats/javascriptUmd.js +++ b/__tests__/formats/javascriptUmd.test.js @@ -11,13 +11,12 @@ * and limitations under the License. */ -var assert = require('chai').assert, - fs = require('fs-extra'), - helpers = require('../helpers'), - formats = require('../../lib/common/formats'); +var formats = require('../../lib/common/formats'); +var fs = require('fs-extra'); +var helpers = require('../__helpers'); var file = { - "destination": "output/", + "destination": "__output/", "format": "javascript/umd", "filter": { "attributes": { @@ -36,16 +35,22 @@ var dictionary = { var formatter = formats['javascript/umd'].bind(file); -describe('formats', function() { - describe('javascript/umd', function() { - beforeEach(function() { +describe('formats', () => { + describe('javascript/umd', () => { + + beforeEach(() => { helpers.clearOutput(); }); - it('should be a valid JS file', function() { - fs.writeFileSync('./test/output/umd.js', formatter(dictionary) ); - var test = require('../output/umd.js'); - assert.equal( test.color.red.value, dictionary.properties.color.red.value ); + afterEach(() => { + helpers.clearOutput(); }); + + it('should be a valid JS file', () => { + fs.writeFileSync('./__tests__/__output/umd.js', formatter(dictionary) ); + var test = require('../__output/umd.js'); + expect(test.color.red.value).toEqual(dictionary.properties.color.red.value); + }); + }); }); diff --git a/test/formats/json.js b/__tests__/formats/json.test.js similarity index 59% rename from test/formats/json.js rename to __tests__/formats/json.test.js index 13457a97e..b59991b88 100644 --- a/test/formats/json.js +++ b/__tests__/formats/json.test.js @@ -11,13 +11,12 @@ * and limitations under the License. */ -var assert = require('chai').assert, - fs = require('fs-extra'), - helpers = require('../helpers'), - formats = require('../../lib/common/formats'); +var formats = require('../../lib/common/formats'); +var fs = require('fs-extra'); +var helpers = require('../__helpers'); var file = { - "destination": "output/", + "destination": "__output/", "format": "json" }; @@ -31,16 +30,22 @@ var dictionary = { var formatter = formats['json'].bind(file); -describe('formats', function() { - describe('javascript/module', function() { - beforeEach(function() { +describe('formats', () => { + describe('json', () => { + + beforeEach(() => { helpers.clearOutput(); }); - it('should be a valid JSON file', function() { - fs.writeFileSync('./test/output/output.json', formatter(dictionary) ); - var test = require('../output/output.json'); - assert.equal( test.color.red.value, dictionary.properties.color.red.value ); + afterEach(() => { + helpers.clearOutput(); + }); + + it('should be a valid JSON file', () => { + fs.writeFileSync('./__tests__/__output/output.json', formatter(dictionary) ); + var test = require('../__output/output.json'); + expect(test.color.red.value).toEqual(dictionary.properties.color.red.value); }); }); + }); diff --git a/test/formats/lessIcons.js b/__tests__/formats/lessIcons.test.js similarity index 78% rename from test/formats/lessIcons.js rename to __tests__/formats/lessIcons.test.js index 0b103cb49..545b008b9 100644 --- a/test/formats/lessIcons.js +++ b/__tests__/formats/lessIcons.test.js @@ -11,12 +11,11 @@ * and limitations under the License. */ -var assert = require('chai').assert, - less = require('less'), - formats = require('../../lib/common/formats'); +var formats = require('../../lib/common/formats'); +var less = require('less'); var file = { - "destination": "output/", + "destination": "__output/", "format": "less/icons", "name": "foo" }; @@ -44,20 +43,21 @@ var config = { prefix: 'sd' // Style-Dictionary Prefix }; - var formatter = formats['less/icons'].bind(file); -describe('formats', function() { - describe('less/icons', function() { - it('should have a valid less syntax', function(done) { +describe('formats', () => { + describe('less/icons', () => { + + it('should have a valid less syntax', done => { less.render(formatter(dictionary, config)) .then(function(output) { - assert.isDefined(output); + expect(output).toBeDefined(); done(); }) .catch(function(err) { - done(new Error(err)) + done(new Error(err)) }); }); + }); }); diff --git a/test/formats/lessVariables.js b/__tests__/formats/lessVariables.test.js similarity index 78% rename from test/formats/lessVariables.js rename to __tests__/formats/lessVariables.test.js index d23f660c5..4b229b033 100644 --- a/test/formats/lessVariables.js +++ b/__tests__/formats/lessVariables.test.js @@ -11,12 +11,11 @@ * and limitations under the License. */ -var assert = require('chai').assert, - less = require('less'), - formats = require('../../lib/common/formats'); +var formats = require('../../lib/common/formats'); +var less = require('less'); var file = { - "destination": "output/", + "destination": "__output/", "format": "less/variables", "name": "foo" }; @@ -48,17 +47,19 @@ var dictionary = { var formatter = formats['less/variables'].bind(file); -describe('formats', function() { - describe('less/variables', function() { - it('should have a valid less syntax', function(done) { +describe('formats', () => { + describe('less/variables', () => { + + it('should have a valid less syntax', done => { less.render(formatter(dictionary)) .then(function(output) { - assert.isDefined(output); + expect(output).toBeDefined(); done(); }) .catch(function(err) { - done(new Error(err)) + done(new Error(err)) }); }); + }); }); diff --git a/test/formats/scssIcons.js b/__tests__/formats/scssIcons.test.js similarity index 80% rename from test/formats/scssIcons.js rename to __tests__/formats/scssIcons.test.js index 297a976ac..ec95d3dc3 100644 --- a/test/formats/scssIcons.js +++ b/__tests__/formats/scssIcons.test.js @@ -11,12 +11,11 @@ * and limitations under the License. */ -var assert = require('chai').assert, - scss = require('node-sass'), - formats = require('../../lib/common/formats'); +var formats = require('../../lib/common/formats'); +var scss = require('node-sass'); var file = { - "destination": "output/", + "destination": "__output/", "format": "scss/icons", "name": "foo" }; @@ -44,21 +43,22 @@ var config = { prefix: 'sd' // Style-Dictionary Prefix }; - var formatter = formats['scss/icons'].bind(file); -describe('formats', function() { - describe('scss/icons', function() { - it('should have a valid scss syntax', function(done) { +describe('formats', () => { + describe('scss/icons', () => { + + it('should have a valid scss syntax', done => { scss.render({ data: formatter(dictionary, config), }, function(err, result) { if(err) { return done(new Error(err)); } - assert.isDefined(result.css); + expect(result.css).toBeDefined(); return done(); }); }); + }); }); diff --git a/test/formats/scssVariables.js b/__tests__/formats/scssVariables.test.js similarity index 80% rename from test/formats/scssVariables.js rename to __tests__/formats/scssVariables.test.js index abd38c619..3cf3dd7ec 100644 --- a/test/formats/scssVariables.js +++ b/__tests__/formats/scssVariables.test.js @@ -11,12 +11,11 @@ * and limitations under the License. */ -var assert = require('chai').assert, - scss = require('node-sass'), - formats = require('../../lib/common/formats'); +var formats = require('../../lib/common/formats'); +var scss = require('node-sass'); var file = { - "destination": "output/", + "destination": "__output/", "format": "scss/variables", "name": "foo" }; @@ -48,18 +47,20 @@ var dictionary = { var formatter = formats['scss/variables'].bind(file); -describe('formats', function() { - describe('scss/variables', function() { - it('should have a valid scss syntax', function(done) { +describe('formats', () => { + describe('scss/variables', () => { + + it('should have a valid scss syntax', done => { scss.render({ data: formatter(dictionary), }, function(err, result) { if(err) { return done(new Error(err)); } - assert.isDefined(result.css); + expect(result.css).toBeDefined(); return done(); }); }); + }); }); diff --git a/test/performAction.js b/__tests__/performAction.test.js similarity index 52% rename from test/performAction.js rename to __tests__/performAction.test.js index ba7f7b768..aad21193e 100644 --- a/test/performAction.js +++ b/__tests__/performAction.test.js @@ -11,38 +11,42 @@ * and limitations under the License. */ -var assert = require('chai').assert, - helpers = require('./helpers'), - fs = require('fs-extra'), - StyleDictionary = require('../index'); +var StyleDictionary = require('../index'); +var StyleDictionaryExtended = StyleDictionary.extend({ + "platforms": { + "android": { + "actions": ["test"] + } + } +}); +var helpers = require('./__helpers'); +var fs = require('fs-extra'); -StyleDictionary.registerAction({ +StyleDictionaryExtended.registerAction({ name: 'test', do: function() { - fs.writeFileSync('./test/output/action.txt', 'hi') + fs.writeFileSync('./__tests__/__output/action.txt', 'hi') }, undo: function() { - fs.removeSync('./test/output/action.txt') + fs.removeSync('./__tests__/__output/action.txt') } }); -var test = StyleDictionary.extend({ - "platforms": { - "android": { - "actions": ["test"] - } - } -}); +describe('performAction', () => { -describe('buildPlatform', function() { - describe('handle actions', function() { - beforeEach(function() { - helpers.clearOutput(); - }); + beforeEach(() => { + helpers.clearOutput(); + }); + + afterEach(() => { + helpers.clearOutput(); + }); - it('should write to a file properly', function() { - test.buildPlatform('android'); - assert(helpers.fileExists('./test/output/action.txt')); + describe('handle actions', () => { + it('should write to a file properly', () => { + StyleDictionaryExtended.buildPlatform('android'); + expect(helpers.fileExists('./__tests__/__output/action.txt')).toBeTruthy(); }); }); + }); diff --git a/__tests__/register/action.test.js b/__tests__/register/action.test.js new file mode 100644 index 000000000..889954acb --- /dev/null +++ b/__tests__/register/action.test.js @@ -0,0 +1,108 @@ +/* + * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with + * the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +var StyleDictionary = require('../../index'); +var StyleDictionaryExtended = StyleDictionary.extend({}); + +describe('register', () => { + describe('action', () => { + + it('should error if name is not a string', () => { + expect( + StyleDictionaryExtended.registerAction.bind(null, { + do: function() {} + }) + ).toThrow('name must be a string'); + + expect( + StyleDictionaryExtended.registerAction.bind(null, { + name: 1, + do: function() {} + }) + ).toThrow('name must be a string'); + + expect( + StyleDictionaryExtended.registerAction.bind(null, { + name: [], + do: function() {} + }) + ).toThrow('name must be a string'); + + expect( + StyleDictionaryExtended.registerAction.bind(null, { + name: {}, + do: function() {} + }) + ).toThrow('name must be a string'); + }); + + it('should error if do is not a function', () => { + expect( + StyleDictionaryExtended.registerAction.bind(null, { + name: 'test' + }) + ).toThrow('do must be a function'); + + expect( + StyleDictionaryExtended.registerAction.bind(null, { + name: 'test', + do: 1 + }) + ).toThrow('do must be a function'); + + expect( + StyleDictionaryExtended.registerAction.bind(null, { + name: 'test', + do: 'name' + }) + ).toThrow('do must be a function'); + + expect( + StyleDictionaryExtended.registerAction.bind(null, { + name: 'test', + do: [] + }) + ).toThrow('do must be a function'); + + expect( + StyleDictionaryExtended.registerAction.bind(null, { + name: 'test', + do: {} + }) + ).toThrow('do must be a function'); + }); + + it('should work if name and do are good', () => { + StyleDictionaryExtended.registerAction({ + name: 'scss', + do: function() {} + }); + expect(typeof StyleDictionaryExtended.action['scss'].do).toBe('function'); + }); + + it('should handle an undo function', () => { + StyleDictionaryExtended.registerAction({ + name: 'scss', + do: function() {}, + undo: function() {} + }); + expect(typeof StyleDictionaryExtended.action['scss'].undo).toBe('function'); + }); + + it('should properly pass the registered format to instances', () => { + var SDE2 = StyleDictionaryExtended.extend({}); + expect(typeof SDE2.action['scss'].do).toBe('function'); + }); + + }); +}); diff --git a/__tests__/register/format.test.js b/__tests__/register/format.test.js new file mode 100644 index 000000000..282b4a050 --- /dev/null +++ b/__tests__/register/format.test.js @@ -0,0 +1,99 @@ +/* + * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with + * the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +var StyleDictionary = require('../../index'); +var StyleDictionaryExtended = StyleDictionary.extend({}); + +describe('register', () => { + describe('format', () => { + + it('should error if name is not a string', () => { + expect( + StyleDictionaryExtended.registerFormat.bind(null, { + formatter: function() {} + }) + ).toThrow('transform name must be a string'); + + expect( + StyleDictionaryExtended.registerFormat.bind(null, { + name: 1, + formatter: function() {} + }) + ).toThrow('transform name must be a string'); + + expect( + StyleDictionaryExtended.registerFormat.bind(null, { + name: [], + formatter: function() {} + }) + ); + + expect( + StyleDictionaryExtended.registerFormat.bind(null, { + name: {}, + formatter: function() {} + }) + ).toThrow('transform name must be a string'); + }); + + it('should error if formatter is not a function', () => { + expect( + StyleDictionaryExtended.registerFormat.bind(null, { + name: 'test' + }) + ).toThrow('format formatter must be a function'); + + expect( + StyleDictionaryExtended.registerFormat.bind(null, { + name: 'test', + formatter: 1 + }) + ).toThrow('format formatter must be a function'); + + expect( + StyleDictionaryExtended.registerFormat.bind(null, { + name: 'test', + formatter: 'name' + }) + ).toThrow('format formatter must be a function'); + + expect( + StyleDictionaryExtended.registerFormat.bind(null, { + name: 'test', + formatter: [] + }) + ).toThrow('format formatter must be a function'); + + expect( + StyleDictionaryExtended.registerFormat.bind(null, { + name: 'test', + formatter: {} + }) + ).toThrow('format formatter must be a function'); + }); + + it('should work if name and formatter are good', () => { + StyleDictionaryExtended.registerFormat({ + name: 'scss', + formatter: function() {} + }); + expect(typeof StyleDictionaryExtended.format['scss']).toBe('function'); + }); + + it('should properly pass the registered format to instances', () => { + var SDE2 = StyleDictionaryExtended.extend({}); + expect(typeof SDE2.format['scss']).toBe('function'); + }); + + }); +}); diff --git a/__tests__/register/transform.test.js b/__tests__/register/transform.test.js new file mode 100644 index 000000000..c3364e870 --- /dev/null +++ b/__tests__/register/transform.test.js @@ -0,0 +1,88 @@ +/* + * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with + * the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +var StyleDictionary = require('../../index'); +var StyleDictionaryExtended = StyleDictionary.extend({}); + +describe('register', () => { + describe('transform', () => { + + it('should error if type is not a string', () => { + expect( + StyleDictionaryExtended.registerTransform.bind(null, { + type: 3 + }) + ).toThrow('type must be a string'); + }); + + it('should error if type is not a valid type', () => { + expect( + StyleDictionaryExtended.registerTransform.bind(null, { + type: 'foo' + }) + ).toThrow('foo type is not one of: name, value, attribute'); + }); + + it('should error if name is not a string', () => { + expect( + StyleDictionaryExtended.registerTransform.bind(null, { + type: 'name' + }) + ).toThrow('name must be a string'); + }); + + it('should error if matcher is not a function', () => { + expect( + StyleDictionaryExtended.registerTransform.bind(null, { + type: 'name', + name: 'name', + matcher: 'foo' + }) + ).toThrow('matcher must be a function'); + }); + + it('should error if transformer is not a function', () => { + expect( + StyleDictionaryExtended.registerTransform.bind(null, { + type: 'name', + name: 'name', + matcher: function() { return true; }, + transformer: 'foo' + }) + ).toThrow('transformer must be a function'); + }); + + it('should work if type, matcher, and transformer are all proper', () => { + StyleDictionaryExtended.registerTransform({ + type: 'name', + name: 'foo', + matcher: function() { return true; }, + transformer: function() { return true; } + }); + expect(typeof StyleDictionaryExtended.transform.foo).toBe('object'); + expect(StyleDictionaryExtended).toHaveProperty('transform.foo.type', 'name'); + expect(typeof StyleDictionaryExtended.transform.foo.matcher).toBe('function'); + expect(typeof StyleDictionaryExtended.transform.foo.transformer).toBe('function'); + }); + + + it('should properly pass the registered transform to instances', () => { + var SDE2 = StyleDictionaryExtended.extend({}); + expect(typeof SDE2.transform.foo).toBe('object'); + expect(SDE2).toHaveProperty('transform.foo.type', 'name'); + expect(typeof SDE2.transform.foo.matcher).toBe('function'); + expect(typeof SDE2.transform.foo.transformer).toBe('function'); + }); + + }); +}); diff --git a/__tests__/register/transformGroup.test.js b/__tests__/register/transformGroup.test.js new file mode 100644 index 000000000..27e05ccbf --- /dev/null +++ b/__tests__/register/transformGroup.test.js @@ -0,0 +1,109 @@ +/* + * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with + * the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +var StyleDictionary = require('../../index'); +var StyleDictionaryExtended = StyleDictionary.extend({}); + +describe('register/transformGroup', () => { + it('should error if name is not a string', () => { + expect( + StyleDictionaryExtended.registerTransformGroup.bind(null, { + transforms: ['foo'] + }) + ).toThrow('transform name must be a string'); + + expect( + StyleDictionaryExtended.registerTransformGroup.bind(null, { + name: 1, + transforms: ['foo'] + }) + ).toThrow('transform name must be a string'); + + expect( + StyleDictionaryExtended.registerTransformGroup.bind(null, { + name: [], + transforms: ['foo'] + }) + ).toThrow('transform name must be a string'); + + expect( + StyleDictionaryExtended.registerTransformGroup.bind(null, { + name: {}, + transforms: ['foo'] + }) + ).toThrow('transform name must be a string'); + + expect( + StyleDictionaryExtended.registerTransformGroup.bind(null, { + name: function() {}, + transforms: ['foo'] + }) + ).toThrow('transform name must be a string'); + }); + + it('should error if transforms isnt an array', () => { + expect( + StyleDictionaryExtended.registerTransformGroup.bind(null, { + name: 'foo' + }) + ).toThrow('transforms must be an array of registered value transforms'); + + expect( + StyleDictionaryExtended.registerTransformGroup.bind(null, { + name: 'foo', + transforms: 'foo' + }) + ).toThrow('transforms must be an array of registered value transforms'); + + expect( + StyleDictionaryExtended.registerTransformGroup.bind(null, { + name: 'foo', + transforms: {} + }) + ).toThrow('transforms must be an array of registered value transforms'); + + expect( + StyleDictionaryExtended.registerTransformGroup.bind(null, { + name: 'foo', + transforms: function() {} + }) + ).toThrow('transforms must be an array of registered value transforms'); + }); + + it('should error if transforms arent registered', () => { + expect( + StyleDictionaryExtended.registerTransformGroup.bind(StyleDictionary, + { + name: 'foo', + transforms: ['foo'] + }) + ).toThrow('transforms must be an array of registered value transforms'); + }); + + it('should work if everything is good', () => { + StyleDictionaryExtended.registerTransformGroup({ + name: 'foo', + transforms: ['size/px'] + }); + expect(Array.isArray(StyleDictionaryExtended.transformGroup.foo)).toBeTruthy(); + expect(typeof StyleDictionaryExtended.transformGroup.foo[0]).toBe('string'); + expect(StyleDictionaryExtended.transformGroup.foo[0]).toBe('size/px'); + }); + + it('should properly pass the registered format to instances', () => { + var SDE2 = StyleDictionaryExtended.extend({}); + expect(Array.isArray(SDE2.transformGroup.foo)).toBeTruthy(); + expect(typeof SDE2.transformGroup.foo[0]).toBe('string'); + expect(SDE2.transformGroup.foo[0]).toBe('size/px'); + }); +}); diff --git a/test/property.js b/__tests__/transform/property.test.js similarity index 73% rename from test/property.js rename to __tests__/transform/property.test.js index a10f17f30..7b3009f49 100644 --- a/test/property.js +++ b/__tests__/transform/property.test.js @@ -11,9 +11,7 @@ * and limitations under the License. */ -var assert = require('chai').assert, - transformProperty = require('../lib/transform/property'); - +var property = require('../../lib/transform/property'); var options = { transforms: [ @@ -37,12 +35,15 @@ var options = { ] }; -describe('transformProperty', function() { - it('should work', function() { - var test = transformProperty({attributes:{baz:'blah'}}, options); - assert.equal(test.attributes.bar, 'foo'); - assert.equal(test.name, 'hello'); - }); +describe('transform', () => { + describe('property', () => { - // Add more tests + it('should work', () => { + var test = property({attributes:{baz:'blah'}}, options); + expect(test).toHaveProperty('attributes.bar', 'foo'); + expect(test).toHaveProperty('name', 'hello'); + }); + + // Add more tests + }); }); diff --git a/__tests__/transform/propertySetup.test.js b/__tests__/transform/propertySetup.test.js new file mode 100644 index 000000000..aabc43abe --- /dev/null +++ b/__tests__/transform/propertySetup.test.js @@ -0,0 +1,93 @@ +/* + * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with + * the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +var propertySetup = require('../../lib/transform/propertySetup'); + +describe('transform', () => { + describe('propertySetup', () => { + + it('should error if property is not an object', () => { + expect( + propertySetup.bind(null, null, 'foo', []) + ).toThrow('Property object must be an object'); + }); + + it('should error if name in not a string', () => { + expect( + propertySetup.bind(null, {}, null, []) + ).toThrow('Name must be a string'); + }); + + it('should error path is not an array', () => { + expect( + propertySetup.bind(null, {}, 'name', null) + ).toThrow('Path must be an array'); + }); + + + it('should work if all the args are proper', () => { + var test = propertySetup( + {value: "#fff"}, + "white", + ["color","base"] + ); + expect(typeof test).toBe('object'); + expect(test); + expect(test).toHaveProperty('value'); + expect(test).toHaveProperty('original'); + expect(test).toHaveProperty('attributes'); + expect(test).toHaveProperty('path'); + }); + + + it('should not do anything and return the property if it has been setup previously', () => { + var original = {value: "#fff", original:{}}; + var test = propertySetup( + original, + "white", + ["color","base"] + ); + expect(test).toMatchObject(original); + }); + + it('should use attributes if already set', () => { + var attributes = {"foo":"bar"}; + var test = propertySetup( + {value:"#fff", attributes:attributes}, + "white", + ["color","base"] + ); + expect(test.attributes).toMatchObject(attributes); + }); + + it('should use the name on the property if set', () => { + var name = "name"; + var test = propertySetup( + {value:"#fff", name:name}, + 'white', + ["color","base"] + ); + expect(test).toHaveProperty('name', name); + }); + + it('should use the name passed in if not set on the property', () => { + var test = propertySetup( + {value:"#fff"}, + 'white', + ["color","base"] + ); + expect(test).toHaveProperty('name', 'white'); + }); + + }); +}); diff --git a/__tests__/utils/combineJSON.test.js b/__tests__/utils/combineJSON.test.js new file mode 100644 index 000000000..d028be23a --- /dev/null +++ b/__tests__/utils/combineJSON.test.js @@ -0,0 +1,72 @@ +/* + * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with + * the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +var combineJSON = require('../../lib/utils/combineJSON'); +var path = require('path'); + +describe('utils', () => { + describe('combineJSON', () => { + + it('should return an object', () => { + var test = combineJSON(["__tests__/__json_files/*.json"]); + expect(typeof test).toBe('object') + }); + + it('should handle wildcards', () => { + var test = combineJSON(["__tests__/__json_files/*.json"]); + expect(typeof test).toBe('object') + }); + + it('should handle js modules that export objects', () => { + var absPath = path.join(process.cwd(), 'test', 'json_files', '*.js'); + var relativePath = '__tests__/__json_files/*.js'; + var test = combineJSON([absPath, relativePath]); + expect(typeof test).toBe('object') + }); + + it('should do a deep merge', () => { + var test = combineJSON(["__tests__/__json_files/shallow/*.json"], true); + expect(test).toHaveProperty('a', 2); + expect(test.b).toMatchObject({"a":1, "c":2}) + expect(test).toHaveProperty('d.e.f.g', 1); + expect(test).toHaveProperty('d.e.f.h', 2); + }); + + it('should do a shallow merge', () => { + var test = combineJSON(["__tests__/__json_files/shallow/*.json"]); + expect(test).toHaveProperty('a', 2); + expect(test.b).toMatchObject({"c":2}); + expect(test).toHaveProperty('c', [3,4]); + expect(test).not.toHaveProperty('d.e.f.g'); + expect(test).toHaveProperty('d.e.f.h', 2); + }); + + it('should fail on invalid JSON', () => { + expect( + combineJSON.bind(null, ["__tests__/__json_files/broken/*.json"], true) + ).toThrow(/Failed to load or parse/); + }); + + it('should fail if there is a collision and it is passed a collision function', () => { + expect( + combineJSON.bind(null, ["__tests__/__json_files/shallow/*.json"], true, function Collision(opts) { + expect(opts).toHaveProperty('key', 'a'); + expect(opts.target[opts.key]).toBe(1); + expect(opts.copy[opts.key]).toBe(2); + throw new Error('test'); + }) + ).toThrow(/test/); + }); + + }); +}); diff --git a/__tests__/utils/convertToBase64.test.js b/__tests__/utils/convertToBase64.test.js new file mode 100644 index 000000000..13d5ad122 --- /dev/null +++ b/__tests__/utils/convertToBase64.test.js @@ -0,0 +1,40 @@ +/* + * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with + * the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +var convertToBase64 = require('../../lib/utils/convertToBase64.js'); + +describe('utils', () => { + describe('convertToBase64', () => { + it('should error if filePath isnt a string', () => { + expect( + convertToBase64.bind(null) + ).toThrow('filePath name must be a string'); + expect( + convertToBase64.bind(null, []) + ).toThrow('filePath name must be a string'); + expect( + convertToBase64.bind(null, {}) + ).toThrow('filePath name must be a string'); + }); + + it('should error if filePath isnt a file', () => { + expect( + convertToBase64.bind(null, 'foo') + ).toThrow("ENOENT: no such file or directory, open 'foo'"); + }); + + it('should return a string', () => { + expect(typeof convertToBase64('__tests__/__configs/test.json')).toBe('string'); + }); + }); +}); diff --git a/__tests__/utils/deepExtend.test.js b/__tests__/utils/deepExtend.test.js new file mode 100644 index 000000000..d2bde878e --- /dev/null +++ b/__tests__/utils/deepExtend.test.js @@ -0,0 +1,78 @@ +/* + * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with + * the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +var deepExtend = require('../../lib/utils/deepExtend'); + +describe('utils', () => { + describe('deepExtend', () => { + + it('should return an object', () => { + var test = deepExtend(); + expect(typeof test).toBe('object') + }); + + it('should override properties from right to left', () => { + var test = deepExtend([{foo:'bar'}, {foo:'baz'}]); + expect(test).toHaveProperty('foo', 'baz'); + + var test2 = deepExtend([{foo:'bar'}, {foo:'baz'}, {foo:'blah'}]); + expect(test2).toHaveProperty('foo', 'blah'); + }); + + it('should override nested properties', () => { + var test = deepExtend([{foo: {foo:'bar'}}, {foo: {foo:'baz'}}]); + expect(test).toHaveProperty('foo.foo', 'baz'); + + var test2 = deepExtend([{foo:{foo:'bar'}}, {foo:{foo:'baz'}}, {foo:{foo:'blah'}}]); + expect(test2).toHaveProperty('foo.foo', 'blah'); + }); + + it('should override nested properties', () => { + var test = deepExtend([{foo: {bar:'bar'}}, {foo: {baz:'baz'}}]); + expect(test).toHaveProperty('foo.baz', 'baz'); + expect(test).toHaveProperty('foo.bar', 'bar'); + + var test2 = deepExtend([{foo:{bar:'bar'}}, {foo:{baz:'baz'}}, {foo:{blah:'blah'}}]); + expect(test2).toHaveProperty('foo.baz', 'baz'); + expect(test2).toHaveProperty('foo.bar', 'bar'); + expect(test2).toHaveProperty('foo.blah', 'blah'); + }); + + it('shouldn\'t fail loudly if it is a normal deep extend', () => { + var test = deepExtend([{foo: {bar:'bar'}}, {foo: {baz:'baz'}}], function() {}); + expect(test).toHaveProperty('foo.baz', 'baz'); + expect(test).toHaveProperty('foo.bar', 'bar'); + }); + + describe('collision detection', () => { + it('should call the collision function if a collision happens', () => { + expect( + deepExtend.bind(null, [{foo: {bar:'bar'}}, {foo: {bar:'baz'}}], function() { + throw new Error('danger danger. high voltage.'); + }) + ).toThrow('danger danger. high voltage.'); + }); + + it('the collision function should have the proper arguments', () => { + var test = deepExtend([{foo: {bar:'bar'}}, {foo: {bar:'baz'}}], function(opts) { + expect(opts).toHaveProperty('target.bar', 'bar'); + expect(opts).toHaveProperty('copy.bar', 'baz'); + expect(opts.path[0]).toBe('foo'); + expect(opts).toHaveProperty('key', 'bar'); + }); + expect(test).toHaveProperty('foo.bar', 'baz'); + }); + }); + + }); +}); diff --git a/__tests__/utils/resolveObject.test.js b/__tests__/utils/resolveObject.test.js new file mode 100644 index 000000000..c07d28323 --- /dev/null +++ b/__tests__/utils/resolveObject.test.js @@ -0,0 +1,249 @@ +/* + * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with + * the License. A copy of the License is located at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +var resolveObject = require('../../lib/utils/resolveObject'); +var helpers = require('../__helpers'); + +describe('utils', () => { + describe('resolveObject', () => { + + it('should error on non-objects', () => { + expect( + resolveObject.bind(null), + ).toThrow('Please pass an object in'); + expect( + resolveObject.bind(null, 'foo'), + ).toThrow('Please pass an object in'); + expect( + resolveObject.bind(null, 0), + ).toThrow('Please pass an object in'); + }); + + it('should not mutate the original object', () => { + var original = helpers.fileToJSON(__dirname + '/../__json_files/nested_references.json'); + var test = resolveObject( original ); + expect(original).toHaveProperty('a.b.d', '{e.f.g}'); + expect(test).toHaveProperty('a.b.d', 2); + }); + + it('should do simple references', () => { + var test = resolveObject( helpers.fileToJSON(__dirname + '/../__json_files/simple.json') ); + expect(test).toHaveProperty('bar', 'bar'); + }); + + it('should do nested references', () => { + var obj = helpers.fileToJSON(__dirname + '/../__json_files/nested_references.json'); + var test = resolveObject( obj ); + expect(test).toHaveProperty('i', 2); + expect(test).toHaveProperty('a.b.d', 2); + expect(test).toHaveProperty('e.f.h', 1); + }); + + it('should handle nested pointers', () => { + var test = resolveObject( helpers.fileToJSON(__dirname + '/../__json_files/nested_pointers.json') ); + expect(test).toHaveProperty('b', 1); + expect(test).toHaveProperty('c', 1); + }); + + it('should handle deep nested pointers', () => { + var test = resolveObject( helpers.fileToJSON(__dirname + '/../__json_files/nested_pointers_2.json') ); + expect(test).toHaveProperty('a', 1); + expect(test).toHaveProperty('b', 1); + expect(test).toHaveProperty('c', 1); + expect(test).toHaveProperty('d', 1); + expect(test).toHaveProperty('e', 1); + expect(test).toHaveProperty('f', 1); + expect(test).toHaveProperty('g', 1); + }); + + it('should handle deep nested pointers with string interpolation', () => { + var test = resolveObject( helpers.fileToJSON(__dirname + '/../__json_files/nested_pointers_3.json') ); + expect(test).toHaveProperty('a', 'foo bon bee bae boo bla baz bar'); + expect(test).toHaveProperty('b', 'foo bon bee bae boo bla baz'); + expect(test).toHaveProperty('c', 'foo bon bee bae boo bla'); + expect(test).toHaveProperty('d', 'foo bon bee bae boo'); + expect(test).toHaveProperty('e', 'foo bon bee bae'); + expect(test).toHaveProperty('f', 'foo bon bee'); + expect(test).toHaveProperty('g', 'foo bon'); + } + ); + + it('should handle deep nested pointers and nested references', () => { + var test = resolveObject( helpers.fileToJSON(__dirname + '/../__json_files/nested_pointers_4.json') ); + expect(test).toHaveProperty('a.a.a', 1); + expect(test).toHaveProperty('b.b.b', 1); + expect(test).toHaveProperty('c.c.c', 1); + expect(test).toHaveProperty('d.d.d', 1); + expect(test).toHaveProperty('e.e.e', 1); + expect(test).toHaveProperty('f.f.f', 1); + expect(test).toHaveProperty('g.g.g', 1); + }); + + + it('should keep the type of the referenced property', () => { + var test = resolveObject( helpers.fileToJSON(__dirname + '/../__json_files/reference_type.json') ); + expect(test).toHaveProperty('d', 1); + expect(typeof test.d).toBe('number'); + expect(typeof test.e).toBe('object'); + expect(Array.isArray(test.f)).toBeTruthy(); + expect(test).toHaveProperty('e.c', 2); + }); + + it('should handle and evaluate items in an array', () => { + var test = resolveObject( helpers.fileToJSON(__dirname + '/../__json_files/array.json') ); + expect(test.d[0]).toBe(2); + expect(test.d[1]).toBe(1); + expect(test.e[0].a).toBe(1); + expect(test.e[1].a).toBe(2); + }); + + it('should throw if pointers don\'t exist', () => { + expect( + resolveObject.bind( helpers.fileToJSON(__dirname + '/../__json_files/non_existent.json')) + ).toThrow(); + }); + + it('should gracefully handle circular references', () => { + expect( + resolveObject.bind(null, + helpers.fileToJSON(__dirname + '/../__json_files/circular.json') + ) + ).toThrow('Circular definition: a | d'); + expect( + resolveObject.bind(null, + helpers.fileToJSON(__dirname + '/../__json_files/circular_2.json') + ) + ).toThrow('Circular definition: a.b.c | d'); + expect( + resolveObject.bind(null, + helpers.fileToJSON(__dirname + '/../__json_files/circular_3.json') + ) + ).toThrow('Circular definition: a.b.c | d.e.f'); + expect( + resolveObject.bind(null, + helpers.fileToJSON(__dirname + '/../__json_files/circular_4.json') + ) + ).toThrow('Circular definition: a.b.c | g.h'); + }); + + describe('ignoreKeys', () => { + it('should handle default value of original', () => { + var test = resolveObject({ + foo: { value: 'bar' }, + bar: { + value: '{foo.value}', + original: '{foo.value}' + } + }); + expect(test).toHaveProperty ('bar.original', '{foo.value}'); + }); + + it('should handle any nested keys under the ignoreKey', () => { + var test = resolveObject({ + foo: { value: 'bar' }, + bar: { + value: '{foo.value}', + original: { + value: '{foo.value}', + foo: { + bar: '{foo.value}' + } + } + } + }); + expect(test).toHaveProperty ('bar.original.value', '{foo.value}'); + expect(test).toHaveProperty ('bar.original.foo.bar', '{foo.value}'); + }); + + it('should handle passing in custom ignoreKeys', () => { + var test = resolveObject({ + foo: { value: 'bar' }, + bar: { + value: '{foo.value}', + baz: '{foo.value}' + } + }, { + ignoreKeys: ['baz'] + }); + expect(test).toHaveProperty ('bar.baz', '{foo.value}'); + }); + + it('should handle multiple keys', () => { + var test = resolveObject({ + foo: { value: 'bar' }, + bar: { + value: '{foo.value}', + original: '{foo.value}', + baz: '{foo.value}' + } + },{ + ignoreKeys: ['baz','original'] + }); + expect(test).toHaveProperty ('bar.original', '{foo.value}'); + expect(test).toHaveProperty ('bar.baz', '{foo.value}'); + }); + + it('should not ignore anything if set to null or empty array', () => { + var test = resolveObject({ + foo: { value: 'bar' }, + bar: { + value: '{foo.value}', + original: '{foo.value}' + } + },{ + ignoreKeys: [] + }); + expect(test).toHaveProperty ('bar.original', 'bar'); + + var test2 = resolveObject({ + foo: { value: 'bar' }, + bar: { + value: '{foo.value}', + original: '{foo.value}' + } + },{ + ignoreKeys: null + }); + expect(test2).toHaveProperty ('bar.original', 'bar'); + + var test3 = resolveObject({ + foo: { value: 'bar' }, + bar: { + value: '{foo.value}', + original: '{foo.value}' + } + },{ + ignoreKeys: undefined + }); + expect(test3).toHaveProperty ('bar.original', 'bar'); + }); + }); + + it('should handle spaces', () => { + var test = resolveObject({ + foo: { value: 'bar' }, + bar: { value: '{ foo.value }'} + }); + expect(test).toHaveProperty ('foo.value', test.bar.value); + }); + + it('should collect multiple reference errors', () => { + expect( + resolveObject.bind(null, + helpers.fileToJSON(__dirname + '/../__json_files/multiple_reference_errors.json') + ) + ).toThrow('Failed due to 3 errors:'); + }); + + }); +}); diff --git a/example/react/native/StyleDictionaryExample/__tests__/index.android.js b/example/react/native/StyleDictionaryExample/__tests__/index.android.js deleted file mode 100644 index b49b9087f..000000000 --- a/example/react/native/StyleDictionaryExample/__tests__/index.android.js +++ /dev/null @@ -1,12 +0,0 @@ -import 'react-native'; -import React from 'react'; -import Index from '../index.android.js'; - -// Note: test renderer must be required after react-native. -import renderer from 'react-test-renderer'; - -it('renders correctly', () => { - const tree = renderer.create( - - ); -}); diff --git a/example/react/native/StyleDictionaryExample/__tests__/index.ios.js b/example/react/native/StyleDictionaryExample/__tests__/index.ios.js deleted file mode 100644 index ba7c5b5e1..000000000 --- a/example/react/native/StyleDictionaryExample/__tests__/index.ios.js +++ /dev/null @@ -1,12 +0,0 @@ -import 'react-native'; -import React from 'react'; -import Index from '../index.ios.js'; - -// Note: test renderer must be required after react-native. -import renderer from 'react-test-renderer'; - -it('renders correctly', () => { - const tree = renderer.create( - - ); -}); diff --git a/lib/common/templates/android/colors.template b/lib/common/templates/android/colors.template index c4c1543ca..0c913bf58 100644 --- a/lib/common/templates/android/colors.template +++ b/lib/common/templates/android/colors.template @@ -20,7 +20,7 @@ var props = _.filter(allProperties, function(prop) { %> <% _.each(props, function(prop) { diff --git a/lib/common/templates/android/dimens.template b/lib/common/templates/android/dimens.template index 4d3be65a5..d101497fe 100644 --- a/lib/common/templates/android/dimens.template +++ b/lib/common/templates/android/dimens.template @@ -19,7 +19,7 @@ var props = _.filter(allProperties, function(prop) { }); %> <% _.each(props, function(prop) { diff --git a/lib/common/templates/android/fontDimens.template b/lib/common/templates/android/fontDimens.template index 975f385ea..18fd9f5ee 100644 --- a/lib/common/templates/android/fontDimens.template +++ b/lib/common/templates/android/fontDimens.template @@ -19,7 +19,7 @@ var props = _.filter(allProperties, function(prop) { }); %> <% _.each(props, function(prop) { diff --git a/lib/common/templates/android/integers.template b/lib/common/templates/android/integers.template index b5b73dde7..2f6fe980a 100644 --- a/lib/common/templates/android/integers.template +++ b/lib/common/templates/android/integers.template @@ -19,7 +19,7 @@ var props = _.filter(allProperties, function(prop) { }); %> <% _.each(props, function(prop) { diff --git a/lib/common/templates/android/strings.template b/lib/common/templates/android/strings.template index 696b44910..75afcba63 100644 --- a/lib/common/templates/android/strings.template +++ b/lib/common/templates/android/strings.template @@ -19,7 +19,7 @@ var props = _.filter(allProperties, function(prop) { }); %> <% _.each(props, function(prop) { diff --git a/package.json b/package.json index 1dc52556d..c5e8e60c7 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ ], "scripts": { "lint": "eslint index.js lib/**/*.js test/*.js test/**/*.js", - "test": "npm run lint && mocha --recursive -c", + "test": "npm run lint && jest --runInBand", "coverage": "istanbul cover ./node_modules/mocha/bin/_mocha -- test/*.js test/**/*.js", "preversion": "npm test", "version": "node ./scripts/version.js && npm run generate-docs", @@ -44,6 +44,20 @@ "serve-docs": "docsify serve docs -p 3000 -P 12345", "install-cli": "npm install -g $(npm pack)" }, + "jest": { + "verbose": false, + "roots": [ + "__tests__" + ], + "testPathIgnorePatterns": [ + "/__tests__/__helpers.js", + "/__tests__/__assets/", + "/__tests__/__configs/", + "/__tests__/__json_files/", + "/__tests__/__properties/", + "/__tests__/__output/" + ] + }, "husky": { "hooks": { "pre-commit": "npm test" @@ -66,13 +80,14 @@ ], "homepage": "https://github.com/amzn/style-dictionary", "dependencies": { + "chalk": "^2.4.1", "commander": "^2.9.0", "fs-extra": "^6.0.1", "glob": "^7.1.1", "lodash": "^4.16.4", + "mockdate": "^2.0.2", "resolve-cwd": "^2.0.0", - "tinycolor2": "^1.4.1", - "chalk": "^2.4.1" + "tinycolor2": "^1.4.1" }, "devDependencies": { "chai": "^4.1.2", @@ -81,6 +96,7 @@ "eslint": "^4.19.1", "husky": "^1.0.0-rc.8", "istanbul": "^0.4.5", + "jest": "^23.6.0", "jsdoc-to-markdown": "^4.0.1", "less": "^3.0.1", "mocha": "^5.2.0", diff --git a/test/buildAllPlatforms.js b/test/buildAllPlatforms.js deleted file mode 100644 index a36ce64f9..000000000 --- a/test/buildAllPlatforms.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ - -var assert = require('chai').assert, - helpers = require('./helpers'), - StyleDictionary = require('../index'); - -describe('buildAllPlatforms', function() { - beforeEach(function() { - helpers.clearOutput(); - }); - - it('should work with json config', function() { - var test = StyleDictionary.extend(__dirname + '/configs/test.json'); - test.buildAllPlatforms(); - assert(helpers.fileExists('./test/output/web/_icons.css')); - assert(helpers.fileExists('./test/output/android/colors.xml')); - }); - - it('should work with js config', function() { - var test = StyleDictionary.extend(__dirname + '/configs/test.js'); - test.buildAllPlatforms(); - assert(helpers.fileExists('./test/output/web/_icons.css')); - assert(helpers.fileExists('./test/output/android/colors.xml')); - }); -}); diff --git a/test/buildFile.js b/test/buildFile.js deleted file mode 100644 index 097ce6dd2..000000000 --- a/test/buildFile.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ - -var assert = require('chai').assert, - helpers = require('./helpers'), - buildFile = require('../lib/buildFile'); - -function format() { - return "hi"; -} - -describe('buildFile', function() { - beforeEach(function() { - helpers.clearOutput(); - }); - - it('should error if format doesnt exist or isnt a function', function() { - assert.throws( - buildFile.bind(null, 'test/output/test.txt', {}, {}, {}), - Error, - 'Please enter a valid file format' - ); - assert.throws( - buildFile.bind(null, 'test/output/test.txt', [], {}, {}), - Error, - 'Please enter a valid file format' - ); - assert.throws( - buildFile.bind(null, 'test/output/test.txt', null, {}, {}), - Error, - 'Please enter a valid file format' - ); - }); - - it('should error if destination doesnt exist or isnt a string', function() { - assert.throws( - buildFile.bind(null, {}, format, {}, {}), - Error, - 'Please enter a valid destination' - ); - assert.throws( - buildFile.bind(null, [], format, {}, {}), - Error, - 'Please enter a valid destination' - ); - assert.throws( - buildFile.bind(null, null, format, {}, {}), - Error, - 'Please enter a valid destination' - ); - }); - - it('should write to a file properly', function() { - buildFile('test.txt', format, {buildPath: 'test/output/'}, {}); - assert(helpers.fileExists('./test/output/test.txt')); - }); -}); diff --git a/test/buildPlatform.js b/test/buildPlatform.js deleted file mode 100644 index c7e7e6d2e..000000000 --- a/test/buildPlatform.js +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ - -var assert = require('chai').assert, - helpers = require('./helpers'), - StyleDictionary = require('../index'); - -// Test configs -var config = helpers.fileToJSON(__dirname + '/configs/test.json'); -var test = StyleDictionary.extend(config); - -describe('buildPlatform', function() { - beforeEach(function() { - helpers.clearOutput(); - }); - - it('should throw if passed a platform that doesn\'t exist', function() { - assert.throws( - test.buildPlatform.bind(test, 'foobar'), - Error, - 'Platform foobar doesn\'t exist' - ); - - assert.doesNotThrow(function() { - test.buildPlatform('web'); - }); - }); - - it('should build web platform files', function() { - test.buildPlatform('web'); - assert(helpers.fileExists('./test/output/web/_icons.css')); - assert(helpers.fileExists('./test/output/web/_styles.js')); - assert(helpers.fileExists('./test/output/web/_variables.css')); - }); - - it('should build scss platform files', function() { - test.buildPlatform('scss'); - assert(helpers.fileExists('./test/output/scss/_icons.scss')); - assert(helpers.fileExists('./test/output/scss/_variables.scss')); - }); - - it('should build less platform files', function() { - test.buildPlatform('less'); - assert(helpers.fileExists('./test/output/less/_icons.less')); - assert(helpers.fileExists('./test/output/less/_variables.less')); - }); - - it('should do android stuff', function() { - test.buildPlatform('android'); - assert(helpers.fileExists('./test/output/android/main/res/drawable-hdpi/flag_us.png')); - assert(helpers.fileExists('./test/output/android/main/res/drawable-xhdpi/flag_us.png')); - assert(helpers.fileExists('./test/output/android/colors.xml')); - assert(helpers.fileExists('./test/output/android/dimens.xml')); - assert(helpers.fileExists('./test/output/android/font_dimen.xml')); - }); - - it('should do ios stuff', function() { - test.buildPlatform('ios'); - assert(helpers.fileExists('./test/output/ios/style_dictionary.plist')); - assert(helpers.fileExists('./test/output/ios/style_dictionary.h')); - }); - - it('should handle non-string values in properties', function() { - var test = StyleDictionary.extend({ - source: ['test/properties/nonString.json'], - platforms: { - test: { - buildPath: "test/output/", - transforms: ["attribute/cti","size/px","color/hex"], - files: [ - { - "destination": "output.json", - "format": "json" - } - ] - } - } - }); - test.buildPlatform('test'); - assert(helpers.fileExists('./test/output/output.json')); - // var input = helpers.fileToJSON('./test/properties/nonString.json'); - var output = helpers.fileToJSON('./test/output/output.json'); - - // Make sure transforms run on non-string values as they normally would - assert.equal(output.color.red.value, output.color.otherRed.value); - assert.equal(output.color.red.value, "#ff0000"); - assert.equal(output.size.large.value, output.size.otherLarge.value); - assert.equal(output.size.large.value, "20px"); - - // Make sure - assert.equal(output.number.test.value, output.number.otherTest.value); - assert.isNumber(output.number.otherTest.value); - assert.deepEqual(output.array.test.value, output.array.otherTest.value); - assert.isArray(output.array.otherTest.value); - assert.deepEqual(output.object.test.value, output.object.otherTest.value); - assert.isObject(output.object.otherTest.value); - }); - - it('should handle non-property nodes', function() { - var test = StyleDictionary.extend({ - source: ['test/properties/nonPropertyNode.json'], - platforms: { - test: { - buildPath: "test/output/", - transformGroup: "scss", - files: [ - { - "destination": "output.json", - "format": "json" - } - ] - } - } - }); - test.buildPlatform('test'); - assert(helpers.fileExists('./test/output/output.json')); - var input = helpers.fileToJSON('./test/properties/nonPropertyNode.json'); - var output = helpers.fileToJSON('./test/output/output.json'); - assert.deepEqual(output.color.key1, input.color.key1); - assert.deepEqual(output.color.base.red.key2, input.color.base.red.key2); - assert.equal(output.color.base.attributes.key3, input.color.base.attributes.key3); - }); - - it('should handle comments', function() { - var test = StyleDictionary.extend({ - source: ['test/properties/comment.json'], - platforms: { - test: { - buildPath: "test/output/", - transformGroup: "scss", - files: [ - { - "destination": "output.json", - "format": "json" - } - ] - } - } - }); - test.buildPlatform('test'); - assert(helpers.fileExists('./test/output/output.json')); - var input = helpers.fileToJSON('./test/properties/comment.json'); - var output = helpers.fileToJSON('./test/output/output.json'); - assert.deepEqual(output.size.large.comment, input.size.large.comment); - }); - - it('should throw an error if given a transformGroup that doesn\'t exist', function() { - var test = StyleDictionary.extend({ - source: ['properties/**/*.json'], - platforms: { - test: { - transformGroup: 'test', - files: [{ - destination: 'test/output/test.css', - format: 'css/variables' - }] - } - } - }); - assert.throws( - test.buildPlatform.bind(test, 'test'), - Error, - 'transformGroup test doesn\'t exist' - ); - }); -}); diff --git a/test/cleanAllPlatforms.js b/test/cleanAllPlatforms.js deleted file mode 100644 index 88a117873..000000000 --- a/test/cleanAllPlatforms.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ - -var assert = require('chai').assert, - helpers = require('./helpers'), - StyleDictionary = require('../index'); - -// Test configs -var config = helpers.fileToJSON(__dirname + '/configs/test.json'); -var test = StyleDictionary.extend(config); - -describe('cleanAllPlatforms', function() { - beforeEach(function() { - helpers.clearOutput(); - }); - - it('should work', function() { - test.buildAllPlatforms(); - test.cleanAllPlatforms(); - assert(helpers.fileDoesNotExist('./test/output/web/_icons.scss')); - assert(helpers.fileDoesNotExist('./test/output/android/colors.xml')); - }); -}); diff --git a/test/cleanDir.js b/test/cleanDir.js deleted file mode 100644 index 273ec793e..000000000 --- a/test/cleanDir.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ - -var assert = require('chai').assert, - helpers = require('./helpers'), - buildFile = require('../lib/buildFile'), - cleanFile = require('../lib/cleanFile'), - cleanDir = require('../lib/cleanDir'); - -function format() { - return "hi"; -} - -describe('cleanDir', function() { - beforeEach(function() { - helpers.clearOutput(); - }); - - it('should delete a dir properly', function() { - buildFile('test.txt', format, {buildPath: 'test/output/extradir1/extradir2/'}, {}); - cleanFile('test.txt', format, {buildPath: 'test/output/extradir1/extradir2/'}, {}); - cleanDir('test.txt', format, {buildPath: 'test/output/extradir1/extradir2/'}, {}); - assert(helpers.dirDoesNotExist('./test/output/extradir1/extradir2')); - assert(helpers.dirDoesNotExist('./test/output/extradir1')); - }); -}); diff --git a/test/cleanPlatform.js b/test/cleanPlatform.js deleted file mode 100644 index b6af7388e..000000000 --- a/test/cleanPlatform.js +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ - -var assert = require('chai').assert, - helpers = require('./helpers'), - StyleDictionary = require('../index'); - -// Test configs -var config = helpers.fileToJSON(__dirname + '/configs/test.json'); -var test = StyleDictionary.extend(config); - -describe('cleanPlatform', function() { - beforeEach(function() { - helpers.clearOutput(); - }); - - it('should delete the proper files', function() { - test.buildPlatform('web'); - test.cleanPlatform('web'); - assert(helpers.fileDoesNotExist('./test/output/web/_icons.scss')); - assert(helpers.fileDoesNotExist('./test/output/web/_styles.js')); - assert(helpers.fileDoesNotExist('./test/output/web/_variables.scss')); - }); - - it('should delete android stuff', function() { - test.buildPlatform('android'); - test.cleanPlatform('android'); - assert(helpers.fileDoesNotExist('./test/output/android/main/res/drawable-hdpi/flag_us.png')); - assert(helpers.fileDoesNotExist('./test/output/android/main/res/drawable-xhdpi/flag_us.png')); - assert(helpers.fileDoesNotExist('./test/output/android/colors.xml')); - assert(helpers.fileDoesNotExist('./test/output/android/dimens.xml')); - assert(helpers.fileDoesNotExist('./test/output/android/font_dimen.xml')); - }); - - it('should delete ios stuff', function() { - test.buildPlatform('ios'); - test.cleanPlatform('ios'); - assert(helpers.fileDoesNotExist('./test/output/ios/style_dictionary.plist')); - assert(helpers.fileDoesNotExist('./test/output/ios/style_dictionary.h')); - }); -}); diff --git a/test/cliBuild.js b/test/cliBuild.js deleted file mode 100644 index cd9212402..000000000 --- a/test/cliBuild.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ - -var assert = require('chai').assert, - childProcess = require("child_process"), - helpers = require('./helpers'); - -describe('cliBuildWithJsConfig', function() { - beforeEach(function() { - helpers.clearOutput(); - }); - - it('should work with json config', function() { - childProcess.execSync("node ./bin/style-dictionary build --config ./test/configs/test.json") - assert(helpers.fileExists('./test/output/web/_icons.css')); - assert(helpers.fileExists('./test/output/android/colors.xml')); - }); - - it('should work with javascript config', function() { - childProcess.execSync("node ./bin/style-dictionary build --config ./test/configs/test.js") - assert(helpers.fileExists('./test/output/web/_icons.css')); - assert(helpers.fileExists('./test/output/android/colors.xml')); - }); -}); diff --git a/test/exportPlatform.js b/test/exportPlatform.js deleted file mode 100644 index 66f541937..000000000 --- a/test/exportPlatform.js +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ - -var assert = require('chai').assert, - helpers = require('./helpers'), - keys = require('lodash/keys'), - StyleDictionary = require('../index'); - -// Test configs -var config = helpers.fileToJSON(__dirname + '/configs/test.json'); -var test = StyleDictionary.extend(config); - -describe('exportPlatform', function() { - - it('should throw if not given a proper platform', function () { - assert.throws(test.exportPlatform, Error); - }); - - it('should throw if not given a proper platform', function () { - assert.throws(function(){ - test.exportPlatform('foo'); - }); - }); - - it('should not throw if given a proper platform', function () { - assert.doesNotThrow(function(){ - test.exportPlatform('web'); - }); - }); - - it('should return an object', function () { - var dictionary = test.exportPlatform('web'); - assert.isObject(dictionary); - }); - - it('should have the same structure as the original properties', function () { - var dictionary = test.exportPlatform('web'); - assert.deepEqual( - keys(dictionary), - keys(test.properties) - ); - }); - - it('should have resolved references', function () { - var dictionary = test.exportPlatform('web'); - assert.equal( - dictionary.color.font.link.value, - dictionary.color.base.blue['100'].value - ); - }); - - it('should have applied transforms', function () { - var dictionary = test.exportPlatform('web'); - assert( - dictionary.size.padding.base.value.indexOf('px') - ); - }); - - it('should not have mutated the original properties', function () { - var dictionary = test.exportPlatform('web'); - - assert.notEqual( - dictionary.color.font.link.value, - test.properties.color.font.link.value - ); - - assert.equal( - test.properties.size.padding.base.value.indexOf('px'), - -1 - ); - }); - - // Make sure when we perform transforms and resolve references - // we don't mutate the original object added to the property. - it('properties should have original value untouched', function() { - var dictionary = test.exportPlatform('web'); - var properties = helpers.fileToJSON('test/properties/colors.json'); - - assert.equal( - dictionary.color.font.link.original.value, - properties.color.font.link.value - ); - }); -}); diff --git a/test/extend.js b/test/extend.js deleted file mode 100644 index c3fec250f..000000000 --- a/test/extend.js +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ - -var assert = require('chai').assert, - helpers = require('./helpers'), - _ = require('lodash'), - StyleDictionary = require('../index'); - -var test_props = { - size: { - padding: { - tiny: {value:'0'} - } - } -}; - -describe('extend', function() { - - describe('method signature', function() { - it('should accept a string as a path to a JSON file', function () { - var test = StyleDictionary.extend(__dirname + '/configs/test.json'); - assert.property(test.platforms, 'web'); - }); - - it('should accept an object as options', function () { - var config = helpers.fileToJSON(__dirname + '/configs/test.json'); - var test = StyleDictionary.extend(config); - assert.property(test.platforms, 'web'); - }); - - it('should override attributes', function () { - var test = StyleDictionary.extend({ - properties: { - foo: 'bar' - } - }); - assert.equal(test.properties.foo, 'bar'); - }); - - it('should have all same properties', function() { - var test = StyleDictionary.extend({}); - _.each(_.keys(StyleDictionary), function(property) { - assert.property(test, property) - }); - }); - }); - - - describe('includes', function() { - it('should throw if include isnt an array', function() { - assert.throws( - StyleDictionary.extend.bind(null, { - include: {} - }), - Error, - 'include must be an array' - ); - }); - - it('should throw if a path in the includes array doesnt resolve', function() { - assert.throws( - StyleDictionary.extend.bind(null, { - include: ['foo'] - }), - Error, - "Cannot find module 'foo'" - ); - }); - - it('should update properties if there are includes', function () { - var test = StyleDictionary.extend({ - include: [__dirname + '/configs/include.json'] - }); - assert.isObject(test.properties.size.padding.tiny); - }); - - it('should override existing properties if there are includes', function () { - var test = StyleDictionary.extend({ - properties: test_props, - include: [__dirname + '/configs/include.json'] - }); - assert.equal(test.properties.size.padding.tiny.value, '3'); - }); - }); - - - describe('source', function() { - it('should throw if source isnt an array', function() { - assert.throws( - StyleDictionary.extend.bind(null, { - source: {} - }), - Error, - 'source must be an array' - ); - }); - - it('should throw if a path in the source array doesnt resolve', function() { - assert.throws( - StyleDictionary.extend.bind(null, { - include: ['foo'] - }), - Error, - "Cannot find module 'foo'" - ); - }); - - it('should build the properties object if a source is given', function() { - var test = StyleDictionary.extend({ - "source": [__dirname + "/properties/paddings.json"] - }); - assert.deepEqual(test.properties, helpers.fileToJSON(__dirname + "/properties/paddings.json")); - }); - - it('should override existing properties source is given', function() { - var test = StyleDictionary.extend({ - properties: test_props, - source: [__dirname + "/properties/paddings.json"] - }); - assert.deepEqual(test.properties, helpers.fileToJSON(__dirname + "/properties/paddings.json")); - }); - }); - - - // This is to allow style dictionaries to depend on other style dictionaries and - // override properties. Useful for skinning - it('should not throw a collision error if a source file collides with an include', function() { - var test = StyleDictionary.extend({ - include: [__dirname + "/properties/paddings.json"], - source: [__dirname + "/properties/paddings.json"], - log: 'error' - }); - assert.deepEqual(test.properties, helpers.fileToJSON(__dirname + "/properties/paddings.json")); - }); - - it('should throw a error if the collision is in source files and log is set to error', function() { - assert.throws( - StyleDictionary.extend.bind(null, { - source: [__dirname + "/properties/paddings.json", __dirname + "/properties/paddings.json"], - log: 'error' - }), - Error, - 'Collision detected at:' - ); - }); - - it('should throw a warning if the collision is in source files and log is set to warn', function() { - assert.doesNotThrow( - StyleDictionary.extend.bind(null, { - source: [__dirname + "/properties/paddings.json", __dirname + "/properties/paddings.json"], - log: 'warn' - }) - ); - }); -}); diff --git a/test/index.js b/test/index.js deleted file mode 100644 index 310aa8e14..000000000 --- a/test/index.js +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ - -var helpers = require('./helpers'); - -after(function() { - // runs after all tests - helpers.clearOutput(); -}); diff --git a/test/properties/font.json b/test/properties/font.json deleted file mode 100644 index 35d04aa3f..000000000 --- a/test/properties/font.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "asset": { - "font": { - "icon": { - "value": "./test/assets/fonts/scapp_icons-regular.ttf" - } - } - } -} \ No newline at end of file diff --git a/test/properties/images/flags/us.json b/test/properties/images/flags/us.json deleted file mode 100644 index 7839839df..000000000 --- a/test/properties/images/flags/us.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "asset": { - "image": { - "flag": { - "us": { - "mdpi": { - "value": "test/assets/images/mdpi/flag_us_base.png" - }, - "hdpi": { - "value": "test/assets/images/hdpi/flag_us_base.png" - }, - "xhdpi": { - "value": "test/assets/images/xhdpi/flag_us_base.png" - }, - "xxhdpi": { - "value": "test/assets/images/xxhdpi/flag_us_base.png" - } - } - } - } - } -} \ No newline at end of file diff --git a/test/propertySetup.js b/test/propertySetup.js deleted file mode 100644 index ccc559ab3..000000000 --- a/test/propertySetup.js +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ - -var assert = require('chai').assert, - propertySetup = require('../lib/transform/propertySetup'); - - -describe('propertySetup', function() { - it('should error if property is not an object', function() { - assert.throws( - propertySetup.bind(null, null, 'foo', []), - Error, - 'Property object must be an object' - ); - }); - - it('should error if name in not a string', function() { - assert.throws( - propertySetup.bind(null, {}, null, []), - Error, - 'Name must be a string' - ); - }); - - it('should error path is not an array', function() { - assert.throws( - propertySetup.bind(null, {}, 'name', null), - Error, - 'Path must be an array' - ); - }); - - - it('should work if all the args are proper', function() { - var test = propertySetup( - {value: "#fff"}, - "white", - ["color","base"] - ); - assert.isObject(test); - assert.property(test, 'value'); - assert.property(test, 'original'); - assert.property(test, 'attributes'); - assert.property(test, 'path'); - }); - - - it('should not do anything and return the property if it has been setup previously', function() { - var original = {value: "#fff", original:{}}; - var test = propertySetup( - original, - "white", - ["color","base"] - ); - assert.deepEqual(test, original); - }); - - it('should use attributes if already set', function() { - var attributes = {"foo":"bar"}; - var test = propertySetup( - {value:"#fff", attributes:attributes}, - "white", - ["color","base"] - ); - assert.deepEqual(test.attributes, attributes); - }); - - it('should use the name on the property if set', function() { - var name = "name"; - var test = propertySetup( - {value:"#fff", name:name}, - 'white', - ["color","base"] - ); - assert.equal(test.name, name); - }); - - it('should use the name passed in if not set on the property', function() { - var test = propertySetup( - {value:"#fff"}, - 'white', - ["color","base"] - ); - assert.equal(test.name, 'white'); - }); -}); diff --git a/test/registerAction.js b/test/registerAction.js deleted file mode 100644 index 22fe8a00c..000000000 --- a/test/registerAction.js +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ - -var assert = require('chai').assert, - StyleDictionary = require('../index').extend({}); - - -describe('registerAction', function() { - it('should error if name is not a string', function() { - assert.throws( - StyleDictionary.registerAction.bind(null, { - do: function() {} - }), - Error, - 'name must be a string' - ); - - assert.throws( - StyleDictionary.registerAction.bind(null, { - name: 1, - do: function() {} - }), - Error, - 'name must be a string' - ); - - assert.throws( - StyleDictionary.registerAction.bind(null, { - name: [], - do: function() {} - }), - Error, - 'name must be a string' - ); - - assert.throws( - StyleDictionary.registerAction.bind(null, { - name: {}, - do: function() {} - }), - Error, - 'name must be a string' - ); - }); - - it('should error if do is not a function', function() { - assert.throws( - StyleDictionary.registerAction.bind(null, { - name: 'test' - }), - Error, - 'do must be a function' - ); - - assert.throws( - StyleDictionary.registerAction.bind(null, { - name: 'test', - do: 1 - }), - Error, - 'do must be a function' - ); - - assert.throws( - StyleDictionary.registerAction.bind(null, { - name: 'test', - do: 'name' - }), - Error, - 'do must be a function' - ); - - assert.throws( - StyleDictionary.registerAction.bind(null, { - name: 'test', - do: [] - }), - Error, - 'do must be a function' - ); - - assert.throws( - StyleDictionary.registerAction.bind(null, { - name: 'test', - do: {} - }), - Error, - 'do must be a function' - ); - }); - - it('should work if name and do are good', function() { - StyleDictionary.registerAction({ - name: 'scss', - do: function() {} - }); - - assert.isFunction(StyleDictionary.action['scss'].do); - }); - - it('should handle an undo function', function() { - StyleDictionary.registerAction({ - name: 'scss', - do: function() {}, - undo: function() {} - }); - - assert.isFunction(StyleDictionary.action['scss'].undo); - }); - - it('should properly pass the registered format to instances', function() { - var test = StyleDictionary.extend({}); - assert.isFunction(test.action['scss'].do); - }); -}); diff --git a/test/registerFormat.js b/test/registerFormat.js deleted file mode 100644 index e02bc3c33..000000000 --- a/test/registerFormat.js +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ - -var assert = require('chai').assert, - StyleDictionary = require('../index').extend({}); - - -describe('registerFormat', function() { - it('should error if name is not a string', function() { - assert.throws( - StyleDictionary.registerFormat.bind(null, { - formatter: function() {} - }), - Error, - 'transform name must be a string' - ); - - assert.throws( - StyleDictionary.registerFormat.bind(null, { - name: 1, - formatter: function() {} - }), - Error, - 'transform name must be a string' - ); - - assert.throws( - StyleDictionary.registerFormat.bind(null, { - name: [], - formatter: function() {} - }) - ); - - assert.throws( - StyleDictionary.registerFormat.bind(null, { - name: {}, - formatter: function() {} - }), - Error, - 'transform name must be a string' - ); - }); - - it('should error if formatter is not a function', function() { - assert.throws( - StyleDictionary.registerFormat.bind(null, { - name: 'test' - }), - Error, - 'format formatter must be a function' - ); - - assert.throws( - StyleDictionary.registerFormat.bind(null, { - name: 'test', - formatter: 1 - }), - Error, - 'format formatter must be a function' - ); - - assert.throws( - StyleDictionary.registerFormat.bind(null, { - name: 'test', - formatter: 'name' - }), - Error, - 'format formatter must be a function' - ); - - assert.throws( - StyleDictionary.registerFormat.bind(null, { - name: 'test', - formatter: [] - }), - Error, - 'format formatter must be a function' - ); - - assert.throws( - StyleDictionary.registerFormat.bind(null, { - name: 'test', - formatter: {} - }), - Error, - 'format formatter must be a function' - ); - }); - - it('should work if name and formatter are good', function() { - StyleDictionary.registerFormat({ - name: 'scss', - formatter: function() {} - }); - - assert.isFunction(StyleDictionary.format['scss']); - }); - - it('should properly pass the registered format to instances', function() { - var test = StyleDictionary.extend({}); - assert.isFunction(test.format['scss']); - }); -}); diff --git a/test/registerTransform.js b/test/registerTransform.js deleted file mode 100644 index 3386e0daf..000000000 --- a/test/registerTransform.js +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ - -var assert = require('chai').assert, - StyleDictionary = require('../index').extend({}); - - -describe('registerTransform', function() { - it('should error if type is not a string', function() { - assert.throws( - StyleDictionary.registerTransform.bind(null, { - type: 3 - }), - Error, - 'type must be a string' - ); - }); - - it('should error if type is not a valid type', function() { - assert.throws( - StyleDictionary.registerTransform.bind(null, { - type: 'foo' - }), - Error, - 'foo type is not one of: name, value, attribute' - ); - }); - - it('should error if name is not a string', function() { - assert.throws( - StyleDictionary.registerTransform.bind(null, { - type: 'name' - }), - Error, - 'name must be a string' - ); - }); - - it('should error if matcher is not a function', function() { - assert.throws( - StyleDictionary.registerTransform.bind(null, { - type: 'name', - name: 'name', - matcher: 'foo' - }), - Error, - 'matcher must be a function' - ); - }); - - it('should error if transformer is not a function', function() { - assert.throws( - StyleDictionary.registerTransform.bind(null, { - type: 'name', - name: 'name', - matcher: function() { return true; }, - transformer: 'foo' - }), - Error, - 'transformer must be a function' - ); - }); - - it('should work if type, matcher, and transformer are all proper', function() { - StyleDictionary.registerTransform({ - type: 'name', - name: 'foo', - matcher: function() { return true; }, - transformer: function() { return true; } - }); - assert.isObject(StyleDictionary.transform.foo); - assert.equal(StyleDictionary.transform.foo.type, 'name'); - assert.isFunction(StyleDictionary.transform.foo.matcher); - assert.isFunction(StyleDictionary.transform.foo.transformer); - }); - - - it('should properly pass the registered transform to instances', function() { - var test = StyleDictionary.extend({}); - assert.isObject(test.transform.foo); - assert.equal(test.transform.foo.type, 'name'); - assert.isFunction(test.transform.foo.matcher); - assert.isFunction(test.transform.foo.transformer); - }); -}); diff --git a/test/registerTransformGroup.js b/test/registerTransformGroup.js deleted file mode 100644 index c2c4308f8..000000000 --- a/test/registerTransformGroup.js +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ - -var assert = require('chai').assert, - StyleDictionary = require('../index').extend({}); - - -describe('registerTransformGroup', function() { - it('should error if name is not a string', function() { - assert.throws( - StyleDictionary.registerTransformGroup.bind(null, { - transforms: ['foo'] - }), - Error, - 'transform name must be a string' - ); - - assert.throws( - StyleDictionary.registerTransformGroup.bind(null, { - name: 1, - transforms: ['foo'] - }), - Error, - 'transform name must be a string' - ); - - assert.throws( - StyleDictionary.registerTransformGroup.bind(null, { - name: [], - transforms: ['foo'] - }), - Error, - 'transform name must be a string' - ); - - assert.throws( - StyleDictionary.registerTransformGroup.bind(null, { - name: {}, - transforms: ['foo'] - }), - Error, - 'transform name must be a string' - ); - - assert.throws( - StyleDictionary.registerTransformGroup.bind(null, { - name: function() {}, - transforms: ['foo'] - }), - Error, - 'transform name must be a string' - ); - }); - - it('should error if transforms isnt an array', function() { - assert.throws( - StyleDictionary.registerTransformGroup.bind(null, { - name: 'foo' - }), - Error, - 'transforms must be an array of registered value transforms' - ); - - assert.throws( - StyleDictionary.registerTransformGroup.bind(null, { - name: 'foo', - transforms: 'foo' - }), - Error, - 'transforms must be an array of registered value transforms' - ); - - assert.throws( - StyleDictionary.registerTransformGroup.bind(null, { - name: 'foo', - transforms: {} - }), - Error, - 'transforms must be an array of registered value transforms' - ); - - assert.throws( - StyleDictionary.registerTransformGroup.bind(null, { - name: 'foo', - transforms: function() {} - }), - Error, - 'transforms must be an array of registered value transforms' - ); - }); - - it('should error if transforms arent registered', function() { - assert.throws( - StyleDictionary.registerTransformGroup.bind(StyleDictionary, - { - name: 'foo', - transforms: ['foo'] - }), - Error, - 'transforms must be an array of registered value transforms' - ); - }); - - it('should work if everything is good', function() { - StyleDictionary.registerTransformGroup({ - name: 'foo', - transforms: ['size/px'] - }); - - assert.isArray(StyleDictionary.transformGroup.foo); - assert.isString(StyleDictionary.transformGroup.foo[0]); - assert.equal(StyleDictionary.transformGroup.foo[0], 'size/px'); - }); - - it('should properly pass the registered format to instances', function() { - var test = StyleDictionary.extend({}); - assert.isArray(test.transformGroup.foo); - assert.isString(test.transformGroup.foo[0]); - assert.equal(test.transformGroup.foo[0], 'size/px'); - }); -}); diff --git a/test/transforms.js b/test/transforms.js deleted file mode 100644 index 6223ba587..000000000 --- a/test/transforms.js +++ /dev/null @@ -1,439 +0,0 @@ -/* - * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ - -var assert = require('chai').assert, - path = require('path'), - transforms = require('../lib/common/transforms'); - - -describe('transforms', function() { - describe('name/cti/camel', function() { - it('should handle prefix', function() { - assert.equal(transforms["name/cti/camel"].transformer( - { - path: ['one','two','three'] - },{ - prefix: 'prefix' - } - ), 'prefixOneTwoThree'); - }); - - it('should handle no prefix', function() { - assert.equal(transforms["name/cti/camel"].transformer( - { - path: ['one','two','three'] - },{ - } - ), 'oneTwoThree'); - }); - }); - - - describe('name/cti/kebab', function() { - it('should handle prefix', function() { - assert.equal(transforms["name/cti/kebab"].transformer( - { - path: ['one','two','three'] - },{ - prefix: 'prefix' - } - ), 'prefix-one-two-three'); - }); - - it('should handle no prefix', function() { - assert.equal(transforms["name/cti/kebab"].transformer( - { - path: ['one','two','three'] - },{ - } - ), 'one-two-three'); - }); - }); - - describe('name/cti/snake', function() { - it('should handle prefix', function() { - assert.equal(transforms["name/cti/snake"].transformer( - { - path: ['one','two','three'] - },{ - prefix: 'prefix' - } - ), 'prefix_one_two_three'); - }); - - it('should handle no prefix', function() { - assert.equal(transforms["name/cti/snake"].transformer( - { - path: ['one','two','three'] - },{ - } - ), 'one_two_three'); - }); - }); - - describe('name/cti/constant', function() { - it('should handle prefix', function() { - assert.equal(transforms["name/cti/constant"].transformer( - { - path: ['one','two','three'] - },{ - prefix: 'prefix' - } - ), 'PREFIX_ONE_TWO_THREE'); - }); - - it('should handle no prefix', function() { - assert.equal(transforms["name/cti/constant"].transformer( - { - path: ['one','two','three'] - },{ - } - ), 'ONE_TWO_THREE'); - }); - }); - - describe('name/ti/constant', function() { - it('should handle prefix', function() { - assert.equal(transforms["name/ti/constant"].transformer( - { - path: ['one','two','three'] - },{ - prefix: 'prefix' - } - ), 'PREFIX_TWO_THREE'); - }); - - it('should handle no prefix', function() { - assert.equal(transforms["name/ti/constant"].transformer( - { - path: ['one','two','three'] - },{ - } - ), 'TWO_THREE'); - }); - }); - - describe('attribute/color', function() { - it('should handle normal colors', function() { - var attributes = transforms["attribute/color"].transformer({ - value: "#aaaaaa" - }); - assert.equal(attributes.rgb.a, 1); - assert.equal(attributes.rgb.r, 170); - assert.equal(attributes.hsl.s, 0); - }); - it('should handle colors with transparency', function() { - var attributes = transforms["attribute/color"].transformer({ - value: "#aaaaaa99" - }); - var attributes2 = transforms["attribute/color"].transformer({ - value: "rgba(170,170,170,0.6)" - }); - assert.equal(attributes.rgb.a, 0.6); - assert.equal(attributes.rgb.r, 170); - assert.equal(attributes.hsl.s, 0); - assert.equal(attributes2.rgb.a, 0.6); - assert.equal(attributes2.rgb.r, 170); - assert.equal(attributes2.hsl.s, 0); - }); - }); - - describe('color/hex', function() { - it('should handle hex colors', function() { - var value = transforms["color/hex"].transformer({ - value: "#aaaaaa" - }); - assert.equal(value, "#aaaaaa"); - }); - - it('should handle hex8 colors', function() { - var value = transforms["color/hex"].transformer({ - value: "#aaaaaaaa" - }); - assert.equal(value, "#aaaaaa"); - }); - - it('should handle rgb colors', function() { - var value = transforms["color/hex"].transformer({ - value: "rgb(170,170,170)" - }); - assert.equal(value, "#aaaaaa"); - }); - - it('should handle rgb (object) colors', function() { - var value = transforms["color/hex"].transformer({ - value: { - r: '170', - g: '170', - b: '170' - } - }); - var value2 = transforms["color/hex"].transformer({ - value: "rgb(170,170,170)" - }); - assert.equal(value, "#aaaaaa"); - assert.equal(value2, "#aaaaaa"); - }); - - it('should handle hsl colors', function() { - var value = transforms["color/hex"].transformer({ - value: { - h: '0', - s: '0', - l: '0.5' - } - }); - var value2 = transforms["color/hex"].transformer({ - value: "hsl(0,0,0.5)" - }); - assert.equal(value, "#808080"); - assert.equal(value2, "#808080"); - }); - }); - - - describe('color/hex8', function() { - it('should handle hex colors', function() { - var value = transforms["color/hex8"].transformer({ - value: "#aaaaaa" - }); - assert.equal(value, "#aaaaaaff"); - }); - - it('should handle rgb colors', function() { - var value = transforms["color/hex8"].transformer({ - value: "rgb(170,170,170)" - }); - assert.equal(value, "#aaaaaaff"); - }); - - it('should handle rgb colors', function() { - var value = transforms["color/hex8"].transformer({ - value: "rgb(170,170,170)" - }); - var value2 = transforms["color/hex8"].transformer({ - value: "rgba(170,170,170,0.6)" - }); - assert.equal(value, "#aaaaaaff"); - assert.equal(value2, "#aaaaaa99"); - }); - }); - - describe('color/hex8android', function() { - it('should handle colors without alpha', function() { - var value = transforms["color/hex8android"].transformer({ - value: "#aaaaaa" - }); - assert.equal(value, "#ffaaaaaa"); - }); - - it('should handle colors with alpha', function() { - var value = transforms["color/hex8android"].transformer({ - value: "#aaaaaa99" - }); - assert.equal(value, "#99aaaaaa"); - }); - }); - - describe('color/rgb', function() { - it('should handle normal colors', function() { - var value = transforms["color/rgb"].transformer({ - value: "#aaaaaa" - }); - assert.equal(value, "rgb(170, 170, 170)"); - }); - - it('should handle colors with transparency', function() { - var value = transforms["color/rgb"].transformer({ - value: "#aaaaaa99" - }); - assert.equal(value, "rgba(170, 170, 170, 0.6)"); - }); - }); - - describe('color/UIColor', function() { - it('should handle normal colors', function() { - var value = transforms["color/UIColor"].transformer({ - value: "#aaaaaa" - }); - assert.equal(value, "[UIColor colorWithRed:0.67f green:0.67f blue:0.67f alpha:1.00f]"); - }); - - it('should handle colors with transparency', function() { - var value = transforms["color/UIColor"].transformer({ - value: "#aaaaaa99" - }); - assert.equal(value, "[UIColor colorWithRed:0.67f green:0.67f blue:0.67f alpha:0.60f]"); - }); - }); - - - describe('color/css', function() { - it('should handle normal colors', function() { - var value = transforms["color/css"].transformer({ - value: "rgb(170, 170, 170)" - }); - assert.equal(value, "#aaaaaa"); - }); - - it('should handle colors with transparency', function() { - var value = transforms["color/css"].transformer({ - value: "#aaaaaa99" - }); - assert.equal(value, "rgba(170, 170, 170, 0.6)"); - }); - }); - - describe('size/sp', function() { - it('should work', function() { - var value = transforms["size/sp"].transformer({ - value: "12px" - }); - var value2 = transforms["size/sp"].transformer({ - value: "12" - }); - assert.equal(value, "12.00sp"); - assert.equal(value2, "12.00sp"); - }); - }); - - describe('size/dp', function() { - it('should work', function() { - var value = transforms["size/dp"].transformer({ - value: "12px" - }); - var value2 = transforms["size/dp"].transformer({ - value: "12" - }); - assert.equal(value, "12.00dp"); - assert.equal(value2, "12.00dp"); - }); - }); - - describe('size/remToSp', function() { - it('should work', function() { - var value = transforms["size/remToSp"].transformer({ - value: "1" - }); - assert.equal(value, "16.00sp"); - }); - }); - - describe('size/remToDp', function() { - it('should work', function() { - var value = transforms["size/remToDp"].transformer({ - value: "1" - }); - assert.equal(value, "16.00dp"); - }); - }); - - describe('size/px', function() { - it('should work', function() { - var value = transforms["size/px"].transformer({ - value: "10" - }); - assert.equal(value, "10px"); - }); - }); - - describe('size/remToPt', function() { - it('should work', function() { - var value = transforms["size/remToPt"].transformer({ - value: "1" - }); - assert.equal(value, "16.00f"); - }); - }); - - describe('size/remToPx', function() { - it('should work', function() { - var value = transforms["size/remToPx"].transformer({ - value: "1" - }); - assert.equal(value, "16px"); - }); - }); - - describe('size/rem', function() { - it('should work', function() { - var value = transforms["size/rem"].transformer({ - value: "1" - }); - assert.equal(value, "1rem"); - }); - }); - - describe('content/quote', function() { - it('should work', function() { - var value = transforms["content/quote"].transformer({ - value: "hello" - }); - assert.equal(value, "'hello'"); - }); - }); - - describe('content/icon', function() { - it('should work', function() { - var value = transforms["content/icon"].transformer({ - value: "" - }); - assert.equal(value, "'\\E001'"); - }); - }); - - describe('content/objC/literal', function() { - it('should work', function() { - var value = transforms["content/objC/literal"].transformer({ - value: "hello" - }); - assert.equal(value, '@"hello"'); - }); - }); - - describe('asset/objC/literal', function() { - it('should work', function() { - var value = transforms["asset/objC/literal"].transformer({ - value: "hello" - }); - assert.equal(value, '@"hello"'); - }); - }); - - describe('font/objC/literal', function() { - it('should work', function() { - var value = transforms["font/objC/literal"].transformer({ - value: "hello" - }); - assert.equal(value, '@"hello"'); - }); - }); - - describe('time/seconds', function() { - it('should work', function() { - var value = transforms["time/seconds"].transformer({ - value: "1000" - }); - assert.equal(value, "1.00s"); - }); - }); - - describe('asset/path', function() { - it('should work', function() { - var value = transforms["asset/path"].transformer({ - value: "foo.json" - }); - assert.equal(value, path.join(process.cwd(), "foo.json")); - }); - }); -}); diff --git a/test/utils/combineJSON.js b/test/utils/combineJSON.js deleted file mode 100644 index 04156c903..000000000 --- a/test/utils/combineJSON.js +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ - -var assert = require('chai').assert, - combineJSON = require('../../lib/utils/combineJSON'), - path = require('path'); - - -describe('combineJSON', function() { - it('should return an object', function () { - var test = combineJSON(["test/json_files/*.json"]); - assert.isObject(test); - }); - - it('should handle wildcards', function () { - var test = combineJSON(["test/json_files/*.json"]); - assert.isObject(test); - }); - - it('should handle js modules that export objects', function () { - var absPath = path.join(process.cwd(), 'test', 'json_files', '*.js'); - var relativePath = 'test/json_files/*.js'; - var test = combineJSON([absPath, relativePath]); - assert.isObject(test); - }); - - it('should do a deep merge', function() { - var test = combineJSON(["test/json_files/shallow/*.json"], true); - assert.equal(test.a, 2); - assert.deepEqual(test.b, {"a":1, "c":2}); - assert.equal(test.d.e.f.g, 1); - assert.equal(test.d.e.f.h, 2); - }); - - it('should do a shallow merge', function() { - var test = combineJSON(["test/json_files/shallow/*.json"]); - assert.equal(test.a, 2); - assert.deepEqual(test.b, {"c":2}); - assert.deepEqual(test.c, [3,4]); - assert(!test.d.e.f.g); - assert.equal(test.d.e.f.h, 2); - }); - - it('should fail on invalid JSON', function() { - assert.throws( - combineJSON.bind(null, ["test/json_files/broken/*.json"], true), - Error, - /Failed to load or parse/ - ); - }); - - it('should fail if there is a collision and it is passed a collision function', function() { - assert.throws( - combineJSON.bind(null, ["test/json_files/shallow/*.json"], true, function Collision(opts) { - assert.equal(opts.key, 'a'); - assert.equal(opts.target[opts.key], 1); - assert.equal(opts.copy[opts.key], 2); - throw new Error('test'); - }), - Error, - 'test' - ); - }); -}); diff --git a/test/utils/convertToBase64.js b/test/utils/convertToBase64.js deleted file mode 100644 index 33b4f00bd..000000000 --- a/test/utils/convertToBase64.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ - -var assert = require('chai').assert, - convertToBase64 = require('../../lib/utils/convertToBase64.js'); - -describe('base64', function() { - it('should error if filePath isnt a string', function() { - assert.throws( - convertToBase64.bind(null), - Error, - 'filePath name must be a string' - ); - assert.throws( - convertToBase64.bind(null, []), - Error, - 'filePath name must be a string' - ); - assert.throws( - convertToBase64.bind(null, {}), - Error, - 'filePath name must be a string' - ); - }); - - it('should error if filePath isnt a file', function() { - assert.throws( - convertToBase64.bind(null, 'foo'), - Error, - "ENOENT: no such file or directory, open 'foo'" - ); - }); - - it('should return a string', function() { - assert.isString(convertToBase64('test/configs/test.json')); - }); -}); diff --git a/test/utils/deepExtend.js b/test/utils/deepExtend.js deleted file mode 100644 index 4fcb61fae..000000000 --- a/test/utils/deepExtend.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ - -var assert = require('chai').assert, - deepExtend = require('../../lib/utils/deepExtend'); - - -describe('deepExtend', function() { - it('should return an object', function () { - var test = deepExtend(); - assert.isObject(test); - }); - - it('should override properties from right to left', function () { - var test = deepExtend([{foo:'bar'}, {foo:'baz'}]); - assert.equal(test.foo, 'baz'); - - var test2 = deepExtend([{foo:'bar'}, {foo:'baz'}, {foo:'blah'}]); - assert.equal(test2.foo, 'blah'); - }); - - it('should override nested properties', function () { - var test = deepExtend([{foo: {foo:'bar'}}, {foo: {foo:'baz'}}]); - assert.equal(test.foo.foo, 'baz'); - - var test2 = deepExtend([{foo:{foo:'bar'}}, {foo:{foo:'baz'}}, {foo:{foo:'blah'}}]); - assert.equal(test2.foo.foo, 'blah'); - }); - - it('should override nested properties', function () { - var test = deepExtend([{foo: {bar:'bar'}}, {foo: {baz:'baz'}}]); - assert.equal(test.foo.baz, 'baz'); - assert.equal(test.foo.bar, 'bar'); - - var test2 = deepExtend([{foo:{bar:'bar'}}, {foo:{baz:'baz'}}, {foo:{blah:'blah'}}]); - assert.equal(test2.foo.baz, 'baz'); - assert.equal(test2.foo.bar, 'bar'); - assert.equal(test2.foo.blah, 'blah'); - }); - - it('shouldn\'t fail loudly if it is a normal deep extend', function () { - var test = deepExtend([{foo: {bar:'bar'}}, {foo: {baz:'baz'}}], function() {}); - assert.equal(test.foo.bar, 'bar'); - assert.equal(test.foo.baz, 'baz'); - }); - - describe('collision detection', function() { - it('should call the collision function if a collision happens', function () { - assert.throws( - deepExtend.bind(null, [{foo: {bar:'bar'}}, {foo: {bar:'baz'}}], function() { - throw new Error('danger danger. high voltage.'); - }), - Error, - 'danger danger. high voltage.' - ); - }); - - it('the collision function should have the proper arguments', function () { - var test = deepExtend([{foo: {bar:'bar'}}, {foo: {bar:'baz'}}], function(opts) { - assert.equal(opts.target.bar, 'bar'); - assert.equal(opts.copy.bar, 'baz'); - assert.equal(opts.path[0], 'foo'); - assert.equal(opts.key, 'bar'); - }); - assert.equal(test.foo.bar, 'baz'); - }); - }); -}); diff --git a/test/utils/resolveObject.js b/test/utils/resolveObject.js deleted file mode 100644 index a51cdf375..000000000 --- a/test/utils/resolveObject.js +++ /dev/null @@ -1,296 +0,0 @@ -/* - * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with - * the License. A copy of the License is located at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR - * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions - * and limitations under the License. - */ - -var assert = require('chai').assert, - helpers = require('../helpers'), - resolveObject = require('../../lib/utils/resolveObject'); - - -describe('resolveObject', function() { - it('should error on non-objects', function() { - assert.throws( - resolveObject.bind(null, 'foo'), - Error, - 'Please pass an object in' - ); - assert.throws( - resolveObject.bind(null), - Error, - 'Please pass an object in' - ); - assert.throws( - resolveObject.bind(null, 0), - Error, - 'Please pass an object in' - ); - }); - - it('should not mutate the original object', function() { - var original = helpers.fileToJSON(__dirname + '/../json_files/nested_references.json'); - var test = resolveObject( original ); - assert.equal(original.a.b.d, '{e.f.g}'); - assert.equal(test.a.b.d, 2); - }); - - it('should do simple references', function() { - var test = resolveObject( helpers.fileToJSON(__dirname + '/../json_files/simple.json') ); - assert.equal(test.bar, 'bar'); - }); - - it('should do nested references', function() { - var obj = helpers.fileToJSON('test/json_files/nested_references.json'); - var test = resolveObject( obj ); - assert.equal(test.i, 2); - assert.equal(test.a.b.d, 2); - assert.equal(test.e.f.h, 1); - }); - - it('should handle nested pointers', function() { - var test = resolveObject( helpers.fileToJSON(__dirname + '/../json_files/nested_pointers.json') ); - assert.equal(test.b, 1); - assert.equal(test.c, 1); - }); - - it('should handle deep nested pointers', function() { - var test = resolveObject( helpers.fileToJSON(__dirname + '/../json_files/nested_pointers_2.json') ); - assert.equal(test.a, 1); - assert.equal(test.b, 1); - assert.equal(test.c, 1); - assert.equal(test.d, 1); - assert.equal(test.e, 1); - assert.equal(test.f, 1); - assert.equal(test.g, 1); - }); - - it('should handle deep nested pointers with string interpolation', function() { - var test = resolveObject( helpers.fileToJSON(__dirname + '/../json_files/nested_pointers_3.json') ); - assert.equal(test.a, 'foo bon bee bae boo bla baz bar'); - assert.equal(test.b, 'foo bon bee bae boo bla baz'); - assert.equal(test.c, 'foo bon bee bae boo bla'); - assert.equal(test.d, 'foo bon bee bae boo'); - assert.equal(test.e, 'foo bon bee bae'); - assert.equal(test.f, 'foo bon bee'); - assert.equal(test.g, 'foo bon'); - }); - - it('should handle deep nested pointers and nested references', function() { - var test = resolveObject( helpers.fileToJSON(__dirname + '/../json_files/nested_pointers_4.json') ); - assert.equal(test.a.a.a, 1); - assert.equal(test.b.b.b, 1); - assert.equal(test.c.c.c, 1); - assert.equal(test.d.d.d, 1); - assert.equal(test.e.e.e, 1); - assert.equal(test.f.f.f, 1); - assert.equal(test.g.g.g, 1); - }); - - - it('should keep the type of the referenced property', function() { - var test = resolveObject( helpers.fileToJSON(__dirname + '/../json_files/reference_type.json') ); - assert.equal(test.d, 1); - assert.isNumber(test.d); - assert.isObject(test.e); - assert.isArray(test.g); - assert.equal(test.e.c, 2); - }); - - it('should handle and evaluate items in an array', function() { - var test = resolveObject( helpers.fileToJSON(__dirname + '/../json_files/array.json') ); - assert.equal(test.d[0], 2); - assert.equal(test.d[1], 1); - assert.equal(test.e[0].a, 1); - assert.equal(test.e[1].a, 2); - }); - - it('should throw if pointers don\'t exist', function() { - assert.throws( - resolveObject.bind( helpers.fileToJSON(__dirname + '/../json_files/non_existent.json')) - ); - }); - - it('should gracefully handle circular references', function() { - assert.throws( - resolveObject.bind(null, - helpers.fileToJSON(__dirname + '/../json_files/circular.json') - ), - Error, - 'Circular definition: a | d' - ); - assert.throws( - resolveObject.bind(null, - helpers.fileToJSON(__dirname + '/../json_files/circular_2.json') - ), - Error, - 'Circular definition: a.b.c | d' - ); - assert.throws( - resolveObject.bind(null, - helpers.fileToJSON(__dirname + '/../json_files/circular_3.json') - ), - Error, - 'Circular definition: a.b.c | d.e.f' - ); - assert.throws( - resolveObject.bind(null, - helpers.fileToJSON(__dirname + '/../json_files/circular_4.json') - ), - Error, - 'Circular definition: a.b.c | g.h' - ); - }); - - describe('ignoreKeys', function() { - it('should handle default value of original', function() { - var test = resolveObject({ - foo: { value: 'bar' }, - bar: { - value: '{foo.value}', - original: '{foo.value}' - } - }); - - assert.equal( - test.bar.original, - '{foo.value}' - ); - }); - - it('should handle any nested keys under the ignoreKey', function() { - var test = resolveObject({ - foo: { value: 'bar' }, - bar: { - value: '{foo.value}', - original: { - value: '{foo.value}', - foo: { - bar: '{foo.value}' - } - } - } - }); - - assert.equal( - test.bar.original.value, - '{foo.value}' - ); - assert.equal( - test.bar.original.foo.bar, - '{foo.value}' - ); - }); - - it('should handle passing in custom ignoreKeys', function() { - var test = resolveObject({ - foo: { value: 'bar' }, - bar: { - value: '{foo.value}', - baz: '{foo.value}' - } - }, { - ignoreKeys: ['baz'] - }); - - assert.equal( - test.bar.baz, - '{foo.value}' - ); - }); - - it('should handle multiple keys', function() { - var test = resolveObject({ - foo: { value: 'bar' }, - bar: { - value: '{foo.value}', - original: '{foo.value}', - baz: '{foo.value}' - } - },{ - ignoreKeys: ['baz','original'] - }); - - assert.equal( - test.bar.original, - '{foo.value}' - ); - assert.equal( - test.bar.baz, - '{foo.value}' - ); - }); - - it('should not ignore anything if set to null or empty array', function() { - var test = resolveObject({ - foo: { value: 'bar' }, - bar: { - value: '{foo.value}', - original: '{foo.value}' - } - },{ - ignoreKeys: [] - }); - - assert.equal( - test.bar.original, - 'bar' - ); - - var test2 = resolveObject({ - foo: { value: 'bar' }, - bar: { - value: '{foo.value}', - original: '{foo.value}' - } - },{ - ignoreKeys: null - }); - - assert.equal( - test2.bar.original, - 'bar' - ); - - var test3 = resolveObject({ - foo: { value: 'bar' }, - bar: { - value: '{foo.value}', - original: '{foo.value}' - } - },{ - ignoreKeys: undefined - }); - - assert.equal( - test3.bar.original, - 'bar' - ); - }); - }); - - it('should handle spaces', function() { - var test = resolveObject({ - foo: { value: 'bar' }, - bar: { value: '{ foo.value }'} - }); - assert.equal(test.foo.value, test.bar.value); - }); - - it('should collect multiple reference errors', function() { - assert.throws( - resolveObject.bind(null, - helpers.fileToJSON(__dirname + '/../json_files/multiple_reference_errors.json') - ), - Error, - 'Failed due to 3 errors:' - ); - }); -}); diff --git a/yarn.lock b/yarn.lock index b73a1138f..538e17298 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,16 +2,45 @@ # yarn lockfile v1 +"@babel/code-frame@^7.0.0-beta.35": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" + dependencies: + "@babel/highlight" "^7.0.0" + +"@babel/highlight@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^4.0.0" + +abab@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.0.tgz#aba0ab4c5eee2d4c79d3487d85450fb2376ebb0f" + abbrev@1, abbrev@1.0.x: version "1.0.9" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135" +acorn-globals@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.3.0.tgz#e3b6f8da3c1552a95ae627571f7dd6923bb54103" + dependencies: + acorn "^6.0.1" + acorn-walk "^6.0.1" + acorn-jsx@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" dependencies: acorn "^3.0.4" +acorn-walk@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.0.1.tgz#c7827bdbb8e21aa97b609adfa225400d9ae348ba" + acorn@^3.0.4: version "3.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" @@ -20,6 +49,14 @@ acorn@^5.5.0: version "5.7.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.1.tgz#f095829297706a7c9776958c0afc8930a9b9d9d8" +acorn@^5.5.3: + version "5.7.3" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" + +acorn@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.0.1.tgz#66e6147e1027704479dc6d9b20d884c572db3cc1" + ajv-keywords@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762" @@ -84,7 +121,7 @@ ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" -ansi-styles@^3.2.1: +ansi-styles@^3.2.0, ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" dependencies: @@ -97,6 +134,19 @@ anymatch@^1.3.0: micromatch "^2.1.5" normalize-path "^2.0.0" +anymatch@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" + dependencies: + micromatch "^3.1.4" + normalize-path "^2.1.1" + +append-transform@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-0.4.0.tgz#d76ebf8ca94d276e247a36bad44a4b74ab611991" + dependencies: + default-require-extensions "^1.0.0" + aproba@^1.0.3: version "1.2.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" @@ -127,10 +177,18 @@ arr-diff@^2.0.0: dependencies: arr-flatten "^1.0.1" -arr-flatten@^1.0.1: +arr-diff@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + +arr-flatten@^1.0.1, arr-flatten@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" +arr-union@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + array-back@^1.0.2, array-back@^1.0.3, array-back@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/array-back/-/array-back-1.0.4.tgz#644ba7f095f7ffcf7c43b5f0dc39d3c1f03c063b" @@ -143,6 +201,10 @@ array-back@^2.0.0: dependencies: typical "^2.6.1" +array-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" + array-find-index@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" @@ -161,7 +223,11 @@ array-unique@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" -arrify@^1.0.0: +array-unique@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + +arrify@^1.0.0, arrify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" @@ -185,6 +251,14 @@ assertion-error@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.0.2.tgz#13ca515d86206da0bac66e834dd397d87581094c" +assign-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + +astral-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" + async-each@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" @@ -193,14 +267,28 @@ async-foreach@^0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/async-foreach/-/async-foreach-0.1.3.tgz#36121f845c0578172de419a97dbeb1d16ec34542" +async-limiter@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" + async@1.x, async@^1.4.0: version "1.5.2" resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" +async@^2.1.4, async@^2.5.0: + version "2.6.1" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610" + dependencies: + lodash "^4.17.10" + asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" +atob@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" + aws-sign2@~0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f" @@ -213,7 +301,11 @@ aws4@^1.2.1, aws4@^1.6.0: version "1.7.0" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.7.0.tgz#d4d0e9b9dbfca77bf08eeb0a8a471550fe39e289" -babel-code-frame@^6.22.0: +aws4@^1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" + +babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" dependencies: @@ -221,6 +313,80 @@ babel-code-frame@^6.22.0: esutils "^2.0.2" js-tokens "^3.0.2" +babel-core@^6.0.0, babel-core@^6.26.0: + version "6.26.3" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" + dependencies: + babel-code-frame "^6.26.0" + babel-generator "^6.26.0" + babel-helpers "^6.24.1" + babel-messages "^6.23.0" + babel-register "^6.26.0" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + convert-source-map "^1.5.1" + debug "^2.6.9" + json5 "^0.5.1" + lodash "^4.17.4" + minimatch "^3.0.4" + path-is-absolute "^1.0.1" + private "^0.1.8" + slash "^1.0.0" + source-map "^0.5.7" + +babel-generator@^6.18.0, babel-generator@^6.26.0: + version "6.26.1" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" + dependencies: + 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" + +babel-helpers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-jest@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-23.6.0.tgz#a644232366557a2240a0c083da6b25786185a2f1" + dependencies: + babel-plugin-istanbul "^4.1.6" + babel-preset-jest "^23.2.0" + +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-istanbul@^4.1.6: + version "4.1.6" + resolved "http://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz#36c59b2192efce81c5b378321b74175add1c9a45" + dependencies: + babel-plugin-syntax-object-rest-spread "^6.13.0" + find-up "^2.1.0" + istanbul-lib-instrument "^1.10.1" + test-exclude "^4.2.1" + +babel-plugin-jest-hoist@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-23.2.0.tgz#e61fae05a1ca8801aadee57a6d66b8cefaf44167" + +babel-plugin-syntax-object-rest-spread@^6.13.0: + version "6.13.0" + resolved "http://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" + babel-polyfill@6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.23.0.tgz#8364ca62df8eafb830499f699177466c3b03499d" @@ -229,17 +395,73 @@ babel-polyfill@6.23.0: core-js "^2.4.0" regenerator-runtime "^0.10.0" -babel-runtime@^6.22.0: +babel-preset-jest@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-23.2.0.tgz#8ec7a03a138f001a1a8fb1e8113652bf1a55da46" + dependencies: + babel-plugin-jest-hoist "^23.2.0" + babel-plugin-syntax-object-rest-spread "^6.13.0" + +babel-register@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" + dependencies: + babel-core "^6.26.0" + babel-runtime "^6.26.0" + core-js "^2.5.0" + home-or-tmp "^2.0.0" + lodash "^4.17.4" + mkdirp "^0.5.1" + source-map-support "^0.4.15" + +babel-runtime@^6.22.0, babel-runtime@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" dependencies: core-js "^2.4.0" regenerator-runtime "^0.11.0" +babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" + dependencies: + 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@^6.0.0, babel-traverse@^6.18.0, babel-traverse@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" + dependencies: + 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.8" + globals "^9.18.0" + invariant "^2.2.2" + lodash "^4.17.4" + +babel-types@^6.0.0, babel-types@^6.18.0, babel-types@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" + dependencies: + babel-runtime "^6.26.0" + esutils "^2.0.2" + lodash "^4.17.4" + to-fast-properties "^1.0.3" + babylon@7.0.0-beta.19: version "7.0.0-beta.19" resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.19.tgz#e928c7e807e970e0536b078ab3e0c48f9e052503" +babylon@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + balanced-match@^0.4.1: version "0.4.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" @@ -248,6 +470,18 @@ balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" +base@^0.11.1: + version "0.11.2" + resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + dependencies: + cache-base "^1.0.1" + class-utils "^0.3.5" + component-emitter "^1.2.1" + define-property "^1.0.0" + isobject "^3.0.1" + mixin-deep "^1.2.0" + pascalcase "^0.1.1" + bcrypt-pbkdf@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" @@ -308,10 +542,41 @@ braces@^1.8.2: preserve "^0.2.0" repeat-element "^1.1.2" +braces@^2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" + dependencies: + arr-flatten "^1.1.0" + array-unique "^0.3.2" + extend-shallow "^2.0.1" + fill-range "^4.0.0" + isobject "^3.0.1" + repeat-element "^1.1.2" + snapdragon "^0.8.1" + snapdragon-node "^2.0.1" + split-string "^3.0.2" + to-regex "^3.0.1" + +browser-process-hrtime@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.2.tgz#425d68a58d3447f02a04aa894187fce8af8b7b8e" + +browser-resolve@^1.11.3: + version "1.11.3" + resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.3.tgz#9b7cbb3d0f510e4cb86bdbd796124d28b5890af6" + dependencies: + resolve "1.1.7" + browser-stdout@1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" +bser@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719" + dependencies: + node-int64 "^0.4.0" + buffer-from@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.0.tgz#87fcaa3a298358e0ade6e442cfce840740d1ad04" @@ -324,6 +589,20 @@ builtin-modules@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" +cache-base@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + dependencies: + collection-visit "^1.0.0" + component-emitter "^1.2.1" + get-value "^2.0.6" + has-value "^1.0.0" + isobject "^3.0.1" + set-value "^2.0.0" + to-object-path "^0.3.0" + union-value "^1.0.0" + unset-value "^1.0.0" + cache-point@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/cache-point/-/cache-point-0.4.1.tgz#cc8c9cbd99d90d7b0c66910cd33d77a1aab8840e" @@ -342,6 +621,10 @@ callsites@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" +callsites@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" + camelcase-keys@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" @@ -361,10 +644,16 @@ camelcase@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" -camelcase@^4.0.0: +camelcase@^4.0.0, camelcase@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" +capture-exit@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-1.2.0.tgz#1c5fcc489fd0ab00d4f1ac7ae1072e3173fbab6f" + dependencies: + rsvp "^3.3.3" + capture-stack-trace@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz#4a6fa07399c26bba47f0b2496b4d0fb408c5550d" @@ -454,6 +743,15 @@ circular-json@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.1.tgz#be8b36aefccde8b3ca7aa2d6afc07a37242c0d2d" +class-utils@^0.3.5: + version "0.3.6" + resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + dependencies: + arr-union "^3.1.0" + define-property "^0.2.5" + isobject "^3.0.0" + static-extend "^0.1.1" + cli-boxes@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-1.0.0.tgz#4fa917c3e59c94a004cd61f8ee509da651687143" @@ -492,6 +790,14 @@ cliui@^3.2.0: strip-ansi "^3.0.1" wrap-ansi "^2.0.0" +cliui@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" + dependencies: + string-width "^2.1.1" + strip-ansi "^4.0.0" + wrap-ansi "^2.0.0" + co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" @@ -507,6 +813,13 @@ collect-all@^1.0.3: stream-connect "^1.0.2" stream-via "^1.0.4" +collection-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + dependencies: + map-visit "^1.0.0" + object-visit "^1.0.0" + color-convert@^1.9.0: version "1.9.2" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.2.tgz#49881b8fba67df12a96bdf3f56c0aab9e7913147" @@ -517,7 +830,7 @@ color-name@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.1.tgz#4b1415304cf50028ea81643643bd82ea05803689" -combined-stream@1.0.6, combined-stream@^1.0.5, combined-stream@~1.0.5: +combined-stream@1.0.6, combined-stream@^1.0.5, combined-stream@~1.0.5, combined-stream@~1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" dependencies: @@ -562,10 +875,18 @@ commander@^2.9.0: dependencies: graceful-readlink ">= 1.0.0" +commander@~2.17.1: + version "2.17.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf" + common-sequence@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/common-sequence/-/common-sequence-1.0.2.tgz#30e07f3f8f6f7f9b3dee854f20b2d39eee086de8" +component-emitter@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" + concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" @@ -613,7 +934,17 @@ console-control-strings@^1.0.0, console-control-strings@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" -core-js@^2.4.0: +convert-source-map@^1.4.0, convert-source-map@^1.5.1: + version "1.6.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" + dependencies: + safe-buffer "~5.1.1" + +copy-descriptor@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + +core-js@^2.4.0, core-js@^2.5.0: version "2.5.7" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e" @@ -670,6 +1001,16 @@ crypto-random-string@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e" +cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": + version "0.3.4" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.4.tgz#8cd52e8a3acfd68d3aed38ee0a640177d2f9d797" + +cssstyle@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-1.1.1.tgz#18b038a9c44d65f7a8e428a653b9f6fe42faf5fb" + dependencies: + cssom "0.3.x" + currently-unhandled@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" @@ -682,7 +1023,15 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" -debug@2.6.9, debug@^2.1.2, debug@^2.6.8: +data-urls@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-1.0.1.tgz#d416ac3896918f29ca84d81085bc3705834da579" + dependencies: + abab "^2.0.0" + whatwg-mimetype "^2.1.0" + whatwg-url "^7.0.0" + +debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" dependencies: @@ -698,6 +1047,10 @@ decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" +decode-uri-component@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + deep-eql@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" @@ -712,6 +1065,37 @@ deep-is@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" +default-require-extensions@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-1.0.0.tgz#f37ea15d3e13ffd9b437d33e1a75b5fb97874cb8" + dependencies: + strip-bom "^2.0.0" + +define-properties@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" + dependencies: + object-keys "^1.0.12" + +define-property@^0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + dependencies: + is-descriptor "^0.1.0" + +define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + dependencies: + is-descriptor "^1.0.0" + +define-property@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + dependencies: + is-descriptor "^1.0.2" + isobject "^3.0.1" + del@^2.0.2: version "2.2.2" resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" @@ -744,11 +1128,21 @@ destroy@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" +detect-indent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" + dependencies: + repeating "^2.0.0" + detect-libc@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" -diff@3.5.0: +detect-newline@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2" + +diff@3.5.0, diff@^3.2.0: version "3.5.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" @@ -814,6 +1208,12 @@ doctrine@^2.1.0: dependencies: esutils "^2.0.2" +domexception@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90" + dependencies: + webidl-conversions "^4.0.2" + dot-prop@^4.1.0: version "4.2.0" resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-4.2.0.tgz#1f19e0c2e1aa0e32797c49799f2837ac6af69c57" @@ -856,6 +1256,24 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" +es-abstract@^1.5.1: + version "1.12.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.12.0.tgz#9dbbdd27c6856f0001421ca18782d786bf8a6165" + dependencies: + es-to-primitive "^1.1.1" + function-bind "^1.1.1" + has "^1.0.1" + is-callable "^1.1.3" + is-regex "^1.0.4" + +es-to-primitive@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d" + dependencies: + is-callable "^1.1.1" + is-date-object "^1.0.1" + is-symbol "^1.0.1" + escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" @@ -875,6 +1293,17 @@ escodegen@1.8.x: optionalDependencies: source-map "~0.2.0" +escodegen@^1.9.1: + version "1.11.0" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.11.0.tgz#b27a9389481d5bfd5bec76f7bb1eb3f8f4556589" + dependencies: + esprima "^3.1.3" + estraverse "^4.2.0" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.6.1" + eslint-scope@^3.7.1: version "3.7.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" @@ -940,7 +1369,7 @@ esprima@2.7.x, esprima@^2.7.1: version "2.7.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" -esprima@^3.1.1: +esprima@^3.1.1, esprima@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" @@ -965,7 +1394,7 @@ estraverse@^1.9.1: version "1.9.3" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" -estraverse@^4.0.0, estraverse@^4.1.1: +estraverse@^4.0.0, estraverse@^4.1.1, estraverse@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" @@ -981,6 +1410,12 @@ etag@~1.8.1: version "1.8.1" resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" +exec-sh@^0.2.0: + version "0.2.2" + resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.2.2.tgz#2a5e7ffcbd7d0ba2755bdecb16e5a427dfbdec36" + dependencies: + merge "^1.2.0" + execa@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" @@ -1005,22 +1440,66 @@ execa@^0.9.0: signal-exit "^3.0.0" strip-eof "^1.0.0" +exit@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + expand-brackets@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" dependencies: is-posix-bracket "^0.1.0" +expand-brackets@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + dependencies: + debug "^2.3.3" + define-property "^0.2.5" + extend-shallow "^2.0.1" + posix-character-classes "^0.1.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + expand-range@^1.8.1: version "1.8.2" resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" dependencies: fill-range "^2.1.0" +expect@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-23.6.0.tgz#1e0c8d3ba9a581c87bd71fb9bc8862d443425f98" + dependencies: + ansi-styles "^3.2.0" + jest-diff "^23.6.0" + jest-get-type "^22.1.0" + jest-matcher-utils "^23.6.0" + jest-message-util "^23.4.0" + jest-regex-util "^23.3.0" + +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + dependencies: + is-extendable "^0.1.0" + +extend-shallow@^3.0.0, extend-shallow@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + dependencies: + assign-symbols "^1.0.0" + is-extendable "^1.0.1" + extend@~3.0.0, extend@~3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" +extend@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + external-editor@^2.0.1, external-editor@^2.0.4: version "2.2.0" resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.2.0.tgz#045511cfd8d133f3846673d1047c154e214ad3d5" @@ -1035,6 +1514,19 @@ extglob@^0.3.1: dependencies: is-extglob "^1.0.0" +extglob@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + dependencies: + array-unique "^0.3.2" + define-property "^1.0.0" + expand-brackets "^2.1.4" + extend-shallow "^2.0.1" + fragment-cache "^0.2.1" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + extsprintf@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" @@ -1055,6 +1547,12 @@ fast-levenshtein@~2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" +fb-watchman@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58" + dependencies: + bser "^2.0.0" + figlet@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/figlet/-/figlet-1.2.0.tgz#6c46537378fab649146b5a6143dda019b430b410" @@ -1083,6 +1581,13 @@ filename-regex@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" +fileset@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/fileset/-/fileset-2.0.3.tgz#8e7548a96d3cc2327ee5e674168723a333bba2a0" + dependencies: + glob "^7.0.3" + minimatch "^3.0.3" + fill-range@^2.1.0: version "2.2.4" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" @@ -1093,6 +1598,15 @@ fill-range@^2.1.0: repeat-element "^1.1.2" repeat-string "^1.5.2" +fill-range@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + dependencies: + extend-shallow "^2.0.1" + is-number "^3.0.0" + repeat-string "^1.6.1" + to-regex-range "^2.1.0" + finalhandler@1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.0.tgz#ce0b6855b45853e791b2fcc680046d88253dd7f5" @@ -1134,7 +1648,7 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -for-in@^1.0.1: +for-in@^1.0.1, for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" @@ -1156,7 +1670,7 @@ form-data@~2.1.1: combined-stream "^1.0.5" mime-types "^2.1.12" -form-data@~2.3.1: +form-data@~2.3.1, form-data@~2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099" dependencies: @@ -1164,6 +1678,12 @@ form-data@~2.3.1: combined-stream "1.0.6" mime-types "^2.1.12" +fragment-cache@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + dependencies: + map-cache "^0.2.2" + fresh@0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" @@ -1197,7 +1717,7 @@ fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" -fsevents@^1.0.0: +fsevents@^1.0.0, fsevents@^1.2.3: version "1.2.4" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.4.tgz#f41dcb1af2582af3692da36fc55cbd8e1041c426" dependencies: @@ -1213,6 +1733,10 @@ fstream@^1.0.0, fstream@^1.0.2: mkdirp ">=0.5 0" rimraf "2" +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + functional-red-black-tree@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" @@ -1266,6 +1790,10 @@ get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" +get-value@^2.0.3, get-value@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + getpass@^0.1.1: version "0.1.7" resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" @@ -1337,6 +1865,10 @@ globals@^11.0.1: version "11.5.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.5.0.tgz#6bc840de6771173b191f13d3a9c94d441ee92642" +globals@^9.18.0: + version "9.18.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" + globby@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" @@ -1390,6 +1922,10 @@ growl@1.10.5: version "1.10.5" resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" +growly@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" + handlebars@^4.0.1: version "4.0.6" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.6.tgz#2ce4484850537f9c97a8026d5399b935c4ed4ed7" @@ -1410,6 +1946,16 @@ handlebars@^4.0.11: optionalDependencies: uglify-js "^2.6" +handlebars@^4.0.3: + version "4.0.12" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.12.tgz#2c15c8a96d46da5e266700518ba8cb8d919d5bc5" + dependencies: + async "^2.5.0" + optimist "^0.6.1" + source-map "^0.6.1" + optionalDependencies: + uglify-js "^3.1.4" + har-schema@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-1.0.5.tgz#d263135f43307c02c602afc8fe95970c0151369e" @@ -1441,6 +1987,13 @@ har-validator@~5.0.3: ajv "^5.1.0" har-schema "^2.0.0" +har-validator@~5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.0.tgz#44657f5688a22cfd4b72486e81b3a3fb11742c29" + dependencies: + ajv "^5.3.0" + har-schema "^2.0.0" + has-ansi@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" @@ -1459,6 +2012,39 @@ has-unicode@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" +has-value@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + dependencies: + get-value "^2.0.3" + has-values "^0.1.4" + isobject "^2.0.0" + +has-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + dependencies: + get-value "^2.0.6" + has-values "^1.0.0" + isobject "^3.0.0" + +has-values@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + +has-values@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + +has@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + dependencies: + function-bind "^1.1.1" + hawk@~3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4" @@ -1476,10 +2062,23 @@ hoek@2.x.x: version "2.16.3" resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" +home-or-tmp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.1" + hosted-git-info@^2.1.4: version "2.6.0" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.6.0.tgz#23235b29ab230c576aab0d4f13fc046b0b038222" +html-encoding-sniffer@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8" + dependencies: + whatwg-encoding "^1.0.1" + http-errors@~1.6.2: version "1.6.3" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" @@ -1519,7 +2118,7 @@ husky@^1.0.0-rc.8: run-node "^1.0.0" slash "^2.0.0" -iconv-lite@^0.4.17, iconv-lite@^0.4.4, iconv-lite@~0.4.13: +iconv-lite@0.4.23, iconv-lite@^0.4.17, iconv-lite@^0.4.4, iconv-lite@~0.4.13: version "0.4.23" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" dependencies: @@ -1543,6 +2142,13 @@ import-lazy@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43" +import-local@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-1.0.0.tgz#5e4ffdc03f4fe6c009c6729beb29631c2f8227bc" + dependencies: + pkg-dir "^2.0.0" + resolve-cwd "^2.0.0" + imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" @@ -1609,10 +2215,28 @@ inquirer@^3.0.6: strip-ansi "^4.0.0" through "^2.3.6" +invariant@^2.2.2, invariant@^2.2.4: + version "2.2.4" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" + dependencies: + loose-envify "^1.0.0" + invert-kv@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" +is-accessor-descriptor@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + dependencies: + kind-of "^3.0.2" + +is-accessor-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + dependencies: + kind-of "^6.0.0" + is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" @@ -1633,12 +2257,48 @@ is-builtin-module@^1.0.0: dependencies: builtin-modules "^1.0.0" +is-callable@^1.1.1, is-callable@^1.1.3: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" + is-ci@^1.0.10, is-ci@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.1.0.tgz#247e4162e7860cebbdaf30b774d6b0ac7dcfe7a5" dependencies: ci-info "^1.0.0" +is-data-descriptor@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + dependencies: + kind-of "^3.0.2" + +is-data-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + dependencies: + kind-of "^6.0.0" + +is-date-object@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" + +is-descriptor@^0.1.0: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + dependencies: + is-accessor-descriptor "^0.1.6" + is-data-descriptor "^0.1.4" + kind-of "^5.0.0" + +is-descriptor@^1.0.0, is-descriptor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + dependencies: + is-accessor-descriptor "^1.0.0" + is-data-descriptor "^1.0.0" + kind-of "^6.0.2" + is-directory@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" @@ -1653,10 +2313,16 @@ is-equal-shallow@^0.1.3: dependencies: is-primitive "^2.0.0" -is-extendable@^0.1.1: +is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" +is-extendable@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + dependencies: + is-plain-object "^2.0.4" + is-extglob@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" @@ -1677,6 +2343,10 @@ is-fullwidth-code-point@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" +is-generator-fn@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-1.0.0.tgz#969d49e1bb3329f6bb7f09089be26578b2ddd46a" + is-glob@^2.0.0, is-glob@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" @@ -1714,6 +2384,12 @@ is-number@^2.1.0: dependencies: kind-of "^3.0.2" +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + dependencies: + kind-of "^3.0.2" + is-number@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" @@ -1738,6 +2414,12 @@ is-path-inside@^1.0.0: dependencies: path-is-inside "^1.0.1" +is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + dependencies: + isobject "^3.0.1" + is-posix-bracket@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" @@ -1758,6 +2440,12 @@ is-redirect@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" +is-regex@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" + dependencies: + has "^1.0.1" + is-resolvable@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.0.0.tgz#8df57c61ea2e3c501408d100fb013cf8d6e0cc62" @@ -1772,6 +2460,10 @@ is-stream@^1.0.0, is-stream@^1.0.1, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" +is-symbol@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572" + is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" @@ -1780,6 +2472,10 @@ is-utf8@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" +is-windows@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + isarray@1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -1794,10 +2490,77 @@ isobject@^2.0.0: dependencies: isarray "1.0.0" +isobject@^3.0.0, isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" +istanbul-api@^1.3.1: + version "1.3.7" + resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.3.7.tgz#a86c770d2b03e11e3f778cd7aedd82d2722092aa" + dependencies: + async "^2.1.4" + fileset "^2.0.2" + istanbul-lib-coverage "^1.2.1" + istanbul-lib-hook "^1.2.2" + istanbul-lib-instrument "^1.10.2" + istanbul-lib-report "^1.1.5" + istanbul-lib-source-maps "^1.2.6" + istanbul-reports "^1.5.1" + js-yaml "^3.7.0" + mkdirp "^0.5.1" + once "^1.4.0" + +istanbul-lib-coverage@^1.2.0, istanbul-lib-coverage@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.1.tgz#ccf7edcd0a0bb9b8f729feeb0930470f9af664f0" + +istanbul-lib-hook@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.2.2.tgz#bc6bf07f12a641fbf1c85391d0daa8f0aea6bf86" + dependencies: + append-transform "^0.4.0" + +istanbul-lib-instrument@^1.10.1, istanbul-lib-instrument@^1.10.2: + version "1.10.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.2.tgz#1f55ed10ac3c47f2bdddd5307935126754d0a9ca" + dependencies: + babel-generator "^6.18.0" + babel-template "^6.16.0" + babel-traverse "^6.18.0" + babel-types "^6.18.0" + babylon "^6.18.0" + istanbul-lib-coverage "^1.2.1" + semver "^5.3.0" + +istanbul-lib-report@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.5.tgz#f2a657fc6282f96170aaf281eb30a458f7f4170c" + dependencies: + istanbul-lib-coverage "^1.2.1" + mkdirp "^0.5.1" + path-parse "^1.0.5" + supports-color "^3.1.2" + +istanbul-lib-source-maps@^1.2.4, istanbul-lib-source-maps@^1.2.6: + version "1.2.6" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.6.tgz#37b9ff661580f8fca11232752ee42e08c6675d8f" + dependencies: + debug "^3.1.0" + istanbul-lib-coverage "^1.2.1" + mkdirp "^0.5.1" + rimraf "^2.6.1" + source-map "^0.5.3" + +istanbul-reports@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.5.1.tgz#97e4dbf3b515e8c484caea15d6524eebd3ff4e1a" + dependencies: + handlebars "^4.0.3" + istanbul@^0.4.5: version "0.4.5" resolved "https://registry.yarnpkg.com/istanbul/-/istanbul-0.4.5.tgz#65c7d73d4c4da84d4f3ac310b918fb0b8033733b" @@ -1817,10 +2580,304 @@ istanbul@^0.4.5: which "^1.1.1" wordwrap "^1.0.0" +jest-changed-files@^23.4.2: + version "23.4.2" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-23.4.2.tgz#1eed688370cd5eebafe4ae93d34bb3b64968fe83" + dependencies: + throat "^4.0.0" + +jest-cli@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-23.6.0.tgz#61ab917744338f443ef2baa282ddffdd658a5da4" + dependencies: + ansi-escapes "^3.0.0" + chalk "^2.0.1" + exit "^0.1.2" + glob "^7.1.2" + graceful-fs "^4.1.11" + import-local "^1.0.0" + is-ci "^1.0.10" + istanbul-api "^1.3.1" + istanbul-lib-coverage "^1.2.0" + istanbul-lib-instrument "^1.10.1" + istanbul-lib-source-maps "^1.2.4" + jest-changed-files "^23.4.2" + jest-config "^23.6.0" + jest-environment-jsdom "^23.4.0" + jest-get-type "^22.1.0" + jest-haste-map "^23.6.0" + jest-message-util "^23.4.0" + jest-regex-util "^23.3.0" + jest-resolve-dependencies "^23.6.0" + jest-runner "^23.6.0" + jest-runtime "^23.6.0" + jest-snapshot "^23.6.0" + jest-util "^23.4.0" + jest-validate "^23.6.0" + jest-watcher "^23.4.0" + jest-worker "^23.2.0" + micromatch "^2.3.11" + node-notifier "^5.2.1" + prompts "^0.1.9" + realpath-native "^1.0.0" + rimraf "^2.5.4" + slash "^1.0.0" + string-length "^2.0.0" + strip-ansi "^4.0.0" + which "^1.2.12" + yargs "^11.0.0" + +jest-config@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-23.6.0.tgz#f82546a90ade2d8c7026fbf6ac5207fc22f8eb1d" + dependencies: + babel-core "^6.0.0" + babel-jest "^23.6.0" + chalk "^2.0.1" + glob "^7.1.1" + jest-environment-jsdom "^23.4.0" + jest-environment-node "^23.4.0" + jest-get-type "^22.1.0" + jest-jasmine2 "^23.6.0" + jest-regex-util "^23.3.0" + jest-resolve "^23.6.0" + jest-util "^23.4.0" + jest-validate "^23.6.0" + micromatch "^2.3.11" + pretty-format "^23.6.0" + +jest-diff@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-23.6.0.tgz#1500f3f16e850bb3d71233408089be099f610c7d" + dependencies: + chalk "^2.0.1" + diff "^3.2.0" + jest-get-type "^22.1.0" + pretty-format "^23.6.0" + +jest-docblock@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-23.2.0.tgz#f085e1f18548d99fdd69b20207e6fd55d91383a7" + dependencies: + detect-newline "^2.1.0" + +jest-each@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-23.6.0.tgz#ba0c3a82a8054387016139c733a05242d3d71575" + dependencies: + chalk "^2.0.1" + pretty-format "^23.6.0" + +jest-environment-jsdom@^23.4.0: + version "23.4.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-23.4.0.tgz#056a7952b3fea513ac62a140a2c368c79d9e6023" + dependencies: + jest-mock "^23.2.0" + jest-util "^23.4.0" + jsdom "^11.5.1" + +jest-environment-node@^23.4.0: + version "23.4.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-23.4.0.tgz#57e80ed0841dea303167cce8cd79521debafde10" + dependencies: + jest-mock "^23.2.0" + jest-util "^23.4.0" + +jest-get-type@^22.1.0: + version "22.4.3" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-22.4.3.tgz#e3a8504d8479342dd4420236b322869f18900ce4" + +jest-haste-map@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-23.6.0.tgz#2e3eb997814ca696d62afdb3f2529f5bbc935e16" + dependencies: + fb-watchman "^2.0.0" + graceful-fs "^4.1.11" + invariant "^2.2.4" + jest-docblock "^23.2.0" + jest-serializer "^23.0.1" + jest-worker "^23.2.0" + micromatch "^2.3.11" + sane "^2.0.0" + +jest-jasmine2@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-23.6.0.tgz#840e937f848a6c8638df24360ab869cc718592e0" + dependencies: + babel-traverse "^6.0.0" + chalk "^2.0.1" + co "^4.6.0" + expect "^23.6.0" + is-generator-fn "^1.0.0" + jest-diff "^23.6.0" + jest-each "^23.6.0" + jest-matcher-utils "^23.6.0" + jest-message-util "^23.4.0" + jest-snapshot "^23.6.0" + jest-util "^23.4.0" + pretty-format "^23.6.0" + +jest-leak-detector@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-23.6.0.tgz#e4230fd42cf381a1a1971237ad56897de7e171de" + dependencies: + pretty-format "^23.6.0" + +jest-matcher-utils@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-23.6.0.tgz#726bcea0c5294261a7417afb6da3186b4b8cac80" + dependencies: + chalk "^2.0.1" + jest-get-type "^22.1.0" + pretty-format "^23.6.0" + +jest-message-util@^23.4.0: + version "23.4.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-23.4.0.tgz#17610c50942349508d01a3d1e0bda2c079086a9f" + dependencies: + "@babel/code-frame" "^7.0.0-beta.35" + chalk "^2.0.1" + micromatch "^2.3.11" + slash "^1.0.0" + stack-utils "^1.0.1" + +jest-mock@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-23.2.0.tgz#ad1c60f29e8719d47c26e1138098b6d18b261134" + +jest-regex-util@^23.3.0: + version "23.3.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-23.3.0.tgz#5f86729547c2785c4002ceaa8f849fe8ca471bc5" + +jest-resolve-dependencies@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-23.6.0.tgz#b4526af24c8540d9a3fab102c15081cf509b723d" + dependencies: + jest-regex-util "^23.3.0" + jest-snapshot "^23.6.0" + +jest-resolve@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-23.6.0.tgz#cf1d1a24ce7ee7b23d661c33ba2150f3aebfa0ae" + dependencies: + browser-resolve "^1.11.3" + chalk "^2.0.1" + realpath-native "^1.0.0" + +jest-runner@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-23.6.0.tgz#3894bd219ffc3f3cb94dc48a4170a2e6f23a5a38" + dependencies: + exit "^0.1.2" + graceful-fs "^4.1.11" + jest-config "^23.6.0" + jest-docblock "^23.2.0" + jest-haste-map "^23.6.0" + jest-jasmine2 "^23.6.0" + jest-leak-detector "^23.6.0" + jest-message-util "^23.4.0" + jest-runtime "^23.6.0" + jest-util "^23.4.0" + jest-worker "^23.2.0" + source-map-support "^0.5.6" + throat "^4.0.0" + +jest-runtime@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-23.6.0.tgz#059e58c8ab445917cd0e0d84ac2ba68de8f23082" + dependencies: + babel-core "^6.0.0" + babel-plugin-istanbul "^4.1.6" + chalk "^2.0.1" + convert-source-map "^1.4.0" + exit "^0.1.2" + fast-json-stable-stringify "^2.0.0" + graceful-fs "^4.1.11" + jest-config "^23.6.0" + jest-haste-map "^23.6.0" + jest-message-util "^23.4.0" + jest-regex-util "^23.3.0" + jest-resolve "^23.6.0" + jest-snapshot "^23.6.0" + jest-util "^23.4.0" + jest-validate "^23.6.0" + micromatch "^2.3.11" + realpath-native "^1.0.0" + slash "^1.0.0" + strip-bom "3.0.0" + write-file-atomic "^2.1.0" + yargs "^11.0.0" + +jest-serializer@^23.0.1: + version "23.0.1" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-23.0.1.tgz#a3776aeb311e90fe83fab9e533e85102bd164165" + +jest-snapshot@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-23.6.0.tgz#f9c2625d1b18acda01ec2d2b826c0ce58a5aa17a" + dependencies: + babel-types "^6.0.0" + chalk "^2.0.1" + jest-diff "^23.6.0" + jest-matcher-utils "^23.6.0" + jest-message-util "^23.4.0" + jest-resolve "^23.6.0" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + pretty-format "^23.6.0" + semver "^5.5.0" + +jest-util@^23.4.0: + version "23.4.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-23.4.0.tgz#4d063cb927baf0a23831ff61bec2cbbf49793561" + dependencies: + callsites "^2.0.0" + chalk "^2.0.1" + graceful-fs "^4.1.11" + is-ci "^1.0.10" + jest-message-util "^23.4.0" + mkdirp "^0.5.1" + slash "^1.0.0" + source-map "^0.6.0" + +jest-validate@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-23.6.0.tgz#36761f99d1ed33fcd425b4e4c5595d62b6597474" + dependencies: + chalk "^2.0.1" + jest-get-type "^22.1.0" + leven "^2.1.0" + pretty-format "^23.6.0" + +jest-watcher@^23.4.0: + version "23.4.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-23.4.0.tgz#d2e28ce74f8dad6c6afc922b92cabef6ed05c91c" + dependencies: + ansi-escapes "^3.0.0" + chalk "^2.0.1" + string-length "^2.0.0" + +jest-worker@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-23.2.0.tgz#faf706a8da36fae60eb26957257fa7b5d8ea02b9" + dependencies: + merge-stream "^1.0.1" + +jest@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-23.6.0.tgz#ad5835e923ebf6e19e7a1d7529a432edfee7813d" + dependencies: + import-local "^1.0.0" + jest-cli "^23.6.0" + js-base64@^2.1.8: version "2.4.5" resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.4.5.tgz#e293cd3c7c82f070d700fc7a1ca0a2e69f101f92" +"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + js-tokens@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" @@ -1832,7 +2889,7 @@ js-yaml@3.x: argparse "^1.0.7" esprima "^3.1.1" -js-yaml@^3.9.0, js-yaml@^3.9.1: +js-yaml@^3.7.0, js-yaml@^3.9.0, js-yaml@^3.9.1: version "3.12.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" dependencies: @@ -1903,6 +2960,41 @@ jsdoc@~3.5.5: taffydb "2.6.2" underscore "~1.8.3" +jsdom@^11.5.1: + version "11.12.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.12.0.tgz#1a80d40ddd378a1de59656e9e6dc5a3ba8657bc8" + dependencies: + abab "^2.0.0" + acorn "^5.5.3" + acorn-globals "^4.1.0" + array-equal "^1.0.0" + cssom ">= 0.3.2 < 0.4.0" + cssstyle "^1.0.0" + data-urls "^1.0.0" + domexception "^1.0.1" + escodegen "^1.9.1" + html-encoding-sniffer "^1.0.2" + left-pad "^1.3.0" + nwsapi "^2.0.7" + parse5 "4.0.0" + pn "^1.1.0" + request "^2.87.0" + request-promise-native "^1.0.5" + sax "^1.2.4" + symbol-tree "^3.2.2" + tough-cookie "^2.3.4" + w3c-hr-time "^1.0.1" + webidl-conversions "^4.0.2" + whatwg-encoding "^1.0.3" + whatwg-mimetype "^2.1.0" + whatwg-url "^6.4.1" + ws "^5.2.0" + xml-name-validator "^3.0.0" + +jsesc@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" + json-parse-better-errors@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" @@ -1929,6 +3021,10 @@ json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" +json5@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" + jsonfile@^2.1.0: version "2.4.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" @@ -1964,7 +3060,23 @@ kind-of@^3.0.2: dependencies: is-buffer "^1.1.5" -kind-of@^6.0.0: +kind-of@^3.0.3, kind-of@^3.2.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + dependencies: + is-buffer "^1.1.5" + +kind-of@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + +kind-of@^6.0.0, kind-of@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" @@ -1974,6 +3086,10 @@ klaw@~2.0.0: dependencies: graceful-fs "^4.1.9" +kleur@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/kleur/-/kleur-2.0.2.tgz#b704f4944d95e255d038f0cb05fb8a602c55a300" + latest-version@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-3.1.0.tgz#a205383fea322b33b5ae3b18abee0dc2f356ee15" @@ -1990,6 +3106,10 @@ lcid@^1.0.0: dependencies: invert-kv "^1.0.0" +left-pad@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e" + less@^3.0.1: version "3.0.4" resolved "https://registry.yarnpkg.com/less/-/less-3.0.4.tgz#d27dcedbac96031c9e7b76f1da1e4b7d83760814" @@ -2003,6 +3123,10 @@ less@^3.0.1: request "^2.83.0" source-map "~0.6.0" +leven@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" + levn@^0.3.0, levn@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" @@ -2072,10 +3196,18 @@ lodash.pick@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.pick/-/lodash.pick-4.4.0.tgz#52f05610fff9ded422611441ed1fc123a03001b3" +lodash.sortby@^4.7.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" + lodash@^4.0.0, lodash@^4.16.4, lodash@^4.3.0: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" +lodash@^4.13.1, lodash@^4.17.10: + version "4.17.11" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" + lodash@^4.17.4, lodash@~4.17.10: version "4.17.10" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" @@ -2084,6 +3216,12 @@ longest@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" +loose-envify@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + loud-rejection@^1.0.0: version "1.6.0" resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f" @@ -2108,10 +3246,26 @@ make-dir@^1.0.0: dependencies: pify "^3.0.0" +makeerror@1.0.x: + version "1.0.11" + resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" + dependencies: + tmpl "1.0.x" + +map-cache@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + map-obj@^1.0.0, map-obj@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" +map-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + dependencies: + object-visit "^1.0.0" + marked@^0.3.12, marked@^0.3.16, marked@~0.3.6: version "0.3.19" resolved "https://registry.yarnpkg.com/marked/-/marked-0.3.19.tgz#5d47f709c4c9fc3c216b6d46127280f40b39d790" @@ -2124,6 +3278,12 @@ medium-zoom@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/medium-zoom/-/medium-zoom-0.4.0.tgz#8e13c9b754903c0c903220611af0d3cd373a4222" +mem@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" + dependencies: + mimic-fn "^1.0.0" + meow@^3.7.0: version "3.7.0" resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" @@ -2139,7 +3299,17 @@ meow@^3.7.0: redent "^1.0.0" trim-newlines "^1.0.0" -micromatch@^2.1.5: +merge-stream@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1" + dependencies: + readable-stream "^2.0.1" + +merge@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.0.tgz#7531e39d4949c281a66b8c5a6e0265e8b05894da" + +micromatch@^2.1.5, micromatch@^2.3.11: version "2.3.11" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" dependencies: @@ -2157,16 +3327,44 @@ micromatch@^2.1.5: parse-glob "^3.0.4" regex-cache "^0.4.2" +micromatch@^3.1.4: + version "3.1.10" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + braces "^2.3.1" + define-property "^2.0.2" + extend-shallow "^3.0.2" + extglob "^2.0.4" + fragment-cache "^0.2.1" + kind-of "^6.0.2" + nanomatch "^1.2.9" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.2" + mime-db@~1.33.0: version "1.33.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.33.0.tgz#a3492050a5cb9b63450541e39d9788d2272783db" +mime-db@~1.36.0: + version "1.36.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.36.0.tgz#5020478db3c7fe93aad7bbcc4dcf869c43363397" + mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.7: version "2.1.18" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.18.tgz#6f323f60a83d11146f831ff11fd66e2fe5503bb8" dependencies: mime-db "~1.33.0" +mime-types@~2.1.19: + version "2.1.20" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.20.tgz#930cb719d571e903738520f8470911548ca2cc19" + dependencies: + mime-db "~1.36.0" + mime@1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6" @@ -2185,7 +3383,7 @@ mimic-fn@^1.0.0: dependencies: brace-expansion "^1.0.0" -minimatch@3.0.4, minimatch@^3.0.4, minimatch@~3.0.2: +minimatch@3.0.4, minimatch@^3.0.3, minimatch@^3.0.4, minimatch@~3.0.2: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" dependencies: @@ -2195,7 +3393,7 @@ minimist@0.0.8, minimist@~0.0.1: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" -minimist@1.2.0, minimist@^1.1.3, minimist@^1.2.0: +minimist@1.2.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" @@ -2212,6 +3410,13 @@ minizlib@^1.1.0: dependencies: minipass "^2.2.1" +mixin-deep@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" + dependencies: + for-in "^1.0.2" + is-extendable "^1.0.1" + mkdirp2@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/mkdirp2/-/mkdirp2-1.0.4.tgz#56de1f8f5c93cf2199906362eba0f9f262ee4437" @@ -2238,6 +3443,10 @@ mocha@^5.2.0: mkdirp "0.5.1" supports-color "5.4.0" +mockdate@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/mockdate/-/mockdate-2.0.2.tgz#5ae0c0eaf8fe23e009cd01f9889b42c4f634af12" + ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" @@ -2250,6 +3459,22 @@ nan@^2.10.0, nan@^2.9.2: version "2.10.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f" +nanomatch@^1.2.9: + version "1.2.13" + resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + define-property "^2.0.2" + extend-shallow "^3.0.2" + fragment-cache "^0.2.1" + is-windows "^1.0.2" + kind-of "^6.0.2" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" @@ -2297,6 +3522,19 @@ node-gyp@^3.3.1: tar "^2.0.0" which "1" +node-int64@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" + +node-notifier@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.2.1.tgz#fa313dd08f5517db0e2502e5758d664ac69f9dea" + dependencies: + growly "^1.3.0" + semver "^5.4.1" + shellwords "^0.1.1" + which "^1.3.0" + node-pre-gyp@^0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.0.tgz#6e4ef5bb5c5203c6552448828c852c40111aac46" @@ -2358,7 +3596,7 @@ normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: semver "2 || 3 || 4 || 5" validate-npm-package-license "^3.0.1" -normalize-path@^2.0.0, normalize-path@^2.0.1: +normalize-path@^2.0.0, normalize-path@^2.0.1, normalize-path@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" dependencies: @@ -2394,22 +3632,55 @@ number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" +nwsapi@^2.0.7: + version "2.0.9" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.0.9.tgz#77ac0cdfdcad52b6a1151a84e73254edc33ed016" + oauth-sign@~0.8.1, oauth-sign@~0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" +oauth-sign@~0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + object-assign@^4.0.1, object-assign@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" +object-copy@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + dependencies: + copy-descriptor "^0.1.0" + define-property "^0.2.5" + kind-of "^3.0.3" + object-get@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/object-get/-/object-get-2.1.0.tgz#722bbdb60039efa47cad3c6dc2ce51a85c02c5ae" +object-keys@^1.0.12: + version "1.0.12" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.12.tgz#09c53855377575310cca62f55bb334abff7b3ed2" + object-to-spawn-args@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/object-to-spawn-args/-/object-to-spawn-args-1.1.1.tgz#77da8827f073d011c9e1b173f895781470246785" +object-visit@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + dependencies: + isobject "^3.0.0" + +object.getownpropertydescriptors@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" + dependencies: + define-properties "^1.1.2" + es-abstract "^1.5.1" + object.omit@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" @@ -2417,13 +3688,19 @@ object.omit@^2.0.0: for-own "^0.1.4" is-extendable "^0.1.1" +object.pick@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + dependencies: + isobject "^3.0.1" + on-finished@~2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" dependencies: ee-first "1.1.1" -once@1.x, once@^1.3.0: +once@1.x, once@^1.3.0, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" dependencies: @@ -2493,7 +3770,15 @@ os-locale@^1.4.0: dependencies: lcid "^1.0.0" -os-tmpdir@^1.0.0, os-tmpdir@~1.0.2: +os-locale@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" + dependencies: + execa "^0.7.0" + lcid "^1.0.0" + mem "^1.1.0" + +os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" @@ -2559,10 +3844,18 @@ parse-json@^4.0.0: error-ex "^1.3.1" json-parse-better-errors "^1.0.1" +parse5@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608" + parseurl@~1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3" +pascalcase@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + path-exists@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" @@ -2573,7 +3866,7 @@ path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" -path-is-absolute@^1.0.0: +path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" @@ -2585,6 +3878,10 @@ path-key@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" +path-parse@^1.0.5: + version "1.0.6" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + path-type@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" @@ -2639,6 +3936,14 @@ pluralize@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" +pn@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" + +posix-character-classes@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" @@ -2651,12 +3956,23 @@ preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" +pretty-format@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-23.6.0.tgz#5eaac8eeb6b33b987b7fe6097ea6a8a146ab5760" + dependencies: + ansi-regex "^3.0.0" + ansi-styles "^3.2.0" + prismjs@^1.9.0: version "1.14.0" resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.14.0.tgz#bbccfdb8be5d850d26453933cb50122ca0362ae0" optionalDependencies: clipboard "^2.0.0" +private@^0.1.8: + version "0.1.8" + resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" + process-nextick-args@~1.0.6: version "1.0.7" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" @@ -2675,6 +3991,13 @@ promise@^7.1.1: dependencies: asap "~2.0.3" +prompts@^0.1.9: + version "0.1.14" + resolved "https://registry.yarnpkg.com/prompts/-/prompts-0.1.14.tgz#a8e15c612c5c9ec8f8111847df3337c9cbd443b2" + dependencies: + kleur "^2.0.1" + sisteransi "^0.1.1" + prr@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" @@ -2683,10 +4006,18 @@ pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" +psl@^1.1.24: + version "1.1.29" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.29.tgz#60f580d360170bb722a797cc704411e6da850c67" + punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" +punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + qs@~6.3.0: version "6.3.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.2.tgz#e75bd5f6e268122a2a0e0bda630b2550c166502c" @@ -2695,7 +4026,7 @@ qs@~6.4.0: version "6.4.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" -qs@~6.5.1: +qs@~6.5.1, qs@~6.5.2: version "6.5.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" @@ -2776,6 +4107,12 @@ readdirp@^2.0.0: readable-stream "^2.0.2" set-immediate-shim "^1.0.1" +realpath-native@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.0.2.tgz#cd51ce089b513b45cf9b1516c82989b51ccc6560" + dependencies: + util.promisify "^1.0.0" + redent@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde" @@ -2817,6 +4154,13 @@ regex-cache@^0.4.2: dependencies: is-equal-shallow "^0.1.3" +regex-not@^1.0.0, regex-not@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + dependencies: + extend-shallow "^3.0.2" + safe-regex "^1.1.0" + regexpp@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-1.1.0.tgz#0e3516dd0b7904f413d2d4193dce4618c3a689ab" @@ -2842,7 +4186,7 @@ repeat-element@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" -repeat-string@^1.5.2: +repeat-string@^1.5.2, repeat-string@^1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" @@ -2852,6 +4196,20 @@ repeating@^2.0.0: dependencies: is-finite "^1.0.0" +request-promise-core@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.1.tgz#3eee00b2c5aa83239cfb04c5700da36f81cd08b6" + dependencies: + lodash "^4.13.1" + +request-promise-native@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.5.tgz#5281770f68e0c9719e5163fd3fab482215f4fda5" + dependencies: + request-promise-core "1.1.1" + stealthy-require "^1.1.0" + tough-cookie ">=2.3.3" + "request@>=2.9.0 <2.82.0": version "2.81.0" resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" @@ -2904,6 +4262,31 @@ request@^2.83.0: tunnel-agent "^0.6.0" uuid "^3.1.0" +request@^2.87.0: + version "2.88.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.8.0" + caseless "~0.12.0" + combined-stream "~1.0.6" + extend "~3.0.2" + forever-agent "~0.6.1" + form-data "~2.3.2" + har-validator "~5.1.0" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.19" + oauth-sign "~0.9.0" + performance-now "^2.1.0" + qs "~6.5.2" + safe-buffer "^5.1.2" + tough-cookie "~2.4.3" + tunnel-agent "^0.6.0" + uuid "^3.3.2" + request@~2.79.0: version "2.79.0" resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" @@ -2968,7 +4351,11 @@ resolve-pathname@^2.1.0: version "2.2.0" resolved "https://registry.yarnpkg.com/resolve-pathname/-/resolve-pathname-2.2.0.tgz#7e9ae21ed815fd63ab189adeee64dc831eefa879" -resolve@1.1.x: +resolve-url@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + +resolve@1.1.7, resolve@1.1.x: version "1.1.7" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" @@ -2979,13 +4366,17 @@ restore-cursor@^2.0.0: onetime "^2.0.0" signal-exit "^3.0.2" +ret@~0.1.10: + version "0.1.15" + resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" + right-align@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" dependencies: align-text "^0.1.1" -rimraf@2, rimraf@^2.6.1: +rimraf@2, rimraf@^2.5.4, rimraf@^2.6.1: version "2.6.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" dependencies: @@ -2997,6 +4388,10 @@ rimraf@^2.2.8: dependencies: glob "^7.0.5" +rsvp@^3.3.3: + version "3.6.2" + resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-3.6.2.tgz#2e96491599a96cde1b515d5674a8f7a91452926a" + run-async@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" @@ -3025,10 +4420,31 @@ safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" +safe-regex@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + dependencies: + ret "~0.1.10" + "safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" +sane@^2.0.0: + version "2.5.2" + resolved "https://registry.yarnpkg.com/sane/-/sane-2.5.2.tgz#b4dc1861c21b427e929507a3e751e2a2cb8ab3fa" + dependencies: + anymatch "^2.0.0" + capture-exit "^1.2.0" + exec-sh "^0.2.0" + fb-watchman "^2.0.0" + micromatch "^3.1.4" + minimist "^1.1.1" + walker "~1.0.5" + watch "~0.18.0" + optionalDependencies: + fsevents "^1.2.3" + sass-graph@^2.2.4: version "2.2.4" resolved "https://registry.yarnpkg.com/sass-graph/-/sass-graph-2.2.4.tgz#13fbd63cd1caf0908b9fd93476ad43a51d1e0b49" @@ -3063,6 +4479,10 @@ semver-diff@^2.0.0: version "5.5.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" +semver@^5.4.1, semver@^5.5.0: + version "5.5.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.1.tgz#7dfdd8814bdb7cabc7be0fb1d734cfb66c940477" + semver@~5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" @@ -3102,6 +4522,24 @@ set-immediate-shim@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" +set-value@^0.4.3: + version "0.4.3" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.1" + to-object-path "^0.3.0" + +set-value@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.3" + split-string "^3.0.1" + setprototypeof@1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" @@ -3116,10 +4554,22 @@ shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" +shellwords@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" + signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" +sisteransi@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-0.1.1.tgz#5431447d5f7d1675aac667ccd0b865a4994cb3ce" + +slash@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" + slash@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" @@ -3130,6 +4580,33 @@ slice-ansi@1.0.0: dependencies: is-fullwidth-code-point "^2.0.0" +snapdragon-node@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + dependencies: + define-property "^1.0.0" + isobject "^3.0.0" + snapdragon-util "^3.0.1" + +snapdragon-util@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + dependencies: + kind-of "^3.2.0" + +snapdragon@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + dependencies: + base "^0.11.1" + debug "^2.2.0" + define-property "^0.2.5" + extend-shallow "^2.0.1" + map-cache "^0.2.2" + source-map "^0.5.6" + source-map-resolve "^0.5.0" + use "^3.1.0" + sntp@1.x.x: version "1.0.9" resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198" @@ -3144,12 +4621,47 @@ sort-array@^2.0.0: object-get "^2.1.0" typical "^2.6.0" +source-map-resolve@^0.5.0: + version "0.5.2" + resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" + dependencies: + atob "^2.1.1" + decode-uri-component "^0.2.0" + resolve-url "^0.2.1" + source-map-url "^0.4.0" + urix "^0.1.0" + +source-map-support@^0.4.15: + version "0.4.18" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" + dependencies: + source-map "^0.5.6" + +source-map-support@^0.5.6: + version "0.5.9" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map-url@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" + source-map@^0.4.2, source-map@^0.4.4: version "0.4.4" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" dependencies: amdefine ">=0.0.4" +source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + +source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0, source-map@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + source-map@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.2.0.tgz#dab73fbcfc2ba819b4de03bd6f6eaa48164b3f9d" @@ -3160,10 +4672,6 @@ source-map@~0.5.1: version "0.5.6" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" -source-map@~0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - spdx-correct@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.0.0.tgz#05a5b4d7153a195bc92c3c425b69f3b2a9524c82" @@ -3186,6 +4694,12 @@ spdx-license-ids@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz#7a7cd28470cc6d3a1cfe6d66886f6bc430d3ac87" +split-string@^3.0.1, split-string@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + dependencies: + extend-shallow "^3.0.0" + sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" @@ -3205,6 +4719,17 @@ sshpk@^1.7.0: jsbn "~0.1.0" tweetnacl "~0.14.0" +stack-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.1.tgz#d4f33ab54e8e38778b0ca5cfd3b3afb12db68620" + +static-extend@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + dependencies: + define-property "^0.2.5" + object-copy "^0.1.0" + "statuses@>= 1.4.0 < 2": version "1.5.0" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" @@ -3223,6 +4748,10 @@ stdout-stream@^1.4.0: dependencies: readable-stream "^2.0.1" +stealthy-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" + stream-connect@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/stream-connect/-/stream-connect-1.0.2.tgz#18bc81f2edb35b8b5d9a8009200a985314428a97" @@ -3233,6 +4762,13 @@ stream-via@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/stream-via/-/stream-via-1.0.4.tgz#8dccbb0ac909328eb8bc8e2a4bd3934afdaf606c" +string-length@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-2.0.0.tgz#d40dbb686a3ace960c1cffca562bf2c45f8363ed" + dependencies: + astral-regex "^1.0.0" + strip-ansi "^4.0.0" + string-width@^1.0.1, string-width@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" @@ -3283,16 +4819,16 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" +strip-bom@3.0.0, strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + strip-bom@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" dependencies: is-utf8 "^0.2.0" -strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" @@ -3317,12 +4853,16 @@ supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" -supports-color@^3.1.0: +supports-color@^3.1.0, supports-color@^3.1.2: version "3.2.3" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" dependencies: has-flag "^1.0.0" +symbol-tree@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" + table-layout@^0.4.2: version "0.4.4" resolved "https://registry.yarnpkg.com/table-layout/-/table-layout-0.4.4.tgz#bc5398b2a05e58b67b05dd9238354b89ef27be0f" @@ -3378,6 +4918,16 @@ term-size@^1.2.0: dependencies: execa "^0.7.0" +test-exclude@^4.2.1: + version "4.2.3" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.2.3.tgz#a9a5e64474e4398339245a0a769ad7c2f4a97c20" + dependencies: + arrify "^1.0.1" + micromatch "^2.3.11" + object-assign "^4.1.0" + read-pkg-up "^1.0.1" + require-main-filename "^1.0.1" + test-value@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/test-value/-/test-value-1.1.0.tgz#a09136f72ec043d27c893707c2b159bfad7de93f" @@ -3403,6 +4953,10 @@ text-table@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" +throat@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a" + through@^2.3.6: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" @@ -3429,16 +4983,63 @@ tmp@^0.0.33: dependencies: os-tmpdir "~1.0.2" +tmpl@1.0.x: + version "1.0.4" + resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" + +to-fast-properties@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + +to-object-path@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + dependencies: + kind-of "^3.0.2" + +to-regex-range@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + dependencies: + is-number "^3.0.0" + repeat-string "^1.6.1" + +to-regex@^3.0.1, to-regex@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + dependencies: + define-property "^2.0.2" + extend-shallow "^3.0.2" + regex-not "^1.0.2" + safe-regex "^1.1.0" + +tough-cookie@>=2.3.3, tough-cookie@^2.3.4, tough-cookie@~2.4.3: + version "2.4.3" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" + dependencies: + psl "^1.1.24" + punycode "^1.4.1" + tough-cookie@~2.3.0, tough-cookie@~2.3.3: version "2.3.4" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655" dependencies: punycode "^1.4.1" +tr46@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" + dependencies: + punycode "^2.1.0" + trim-newlines@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + "true-case-path@^1.0.2": version "1.0.2" resolved "https://registry.yarnpkg.com/true-case-path/-/true-case-path-1.0.2.tgz#7ec91130924766c7f573be3020c34f8fdfd00d62" @@ -3494,6 +5095,13 @@ uglify-js@^2.6: optionalDependencies: uglify-to-browserify "~1.0.0" +uglify-js@^3.1.4: + version "3.4.9" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.4.9.tgz#af02f180c1207d76432e473ed24a28f4a782bae3" + dependencies: + commander "~2.17.1" + source-map "~0.6.1" + uglify-to-browserify@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" @@ -3516,6 +5124,15 @@ underscore@~1.8.3: version "1.8.3" resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.8.3.tgz#4f3fb53b106e6097fcf9cb4109f2a5e9bdfa5022" +union-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" + dependencies: + arr-union "^3.1.0" + get-value "^2.0.6" + is-extendable "^0.1.1" + set-value "^0.4.3" + unique-string@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-1.0.0.tgz#9e1057cca851abb93398f8b33ae187b99caec11a" @@ -3530,6 +5147,13 @@ unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" +unset-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + dependencies: + has-value "^0.3.1" + isobject "^3.0.0" + unzip-response@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-2.0.1.tgz#d2f0f737d16b0615e72a6935ed04214572d56f97" @@ -3549,16 +5173,31 @@ update-notifier@^2.1.0: semver-diff "^2.0.0" xdg-basedir "^3.0.0" +urix@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + url-parse-lax@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" dependencies: prepend-http "^1.0.1" +use@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" +util.promisify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030" + dependencies: + define-properties "^1.1.2" + object.getownpropertydescriptors "^2.0.3" + utils-merge@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" @@ -3567,6 +5206,10 @@ uuid@^3.0.0, uuid@^3.1.0: version "3.2.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.2.1.tgz#12c528bb9d58d0b9265d9a2f6f0fe8be17ff1f14" +uuid@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" + validate-npm-package-license@^3.0.1: version "3.0.3" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz#81643bcbef1bdfecd4623793dc4648948ba98338" @@ -3582,6 +5225,12 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" +w3c-hr-time@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz#82ac2bff63d950ea9e3189a58a65625fedf19045" + dependencies: + browser-process-hrtime "^0.1.2" + walk-back@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/walk-back/-/walk-back-2.0.1.tgz#554e2a9d874fac47a8cb006bf44c2f0c4998a0a4" @@ -3590,11 +5239,58 @@ walk-back@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/walk-back/-/walk-back-3.0.0.tgz#2358787a35da91032dad5e92f80b12370d8795c5" +walker@~1.0.5: + version "1.0.7" + resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" + dependencies: + makeerror "1.0.x" + +watch@~0.18.0: + version "0.18.0" + resolved "https://registry.yarnpkg.com/watch/-/watch-0.18.0.tgz#28095476c6df7c90c963138990c0a5423eb4b986" + dependencies: + exec-sh "^0.2.0" + minimist "^1.2.0" + +webidl-conversions@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" + +whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.4.tgz#63fb016b7435b795d9025632c086a5209dbd2621" + dependencies: + iconv-lite "0.4.23" + +whatwg-mimetype@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.2.0.tgz#a3d58ef10b76009b042d03e25591ece89b88d171" + +whatwg-url@^6.4.1: + version "6.5.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.5.0.tgz#f2df02bff176fd65070df74ad5ccbb5a199965a8" + dependencies: + lodash.sortby "^4.7.0" + tr46 "^1.0.1" + webidl-conversions "^4.0.2" + +whatwg-url@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.0.0.tgz#fde926fa54a599f3adf82dff25a9f7be02dc6edd" + dependencies: + lodash.sortby "^4.7.0" + tr46 "^1.0.1" + webidl-conversions "^4.0.2" + which-module@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" -which@1, which@^1.2.9: +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + +which@1, which@^1.2.12, which@^1.2.9, which@^1.3.0: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" dependencies: @@ -3652,7 +5348,7 @@ wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" -write-file-atomic@^2.0.0: +write-file-atomic@^2.0.0, write-file-atomic@^2.1.0: version "2.3.0" resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.3.0.tgz#1ff61575c2e2a4e8e510d6fa4e243cce183999ab" dependencies: @@ -3673,10 +5369,20 @@ ws@^1.1.1: options ">=0.0.5" ultron "1.0.x" +ws@^5.2.0: + version "5.2.2" + resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f" + dependencies: + async-limiter "~1.0.0" + xdg-basedir@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4" +xml-name-validator@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" + xmlcreate@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/xmlcreate/-/xmlcreate-1.0.2.tgz#fa6bf762a60a413fb3dd8f4b03c5b269238d308f" @@ -3711,6 +5417,29 @@ yargs-parser@^5.0.0: dependencies: camelcase "^3.0.0" +yargs-parser@^9.0.2: + version "9.0.2" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-9.0.2.tgz#9ccf6a43460fe4ed40a9bb68f48d43b8a68cc077" + dependencies: + camelcase "^4.1.0" + +yargs@^11.0.0: + version "11.1.0" + resolved "http://registry.npmjs.org/yargs/-/yargs-11.1.0.tgz#90b869934ed6e871115ea2ff58b03f4724ed2d77" + dependencies: + cliui "^4.0.0" + decamelize "^1.1.1" + find-up "^2.1.0" + get-caller-file "^1.0.1" + os-locale "^2.0.0" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^2.0.0" + which-module "^2.0.0" + y18n "^3.2.1" + yargs-parser "^9.0.2" + yargs@^7.0.0, yargs@^7.0.2: version "7.1.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.0.tgz#6ba318eb16961727f5d284f8ea003e8d6154d0c8"