diff --git a/.gitignore b/.gitignore index a7eb01438..6b3794e52 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ test.sh dist/flavor\.min\.css dist/flavor\.css + +test_old/ diff --git a/package-lock.json b/package-lock.json index 1f859f49d..a0f21e80e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,44 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@babel/code-frame": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.51.tgz", + "integrity": "sha1-vXHZsZKvl435FYKdOdQJRFZDmgw=", + "dev": true, + "requires": { + "@babel/highlight": "7.0.0-beta.51" + } + }, + "@babel/highlight": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.51.tgz", + "integrity": "sha1-6IRK4loVlcz9QriWI7Q3bKBtIl0=", + "dev": true, + "requires": { + "chalk": "2.4.1", + "esutils": "2.0.2", + "js-tokens": "3.0.2" + } + }, + "@comandeer/babel-plugin-banner": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@comandeer/babel-plugin-banner/-/babel-plugin-banner-1.0.0.tgz", + "integrity": "sha1-QLzOC77ghLWwJUWjNjXQU8JINW8=", + "dev": true + }, + "@types/estree": { + "version": "0.0.38", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.38.tgz", + "integrity": "sha512-F/v7t1LwS4vnXuPooJQGBRKRGIoxWUTmA4VHfqjOccFsNDThD5bfUNpITive6s352O7o384wcpEaDV8rHCehDA==", + "dev": true + }, + "@types/node": { + "version": "10.3.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.3.3.tgz", + "integrity": "sha512-/gwCgiI2e9RzzZTKbl+am3vgNqOt7a9fJ/uxv4SqYKxenoEDNVU3KZEadlpusWhQI0A0dOrZ0T68JYKVjzmgdQ==", + "dev": true + }, "abab": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/abab/-/abab-1.0.4.tgz", @@ -31,12 +69,64 @@ "acorn": "5.5.3" } }, + "acorn-jsx": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", + "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", + "dev": true, + "requires": { + "acorn": "3.3.0" + }, + "dependencies": { + "acorn": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", + "dev": true + } + } + }, + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "dev": true, + "requires": { + "co": "4.6.0", + "fast-deep-equal": "1.1.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" + } + }, + "ajv-keywords": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", + "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", + "dev": true + }, + "align-text": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "dev": true, + "requires": { + "kind-of": "3.2.2", + "longest": "1.0.1", + "repeat-string": "1.6.1" + } + }, "amdefine": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", "dev": true }, + "ansi-escapes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", + "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", + "dev": true + }, "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", @@ -49,6 +139,54 @@ "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", "dev": true }, + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "requires": { + "micromatch": "3.1.10", + "normalize-path": "2.1.1" + }, + "dependencies": { + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "4.0.0", + "array-unique": "0.3.2", + "braces": "2.3.2", + "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.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + } + } + } + }, + "append-transform": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-1.0.0.tgz", + "integrity": "sha512-P009oYkeHyU742iSZJzZZywj4QRJdnTWffaKuJQLablCZ1uz6/cW4yaRgcDaoQ+uwOxxnt0gRUcwfsNP2ri0gw==", + "dev": true, + "requires": { + "default-require-extensions": "2.0.0" + } + }, "aproba": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", @@ -74,6 +212,24 @@ "sprintf-js": "1.0.3" } }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, "array-equal": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", @@ -86,6 +242,49 @@ "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", "dev": true }, + "array-includes": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.0.3.tgz", + "integrity": "sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0=", + "dev": true, + "requires": { + "define-properties": "1.1.2", + "es-abstract": "1.11.0" + } + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "1.0.3" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=", + "dev": true + }, "asn1": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", @@ -98,6 +297,35 @@ "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", "dev": true }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true + }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, + "async": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", + "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "dev": true, + "requires": { + "lodash": "4.17.10" + }, + "dependencies": { + "lodash": { + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "dev": true + } + } + }, "async-foreach": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/async-foreach/-/async-foreach-0.1.3.tgz", @@ -116,6 +344,12 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", "dev": true }, + "atob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.1.tgz", + "integrity": "sha1-ri1acpR38onWDdf5amMUoi3Wwio=", + "dev": true + }, "aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", @@ -190,6 +424,60 @@ } } }, + "babel-core": { + "version": "6.26.3", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", + "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", + "dev": true, + "requires": { + "babel-code-frame": "6.26.0", + "babel-generator": "6.26.1", + "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" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "babel-generator": { + "version": "6.26.1", + "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", + "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", + "dev": true, + "requires": { + "babel-messages": "6.23.0", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "detect-indent": "4.0.0", + "jsesc": "1.3.0", + "lodash": "4.17.4", + "source-map": "0.5.7", + "trim-right": "1.0.1" + } + }, "babel-helper-builder-binary-assignment-operator-visitor": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz", @@ -225,6 +513,12 @@ "lodash": "4.17.4" } }, + "babel-helper-evaluate-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-helper-evaluate-path/-/babel-helper-evaluate-path-0.3.0.tgz", + "integrity": "sha512-dRFlMTqUJRGzx5a2smKxmptDdNCXKSkPcXWzKLwAV72hvIZumrd/0z9RcewHkr7PmAEq+ETtpD1GK6wZ6ZUXzw==", + "dev": true + }, "babel-helper-explode-assignable-expression": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz", @@ -236,6 +530,12 @@ "babel-types": "6.26.0" } }, + "babel-helper-flip-expressions": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-helper-flip-expressions/-/babel-helper-flip-expressions-0.3.0.tgz", + "integrity": "sha512-kNGohWmtAG3b7tN1xocRQ5rsKkH/hpvZsMiGOJ1VwGJKhnwzR5KlB3rvKBaBPl5/IGHcopB2JN+r1SUEX1iMAw==", + "dev": true + }, "babel-helper-function-name": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", @@ -269,6 +569,24 @@ "babel-types": "6.26.0" } }, + "babel-helper-is-nodes-equiv": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/babel-helper-is-nodes-equiv/-/babel-helper-is-nodes-equiv-0.0.1.tgz", + "integrity": "sha1-NOmzALFHnd2Y7HfqC76TQt/jloQ=", + "dev": true + }, + "babel-helper-is-void-0": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-helper-is-void-0/-/babel-helper-is-void-0-0.3.0.tgz", + "integrity": "sha512-JVqdX8y7Rf/x4NwbqtUI7mdQjL9HWoDnoAEQ8Gv8oxzjvbJv+n75f7l36m9Y8C7sCUltX3V5edndrp7Hp1oSXQ==", + "dev": true + }, + "babel-helper-mark-eval-scopes": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-helper-mark-eval-scopes/-/babel-helper-mark-eval-scopes-0.3.0.tgz", + "integrity": "sha512-nrho5Dg4vl0VUgURVpGpEGiwbst5JX7efIyDHFxmkCx/ocQFnrPt8ze9Kxl6TKjR29bJ7D/XKY1NMlSxOQJRbQ==", + "dev": true + }, "babel-helper-optimise-call-expression": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz", @@ -303,6 +621,12 @@ "babel-types": "6.26.0" } }, + "babel-helper-remove-or-void": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-helper-remove-or-void/-/babel-helper-remove-or-void-0.3.0.tgz", + "integrity": "sha512-D68W1M3ibCcbg0ysh3ww4/O0g10X1CXK720oOuR8kpfY7w0yP4tVcpK7zDmI1JecynycTQYAZ1rhLJo9aVtIKQ==", + "dev": true + }, "babel-helper-replace-supers": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz", @@ -317,6 +641,32 @@ "babel-types": "6.26.0" } }, + "babel-helper-to-multiple-sequence-expressions": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-helper-to-multiple-sequence-expressions/-/babel-helper-to-multiple-sequence-expressions-0.3.0.tgz", + "integrity": "sha512-1uCrBD+EAaMnAYh7hc944n8Ga19y3daEnoXWPYDvFVsxMCc1l8aDjksApaCEaNSSuewq8BEcff47Cy1PbLg2Gw==", + "dev": true + }, + "babel-helpers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", + "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-template": "6.26.0" + } + }, + "babel-jest": { + "version": "23.0.1", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-23.0.1.tgz", + "integrity": "sha1-u6079SP7IC2gXtCmVAtIyE7tE6Y=", + "dev": true, + "requires": { + "babel-plugin-istanbul": "4.1.6", + "babel-preset-jest": "23.0.1" + } + }, "babel-messages": { "version": "6.23.0", "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", @@ -335,6 +685,130 @@ "babel-runtime": "6.26.0" } }, + "babel-plugin-istanbul": { + "version": "4.1.6", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz", + "integrity": "sha512-PWP9FQ1AhZhS01T/4qLSKoHGY/xvkZdVBGlKM/HuxxS3+sC66HhTNR7+MpbO/so/cz/wY94MeSWJuP1hXIPfwQ==", + "dev": true, + "requires": { + "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" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "2.0.0" + } + } + } + }, + "babel-plugin-jest-hoist": { + "version": "23.0.1", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-23.0.1.tgz", + "integrity": "sha1-6qEclkVjrqnCG+zvK994U/fzwUg=", + "dev": true + }, + "babel-plugin-minify-builtins": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-builtins/-/babel-plugin-minify-builtins-0.3.0.tgz", + "integrity": "sha512-MqhSHlxkmgURqj3144qPksbZ/qof1JWdumcbucc4tysFcf3P3V3z3munTevQgKEFNMd8F5/ECGnwb63xogLjAg==", + "dev": true, + "requires": { + "babel-helper-evaluate-path": "0.3.0" + } + }, + "babel-plugin-minify-constant-folding": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-constant-folding/-/babel-plugin-minify-constant-folding-0.3.0.tgz", + "integrity": "sha512-1XeRpx+aY1BuNY6QU/cm6P+FtEi3ar3XceYbmC+4q4W+2Ewq5pL7V68oHg1hKXkBIE0Z4/FjSoHz6vosZLOe/A==", + "dev": true, + "requires": { + "babel-helper-evaluate-path": "0.3.0" + } + }, + "babel-plugin-minify-dead-code-elimination": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-dead-code-elimination/-/babel-plugin-minify-dead-code-elimination-0.3.0.tgz", + "integrity": "sha512-SjM2Fzg85YZz+q/PNJ/HU4O3W98FKFOiP9K5z3sfonlamGOzvZw3Eup2OTiEBsbbqTeY8yzNCAv3qpJRYCgGmw==", + "dev": true, + "requires": { + "babel-helper-evaluate-path": "0.3.0", + "babel-helper-mark-eval-scopes": "0.3.0", + "babel-helper-remove-or-void": "0.3.0", + "lodash.some": "4.6.0" + } + }, + "babel-plugin-minify-flip-comparisons": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-flip-comparisons/-/babel-plugin-minify-flip-comparisons-0.3.0.tgz", + "integrity": "sha512-B8lK+ekcpSNVH7PZpWDe5nC5zxjRiiT4nTsa6h3QkF3Kk6y9qooIFLemdGlqBq6j0zALEnebvCpw8v7gAdpgnw==", + "dev": true, + "requires": { + "babel-helper-is-void-0": "0.3.0" + } + }, + "babel-plugin-minify-guarded-expressions": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-guarded-expressions/-/babel-plugin-minify-guarded-expressions-0.3.0.tgz", + "integrity": "sha512-O+6CvF5/Ttsth3LMg4/BhyvVZ82GImeKMXGdVRQGK/8jFiP15EjRpdgFlxv3cnqRjqdYxLCS6r28VfLpb9C/kA==", + "dev": true, + "requires": { + "babel-helper-flip-expressions": "0.3.0" + } + }, + "babel-plugin-minify-infinity": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-infinity/-/babel-plugin-minify-infinity-0.3.0.tgz", + "integrity": "sha512-Sj8ia3/w9158DWieUxU6/VvnYVy59geeFEkVgLZYBE8EBP+sN48tHtBM/jSgz0ejEdBlcfqJ6TnvPmVXTzR2BQ==", + "dev": true + }, + "babel-plugin-minify-mangle-names": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-mangle-names/-/babel-plugin-minify-mangle-names-0.3.0.tgz", + "integrity": "sha512-PYTonhFWURsfAN8achDwvR5Xgy6EeTClLz+fSgGRqjAIXb0OyFm3/xfccbQviVi1qDXmlSnt6oJhBg8KE4Fn7Q==", + "dev": true, + "requires": { + "babel-helper-mark-eval-scopes": "0.3.0" + } + }, + "babel-plugin-minify-numeric-literals": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-numeric-literals/-/babel-plugin-minify-numeric-literals-0.3.0.tgz", + "integrity": "sha512-TgZj6ay8zDw74AS3yiIfoQ8vRSNJisYO/Du60S8nPV7EW7JM6fDMx5Sar6yVHlVuuwNgvDUBh191K33bVrAhpg==", + "dev": true + }, + "babel-plugin-minify-replace": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-replace/-/babel-plugin-minify-replace-0.3.0.tgz", + "integrity": "sha512-VR6tTg2Lt0TicHIOw04fsUtpPw7RaRP8PC8YzSFwEixnzvguZjZJoL7TgG7ZyEWQD1cJ96UezswECmFNa815bg==", + "dev": true + }, + "babel-plugin-minify-simplify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-simplify/-/babel-plugin-minify-simplify-0.3.0.tgz", + "integrity": "sha512-2M16ytQOCqBi7bYMu4DCWn8e6KyFCA108F6+tVrBJxOmm5u2sOmTFEa8s94tR9RHRRNYmcUf+rgidfnzL3ik9Q==", + "dev": true, + "requires": { + "babel-helper-flip-expressions": "0.3.0", + "babel-helper-is-nodes-equiv": "0.0.1", + "babel-helper-to-multiple-sequence-expressions": "0.3.0" + } + }, + "babel-plugin-minify-type-constructors": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-type-constructors/-/babel-plugin-minify-type-constructors-0.3.0.tgz", + "integrity": "sha512-XRXpvsUCPeVw9YEUw+9vSiugcSZfow81oIJT0yR9s8H4W7yJ6FHbImi5DJHoL8KcDUjYnL9wYASXk/fOkbyR6Q==", + "dev": true, + "requires": { + "babel-helper-is-void-0": "0.3.0" + } + }, "babel-plugin-syntax-async-functions": { "version": "6.13.0", "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz", @@ -347,6 +821,12 @@ "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=", "dev": true }, + "babel-plugin-syntax-object-rest-spread": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz", + "integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=", + "dev": true + }, "babel-plugin-syntax-trailing-function-commas": { "version": "6.22.0", "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz", @@ -609,6 +1089,39 @@ "babel-runtime": "6.26.0" } }, + "babel-plugin-transform-inline-consecutive-adds": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-inline-consecutive-adds/-/babel-plugin-transform-inline-consecutive-adds-0.3.0.tgz", + "integrity": "sha512-iZsYAIjYLLfLK0yN5WVT7Xf7Y3wQ9Z75j9A8q/0IglQSpUt2ppTdHlwl/GeaXnxdaSmsxBu861klbTBbv2n+RA==", + "dev": true + }, + "babel-plugin-transform-member-expression-literals": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-member-expression-literals/-/babel-plugin-transform-member-expression-literals-6.9.4.tgz", + "integrity": "sha1-NwOcmgwzE6OUlfqsL/OmtbnQOL8=", + "dev": true + }, + "babel-plugin-transform-merge-sibling-variables": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-merge-sibling-variables/-/babel-plugin-transform-merge-sibling-variables-6.9.4.tgz", + "integrity": "sha1-hbQi/DN3tEnJ0c3kQIcgNTJAHa4=", + "dev": true + }, + "babel-plugin-transform-minify-booleans": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-minify-booleans/-/babel-plugin-transform-minify-booleans-6.9.4.tgz", + "integrity": "sha1-rLs+VqNVXdI5KOS1gtKFFi3SsZg=", + "dev": true + }, + "babel-plugin-transform-property-literals": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-property-literals/-/babel-plugin-transform-property-literals-6.9.4.tgz", + "integrity": "sha1-mMHSHiVXNlc/k+zlRFn2ziSYXTk=", + "dev": true, + "requires": { + "esutils": "2.0.2" + } + }, "babel-plugin-transform-regenerator": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz", @@ -618,6 +1131,39 @@ "regenerator-transform": "0.10.1" } }, + "babel-plugin-transform-regexp-constructors": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-regexp-constructors/-/babel-plugin-transform-regexp-constructors-0.3.0.tgz", + "integrity": "sha512-h92YHzyl042rb0naKO8frTHntpRFwRgKkfWD8602kFHoQingjJNtbvZzvxqHncJ6XmKVyYvfrBpDOSkCTDIIxw==", + "dev": true + }, + "babel-plugin-transform-remove-console": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-remove-console/-/babel-plugin-transform-remove-console-6.9.4.tgz", + "integrity": "sha1-uYA2DAZzhOJLNXpYjYB9PINSd4A=", + "dev": true + }, + "babel-plugin-transform-remove-debugger": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-remove-debugger/-/babel-plugin-transform-remove-debugger-6.9.4.tgz", + "integrity": "sha1-QrcnYxyXl44estGZp67IShgznvI=", + "dev": true + }, + "babel-plugin-transform-remove-undefined": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-remove-undefined/-/babel-plugin-transform-remove-undefined-0.3.0.tgz", + "integrity": "sha512-TYGQucc8iP3LJwN3kDZLEz5aa/2KuFrqpT+s8f8NnHsBU1sAgR3y8Opns0xhC+smyDYWscqFCKM1gbkWQOhhnw==", + "dev": true, + "requires": { + "babel-helper-evaluate-path": "0.3.0" + } + }, + "babel-plugin-transform-simplify-comparison-operators": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-simplify-comparison-operators/-/babel-plugin-transform-simplify-comparison-operators-6.9.4.tgz", + "integrity": "sha1-9ir+CWyrDh9ootdT/fKDiIRxzrk=", + "dev": true + }, "babel-plugin-transform-strict-mode": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", @@ -628,6 +1174,12 @@ "babel-types": "6.26.0" } }, + "babel-plugin-transform-undefined-to-void": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-undefined-to-void/-/babel-plugin-transform-undefined-to-void-6.9.4.tgz", + "integrity": "sha1-viQcqBQEAwZ4t0hxcyK4nQyP4oA=", + "dev": true + }, "babel-preset-env": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.6.1.tgz", @@ -666,6 +1218,62 @@ "semver": "5.4.1" } }, + "babel-preset-jest": { + "version": "23.0.1", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-23.0.1.tgz", + "integrity": "sha1-YxzFRcbPAhlDATvK8i9F2H/mIZg=", + "dev": true, + "requires": { + "babel-plugin-jest-hoist": "23.0.1", + "babel-plugin-syntax-object-rest-spread": "6.13.0" + } + }, + "babel-preset-minify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/babel-preset-minify/-/babel-preset-minify-0.3.0.tgz", + "integrity": "sha512-+VV2GWEyak3eDOmzT1DDMuqHrw3VbE9nBNkx2LLVs4pH/Me32ND8DRpVDd8IRvk1xX5p75nygyRPtkMh6GIAbQ==", + "dev": true, + "requires": { + "babel-plugin-minify-builtins": "0.3.0", + "babel-plugin-minify-constant-folding": "0.3.0", + "babel-plugin-minify-dead-code-elimination": "0.3.0", + "babel-plugin-minify-flip-comparisons": "0.3.0", + "babel-plugin-minify-guarded-expressions": "0.3.0", + "babel-plugin-minify-infinity": "0.3.0", + "babel-plugin-minify-mangle-names": "0.3.0", + "babel-plugin-minify-numeric-literals": "0.3.0", + "babel-plugin-minify-replace": "0.3.0", + "babel-plugin-minify-simplify": "0.3.0", + "babel-plugin-minify-type-constructors": "0.3.0", + "babel-plugin-transform-inline-consecutive-adds": "0.3.0", + "babel-plugin-transform-member-expression-literals": "6.9.4", + "babel-plugin-transform-merge-sibling-variables": "6.9.4", + "babel-plugin-transform-minify-booleans": "6.9.4", + "babel-plugin-transform-property-literals": "6.9.4", + "babel-plugin-transform-regexp-constructors": "0.3.0", + "babel-plugin-transform-remove-console": "6.9.4", + "babel-plugin-transform-remove-debugger": "6.9.4", + "babel-plugin-transform-remove-undefined": "0.3.0", + "babel-plugin-transform-simplify-comparison-operators": "6.9.4", + "babel-plugin-transform-undefined-to-void": "6.9.4", + "lodash.isplainobject": "4.0.6" + } + }, + "babel-register": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", + "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", + "dev": true, + "requires": { + "babel-core": "6.26.3", + "babel-runtime": "6.26.0", + "core-js": "2.5.3", + "home-or-tmp": "2.0.0", + "lodash": "4.17.4", + "mkdirp": "0.5.1", + "source-map-support": "0.4.18" + } + }, "babel-runtime": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", @@ -747,6 +1355,67 @@ "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "requires": { + "cache-base": "1.0.1", + "class-utils": "0.3.6", + "component-emitter": "1.2.1", + "define-property": "1.0.0", + "isobject": "3.0.1", + "mixin-deep": "1.3.1", + "pascalcase": "0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "1.0.2" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + } + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, "bcrypt-pbkdf": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", @@ -785,12 +1454,58 @@ "concat-map": "0.0.1" } }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "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.2", + "snapdragon-node": "2.1.1", + "split-string": "3.1.0", + "to-regex": "3.0.2" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, "browser-process-hrtime": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.2.tgz", "integrity": "sha1-Ql1opY00R/AqBKqJQYf86K+Le44=", "dev": true }, + "browser-resolve": { + "version": "1.11.2", + "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.2.tgz", + "integrity": "sha1-j/CbCixCFxihBRwmCzLkj0QpOM4=", + "dev": true, + "requires": { + "resolve": "1.1.7" + }, + "dependencies": { + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true + } + } + }, "browserslist": { "version": "2.10.1", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.10.1.tgz", @@ -801,12 +1516,67 @@ "electron-to-chromium": "1.3.30" } }, + "bser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.0.0.tgz", + "integrity": "sha1-mseNPtXZFYBP2HrLFYvHlxR6Fxk=", + "dev": true, + "requires": { + "node-int64": "0.4.0" + } + }, + "buffer-from": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.0.tgz", + "integrity": "sha512-c5mRlguI/Pe2dSZmpER62rSCu0ryKmWddzRYsuXc50U2/g8jMOulc31VZMa4mYx31U5xsmSOpDCgH88Vl9cDGQ==", + "dev": true + }, "builtin-modules": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", "dev": true }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "requires": { + "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" + } + }, + "caller-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", + "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", + "dev": true, + "requires": { + "callsites": "0.2.0" + }, + "dependencies": { + "callsites": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", + "dev": true + } + } + }, + "callsites": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", + "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=", + "dev": true + }, "camel-case": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz", @@ -839,12 +1609,32 @@ "integrity": "sha1-EpztdOmhKApEGIC2zSvOMO9Z5sA=", "dev": true }, + "capture-exit": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-1.2.0.tgz", + "integrity": "sha1-HF/MSJ/QqwDU8ax64QcuMXP7q28=", + "dev": true, + "requires": { + "rsvp": "3.6.2" + } + }, "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", "dev": true }, + "center-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "dev": true, + "optional": true, + "requires": { + "align-text": "0.1.4", + "lazy-cache": "1.0.4" + } + }, "chalk": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", @@ -876,6 +1666,47 @@ } } }, + "chardet": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", + "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", + "dev": true + }, + "ci-info": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.1.3.tgz", + "integrity": "sha512-SK/846h/Rcy8q9Z9CAwGBLfCJ6EkjJWdpelWDufQpqVDYq2Wnnv8zlSO6AMQap02jvhVruKKpEtQOufo3pFhLg==", + "dev": true + }, + "circular-json": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", + "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", + "dev": true + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "requires": { + "arr-union": "3.1.0", + "define-property": "0.2.5", + "isobject": "3.0.1", + "static-extend": "0.1.2" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + } + } + }, "clean-css": { "version": "4.1.11", "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.1.11.tgz", @@ -885,6 +1716,21 @@ "source-map": "0.5.7" } }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "2.0.0" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, "clipboard": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.1.tgz", @@ -942,6 +1788,16 @@ "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "requires": { + "map-visit": "1.0.0", + "object-visit": "1.0.1" + } + }, "color-convert": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", @@ -972,18 +1828,60 @@ "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", "dev": true }, + "compare-versions": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.3.0.tgz", + "integrity": "sha512-MAAAIOdi2s4Gl6rZ76PNcUa9IOYB+5ICdT41o5uMRf09aEu/F9RK+qhe8RjXNPwcTjGV7KU7h2P/fljThFVqyQ==", + "dev": true + }, + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "dev": true + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "1.1.0", + "inherits": "2.0.3", + "readable-stream": "2.3.3", + "typedarray": "0.0.6" + } + }, "console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", "dev": true }, + "contains-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", + "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", + "dev": true + }, + "convert-source-map": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz", + "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=", + "dev": true + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true + }, "core-js": { "version": "2.5.3", "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.3.tgz", @@ -1070,16 +1968,31 @@ "whatwg-url": "6.4.1" } }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "debug-log": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/debug-log/-/debug-log-1.0.1.tgz", + "integrity": "sha1-IwdjLUwEOCuN+KMvcLiVBG1SdF8=", + "dev": true + }, "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, - "deep-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", - "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", "dev": true }, "deep-is": { @@ -1088,6 +2001,15 @@ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, + "default-require-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-2.0.0.tgz", + "integrity": "sha1-9fj7sYp9bVCyH2QfZJ67Uiz+JPc=", + "dev": true, + "requires": { + "strip-bom": "3.0.0" + } + }, "define-properties": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", @@ -1098,11 +2020,81 @@ "object-keys": "1.0.11" } }, - "defined": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", - "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", - "dev": true + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "1.0.2", + "isobject": "3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + } + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "deglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/deglob/-/deglob-2.1.1.tgz", + "integrity": "sha512-2kjwuGGonL7gWE1XU4Fv79+vVzpoQCl0V+boMwWtOQJV2AGDabCwez++nB1Nli/8BabAfZQ/UuHPlp6AymKdWw==", + "dev": true, + "requires": { + "find-root": "1.1.0", + "glob": "7.1.2", + "ignore": "3.3.8", + "pkg-config": "1.1.1", + "run-parallel": "1.1.9", + "uniq": "1.0.1" + } + }, + "del": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", + "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", + "dev": true, + "requires": { + "globby": "5.0.0", + "is-path-cwd": "1.0.0", + "is-path-in-cwd": "1.0.1", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "rimraf": "2.6.2" + } }, "delayed-stream": { "version": "1.0.0", @@ -1123,6 +2115,42 @@ "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "dev": true }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true + }, + "detect-indent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", + "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", + "dev": true, + "requires": { + "repeating": "2.0.1" + } + }, + "detect-newline": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz", + "integrity": "sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I=", + "dev": true + }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "2.0.2" + } + }, "domexception": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", @@ -1132,12 +2160,6 @@ "webidl-conversions": "4.0.2" } }, - "duplexer": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", - "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", - "dev": true - }, "ecc-jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", @@ -1163,6 +2185,15 @@ "electron-releases": "2.1.0" } }, + "encoding": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", + "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", + "dev": true, + "requires": { + "iconv-lite": "0.4.19" + } + }, "entities": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", @@ -1236,6 +2267,318 @@ } } }, + "eslint": { + "version": "4.18.2", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.18.2.tgz", + "integrity": "sha512-qy4i3wODqKMYfz9LUI8N2qYDkHkoieTbiHpMrYUI/WbjhXJQr7lI4VngixTgaG+yHX+NBCv7nW4hA0ShbvaNKw==", + "dev": true, + "requires": { + "ajv": "5.5.2", + "babel-code-frame": "6.26.0", + "chalk": "2.4.1", + "concat-stream": "1.6.2", + "cross-spawn": "5.1.0", + "debug": "3.1.0", + "doctrine": "2.1.0", + "eslint-scope": "3.7.1", + "eslint-visitor-keys": "1.0.0", + "espree": "3.5.4", + "esquery": "1.0.1", + "esutils": "2.0.2", + "file-entry-cache": "2.0.0", + "functional-red-black-tree": "1.0.1", + "glob": "7.1.2", + "globals": "11.5.0", + "ignore": "3.3.8", + "imurmurhash": "0.1.4", + "inquirer": "3.3.0", + "is-resolvable": "1.1.0", + "js-yaml": "3.12.0", + "json-stable-stringify-without-jsonify": "1.0.1", + "levn": "0.3.0", + "lodash": "4.17.4", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "natural-compare": "1.4.0", + "optionator": "0.8.2", + "path-is-inside": "1.0.2", + "pluralize": "7.0.0", + "progress": "2.0.0", + "require-uncached": "1.0.3", + "semver": "5.4.1", + "strip-ansi": "4.0.0", + "strip-json-comments": "2.0.1", + "table": "4.0.2", + "text-table": "0.2.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "dev": true, + "requires": { + "lru-cache": "4.1.2", + "shebang-command": "1.2.0", + "which": "1.3.0" + } + }, + "globals": { + "version": "11.5.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.5.0.tgz", + "integrity": "sha512-hYyf+kI8dm3nORsiiXUQigOU62hDLfJ9G01uyGMxhc6BKsircrUhC4uJPQPUSuq2GrTmiiEt7ewxlMdBewfmKQ==", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + } + } + }, + "eslint-config-semistandard": { + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/eslint-config-semistandard/-/eslint-config-semistandard-12.0.1.tgz", + "integrity": "sha512-4zaPW5uRFasf2uRZkE19Y+W84KBV3q+oyWYOsgUN+5DQXE5HCsh7ZxeWDXxozk7NPycGm0kXcsJzLe5GZ1jCeg==", + "dev": true + }, + "eslint-config-standard": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-11.0.0.tgz", + "integrity": "sha512-oDdENzpViEe5fwuRCWla7AXQd++/oyIp8zP+iP9jiUPG6NBj3SHgdgtl/kTn00AjeN+1HNvavTKmYbMo+xMOlw==", + "dev": true + }, + "eslint-config-standard-jsx": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-standard-jsx/-/eslint-config-standard-jsx-5.0.0.tgz", + "integrity": "sha512-rLToPAEqLMPBfWnYTu6xRhm2OWziS2n40QFqJ8jAM8NSVzeVKTa3nclhsU4DpPJQRY60F34Oo1wi/71PN/eITg==", + "dev": true + }, + "eslint-import-resolver-node": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz", + "integrity": "sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==", + "dev": true, + "requires": { + "debug": "2.6.9", + "resolve": "1.5.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "eslint-module-utils": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.2.0.tgz", + "integrity": "sha1-snA2LNiLGkitMIl2zn+lTphBF0Y=", + "dev": true, + "requires": { + "debug": "2.6.9", + "pkg-dir": "1.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "pkg-dir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz", + "integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=", + "dev": true, + "requires": { + "find-up": "1.1.2" + } + } + } + }, + "eslint-plugin-import": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.8.0.tgz", + "integrity": "sha512-Rf7dfKJxZ16QuTgVv1OYNxkZcsu/hULFnC+e+w0Gzi6jMC3guQoWQgxYxc54IDRinlb6/0v5z/PxxIKmVctN+g==", + "dev": true, + "requires": { + "builtin-modules": "1.1.1", + "contains-path": "0.1.0", + "debug": "2.6.9", + "doctrine": "1.5.0", + "eslint-import-resolver-node": "0.3.2", + "eslint-module-utils": "2.2.0", + "has": "1.0.1", + "lodash.cond": "4.5.2", + "minimatch": "3.0.4", + "read-pkg-up": "2.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "doctrine": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "dev": true, + "requires": { + "esutils": "2.0.2", + "isarray": "1.0.0" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "2.0.0" + } + }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true, + "requires": { + "pify": "2.3.0" + } + }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "dev": true, + "requires": { + "load-json-file": "2.0.0", + "normalize-package-data": "2.4.0", + "path-type": "2.0.0" + } + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "dev": true, + "requires": { + "find-up": "2.1.0", + "read-pkg": "2.0.0" + } + } + } + }, + "eslint-plugin-node": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-6.0.1.tgz", + "integrity": "sha512-Q/Cc2sW1OAISDS+Ji6lZS2KV4b7ueA/WydVWd1BECTQwVvfQy5JAi3glhINoKzoMnfnuRgNP+ZWKrGAbp3QDxw==", + "dev": true, + "requires": { + "ignore": "3.3.8", + "minimatch": "3.0.4", + "resolve": "1.5.0", + "semver": "5.4.1" + } + }, + "eslint-plugin-promise": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-3.6.0.tgz", + "integrity": "sha512-YQzM6TLTlApAr7Li8vWKR+K3WghjwKcYzY0d2roWap4SLK+kzuagJX/leTetIDWsFcTFnKNJXWupDCD6aZkP2Q==", + "dev": true + }, + "eslint-plugin-react": { + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.6.1.tgz", + "integrity": "sha512-30aMOHWX/DOaaLJVBHz6RMvYM2qy5GH63+y2PLFdIrYe4YLtODFmT3N1YA7ZqUnaBweVbedr4K4cqxOlWAPjIw==", + "dev": true, + "requires": { + "doctrine": "2.1.0", + "has": "1.0.1", + "jsx-ast-utils": "2.0.1", + "prop-types": "15.6.1" + } + }, + "eslint-plugin-standard": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-3.0.1.tgz", + "integrity": "sha1-NNDJFbRe3G8BA5PH7vOCOwhWXPI=", + "dev": true + }, + "eslint-scope": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz", + "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=", + "dev": true, + "requires": { + "esrecurse": "4.2.1", + "estraverse": "4.2.0" + } + }, + "eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", + "dev": true + }, + "espree": { + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", + "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", + "dev": true, + "requires": { + "acorn": "5.5.3", + "acorn-jsx": "3.0.1" + } + }, + "esprima": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "dev": true + }, + "esquery": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", + "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "dev": true, + "requires": { + "estraverse": "4.2.0" + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "4.2.0" + } + }, "estraverse": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", @@ -1254,12 +2597,269 @@ "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", "dev": true }, + "exec-sh": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.2.1.tgz", + "integrity": "sha512-aLt95pexaugVtQerpmE51+4QfWrNc304uez7jvj6fWnN8GeEHpttB8F36n8N7uVhUMbH/1enbxQ9HImZ4w/9qg==", + "dev": true, + "requires": { + "merge": "1.2.0" + } + }, + "execa": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "dev": true, + "requires": { + "cross-spawn": "5.1.0", + "get-stream": "3.0.0", + "is-stream": "1.1.0", + "npm-run-path": "2.0.2", + "p-finally": "1.0.0", + "signal-exit": "3.0.2", + "strip-eof": "1.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "dev": true, + "requires": { + "lru-cache": "4.1.2", + "shebang-command": "1.2.0", + "which": "1.3.0" + } + } + } + }, + "exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "dev": true + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "requires": { + "debug": "2.6.9", + "define-property": "0.2.5", + "extend-shallow": "2.0.1", + "posix-character-classes": "0.1.1", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "expand-range": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "dev": true, + "requires": { + "fill-range": "2.2.4" + }, + "dependencies": { + "fill-range": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", + "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", + "dev": true, + "requires": { + "is-number": "2.1.0", + "isobject": "2.1.0", + "randomatic": "3.0.0", + "repeat-element": "1.1.2", + "repeat-string": "1.6.1" + } + }, + "is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + } + }, + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "expect": { + "version": "23.1.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-23.1.0.tgz", + "integrity": "sha1-v9/VeiogFw2HWZnul4fMcfAcIF8=", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "jest-diff": "23.0.1", + "jest-get-type": "22.4.3", + "jest-matcher-utils": "23.0.1", + "jest-message-util": "23.1.0", + "jest-regex-util": "23.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + } + } + }, "extend": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", "dev": true }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "1.0.0", + "is-extendable": "1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "2.0.4" + } + } + } + }, + "external-editor": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", + "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", + "dev": true, + "requires": { + "chardet": "0.4.2", + "iconv-lite": "0.4.19", + "tmp": "0.0.33" + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "requires": { + "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.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "1.0.2" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + } + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, "extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", @@ -1284,16 +2884,93 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, - "figures": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", - "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "fb-watchman": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.0.tgz", + "integrity": "sha1-VOmr99+i8mzZsWNsWIwa/AXeXVg=", "dev": true, "requires": { - "escape-string-regexp": "1.0.5", + "bser": "2.0.0" + } + }, + "fbjs": { + "version": "0.8.17", + "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-0.8.17.tgz", + "integrity": "sha1-xNWY6taUkRJlPWWIsBpc3Nn5D90=", + "dev": true, + "requires": { + "core-js": "1.2.7", + "isomorphic-fetch": "2.2.1", + "loose-envify": "1.3.1", + "object-assign": "4.1.1", + "promise": "7.3.1", + "setimmediate": "1.0.5", + "ua-parser-js": "0.7.18" + }, + "dependencies": { + "core-js": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz", + "integrity": "sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=", + "dev": true + } + } + }, + "file-entry-cache": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", + "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", + "dev": true, + "requires": { + "flat-cache": "1.3.0", "object-assign": "4.1.1" } }, + "filename-regex": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", + "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", + "dev": true + }, + "fileset": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/fileset/-/fileset-2.0.3.tgz", + "integrity": "sha1-jnVIqW08wjJ+5eZ0FocjozO7oqA=", + "dev": true, + "requires": { + "glob": "7.1.2", + "minimatch": "3.0.4" + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "2.0.1", + "is-number": "3.0.0", + "repeat-string": "1.6.1", + "to-regex-range": "2.1.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "find-root": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", + "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==", + "dev": true + }, "find-up": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", @@ -1304,13 +2981,31 @@ "pinkie-promise": "2.0.1" } }, - "for-each": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.2.tgz", - "integrity": "sha1-LEBFC5NI6X8oEyJZO6lnBLmr1NQ=", + "flat-cache": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", + "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", "dev": true, "requires": { - "is-function": "1.0.1" + "circular-json": "0.3.3", + "del": "2.2.2", + "graceful-fs": "4.1.11", + "write": "0.2.1" + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "for-own": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "dev": true, + "requires": { + "for-in": "1.0.2" } }, "foreach": { @@ -1336,12 +3031,561 @@ "mime-types": "2.1.18" } }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "requires": { + "map-cache": "0.2.2" + } + }, + "fs-extra": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-6.0.1.tgz", + "integrity": "sha512-GnyIkKhhzXZUWFCaJzvyDLEEgDkPfb4/TPvJCJVuS8MWZgoSsErf++QpiAlDnKFcqhRlm+tIOcencCjyJE6ZCA==", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "jsonfile": "4.0.0", + "universalify": "0.1.1" + } + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, + "fsevents": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz", + "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==", + "dev": true, + "optional": true, + "requires": { + "nan": "2.10.0", + "node-pre-gyp": "0.10.0" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "aproba": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "delegates": "1.0.0", + "readable-stream": "2.3.6" + } + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "chownr": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "debug": { + "version": "2.6.9", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "optional": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.3", + "bundled": true, + "dev": true, + "optional": true + }, + "fs-minipass": { + "version": "1.2.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "2.2.4" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aproba": "1.2.0", + "console-control-strings": "1.1.0", + "has-unicode": "2.0.1", + "object-assign": "4.1.1", + "signal-exit": "3.0.2", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wide-align": "1.1.2" + } + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "iconv-lite": { + "version": "0.4.21", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safer-buffer": "2.1.2" + } + }, + "ignore-walk": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minimatch": "3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "dev": true + }, + "ini": { + "version": "1.3.5", + "bundled": true, + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "requires": { + "brace-expansion": "1.1.11" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true + }, + "minipass": { + "version": "2.2.4", + "bundled": true, + "dev": true, + "requires": { + "safe-buffer": "5.1.1", + "yallist": "3.0.2" + } + }, + "minizlib": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "2.2.4" + } + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "needle": { + "version": "2.2.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "debug": "2.6.9", + "iconv-lite": "0.4.21", + "sax": "1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.10.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "detect-libc": "1.0.3", + "mkdirp": "0.5.1", + "needle": "2.2.0", + "nopt": "4.0.1", + "npm-packlist": "1.1.10", + "npmlog": "4.1.2", + "rc": "1.2.7", + "rimraf": "2.6.2", + "semver": "5.5.0", + "tar": "4.4.1" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "abbrev": "1.1.1", + "osenv": "0.1.5" + } + }, + "npm-bundled": { + "version": "1.0.3", + "bundled": true, + "dev": true, + "optional": true + }, + "npm-packlist": { + "version": "1.1.10", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ignore-walk": "3.0.1", + "npm-bundled": "1.0.3" + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "1.1.4", + "console-control-strings": "1.1.0", + "gauge": "2.7.4", + "set-blocking": "2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.7", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "deep-extend": "0.5.1", + "ini": "1.3.5", + "minimist": "1.2.0", + "strip-json-comments": "2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.3.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.1", + "string_decoder": "1.1.1", + "util-deprecate": "1.0.2" + } + }, + "rimraf": { + "version": "2.6.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "glob": "7.1.2" + } + }, + "safe-buffer": { + "version": "5.1.1", + "bundled": true, + "dev": true + }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "sax": { + "version": "1.2.4", + "bundled": true, + "dev": true, + "optional": true + }, + "semver": { + "version": "5.5.0", + "bundled": true, + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "tar": { + "version": "4.4.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "chownr": "1.0.1", + "fs-minipass": "1.2.5", + "minipass": "2.2.4", + "minizlib": "1.1.0", + "mkdirp": "0.5.1", + "safe-buffer": "5.1.1", + "yallist": "3.0.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "wide-align": { + "version": "1.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "string-width": "1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "yallist": { + "version": "3.0.2", + "bundled": true, + "dev": true + } + } + }, "fstream": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", @@ -1360,6 +3604,12 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, "gauge": { "version": "2.7.4", "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", @@ -1428,6 +3678,24 @@ "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=", "dev": true }, + "get-stdin": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "dev": true + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", @@ -1451,12 +3719,45 @@ "path-is-absolute": "1.0.1" } }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "dev": true, + "requires": { + "glob-parent": "2.0.0", + "is-glob": "2.0.1" + } + }, + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "requires": { + "is-glob": "2.0.1" + } + }, "globals": { "version": "9.18.0", "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", "dev": true }, + "globby": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", + "dev": true, + "requires": { + "array-union": "1.0.2", + "arrify": "1.0.1", + "glob": "7.1.2", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + } + }, "globule": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/globule/-/globule-1.2.0.tgz", @@ -1484,6 +3785,101 @@ "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", "dev": true }, + "growly": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", + "integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=", + "dev": true + }, + "handlebars": { + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz", + "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", + "dev": true, + "requires": { + "async": "1.5.2", + "optimist": "0.6.1", + "source-map": "0.4.4", + "uglify-js": "2.8.29" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true, + "optional": true + }, + "cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "dev": true, + "optional": true, + "requires": { + "center-align": "0.1.3", + "right-align": "0.1.3", + "wordwrap": "0.0.2" + } + }, + "source-map": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "dev": true, + "requires": { + "amdefine": "1.0.1" + } + }, + "uglify-js": { + "version": "2.8.29", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", + "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "dev": true, + "optional": true, + "requires": { + "source-map": "0.5.7", + "uglify-to-browserify": "1.0.2", + "yargs": "3.10.0" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true, + "optional": true + } + } + }, + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "dev": true, + "optional": true + }, + "yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "dev": true, + "optional": true, + "requires": { + "camelcase": "1.2.1", + "cliui": "2.1.0", + "decamelize": "1.2.0", + "window-size": "0.1.0" + } + } + } + }, "har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", @@ -1544,6 +3940,38 @@ "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", "dev": true }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "requires": { + "get-value": "2.0.6", + "has-values": "1.0.0", + "isobject": "3.0.1" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "requires": { + "is-number": "3.0.0", + "kind-of": "4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, "hawk": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", @@ -1568,6 +3996,16 @@ "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==", "dev": true }, + "home-or-tmp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", + "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", + "dev": true, + "requires": { + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" + } + }, "hosted-git-info": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.0.tgz", @@ -1615,6 +4053,28 @@ "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==", "dev": true }, + "ignore": { + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.8.tgz", + "integrity": "sha512-pUh+xUQQhQzevjRHHFqqcTy0/dP/kS9I8HSrUydhihjuD09W6ldVWFtIrwhXdUJHis3i2rZNqEHpZH/cbinFbg==", + "dev": true + }, + "import-local": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-1.0.0.tgz", + "integrity": "sha512-vAaZHieK9qjGo58agRBg+bhHX3hoTZU/Oa3GESWLz7t1U62fk63aHuDJJEteXoDeTCcPmUT+z38gkHPZkkmpmQ==", + "dev": true, + "requires": { + "pkg-dir": "2.0.0", + "resolve-cwd": "2.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, "in-publish": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/in-publish/-/in-publish-2.0.0.tgz", @@ -1646,6 +4106,54 @@ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, + "inquirer": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", + "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", + "dev": true, + "requires": { + "ansi-escapes": "3.1.0", + "chalk": "2.4.1", + "cli-cursor": "2.1.0", + "cli-width": "2.2.0", + "external-editor": "2.2.0", + "figures": "2.0.0", + "lodash": "4.17.4", + "mute-stream": "0.0.7", + "run-async": "2.3.0", + "rx-lite": "4.0.8", + "rx-lite-aggregates": "4.0.8", + "string-width": "2.1.1", + "strip-ansi": "4.0.0", + "through": "2.3.8" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "1.0.5" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + } + } + }, "invariant": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.2.tgz", @@ -1661,12 +4169,27 @@ "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", "dev": true }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + } + }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", "dev": true }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, "is-builtin-module": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", @@ -1682,12 +4205,76 @@ "integrity": "sha1-hut1OSgF3cM69xySoO7fdO52BLI=", "dev": true }, + "is-ci": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.1.0.tgz", + "integrity": "sha512-c7TnwxLePuqIlxHgr7xtxzycJPegNHFuIrBkwbf8hc58//+Op1CqFkyS+xnIMkwn9UsJIwc174BIjkyBmSpjKg==", + "dev": true, + "requires": { + "ci-info": "1.1.3" + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + } + }, "is-date-object": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", "dev": true }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "5.1.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", + "dev": true + }, + "is-equal-shallow": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "dev": true, + "requires": { + "is-primitive": "2.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, "is-finite": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", @@ -1697,12 +4284,27 @@ "number-is-nan": "1.0.1" } }, - "is-function": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.1.tgz", - "integrity": "sha1-Es+5i2W1fdPRk6MSH19uL0N2ArU=", + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, + "is-generator-fn": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-1.0.0.tgz", + "integrity": "sha1-lp1J4bszKfa7fwkIm+JleLLd1Go=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } + }, "is-my-ip-valid": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz", @@ -1722,6 +4324,83 @@ "xtend": "4.0.1" } }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + } + }, + "is-odd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-odd/-/is-odd-2.0.0.tgz", + "integrity": "sha512-OTiixgpZAT1M4NHgS5IguFp/Vz2VI3U7Goh4/HA1adtwyLtSBrxYlcSYkhpAE07s4fKEcjrFxyvtQBND4vFQyQ==", + "dev": true, + "requires": { + "is-number": "4.0.0" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true + } + } + }, + "is-path-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", + "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", + "dev": true + }, + "is-path-in-cwd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz", + "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", + "dev": true, + "requires": { + "is-path-inside": "1.0.1" + } + }, + "is-path-inside": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", + "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", + "dev": true, + "requires": { + "path-is-inside": "1.0.2" + } + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "3.0.1" + } + }, + "is-posix-bracket": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", + "dev": true + }, + "is-primitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", + "dev": true + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, "is-property": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", @@ -1737,6 +4416,18 @@ "has": "1.0.1" } }, + "is-resolvable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", + "dev": true + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, "is-symbol": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz", @@ -1755,6 +4446,12 @@ "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", "dev": true }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -1767,12 +4464,734 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "isomorphic-fetch": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz", + "integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=", + "dev": true, + "requires": { + "node-fetch": "1.7.3", + "whatwg-fetch": "2.0.4" + } + }, "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", "dev": true }, + "istanbul-api": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/istanbul-api/-/istanbul-api-1.3.1.tgz", + "integrity": "sha512-duj6AlLcsWNwUpfyfHt0nWIeRiZpuShnP40YTxOGQgtaN8fd6JYSxsvxUphTDy8V5MfDXo4s/xVCIIvVCO808g==", + "dev": true, + "requires": { + "async": "2.6.1", + "compare-versions": "3.3.0", + "fileset": "2.0.3", + "istanbul-lib-coverage": "1.2.0", + "istanbul-lib-hook": "1.2.1", + "istanbul-lib-instrument": "1.10.1", + "istanbul-lib-report": "1.1.4", + "istanbul-lib-source-maps": "1.2.5", + "istanbul-reports": "1.3.0", + "js-yaml": "3.12.0", + "mkdirp": "0.5.1", + "once": "1.4.0" + } + }, + "istanbul-lib-coverage": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.0.tgz", + "integrity": "sha512-GvgM/uXRwm+gLlvkWHTjDAvwynZkL9ns15calTrmhGgowlwJBbWMYzWbKqE2DT6JDP1AFXKa+Zi0EkqNCUqY0A==", + "dev": true + }, + "istanbul-lib-hook": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-1.2.1.tgz", + "integrity": "sha512-eLAMkPG9FU0v5L02lIkcj/2/Zlz9OuluaXikdr5iStk8FDbSwAixTK9TkYxbF0eNnzAJTwM2fkV2A1tpsIp4Jg==", + "dev": true, + "requires": { + "append-transform": "1.0.0" + } + }, + "istanbul-lib-instrument": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.1.tgz", + "integrity": "sha512-1dYuzkOCbuR5GRJqySuZdsmsNKPL3PTuyPevQfoCXJePT9C8y1ga75neU+Tuy9+yS3G/dgx8wgOmp2KLpgdoeQ==", + "dev": true, + "requires": { + "babel-generator": "6.26.1", + "babel-template": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "istanbul-lib-coverage": "1.2.0", + "semver": "5.4.1" + } + }, + "istanbul-lib-report": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-1.1.4.tgz", + "integrity": "sha512-Azqvq5tT0U09nrncK3q82e/Zjkxa4tkFZv7E6VcqP0QCPn6oNljDPfrZEC/umNXds2t7b8sRJfs6Kmpzt8m2kA==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "1.2.0", + "mkdirp": "0.5.1", + "path-parse": "1.0.5", + "supports-color": "3.2.3" + }, + "dependencies": { + "has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "dev": true + }, + "supports-color": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "dev": true, + "requires": { + "has-flag": "1.0.0" + } + } + } + }, + "istanbul-lib-source-maps": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.5.tgz", + "integrity": "sha512-8O2T/3VhrQHn0XcJbP1/GN7kXMiRAlPi+fj3uEHrjBD8Oz7Py0prSC25C09NuAZS6bgW1NNKAvCSHZXB0irSGA==", + "dev": true, + "requires": { + "debug": "3.1.0", + "istanbul-lib-coverage": "1.2.0", + "mkdirp": "0.5.1", + "rimraf": "2.6.2", + "source-map": "0.5.7" + } + }, + "istanbul-reports": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-1.3.0.tgz", + "integrity": "sha512-y2Z2IMqE1gefWUaVjrBm0mSKvUkaBy9Vqz8iwr/r40Y9hBbIteH5wqHG/9DLTfJ9xUnUT2j7A3+VVJ6EaYBllA==", + "dev": true, + "requires": { + "handlebars": "4.0.11" + } + }, + "jest": { + "version": "23.1.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-23.1.0.tgz", + "integrity": "sha1-u7f4kxAKEadC3YvQ0EelSwlorRo=", + "dev": true, + "requires": { + "import-local": "1.0.0", + "jest-cli": "23.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "cliui": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "dev": true, + "requires": { + "string-width": "2.1.1", + "strip-ansi": "4.0.0", + "wrap-ansi": "2.1.0" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "2.0.0" + } + }, + "jest-cli": { + "version": "23.1.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-23.1.0.tgz", + "integrity": "sha1-64vdTODRUlCJLjGtm2m8mdKo9r8=", + "dev": true, + "requires": { + "ansi-escapes": "3.1.0", + "chalk": "2.4.1", + "exit": "0.1.2", + "glob": "7.1.2", + "graceful-fs": "4.1.11", + "import-local": "1.0.0", + "is-ci": "1.1.0", + "istanbul-api": "1.3.1", + "istanbul-lib-coverage": "1.2.0", + "istanbul-lib-instrument": "1.10.1", + "istanbul-lib-source-maps": "1.2.5", + "jest-changed-files": "23.0.1", + "jest-config": "23.1.0", + "jest-environment-jsdom": "23.1.0", + "jest-get-type": "22.4.3", + "jest-haste-map": "23.1.0", + "jest-message-util": "23.1.0", + "jest-regex-util": "23.0.0", + "jest-resolve-dependencies": "23.0.1", + "jest-runner": "23.1.0", + "jest-runtime": "23.1.0", + "jest-snapshot": "23.0.1", + "jest-util": "23.1.0", + "jest-validate": "23.0.1", + "jest-watcher": "23.1.0", + "jest-worker": "23.0.1", + "micromatch": "2.3.11", + "node-notifier": "5.2.1", + "realpath-native": "1.0.0", + "rimraf": "2.6.2", + "slash": "1.0.0", + "string-length": "2.0.0", + "strip-ansi": "4.0.0", + "which": "1.3.0", + "yargs": "11.0.0" + } + }, + "os-locale": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", + "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "dev": true, + "requires": { + "execa": "0.7.0", + "lcid": "1.0.0", + "mem": "1.1.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "yargs": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.0.0.tgz", + "integrity": "sha512-Rjp+lMYQOWtgqojx1dEWorjCofi1YN7AoFvYV7b1gx/7dAAeuI4kN5SZiEvr0ZmsZTOpDRcCqrpI10L31tFkBw==", + "dev": true, + "requires": { + "cliui": "4.1.0", + "decamelize": "1.2.0", + "find-up": "2.1.0", + "get-caller-file": "1.0.2", + "os-locale": "2.1.0", + "require-directory": "2.1.1", + "require-main-filename": "1.0.1", + "set-blocking": "2.0.0", + "string-width": "2.1.1", + "which-module": "2.0.0", + "y18n": "3.2.1", + "yargs-parser": "9.0.2" + } + }, + "yargs-parser": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz", + "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", + "dev": true, + "requires": { + "camelcase": "4.1.0" + } + } + } + }, + "jest-changed-files": { + "version": "23.0.1", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-23.0.1.tgz", + "integrity": "sha1-95Vy0HIIROpd+EwqRI6GLCJU9gw=", + "dev": true, + "requires": { + "throat": "4.1.0" + } + }, + "jest-config": { + "version": "23.1.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-23.1.0.tgz", + "integrity": "sha1-cIyg9DHTVu5CT7SJXTMIAGvdgkE=", + "dev": true, + "requires": { + "babel-core": "6.26.3", + "babel-jest": "23.0.1", + "chalk": "2.4.1", + "glob": "7.1.2", + "jest-environment-jsdom": "23.1.0", + "jest-environment-node": "23.1.0", + "jest-get-type": "22.4.3", + "jest-jasmine2": "23.1.0", + "jest-regex-util": "23.0.0", + "jest-resolve": "23.1.0", + "jest-util": "23.1.0", + "jest-validate": "23.0.1", + "pretty-format": "23.0.1" + } + }, + "jest-diff": { + "version": "23.0.1", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-23.0.1.tgz", + "integrity": "sha1-PUkTfO4SwyCktNK0pvpugtSRoWo=", + "dev": true, + "requires": { + "chalk": "2.4.1", + "diff": "3.5.0", + "jest-get-type": "22.4.3", + "pretty-format": "23.0.1" + } + }, + "jest-docblock": { + "version": "23.0.1", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-23.0.1.tgz", + "integrity": "sha1-3t3RgzO+XcJBUmCgTvP86SdrVyU=", + "dev": true, + "requires": { + "detect-newline": "2.1.0" + } + }, + "jest-each": { + "version": "23.1.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-23.1.0.tgz", + "integrity": "sha1-FhRrWSw1SGelrl4TzfFcbGW2lsY=", + "dev": true, + "requires": { + "chalk": "2.4.1", + "pretty-format": "23.0.1" + } + }, + "jest-environment-jsdom": { + "version": "23.1.0", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-23.1.0.tgz", + "integrity": "sha1-hZKZFOI77TV32sl1X0EG0Gl8R5w=", + "dev": true, + "requires": { + "jest-mock": "23.1.0", + "jest-util": "23.1.0", + "jsdom": "11.10.0" + } + }, + "jest-environment-node": { + "version": "23.1.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-23.1.0.tgz", + "integrity": "sha1-RSwL+UnPy7rNoeF2Lu7XC8eEx9U=", + "dev": true, + "requires": { + "jest-mock": "23.1.0", + "jest-util": "23.1.0" + } + }, + "jest-get-type": { + "version": "22.4.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-22.4.3.tgz", + "integrity": "sha512-/jsz0Y+V29w1chdXVygEKSz2nBoHoYqNShPe+QgxSNjAuP1i8+k4LbQNrfoliKej0P45sivkSCh7yiD6ubHS3w==", + "dev": true + }, + "jest-haste-map": { + "version": "23.1.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-23.1.0.tgz", + "integrity": "sha1-GObH1ajScTb5G32YUvhd4McHTEk=", + "dev": true, + "requires": { + "fb-watchman": "2.0.0", + "graceful-fs": "4.1.11", + "jest-docblock": "23.0.1", + "jest-serializer": "23.0.1", + "jest-worker": "23.0.1", + "micromatch": "2.3.11", + "sane": "2.5.2" + } + }, + "jest-jasmine2": { + "version": "23.1.0", + "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-23.1.0.tgz", + "integrity": "sha1-SvqzFym2VN3NKwdK3YSTlvE7MLg=", + "dev": true, + "requires": { + "chalk": "2.4.1", + "co": "4.6.0", + "expect": "23.1.0", + "is-generator-fn": "1.0.0", + "jest-diff": "23.0.1", + "jest-each": "23.1.0", + "jest-matcher-utils": "23.0.1", + "jest-message-util": "23.1.0", + "jest-snapshot": "23.0.1", + "jest-util": "23.1.0", + "pretty-format": "23.0.1" + } + }, + "jest-leak-detector": { + "version": "23.0.1", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-23.0.1.tgz", + "integrity": "sha1-nboHUFrDSVw50+wJrB5WRZnoYaA=", + "dev": true, + "requires": { + "pretty-format": "23.0.1" + } + }, + "jest-matcher-utils": { + "version": "23.0.1", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-23.0.1.tgz", + "integrity": "sha1-DGwNrt+YM8Kn82I2Bp7+y0w/bl8=", + "dev": true, + "requires": { + "chalk": "2.4.1", + "jest-get-type": "22.4.3", + "pretty-format": "23.0.1" + } + }, + "jest-message-util": { + "version": "23.1.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-23.1.0.tgz", + "integrity": "sha1-moCbpIfsrFzlEdTmmO47XuJGHqk=", + "dev": true, + "requires": { + "@babel/code-frame": "7.0.0-beta.51", + "chalk": "2.4.1", + "micromatch": "2.3.11", + "slash": "1.0.0", + "stack-utils": "1.0.1" + } + }, + "jest-mock": { + "version": "23.1.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-23.1.0.tgz", + "integrity": "sha1-o4HDGxIasfYMRiotrbe4bczKxIc=", + "dev": true + }, + "jest-regex-util": { + "version": "23.0.0", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-23.0.0.tgz", + "integrity": "sha1-3Vwf3gxG9DcTFM8Q96dRoj9Oj3Y=", + "dev": true + }, + "jest-resolve": { + "version": "23.1.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-23.1.0.tgz", + "integrity": "sha1-ueMW7s69bwC8UKOWDRUnuuZXktI=", + "dev": true, + "requires": { + "browser-resolve": "1.11.2", + "chalk": "2.4.1", + "realpath-native": "1.0.0" + } + }, + "jest-resolve-dependencies": { + "version": "23.0.1", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-23.0.1.tgz", + "integrity": "sha1-0BoQ3a2RUsTOzfXqwriFccS2pk0=", + "dev": true, + "requires": { + "jest-regex-util": "23.0.0", + "jest-snapshot": "23.0.1" + } + }, + "jest-runner": { + "version": "23.1.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-23.1.0.tgz", + "integrity": "sha1-+iCpM//3MaVDKzVh5/ZCZZT6KbU=", + "dev": true, + "requires": { + "exit": "0.1.2", + "graceful-fs": "4.1.11", + "jest-config": "23.1.0", + "jest-docblock": "23.0.1", + "jest-haste-map": "23.1.0", + "jest-jasmine2": "23.1.0", + "jest-leak-detector": "23.0.1", + "jest-message-util": "23.1.0", + "jest-runtime": "23.1.0", + "jest-util": "23.1.0", + "jest-worker": "23.0.1", + "source-map-support": "0.5.6", + "throat": "4.1.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "source-map-support": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.6.tgz", + "integrity": "sha512-N4KXEz7jcKqPf2b2vZF11lQIz9W5ZMuUcIOGj243lduidkf2fjkVKJS9vNxVWn3u/uxX38AcE8U9nnH9FPcq+g==", + "dev": true, + "requires": { + "buffer-from": "1.1.0", + "source-map": "0.6.1" + } + } + } + }, + "jest-runtime": { + "version": "23.1.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-23.1.0.tgz", + "integrity": "sha1-tK4OhyWeys/UqIS2OdsHz03WIK8=", + "dev": true, + "requires": { + "babel-core": "6.26.3", + "babel-plugin-istanbul": "4.1.6", + "chalk": "2.4.1", + "convert-source-map": "1.5.1", + "exit": "0.1.2", + "fast-json-stable-stringify": "2.0.0", + "graceful-fs": "4.1.11", + "jest-config": "23.1.0", + "jest-haste-map": "23.1.0", + "jest-message-util": "23.1.0", + "jest-regex-util": "23.0.0", + "jest-resolve": "23.1.0", + "jest-snapshot": "23.0.1", + "jest-util": "23.1.0", + "jest-validate": "23.0.1", + "micromatch": "2.3.11", + "realpath-native": "1.0.0", + "slash": "1.0.0", + "strip-bom": "3.0.0", + "write-file-atomic": "2.3.0", + "yargs": "11.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "cliui": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "dev": true, + "requires": { + "string-width": "2.1.1", + "strip-ansi": "4.0.0", + "wrap-ansi": "2.1.0" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "2.0.0" + } + }, + "os-locale": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", + "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "dev": true, + "requires": { + "execa": "0.7.0", + "lcid": "1.0.0", + "mem": "1.1.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "yargs": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.0.0.tgz", + "integrity": "sha512-Rjp+lMYQOWtgqojx1dEWorjCofi1YN7AoFvYV7b1gx/7dAAeuI4kN5SZiEvr0ZmsZTOpDRcCqrpI10L31tFkBw==", + "dev": true, + "requires": { + "cliui": "4.1.0", + "decamelize": "1.2.0", + "find-up": "2.1.0", + "get-caller-file": "1.0.2", + "os-locale": "2.1.0", + "require-directory": "2.1.1", + "require-main-filename": "1.0.1", + "set-blocking": "2.0.0", + "string-width": "2.1.1", + "which-module": "2.0.0", + "y18n": "3.2.1", + "yargs-parser": "9.0.2" + } + }, + "yargs-parser": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz", + "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", + "dev": true, + "requires": { + "camelcase": "4.1.0" + } + } + } + }, + "jest-serializer": { + "version": "23.0.1", + "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-23.0.1.tgz", + "integrity": "sha1-o3dq6zEekP6D+rnlM+hRAr0WQWU=", + "dev": true + }, + "jest-snapshot": { + "version": "23.0.1", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-23.0.1.tgz", + "integrity": "sha1-ZnT6Gbnraamcq+zUFb3cQtavPn4=", + "dev": true, + "requires": { + "chalk": "2.4.1", + "jest-diff": "23.0.1", + "jest-matcher-utils": "23.0.1", + "mkdirp": "0.5.1", + "natural-compare": "1.4.0", + "pretty-format": "23.0.1" + } + }, + "jest-tap-reporter": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/jest-tap-reporter/-/jest-tap-reporter-1.9.0.tgz", + "integrity": "sha512-KBNkyWWDO0sGc593H04+QJuMHm9WEwe/0RnMD5ke2spA7nNMQao3ktU34brfOBKk7vNn5EbGIr2pODxNQo+bNA==", + "dev": true, + "requires": { + "@babel/code-frame": "7.0.0-beta.36", + "chalk": "2.4.1", + "string.prototype.padend": "3.0.0", + "string.prototype.padstart": "3.0.0", + "strip-ansi": "4.0.0", + "utf8-bar": "0.1.0" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.0.0-beta.36", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.36.tgz", + "integrity": "sha512-sW77BFwJ48YvQp3Gzz5xtAUiXuYOL2aMJKDwiaY3OcvdqBFurtYfOpSa4QrNyDxmOGRFSYzUpabU2m9QrlWE7w==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "esutils": "2.0.2", + "js-tokens": "3.0.2" + } + }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + } + } + }, + "jest-util": { + "version": "23.1.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-23.1.0.tgz", + "integrity": "sha1-wCUbrzRkTG3S/qeKli9CY6xVdy0=", + "dev": true, + "requires": { + "callsites": "2.0.0", + "chalk": "2.4.1", + "graceful-fs": "4.1.11", + "is-ci": "1.1.0", + "jest-message-util": "23.1.0", + "mkdirp": "0.5.1", + "slash": "1.0.0", + "source-map": "0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "jest-validate": { + "version": "23.0.1", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-23.0.1.tgz", + "integrity": "sha1-zZ8BqJ0mu4hfEqhmdxXpyGWldU8=", + "dev": true, + "requires": { + "chalk": "2.4.1", + "jest-get-type": "22.4.3", + "leven": "2.1.0", + "pretty-format": "23.0.1" + } + }, + "jest-watcher": { + "version": "23.1.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-23.1.0.tgz", + "integrity": "sha1-qNWELjjZ+0r/+CPfartCpYrmzb0=", + "dev": true, + "requires": { + "ansi-escapes": "3.1.0", + "chalk": "2.4.1", + "string-length": "2.0.0" + } + }, + "jest-worker": { + "version": "23.0.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-23.0.1.tgz", + "integrity": "sha1-nmSd2WP/QEYCb5HEAX8Dmmqkp7w=", + "dev": true, + "requires": { + "merge-stream": "1.0.1" + } + }, "js-base64": { "version": "2.4.3", "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.4.3.tgz", @@ -1785,6 +5204,16 @@ "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", "dev": true }, + "js-yaml": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", + "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "dev": true, + "requires": { + "argparse": "1.0.10", + "esprima": "4.0.0" + } + }, "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", @@ -1826,6 +5255,18 @@ "xml-name-validator": "3.0.0" } }, + "jsesc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", + "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, "json-schema": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", @@ -1838,12 +5279,33 @@ "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", "dev": true }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", "dev": true }, + "json5": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11" + } + }, "jsonpointer": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", @@ -1862,6 +5324,31 @@ "verror": "1.10.0" } }, + "jsx-ast-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.0.1.tgz", + "integrity": "sha1-6AGxs5mF4g//yHtA43SAgOLcrH8=", + "dev": true, + "requires": { + "array-includes": "3.0.3" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + }, + "lazy-cache": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "dev": true, + "optional": true + }, "lcid": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", @@ -1877,6 +5364,12 @@ "integrity": "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==", "dev": true }, + "leven": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz", + "integrity": "sha1-wuep93IJTe6dNCAq6KzORoeHVYA=", + "dev": true + }, "levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", @@ -1896,6 +5389,36 @@ "uc.micro": "1.0.5" } }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "2.2.0", + "pify": "2.3.0", + "strip-bom": "3.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "2.0.0", + "path-exists": "3.0.0" + }, + "dependencies": { + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + } + } + }, "lodash": { "version": "4.17.4", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", @@ -1914,18 +5437,42 @@ "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", "dev": true }, + "lodash.cond": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/lodash.cond/-/lodash.cond-4.5.2.tgz", + "integrity": "sha1-9HGh2khr5g9quVXRcRVSPdHSVdU=", + "dev": true + }, + "lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=", + "dev": true + }, "lodash.mergewith": { "version": "4.6.1", "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz", "integrity": "sha512-eWw5r+PYICtEBgrBE5hhlT6aAa75f411bgDz/ZL2KZqYV03USvucsxcHUIlGTDTECs1eunpI7HOV7U+WLDvNdQ==", "dev": true }, + "lodash.some": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.some/-/lodash.some-4.6.0.tgz", + "integrity": "sha1-G7nzFO9ri63tE7VJFpsqlF62jk0=", + "dev": true + }, "lodash.sortby": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", "dev": true }, + "longest": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "dev": true + }, "loose-envify": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz", @@ -1961,12 +5508,45 @@ "yallist": "2.1.2" } }, + "magic-string": { + "version": "0.22.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.22.5.tgz", + "integrity": "sha512-oreip9rJZkzvA8Qzk9HFs8fZGF/u7H/gtrE8EN6RjKJ9kh2HlC+yQ2QezifqTZfGyiuAV0dRv5a+y/8gBb1m9w==", + "dev": true, + "requires": { + "vlq": "0.2.3" + } + }, + "makeerror": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.11.tgz", + "integrity": "sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw=", + "dev": true, + "requires": { + "tmpl": "1.0.4" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, "map-obj": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", "dev": true }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "1.0.1" + } + }, "markdown-it": { "version": "8.4.1", "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.4.1.tgz", @@ -1980,12 +5560,27 @@ "uc.micro": "1.0.5" } }, + "math-random": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz", + "integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w=", + "dev": true + }, "mdurl": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=", "dev": true }, + "mem": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", + "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", + "dev": true, + "requires": { + "mimic-fn": "1.2.0" + } + }, "meow": { "version": "3.7.0", "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", @@ -2004,6 +5599,88 @@ "trim-newlines": "1.0.0" } }, + "merge": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/merge/-/merge-1.2.0.tgz", + "integrity": "sha1-dTHjnUlJwoGma4xabgJl6LBYlNo=", + "dev": true + }, + "merge-stream": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-1.0.1.tgz", + "integrity": "sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE=", + "dev": true, + "requires": { + "readable-stream": "2.3.3" + } + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "2.0.0", + "array-unique": "0.2.1", + "braces": "1.8.5", + "expand-brackets": "0.1.5", + "extglob": "0.3.2", + "filename-regex": "2.0.1", + "is-extglob": "1.0.0", + "is-glob": "2.0.1", + "kind-of": "3.2.2", + "normalize-path": "2.1.1", + "object.omit": "2.0.1", + "parse-glob": "3.0.4", + "regex-cache": "0.4.4" + }, + "dependencies": { + "arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "requires": { + "arr-flatten": "1.1.0" + } + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, + "braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "1.8.2", + "preserve": "0.2.0", + "repeat-element": "1.1.2" + } + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "0.1.1" + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } + } + } + }, "mime-db": { "version": "1.33.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", @@ -2019,6 +5696,12 @@ "mime-db": "1.33.0" } }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, "mini.css": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/mini.css/-/mini.css-2.3.7.tgz", @@ -2040,6 +5723,27 @@ "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, + "mixin-deep": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", + "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "dev": true, + "requires": { + "for-in": "1.0.2", + "is-extendable": "1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "2.0.4" + } + } + } + }, "mkdirp": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", @@ -2057,12 +5761,58 @@ } } }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, "nan": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==", "dev": true }, + "nanomatch": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz", + "integrity": "sha512-n8R9bS8yQ6eSXaV6jHUpKzD8gLsin02w1HSFiegwrs9E098Ylhw5jdyKPaYqvHknHaSCKTPp7C8dGCQ0q9koXA==", + "dev": true, + "requires": { + "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-odd": "2.0.0", + "is-windows": "1.0.2", + "kind-of": "6.0.2", + "object.pick": "1.3.0", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, "no-case": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz", @@ -2072,6 +5822,16 @@ "lower-case": "1.1.4" } }, + "node-fetch": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", + "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", + "dev": true, + "requires": { + "encoding": "0.1.12", + "is-stream": "1.1.0" + } + }, "node-gyp": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.6.2.tgz", @@ -2101,6 +5861,24 @@ } } }, + "node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", + "dev": true + }, + "node-notifier": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-5.2.1.tgz", + "integrity": "sha512-MIBs+AAd6dJ2SklbbE8RUDRlIVhU8MaNLh1A9SUZDUHPiZkWLFde6UNwG41yQHZEToHgJMXqyVZ9UcS/ReOVTg==", + "dev": true, + "requires": { + "growly": "1.3.0", + "semver": "5.4.1", + "shellwords": "0.1.1", + "which": "1.3.0" + } + }, "node-sass": { "version": "4.9.0", "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.9.0.tgz", @@ -2307,6 +6085,24 @@ "validate-npm-package-license": "3.0.3" } }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "1.1.0" + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "2.0.1" + } + }, "npmlog": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", @@ -2343,11 +6139,27 @@ "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true }, - "object-inspect": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.5.0.tgz", - "integrity": "sha512-UmOFbHbwvv+XHj7BerrhVq+knjceBdkvU5AriwLMvhv2qi+e7DJzxfBeFpILEjVzCp+xA+W/pIf06RGPWlZNfw==", - "dev": true + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "requires": { + "copy-descriptor": "0.1.1", + "define-property": "0.2.5", + "kind-of": "3.2.2" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + } + } }, "object-keys": { "version": "1.0.11", @@ -2355,6 +6167,44 @@ "integrity": "sha1-xUYBd4rVYPEULODgG8yotW0TQm0=", "dev": true }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "requires": { + "isobject": "3.0.1" + } + }, + "object.getownpropertydescriptors": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz", + "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=", + "dev": true, + "requires": { + "define-properties": "1.1.2", + "es-abstract": "1.11.0" + } + }, + "object.omit": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "dev": true, + "requires": { + "for-own": "0.1.5", + "is-extendable": "0.1.1" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "3.0.1" + } + }, "octicons": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/octicons/-/octicons-7.2.0.tgz", @@ -2373,6 +6223,39 @@ "wrappy": "1.0.2" } }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "1.2.0" + } + }, + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "dev": true, + "requires": { + "minimist": "0.0.10", + "wordwrap": "0.0.3" + }, + "dependencies": { + "minimist": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", + "dev": true + }, + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "dev": true + } + } + }, "optionator": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", @@ -2418,6 +6301,36 @@ "os-tmpdir": "1.0.2" } }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "1.3.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, "param-case": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/param-case/-/param-case-2.1.1.tgz", @@ -2427,6 +6340,18 @@ "no-case": "2.3.2" } }, + "parse-glob": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "dev": true, + "requires": { + "glob-base": "0.3.0", + "is-dotfile": "1.0.3", + "is-extglob": "1.0.0", + "is-glob": "2.0.1" + } + }, "parse-json": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", @@ -2436,18 +6361,18 @@ "error-ex": "1.3.1" } }, - "parse-ms": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-1.0.1.tgz", - "integrity": "sha1-VjRtR0nXjyNDDKDHE4UK75GqNh0=", - "dev": true - }, "parse5": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==", "dev": true }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, "path-exists": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", @@ -2463,6 +6388,18 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, "path-parse": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", @@ -2507,10 +6444,90 @@ "pinkie": "2.0.4" } }, - "plur": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/plur/-/plur-1.0.0.tgz", - "integrity": "sha1-24XGgU9eXlo7Se/CjWBP7GKXUVY=", + "pkg-conf": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-2.1.0.tgz", + "integrity": "sha1-ISZRTKbyq/69FoWW3xi6V4Z/AFg=", + "dev": true, + "requires": { + "find-up": "2.1.0", + "load-json-file": "4.0.0" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "2.0.0" + } + }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "4.0.0", + "pify": "3.0.0", + "strip-bom": "3.0.0" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "1.3.1", + "json-parse-better-errors": "1.0.2" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "pkg-config": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pkg-config/-/pkg-config-1.1.1.tgz", + "integrity": "sha1-VX7yLXPaPIg3EHdmxS6tq94pj+Q=", + "dev": true, + "requires": { + "debug-log": "1.0.1", + "find-root": "1.1.0", + "xtend": "4.0.1" + } + }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "requires": { + "find-up": "2.1.0" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "2.0.0" + } + } + } + }, + "pluralize": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", + "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", "dev": true }, "pn": { @@ -2519,27 +6536,55 @@ "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==", "dev": true }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true + }, "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, + "preserve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", + "dev": true + }, "prettier": { "version": "1.12.1", "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.12.1.tgz", "integrity": "sha1-wa0g6APndJ+vkFpAnSNn4Gu+cyU=", "dev": true }, - "pretty-ms": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-2.1.0.tgz", - "integrity": "sha1-QlfCVt8/sLRR1q/6qwIYhBJpgdw=", + "pretty-format": { + "version": "23.0.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-23.0.1.tgz", + "integrity": "sha1-1h0GUmjkx1kIO8y8onoBrXx2AfQ=", "dev": true, "requires": { - "is-finite": "1.0.2", - "parse-ms": "1.0.1", - "plur": "1.0.0" + "ansi-regex": "3.0.0", + "ansi-styles": "3.2.1" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + } } }, "prismjs": { @@ -2563,6 +6608,32 @@ "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", "dev": true }, + "progress": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz", + "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=", + "dev": true + }, + "promise": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", + "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", + "dev": true, + "requires": { + "asap": "2.0.6" + } + }, + "prop-types": { + "version": "15.6.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.6.1.tgz", + "integrity": "sha512-4ec7bY1Y66LymSUOH/zARVYObB23AT2h8cf6e/O6ZALB/N0sqZFEx7rq6EYPX2MkOdKORuooI/H5k9TlR4q7kQ==", + "dev": true, + "requires": { + "fbjs": "0.8.17", + "loose-envify": "1.3.1", + "object-assign": "4.1.1" + } + }, "pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", @@ -2581,11 +6652,30 @@ "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==", "dev": true }, - "re-emitter": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/re-emitter/-/re-emitter-1.1.3.tgz", - "integrity": "sha1-+p4xn/3u6zWycpbvDz03TawvUqc=", - "dev": true + "randomatic": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.0.0.tgz", + "integrity": "sha512-VdxFOIEY3mNO5PtSRkkle/hPJDHvQhK21oa73K4yAc9qmp6N429gAyF1gZMOTMeS0/AYzaV/2Trcef+NaIonSA==", + "dev": true, + "requires": { + "is-number": "4.0.0", + "kind-of": "6.0.2", + "math-random": "1.0.1" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } }, "read-pkg": { "version": "1.1.0", @@ -2647,6 +6737,15 @@ "util-deprecate": "1.0.2" } }, + "realpath-native": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/realpath-native/-/realpath-native-1.0.0.tgz", + "integrity": "sha512-XJtlRJ9jf0E1H1SLeJyQ9PGzQD7S65h1pRXEcAeK48doKOnKxcgPeNohJvD5u/2sI9J1oke6E8bZHS/fmW1UiQ==", + "dev": true, + "requires": { + "util.promisify": "1.0.0" + } + }, "redent": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", @@ -2680,6 +6779,25 @@ "private": "0.1.8" } }, + "regex-cache": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "dev": true, + "requires": { + "is-equal-shallow": "0.1.3" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "requires": { + "extend-shallow": "3.0.2", + "safe-regex": "1.1.0" + } + }, "regexpu-core": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", @@ -2720,6 +6838,18 @@ "integrity": "sha1-VNvzd+UUQKypCkzSdGANP/LYiKk=", "dev": true }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", + "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", + "dev": true + }, "repeat-string": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", @@ -2797,6 +6927,24 @@ "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", "dev": true }, + "require-uncached": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", + "dev": true, + "requires": { + "caller-path": "0.1.0", + "resolve-from": "1.0.1" + }, + "dependencies": { + "resolve-from": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", + "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", + "dev": true + } + } + }, "resolve": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz", @@ -2806,13 +6954,51 @@ "path-parse": "1.0.5" } }, - "resumer": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", - "integrity": "sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k=", + "resolve-cwd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", + "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", "dev": true, "requires": { - "through": "2.3.8" + "resolve-from": "3.0.0" + } + }, + "resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "2.0.1", + "signal-exit": "3.0.2" + } + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, + "right-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "dev": true, + "optional": true, + "requires": { + "align-text": "0.1.4" } }, "rimraf": { @@ -2824,6 +7010,16 @@ "glob": "7.1.2" } }, + "rollup": { + "version": "0.58.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-0.58.2.tgz", + "integrity": "sha512-RZVvCWm9BHOYloaE6LLiE/ibpjv1CmI8F8k0B0Cp+q1eezo3cswszJH1DN0djgzSlo0hjuuCmyeI+1XOYLl4wg==", + "dev": true, + "requires": { + "@types/estree": "0.0.38", + "@types/node": "10.3.3" + } + }, "rollup-plugin-babel": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/rollup-plugin-babel/-/rollup-plugin-babel-3.0.4.tgz", @@ -2833,6 +7029,28 @@ "rollup-pluginutils": "1.5.2" } }, + "rollup-plugin-babel-minify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-babel-minify/-/rollup-plugin-babel-minify-4.0.0.tgz", + "integrity": "sha512-aqQTNCjrYZrWogHVpPQPVFRB/oKT9pGQzW8M/l3lRRuNz1zPtsYR/3shd5/SA8Msfb4HIytBEFUOQBCMoVVx6Q==", + "dev": true, + "requires": { + "@comandeer/babel-plugin-banner": "1.0.0", + "babel-core": "6.26.3", + "babel-preset-minify": "0.3.0", + "depd": "1.1.2", + "magic-string": "0.22.5", + "semver": "5.5.0" + }, + "dependencies": { + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true + } + } + }, "rollup-pluginutils": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz", @@ -2843,12 +7061,103 @@ "minimatch": "3.0.4" } }, + "rsvp": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-3.6.2.tgz", + "integrity": "sha512-OfWGQTb9vnwRjwtA2QwpG2ICclHC3pgXZO5xt8H2EfgDquO0qVdSb5T88L4qJVAEugbS56pAuV4XZM58UX8ulw==", + "dev": true + }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, + "requires": { + "is-promise": "2.1.0" + } + }, + "run-parallel": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", + "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==", + "dev": true + }, + "rx-lite": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", + "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=", + "dev": true + }, + "rx-lite-aggregates": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz", + "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=", + "dev": true, + "requires": { + "rx-lite": "4.0.8" + } + }, "safe-buffer": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", "dev": true }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "requires": { + "ret": "0.1.15" + } + }, + "sane": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/sane/-/sane-2.5.2.tgz", + "integrity": "sha1-tNwYYcIbQn6SlQej51HiosuKs/o=", + "dev": true, + "requires": { + "anymatch": "2.0.0", + "capture-exit": "1.2.0", + "exec-sh": "0.2.1", + "fb-watchman": "2.0.0", + "fsevents": "1.2.4", + "micromatch": "3.1.10", + "minimist": "1.2.0", + "walker": "1.0.7", + "watch": "0.18.0" + }, + "dependencies": { + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "4.0.0", + "array-unique": "0.3.2", + "braces": "2.3.2", + "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.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + } + } + } + }, "sass-graph": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.4.tgz", @@ -2895,6 +7204,24 @@ "dev": true, "optional": true }, + "semistandard": { + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/semistandard/-/semistandard-12.0.1.tgz", + "integrity": "sha512-+FBRXBCi8GC1Nivc4ruw2KXER31bE1lrNyESo7prn2Sv9I9+H/Iqpt0NOtlV/GUxq34AgJwJViBUpA3/PUGqOw==", + "dev": true, + "requires": { + "eslint": "4.18.2", + "eslint-config-semistandard": "12.0.1", + "eslint-config-standard": "11.0.0", + "eslint-config-standard-jsx": "5.0.0", + "eslint-plugin-import": "2.8.0", + "eslint-plugin-node": "6.0.1", + "eslint-plugin-promise": "3.6.0", + "eslint-plugin-react": "7.6.1", + "eslint-plugin-standard": "3.0.1", + "standard-engine": "8.0.1" + } + }, "semver": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", @@ -2907,12 +7234,188 @@ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, + "set-value": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", + "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "dev": true, + "requires": { + "extend-shallow": "2.0.1", + "is-extendable": "0.1.1", + "is-plain-object": "2.0.4", + "split-string": "3.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "shellwords": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", + "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", + "dev": true + }, "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, + "slash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", + "dev": true + }, + "slice-ansi": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", + "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0" + } + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "requires": { + "base": "0.11.2", + "debug": "2.6.9", + "define-property": "0.2.5", + "extend-shallow": "2.0.1", + "map-cache": "0.2.2", + "source-map": "0.5.7", + "source-map-resolve": "0.5.2", + "use": "3.1.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "requires": { + "define-property": "1.0.0", + "isobject": "3.0.1", + "snapdragon-util": "3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "1.0.2" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + } + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "requires": { + "kind-of": "3.2.2" + } + }, "sntp": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz", @@ -2928,6 +7431,34 @@ "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "dev": true }, + "source-map-resolve": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "dev": true, + "requires": { + "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": { + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "dev": true, + "requires": { + "source-map": "0.5.7" + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true + }, "spdx-correct": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", @@ -2960,13 +7491,13 @@ "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==", "dev": true }, - "split": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", - "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", "dev": true, "requires": { - "through": "2.3.8" + "extend-shallow": "3.0.2" } }, "sprintf-js": { @@ -2991,6 +7522,45 @@ "tweetnacl": "0.14.5" } }, + "stack-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.1.tgz", + "integrity": "sha1-1PM6tU6OOHeLDKXP07OvsS22hiA=", + "dev": true + }, + "standard-engine": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/standard-engine/-/standard-engine-8.0.1.tgz", + "integrity": "sha512-LA531C3+nljom/XRvdW/hGPXwmilRkaRkENhO3FAGF1Vtq/WtCXzgmnc5S6vUHHsgv534MRy02C1ikMwZXC+tw==", + "dev": true, + "requires": { + "deglob": "2.1.1", + "get-stdin": "6.0.0", + "minimist": "1.2.0", + "pkg-conf": "2.1.0" + } + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "requires": { + "define-property": "0.2.5", + "object-copy": "0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + } + } + }, "stdout-stream": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/stdout-stream/-/stdout-stream-1.4.0.tgz", @@ -3006,10 +7576,75 @@ "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", "dev": true }, - "string.prototype.trim": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz", - "integrity": "sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo=", + "string-length": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-2.0.0.tgz", + "integrity": "sha1-1A27aGo6zpYMHP/KVivyxF+DY+0=", + "dev": true, + "requires": { + "astral-regex": "1.0.0", + "strip-ansi": "4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + } + } + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + } + } + }, + "string.prototype.padend": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.0.0.tgz", + "integrity": "sha1-86rvfBcZ8XDF6rHDK/eA2W4h8vA=", + "dev": true, + "requires": { + "define-properties": "1.1.2", + "es-abstract": "1.11.0", + "function-bind": "1.1.1" + } + }, + "string.prototype.padstart": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/string.prototype.padstart/-/string.prototype.padstart-3.0.0.tgz", + "integrity": "sha1-W8+tOfRkm7LQMSkuGbzwtRDUskI=", "dev": true, "requires": { "define-properties": "1.1.2", @@ -3041,6 +7676,18 @@ "ansi-regex": "2.1.1" } }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, "strip-indent": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", @@ -3058,6 +7705,12 @@ } } }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", @@ -3070,74 +7723,18 @@ "integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY=", "dev": true }, - "tap-out": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/tap-out/-/tap-out-1.4.2.tgz", - "integrity": "sha1-yQfsG/lAURHQiCY+kvVgi4jLs3o=", + "table": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", + "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", "dev": true, "requires": { - "re-emitter": "1.1.3", - "readable-stream": "2.3.3", - "split": "1.0.1", - "trim": "0.0.1" - } - }, - "tap-spec": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/tap-spec/-/tap-spec-4.1.1.tgz", - "integrity": "sha1-4unyb1IIIysfViKIyXYk1YqI8Fo=", - "dev": true, - "requires": { - "chalk": "1.1.3", - "duplexer": "0.1.1", - "figures": "1.7.0", - "lodash": "3.10.1", - "pretty-ms": "2.1.0", - "repeat-string": "1.6.1", - "tap-out": "1.4.2", - "through2": "2.0.3" - }, - "dependencies": { - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" - } - }, - "lodash": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", - "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=", - "dev": true - } - } - }, - "tape": { - "version": "4.9.0", - "resolved": "https://registry.npmjs.org/tape/-/tape-4.9.0.tgz", - "integrity": "sha512-j0jO9BiScfqtPBb9QmPLL0qvxXMz98xjkMb7x8lKipFlJZwNJkqkWPou+NU4V6T9RnVh1kuSthLE8gLrN8bBfw==", - "dev": true, - "requires": { - "deep-equal": "1.0.1", - "defined": "1.0.0", - "for-each": "0.3.2", - "function-bind": "1.1.1", - "glob": "7.1.2", - "has": "1.0.1", - "inherits": "2.0.3", - "minimist": "1.2.0", - "object-inspect": "1.5.0", - "resolve": "1.5.0", - "resumer": "0.0.0", - "string.prototype.trim": "1.1.2", - "through": "2.3.8" + "ajv": "5.5.2", + "ajv-keywords": "2.1.1", + "chalk": "2.4.1", + "lodash": "4.17.4", + "slice-ansi": "1.0.0", + "string-width": "2.1.1" } }, "tar": { @@ -3151,22 +7748,66 @@ "inherits": "2.0.3" } }, + "test-exclude": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-4.2.1.tgz", + "integrity": "sha512-qpqlP/8Zl+sosLxBcVKl9vYy26T9NPalxSzzCP/OY6K7j938ui2oKgo+kRZYfxAeIpLqpbVnsHq1tyV70E4lWQ==", + "dev": true, + "requires": { + "arrify": "1.0.1", + "micromatch": "3.1.10", + "object-assign": "4.1.1", + "read-pkg-up": "1.0.1", + "require-main-filename": "1.0.1" + }, + "dependencies": { + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "4.0.0", + "array-unique": "0.3.2", + "braces": "2.3.2", + "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.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + } + } + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "throat": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/throat/-/throat-4.1.0.tgz", + "integrity": "sha1-iQN8vJLFarGJJua6TLsgDhVnKmo=", + "dev": true + }, "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, - "through2": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", - "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", - "dev": true, - "requires": { - "readable-stream": "2.3.3", - "xtend": "4.0.1" - } - }, "tiny-emitter": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.0.2.tgz", @@ -3174,12 +7815,58 @@ "dev": true, "optional": true }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "1.0.2" + } + }, + "tmpl": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", + "integrity": "sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=", + "dev": true + }, "to-fast-properties": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", "dev": true }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "requires": { + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "regex-not": "1.0.2", + "safe-regex": "1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "3.0.0", + "repeat-string": "1.6.1" + } + }, "tough-cookie": { "version": "2.3.4", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", @@ -3206,18 +7893,18 @@ "punycode": "2.1.0" } }, - "trim": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz", - "integrity": "sha1-WFhUf2spB1fulczMZm+1AITEYN0=", - "dev": true - }, "trim-newlines": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", "dev": true }, + "trim-right": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", + "dev": true + }, "true-case-path": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/true-case-path/-/true-case-path-1.0.2.tgz", @@ -3267,6 +7954,18 @@ "prelude-ls": "1.1.2" } }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "ua-parser-js": { + "version": "0.7.18", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.18.tgz", + "integrity": "sha512-LtzwHlVHwFGTptfNSgezHp7WUlwiqb0gA9AALRbKaERfxwJoiX0A73QbTToxteIAuIaFshhgIZfqK8s7clqgnA==", + "dev": true + }, "uc.micro": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.5.tgz", @@ -3291,18 +7990,151 @@ } } }, + "uglify-to-browserify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "dev": true, + "optional": true + }, + "union-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", + "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "dev": true, + "requires": { + "arr-union": "3.1.0", + "get-value": "2.0.6", + "is-extendable": "0.1.1", + "set-value": "0.4.3" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + }, + "set-value": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", + "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "dev": true, + "requires": { + "extend-shallow": "2.0.1", + "is-extendable": "0.1.1", + "is-plain-object": "2.0.4", + "to-object-path": "0.3.0" + } + } + } + }, + "uniq": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", + "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=", + "dev": true + }, + "universalify": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.1.tgz", + "integrity": "sha1-+nG63UQ3r0wUiEHjs7Fl+enlkLc=", + "dev": true + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "requires": { + "has-value": "0.3.1", + "isobject": "3.0.1" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "requires": { + "get-value": "2.0.6", + "has-values": "0.1.4", + "isobject": "2.1.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true + } + } + }, "upper-case": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-1.1.3.tgz", "integrity": "sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg=", "dev": true }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "use": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.0.tgz", + "integrity": "sha512-6UJEQM/L+mzC3ZJNM56Q4DFGLX/evKGRg15UJHGB9X5j5Z3AFbgZvjUh2yq/UJUY4U5dh7Fal++XbNg1uzpRAw==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + }, + "dependencies": { + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "utf8-bar": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/utf8-bar/-/utf8-bar-0.1.0.tgz", + "integrity": "sha512-AU+KwhlIChF/Su3d/tBrnhtDS6Bd1YWXeRc/If2/XEV/3f8LTSGJQQVONqUI6fwwTrkT5GKbdYxm7qQD7nEcCQ==", + "dev": true + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, + "util.promisify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz", + "integrity": "sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA==", + "dev": true, + "requires": { + "define-properties": "1.1.2", + "object.getownpropertydescriptors": "2.0.3" + } + }, "uuid": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", @@ -3330,6 +8162,12 @@ "extsprintf": "1.3.0" } }, + "vlq": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.3.tgz", + "integrity": "sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow==", + "dev": true + }, "w3c-hr-time": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz", @@ -3339,6 +8177,25 @@ "browser-process-hrtime": "0.1.2" } }, + "walker": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.7.tgz", + "integrity": "sha1-L3+bj9ENZ3JisYqITijRlhjgKPs=", + "dev": true, + "requires": { + "makeerror": "1.0.11" + } + }, + "watch": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/watch/-/watch-0.18.0.tgz", + "integrity": "sha1-KAlUdsbffJDJYxOJkMClQj60uYY=", + "dev": true, + "requires": { + "exec-sh": "0.2.1", + "minimist": "1.2.0" + } + }, "webidl-conversions": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", @@ -3354,6 +8211,12 @@ "iconv-lite": "0.4.19" } }, + "whatwg-fetch": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz", + "integrity": "sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng==", + "dev": true + }, "whatwg-mimetype": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.1.0.tgz", @@ -3417,6 +8280,13 @@ } } }, + "window-size": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "dev": true, + "optional": true + }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", @@ -3461,6 +8331,26 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, + "write": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", + "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "dev": true, + "requires": { + "mkdirp": "0.5.1" + } + }, + "write-file-atomic": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.3.0.tgz", + "integrity": "sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "imurmurhash": "0.1.4", + "signal-exit": "3.0.2" + } + }, "ws": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/ws/-/ws-4.1.0.tgz", diff --git a/package.json b/package.json index c0bc1c84d..1e2008d3d 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "chalk": "^2.4.1", "fs-extra": "^6.0.0", "html-minifier": "^3.5.15", - "jsdom": "^11.10.0", + "jest": "^23.1.0", + "jest-tap-reporter": "^1.9.0", "markdown-it": "^8.4.1", "mini.css": "^2.3.7", "node-sass": "^4.9.0", @@ -14,9 +15,7 @@ "rollup": "^0.58.2", "rollup-plugin-babel": "^3.0.4", "rollup-plugin-babel-minify": "^4.0.0", - "semistandard": "^12.0.1", - "tap-spec": "^4.1.1", - "tape": "^4.9.0" + "semistandard": "^12.0.1" }, "name": "30-seconds-of-code", "description": "A collection of useful JavaScript snippets.", @@ -32,7 +31,7 @@ "extractor": "node ./scripts/extract.js", "packager": "node ./scripts/module.js", "localizer": "node ./scripts/localize.js", - "test": "tape test/**/*.test.js | tap-spec" + "test": "jest --verbose" }, "repository": { "type": "git", @@ -49,5 +48,17 @@ "url": "https://github.com/Chalarangelo/30-seconds-of-code/issues" }, "homepage": "https://github.com/Chalarangelo/30-seconds-of-code#readme", - "dependencies": {} + "dependencies": {}, + "jest": { + "reporters": [ + [ + "jest-tap-reporter", + { + "logLevel": "INFO", + "showInternalStackTraces": false, + "filePath": "test/testlog" + } + ] + ] + } } diff --git a/scripts/tdd.js b/scripts/tdd.js index 0ade624d5..1026aaecb 100644 --- a/scripts/tdd.js +++ b/scripts/tdd.js @@ -5,7 +5,7 @@ // Load modules const fs = require('fs-extra'), path = require('path'); -const child_process = require('child_process'); +const childProcess = require('child_process'); const chalk = require('chalk'); const util = require('./util'); if(util.isTravisCI() && process.env['TRAVIS_EVENT_TYPE'] !== 'cron' && process.env['TRAVIS_EVENT_TYPE'] !== 'api') { @@ -64,16 +64,10 @@ snippetFiles // Export template for snippetName.test.js which generates a example test & other information const exportTest = [ - `const test = require('tape');`, + `const expect = require('expect');`, `const ${fileName} = require('./${fileName}.js');`, - `\ntest('Testing ${fileName}', (t) => {`, - ` //For more information on all the methods supported by tape\n //Please go to https://github.com/substack/tape`, - ` t.true(typeof ${fileName} === 'function', '${fileName} is a Function');`, - ` //t.deepEqual(${fileName}(args..), 'Expected');`, - ` //t.equal(${fileName}(args..), 'Expected');`, - ` //t.false(${fileName}(args..), 'Expected');`, - ` //t.throws(${fileName}(args..), 'Expected');`, - ` t.end();`, + `\ntest('${fileName} is a Function', () => {`, + ` expect(${fileName}).toBeInstanceOf(Function);`, `});` ].join('\n'); @@ -90,7 +84,7 @@ snippetFiles }); try { fs.writeFileSync(path.join(TEST_PATH,'testlog'),`Test log for: ${new Date().toString()}\n`); - child_process.execSync(`npm test >> ${TEST_PATH}/testlog`); + childProcess.execSync(`npm test`); } catch (e) { fs.appendFileSync(path.join(TEST_PATH,'testlog')); diff --git a/test/JSONToDate/JSONToDate.test.js b/test/JSONToDate/JSONToDate.test.js index 1e2a7a57b..8a9ca3412 100644 --- a/test/JSONToDate/JSONToDate.test.js +++ b/test/JSONToDate/JSONToDate.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const JSONToDate = require('./JSONToDate.js'); -test('Testing JSONToDate', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof JSONToDate === 'function', 'JSONToDate is a Function'); - //t.deepEqual(JSONToDate(args..), 'Expected'); - //t.equal(JSONToDate(args..), 'Expected'); - //t.false(JSONToDate(args..), 'Expected'); - //t.throws(JSONToDate(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('JSONToDate is a Function', () => { + expect(JSONToDate).toBeInstanceOf(Function); +}); diff --git a/test/JSONToFile/JSONToFile.test.js b/test/JSONToFile/JSONToFile.test.js index 7c352d079..325eface8 100644 --- a/test/JSONToFile/JSONToFile.test.js +++ b/test/JSONToFile/JSONToFile.test.js @@ -1,14 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const JSONToFile = require('./JSONToFile.js'); -test('Testing JSONToFile', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof JSONToFile === 'function', 'JSONToFile is a Function'); - t.pass('Tested on 09/02/2018 by @chalarangelo'); - //t.deepEqual(JSONToFile(args..), 'Expected'); - //t.equal(JSONToFile(args..), 'Expected'); - //t.false(JSONToFile(args..), 'Expected'); - //t.throws(JSONToFile(args..), 'Expected'); - t.end(); +test('JSONToFile is a Function', () => { + expect(JSONToFile).toBeInstanceOf(Function); }); diff --git a/test/RGBToHex/RGBToHex.test.js b/test/RGBToHex/RGBToHex.test.js index 277d6575c..70892c498 100644 --- a/test/RGBToHex/RGBToHex.test.js +++ b/test/RGBToHex/RGBToHex.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const RGBToHex = require('./RGBToHex.js'); -test('Testing RGBToHex', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof RGBToHex === 'function', 'RGBToHex is a Function'); - t.equal(RGBToHex(255, 165, 1), 'ffa501', "Converts the values of RGB components to a color code."); - //t.deepEqual(RGBToHex(args..), 'Expected'); - //t.equal(RGBToHex(args..), 'Expected'); - //t.false(RGBToHex(args..), 'Expected'); - //t.throws(RGBToHex(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('RGBToHex is a Function', () => { + expect(RGBToHex).toBeInstanceOf(Function); +}); +test('Converts the values of RGB components to a color code.', () => { + expect(RGBToHex(255, 165, 1)).toBe('ffa501'); +}); diff --git a/test/URLJoin/URLJoin.test.js b/test/URLJoin/URLJoin.test.js index 70d0d09a6..4e72b9363 100644 --- a/test/URLJoin/URLJoin.test.js +++ b/test/URLJoin/URLJoin.test.js @@ -1,15 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const URLJoin = require('./URLJoin.js'); -test('Testing URLJoin', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof URLJoin === 'function', 'URLJoin is a Function'); - t.equal(URLJoin('http://www.google.com', 'a', '/b/cd', '?foo=123', '?bar=foo'), 'http://www.google.com/a/b/cd?foo=123&bar=foo', 'Returns proper URL'); - t.equal(URLJoin('file://www.google.com', 'a', '/b/cd', '?foo=123', '?bar=foo'), 'file:///www.google.com/a/b/cd?foo=123&bar=foo', 'Returns proper URL'); - //t.deepEqual(URLJoin(args..), 'Expected'); - //t.equal(URLJoin(args..), 'Expected'); - //t.false(URLJoin(args..), 'Expected'); - //t.throws(URLJoin(args..), 'Expected'); - t.end(); +test('URLJoin is a Function', () => { + expect(URLJoin).toBeInstanceOf(Function); +}); +test('Returns proper URL', () => { + expect(URLJoin('http://www.google.com', 'a', '/b/cd', '?foo=123', '?bar=foo')).toBe('http://www.google.com/a/b/cd?foo=123&bar=foo'); +}); +test('Returns proper URL', () => { + expect(URLJoin('file://www.google.com', 'a', '/b/cd', '?foo=123', '?bar=foo')).toBe('file:///www.google.com/a/b/cd?foo=123&bar=foo'); }); diff --git a/test/UUIDGeneratorBrowser/UUIDGeneratorBrowser.test.js b/test/UUIDGeneratorBrowser/UUIDGeneratorBrowser.test.js index 255054290..60033da0e 100644 --- a/test/UUIDGeneratorBrowser/UUIDGeneratorBrowser.test.js +++ b/test/UUIDGeneratorBrowser/UUIDGeneratorBrowser.test.js @@ -1,14 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const UUIDGeneratorBrowser = require('./UUIDGeneratorBrowser.js'); -test('Testing UUIDGeneratorBrowser', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof UUIDGeneratorBrowser === 'function', 'UUIDGeneratorBrowser is a Function'); - t.pass('Tested 09/02/2018 by @chalarangelo'); - //t.deepEqual(UUIDGeneratorBrowser(args..), 'Expected'); - //t.equal(UUIDGeneratorBrowser(args..), 'Expected'); - //t.false(UUIDGeneratorBrowser(args..), 'Expected'); - //t.throws(UUIDGeneratorBrowser(args..), 'Expected'); - t.end(); +test('UUIDGeneratorBrowser is a Function', () => { + expect(UUIDGeneratorBrowser).toBeInstanceOf(Function); }); diff --git a/test/UUIDGeneratorNode/UUIDGeneratorNode.test.js b/test/UUIDGeneratorNode/UUIDGeneratorNode.test.js index 1857e1727..8c3aa4356 100644 --- a/test/UUIDGeneratorNode/UUIDGeneratorNode.test.js +++ b/test/UUIDGeneratorNode/UUIDGeneratorNode.test.js @@ -1,16 +1,13 @@ -const test = require('tape'); +const expect = require('expect'); const UUIDGeneratorNode = require('./UUIDGeneratorNode.js'); -test('Testing UUIDGeneratorNode', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof UUIDGeneratorNode === 'function', 'UUIDGeneratorNode is a Function'); - const uuid = UUIDGeneratorNode(); - t.deepEqual([uuid[8], uuid[13], uuid[18], uuid[23]], ['-', '-', '-', '-'], 'Contains dashes in the proper places'); - t.true(/^[0-9A-Fa-f-]+$/.test(uuid), 'Only contains hexadecimal digits'); - //t.deepEqual(UUIDGeneratorNode(args..), 'Expected'); - //t.equal(UUIDGeneratorNode(args..), 'Expected'); - //t.false(UUIDGeneratorNode(args..), 'Expected'); - //t.throws(UUIDGeneratorNode(args..), 'Expected'); - t.end(); +test('UUIDGeneratorNode is a Function', () => { + expect(UUIDGeneratorNode).toBeInstanceOf(Function); +}); +const uuid = UUIDGeneratorNode(); +test('Contains dashes in the proper places', () => { + expect([uuid[8], uuid[13], uuid[18], uuid[23]]).toEqual(['-', '-', '-', '-']); +}); +test('Only contains hexadecimal digits', () => { + expect(/^[0-9A-Fa-f-]+$/.test(uuid)).toBeTruthy(); }); diff --git a/test/all/all.test.js b/test/all/all.test.js index 60ac82f4a..9c07329df 100644 --- a/test/all/all.test.js +++ b/test/all/all.test.js @@ -1,21 +1,30 @@ -const test = require('tape'); +const expect = require('expect'); const all = require('./all.js'); -test('Testing all', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof all === 'function', 'all is a Function'); - t.true(all([4,1,2,3]), 'Returns true for arrays with no falsey values'); - t.false(all([0,1]), 'Returns false for arrays with 0'); - t.false(all([NaN,1]), 'Returns false for arrays with NaN'); - t.false(all([undefined,1]), 'Returns false for arrays with undefined'); - t.false(all([null,1]), 'Returns false for arrays with null'); - t.false(all(['',1]), 'Returns false for arrays with empty strings'); - t.true(all([4,1,2,3], x => x >= 1), 'Returns true with predicate function'); - t.false(all([0,1], x => x >= 1), 'Returns false with a predicate function'); - //t.deepEqual(all(args..), 'Expected'); - //t.equal(all(args..), 'Expected'); - //t.false(all(args..), 'Expected'); - //t.throws(all(args..), 'Expected'); - t.end(); +test('all is a Function', () => { + expect(all).toBeInstanceOf(Function); +}); +test('Returns true for arrays with no falsey values', () => { + expect(all([4,1,2,3])).toBeTruthy(); +}); +test('Returns false for arrays with 0', () => { + expect(all([0,1])).toBeFalsy(); +}); +test('Returns false for arrays with NaN', () => { + expect(all([NaN,1])).toBeFalsy(); +}); +test('Returns false for arrays with undefined', () => { + expect(all([undefined,1])).toBeFalsy(); +}); +test('Returns false for arrays with null', () => { + expect(all([null,1])).toBeFalsy(); +}); +test('Returns false for arrays with empty strings', () => { + expect(all(['',1])).toBeFalsy(); +}); +test('Returns true with predicate function', () => { + expect(all([4,1,2,3], x => x >= 1)).toBeTruthy(); +}); +test('Returns false with a predicate function', () => { + expect(all([0,1], x => x >= 1)).toBeFalsy(); }); diff --git a/test/any/any.test.js b/test/any/any.test.js index 63399b385..083545c1e 100644 --- a/test/any/any.test.js +++ b/test/any/any.test.js @@ -1,18 +1,21 @@ -const test = require('tape'); +const expect = require('expect'); const any = require('./any.js'); -test('Testing any', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof any === 'function', 'any is a Function'); - t.true(any([0,1,2,3]), 'Returns true for arrays with at least one truthy value'); - t.false(any([0,0]), 'Returns false for arrays with no truthy values'); - t.false(any([NaN,0,undefined,null,'']), 'Returns false for arrays with no truthy values'); - t.true(any([4,1,0,3], x => x >= 1), 'Returns true with predicate function'); - t.false(any([0,1], x => x < 0), 'Returns false with a predicate function'); - //t.deepEqual(any(args..), 'Expected'); - //t.equal(any(args..), 'Expected'); - //t.false(any(args..), 'Expected'); - //t.throws(any(args..), 'Expected'); - t.end(); +test('any is a Function', () => { + expect(any).toBeInstanceOf(Function); +}); +test('Returns true for arrays with at least one truthy value', () => { + expect(any([0,1,2,3])).toBeTruthy(); +}); +test('Returns false for arrays with no truthy values', () => { + expect(any([0,0])).toBeFalsy(); +}); +test('Returns false for arrays with no truthy values', () => { + expect(any([NaN,0,undefined,null,''])).toBeFalsy(); +}); +test('Returns true with predicate function', () => { + expect(any([4,1,0,3], x => x >= 1)).toBeTruthy(); +}); +test('Returns false with a predicate function', () => { + expect(any([0,1], x => x < 0)).toBeFalsy(); }); diff --git a/test/approximatelyEqual/approximatelyEqual.test.js b/test/approximatelyEqual/approximatelyEqual.test.js index 44221aeb8..12cd74a82 100644 --- a/test/approximatelyEqual/approximatelyEqual.test.js +++ b/test/approximatelyEqual/approximatelyEqual.test.js @@ -1,17 +1,18 @@ -const test = require('tape'); +const expect = require('expect'); const approximatelyEqual = require('./approximatelyEqual.js'); -test('Testing approximatelyEqual', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof approximatelyEqual === 'function', 'approximatelyEqual is a Function'); - t.true(approximatelyEqual(Math.PI / 2.0 , 1.5708), 'Works for PI / 2'); - t.true(approximatelyEqual(0.1 + 0.2, 0.3), 'Works for 0.1 + 0.2 === 0.3'); - t.true(approximatelyEqual(0.5, 0.5), 'Works for exactly equal values'); - t.true(approximatelyEqual(0.501, 0.5, 0.1), 'Works for a custom epsilon'); - //t.deepEqual(approximatelyEqual(args..), 'Expected'); - //t.equal(approximatelyEqual(args..), 'Expected'); - //t.false(approximatelyEqual(args..), 'Expected'); - //t.throws(approximatelyEqual(args..), 'Expected'); - t.end(); +test('approximatelyEqual is a Function', () => { + expect(approximatelyEqual).toBeInstanceOf(Function); +}); +test('Works for PI / 2', () => { + expect(approximatelyEqual(Math.PI / 2.0 , 1.5708)).toBeTruthy(); +}); +test('Works for 0.1 + 0.2 === 0.3', () => { + expect(approximatelyEqual(0.1 + 0.2, 0.3)).toBeTruthy(); +}); +test('Works for exactly equal values', () => { + expect(approximatelyEqual(0.5, 0.5)).toBeTruthy(); +}); +test('Works for a custom epsilon', () => { + expect(approximatelyEqual(0.501, 0.5, 0.1)).toBeTruthy(); }); diff --git a/test/arrayToHtmlList/arrayToHtmlList.test.js b/test/arrayToHtmlList/arrayToHtmlList.test.js index 7cb8f4582..07a97dcf8 100644 --- a/test/arrayToHtmlList/arrayToHtmlList.test.js +++ b/test/arrayToHtmlList/arrayToHtmlList.test.js @@ -1,14 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const arrayToHtmlList = require('./arrayToHtmlList.js'); -test('Testing arrayToHtmlList', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof arrayToHtmlList === 'function', 'arrayToHtmlList is a Function'); - t.pass('Tested by @chalarangelo on 16/02/2018'); - //t.deepEqual(arrayToHtmlList(args..), 'Expected'); - //t.equal(arrayToHtmlList(args..), 'Expected'); - //t.false(arrayToHtmlList(args..), 'Expected'); - //t.throws(arrayToHtmlList(args..), 'Expected'); - t.end(); +test('arrayToHtmlList is a Function', () => { + expect(arrayToHtmlList).toBeInstanceOf(Function); }); diff --git a/test/ary/ary.test.js b/test/ary/ary.test.js index f73c1c40f..e695ca124 100644 --- a/test/ary/ary.test.js +++ b/test/ary/ary.test.js @@ -1,15 +1,10 @@ -const test = require('tape'); +const expect = require('expect'); const ary = require('./ary.js'); -test('Testing ary', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof ary === 'function', 'ary is a Function'); - const firstTwoMax = ary(Math.max, 2); - t.deepEquals([[2, 6, 'a'], [8, 4, 6], [10]].map(x => firstTwoMax(...x)), [6, 8, 10], 'Discards arguments with index >=n'); - //t.deepEqual(ary(args..), 'Expected'); - //t.equal(ary(args..), 'Expected'); - //t.false(ary(args..), 'Expected'); - //t.throws(ary(args..), 'Expected'); - t.end(); +test('ary is a Function', () => { + expect(ary).toBeInstanceOf(Function); +}); +const firstTwoMax = ary(Math.max, 2); +test('Discards arguments with index >=n', () => { + expect([[2, 6, 'a'], [8, 4, 6], [10]].map(x => firstTwoMax(...x))).toEqual([6, 8, 10]); }); diff --git a/test/atob/atob.test.js b/test/atob/atob.test.js index 32e3567d5..43c4f1386 100644 --- a/test/atob/atob.test.js +++ b/test/atob/atob.test.js @@ -1,15 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const atob = require('./atob.js'); -test('Testing atob', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof atob === 'function', 'atob is a Function'); - t.equals(atob('Zm9vYmFy'), 'foobar', 'atob("Zm9vYmFy") equals "foobar"'); - t.equals(atob('Z'), '', 'atob("Z") returns ""'); - //t.deepEqual(atob(args..), 'Expected'); - //t.equal(atob(args..), 'Expected'); - //t.false(atob(args..), 'Expected'); - //t.throws(atob(args..), 'Expected'); - t.end(); +test('atob is a Function', () => { + expect(atob).toBeInstanceOf(Function); +}); +test('atob("Zm9vYmFy") equals "foobar"', () => { + expect(atob('Zm9vYmFy')).toBe('foobar'); +}); +test('atob("Z") returns ""', () => { + expect(atob('Z')).toBe(''); }); diff --git a/test/attempt/attempt.test.js b/test/attempt/attempt.test.js index 557d7af3b..047cfd4e7 100644 --- a/test/attempt/attempt.test.js +++ b/test/attempt/attempt.test.js @@ -1,15 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const attempt = require('./attempt.js'); -test('Testing attempt', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof attempt === 'function', 'attempt is a Function'); - t.equals(attempt(() => 0), 0, 'Returns a value'); - t.true(attempt(() => {throw new Error();}) instanceof Error, 'Returns an error'); - //t.deepEqual(attempt(args..), 'Expected'); - //t.equal(attempt(args..), 'Expected'); - //t.false(attempt(args..), 'Expected'); - //t.throws(attempt(args..), 'Expected'); - t.end(); +test('attempt is a Function', () => { + expect(attempt).toBeInstanceOf(Function); +}); +test('Returns a value', () => { + expect(attempt(() => 0)).toBe(0); +}); +test('Returns an error', () => { + expect(attempt(() => {throw new Error();})).toBeInstanceOf(Error); }); diff --git a/test/average/average.test.js b/test/average/average.test.js index 16a9471c7..fe042cf36 100644 --- a/test/average/average.test.js +++ b/test/average/average.test.js @@ -1,24 +1,43 @@ -const test = require('tape'); +const expect = require('expect'); const average = require('./average.js'); -test('Testing average', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof average === 'function', 'average is a Function'); - t.true(average(true) === 1, 'average(true) returns 0'); - t.true(average(false) === 0, 'average(false) returns 1'); - t.equal(average(9, 1), 5, 'average(9, 1) returns 5'); - t.equal(average(153, 44, 55, 64, 71, 1122, 322774, 2232, 23423, 234, 3631), 32163.909090909092, 'average(153, 44, 55, 64, 71, 1122, 322774, 2232, 23423, 234, 3631) returns 32163.909090909092 '); - t.equal(average(1, 2, 3), 2, 'average(1, 2, 3) returns 2'); - t.equal(average(null), 0, 'average(null) returns 0'); - t.true(isNaN(average(undefined)), 'average(1, 2, 3) returns NaN'); - t.true(isNaN(average('String')), 'average(String) returns NaN'); - t.true(isNaN(average({ a: 123})), 'average({ a: 123}) returns NaN'); - t.true(isNaN(average([undefined, 0, 'string'])), 'average([undefined, 0, string]) returns NaN'); +test('average is a Function', () => { + expect(average).toBeInstanceOf(Function); +}); +test('average(true) returns 0', () => { + expect(average(true) === 1).toBeTruthy(); +}); +test('average(false) returns 1', () => { + expect(average(false) === 0).toBeTruthy(); +}); +test('average(9, 1) returns 5', () => { + expect(average(9, 1)).toBe(5); +}); +test('average(153, 44, 55, 64, 71, 1122, 322774, 2232, 23423, 234, 3631) returns 32163.909090909092 ', () => { + expect(average(153, 44, 55, 64, 71, 1122, 322774, 2232, 23423, 234, 3631)).toBeCloseTo(32163.909090909092, 3); +}); +test('average(1, 2, 3) returns 2', () => { + expect(average(1, 2, 3)).toBe(2); +}); +test('average(null) returns 0', () => { + expect(average(null)).toBe(0); +}); +test('average(1, 2, 3) returns NaN', () => { + expect(isNaN(average(undefined))).toBeTruthy(); +}); +test('average(String) returns NaN', () => { + expect(isNaN(average('String'))).toBeTruthy(); +}); +test('average({ a: 123}) returns NaN', () => { + expect(isNaN(average({ a: 123}))).toBeTruthy(); +}); +test('average([undefined, 0, string]) returns NaN', () => { + expect(isNaN(average([undefined, 0, 'string']))).toBeTruthy(); +}); - let start = new Date().getTime(); - average(153, 44, 55, 64, 71, 1122, 322774, 2232, 23423, 234, 3631); - let end = new Date().getTime(); - t.true((end - start) < 2000, 'average([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run'); - t.end(); -}); \ No newline at end of file +let start = new Date().getTime(); +average(153, 44, 55, 64, 71, 1122, 322774, 2232, 23423, 234, 3631); +let end = new Date().getTime(); +test('average([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run', () => { + expect((end - start) < 2000).toBeTruthy(); +}); diff --git a/test/averageBy/averageBy.test.js b/test/averageBy/averageBy.test.js index 7c3fabe16..044d407df 100644 --- a/test/averageBy/averageBy.test.js +++ b/test/averageBy/averageBy.test.js @@ -1,15 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const averageBy = require('./averageBy.js'); -test('Testing averageBy', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof averageBy === 'function', 'averageBy is a Function'); - t.equals(averageBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], o => o.n), 5, 'Produces the right result with a function'); - t.equals(averageBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], 'n'), 5, 'Produces the right result with a property name'); - //t.deepEqual(averageBy(args..), 'Expected'); - //t.equal(averageBy(args..), 'Expected'); - //t.false(averageBy(args..), 'Expected'); - //t.throws(averageBy(args..), 'Expected'); - t.end(); +test('averageBy is a Function', () => { + expect(averageBy).toBeInstanceOf(Function); +}); +test('Produces the right result with a function', () => { + expect(averageBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], o => o.n)).toBe(5); +}); +test('Produces the right result with a property name', () => { + expect(averageBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], 'n')).toBe(5); }); diff --git a/test/bifurcate/bifurcate.test.js b/test/bifurcate/bifurcate.test.js index c65333ee0..456d490cb 100644 --- a/test/bifurcate/bifurcate.test.js +++ b/test/bifurcate/bifurcate.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const bifurcate = require('./bifurcate.js'); -test('Testing bifurcate', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof bifurcate === 'function', 'bifurcate is a Function'); - t.deepEqual(bifurcate([ 'beep', 'boop', 'foo', 'bar' ], [ true, true, false, true ]), [ ['beep', 'boop', 'bar'], ['foo'] ], 'Splits the collection into two groups'); - //t.deepEqual(bifurcate(args..), 'Expected'); - //t.equal(bifurcate(args..), 'Expected'); - //t.false(bifurcate(args..), 'Expected'); - //t.throws(bifurcate(args..), 'Expected'); - t.end(); +test('bifurcate is a Function', () => { + expect(bifurcate).toBeInstanceOf(Function); +}); +test('Splits the collection into two groups', () => { + expect(bifurcate([ 'beep', 'boop', 'foo', 'bar' ], [ true, true, false, true ])).toEqual([ ['beep', 'boop', 'bar'], ['foo'] ]); }); diff --git a/test/bifurcateBy/bifurcateBy.test.js b/test/bifurcateBy/bifurcateBy.test.js index a6c293638..1b01c76e7 100644 --- a/test/bifurcateBy/bifurcateBy.test.js +++ b/test/bifurcateBy/bifurcateBy.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const bifurcateBy = require('./bifurcateBy.js'); -test('Testing bifurcateBy', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof bifurcateBy === 'function', 'bifurcateBy is a Function'); - t.deepEqual(bifurcateBy([ 'beep', 'boop', 'foo', 'bar' ], x => x[0] === 'b'), [ ['beep', 'boop', 'bar'], ['foo'] ], 'Splits the collection into two groups'); - //t.deepEqual(bifurcateBy(args..), 'Expected'); - //t.equal(bifurcateBy(args..), 'Expected'); - //t.false(bifurcateBy(args..), 'Expected'); - //t.throws(bifurcateBy(args..), 'Expected'); - t.end(); +test('bifurcateBy is a Function', () => { + expect(bifurcateBy).toBeInstanceOf(Function); +}); +test('Splits the collection into two groups', () => { + expect(bifurcateBy([ 'beep', 'boop', 'foo', 'bar' ], x => x[0] === 'b')).toEqual([ ['beep', 'boop', 'bar'], ['foo'] ]); }); diff --git a/test/binarySearch/binarySearch.test.js b/test/binarySearch/binarySearch.test.js index e1a53283d..a00680bb6 100644 --- a/test/binarySearch/binarySearch.test.js +++ b/test/binarySearch/binarySearch.test.js @@ -1,16 +1,18 @@ -const test = require('tape'); +const expect = require('expect'); const binarySearch = require('./binarySearch.js'); -test('Testing binarySearch', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof binarySearch === 'function', 'binarySearch is a Function'); - //t.deepEqual(binarySearch(args..), 'Expected'); - t.equal(binarySearch([1, 4, 6, 7, 12, 13, 15, 18, 19, 20, 22, 24], 6), 2, 'Finds item in array'); - t.equal(binarySearch([1, 4, 6, 7, 12, 13, 15, 18, 19, 20, 22, 24], 21), -1, 'Returns -1 when not found'); - t.equal(binarySearch([], 21), -1, 'Works with empty arrays'); - t.equal(binarySearch([1], 1), 0, "Works for one element arrays"); - //t.false(binarySearch(args..), 'Expected'); - //t.throws(binarySearch(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('binarySearch is a Function', () => { + expect(binarySearch).toBeInstanceOf(Function); +}); +test('Finds item in array', () => { + expect(binarySearch([1, 4, 6, 7, 12, 13, 15, 18, 19, 20, 22, 24], 6)).toBe(2); +}); +test('Returns -1 when not found', () => { + expect(binarySearch([1, 4, 6, 7, 12, 13, 15, 18, 19, 20, 22, 24], 21)).toBe(-1); +}); +test('Works with empty arrays', () => { + expect(binarySearch([], 21)).toBe(-1); +}); +test('Works for one element arrays', () => { + expect(binarySearch([1], 1)).toBe(0); +}); diff --git a/test/bind/bind.test.js b/test/bind/bind.test.js index e3ba1054c..423b2b8d9 100644 --- a/test/bind/bind.test.js +++ b/test/bind/bind.test.js @@ -1,19 +1,14 @@ -const test = require('tape'); +const expect = require('expect'); const bind = require('./bind.js'); -test('Testing bind', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof bind === 'function', 'bind is a Function'); - function greet(greeting, punctuation) { - return greeting + ' ' + this.user + punctuation; - } - const freddy = { user: 'fred' }; - const freddyBound = bind(greet, freddy); - t.equals(freddyBound('hi', '!'),'hi fred!', 'Binds to an object context'); - //t.deepEqual(bind(args..), 'Expected'); - //t.equal(bind(args..), 'Expected'); - //t.false(bind(args..), 'Expected'); - //t.throws(bind(args..), 'Expected'); - t.end(); +test('bind is a Function', () => { + expect(bind).toBeInstanceOf(Function); +}); +function greet(greeting, punctuation) { + return greeting + ' ' + this.user + punctuation; +} +const freddy = { user: 'fred' }; +const freddyBound = bind(greet, freddy); +test('Binds to an object context', () => { + expect(freddyBound('hi', '!')).toBe('hi fred!'); }); diff --git a/test/bindAll/bindAll.test.js b/test/bindAll/bindAll.test.js index 3876982f4..8415c730c 100644 --- a/test/bindAll/bindAll.test.js +++ b/test/bindAll/bindAll.test.js @@ -1,21 +1,16 @@ -const test = require('tape'); +const expect = require('expect'); const bindAll = require('./bindAll.js'); -test('Testing bindAll', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof bindAll === 'function', 'bindAll is a Function'); - var view = { - label: 'docs', - 'click': function() { - return 'clicked ' + this.label; - } - }; - bindAll(view, 'click'); - t.equal(view.click(), 'clicked docs', 'Binds to an object context'); - //t.deepEqual(bindAll(args..), 'Expected'); - //t.equal(bindAll(args..), 'Expected'); - //t.false(bindAll(args..), 'Expected'); - //t.throws(bindAll(args..), 'Expected'); - t.end(); +test('bindAll is a Function', () => { + expect(bindAll).toBeInstanceOf(Function); +}); +var view = { + label: 'docs', + 'click': function() { + return 'clicked ' + this.label; + } +}; +bindAll(view, 'click'); +test('Binds to an object context', () => { + expect(view.click()).toBe('clicked docs'); }); diff --git a/test/bindKey/bindKey.test.js b/test/bindKey/bindKey.test.js index 2aed1fb1e..cce1b4c98 100644 --- a/test/bindKey/bindKey.test.js +++ b/test/bindKey/bindKey.test.js @@ -1,21 +1,16 @@ -const test = require('tape'); +const expect = require('expect'); const bindKey = require('./bindKey.js'); -test('Testing bindKey', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof bindKey === 'function', 'bindKey is a Function'); - const freddy = { - user: 'fred', - greet: function(greeting, punctuation) { - return greeting + ' ' + this.user + punctuation; - } - }; - const freddyBound = bindKey(freddy, 'greet'); - t.equal(freddyBound('hi', '!'), 'hi fred!', 'Binds function to an object context'); - //t.deepEqual(bindKey(args..), 'Expected'); - //t.equal(bindKey(args..), 'Expected'); - //t.false(bindKey(args..), 'Expected'); - //t.throws(bindKey(args..), 'Expected'); - t.end(); +test('bindKey is a Function', () => { + expect(bindKey).toBeInstanceOf(Function); +}); +const freddy = { + user: 'fred', + greet: function(greeting, punctuation) { + return greeting + ' ' + this.user + punctuation; + } +}; +const freddyBound = bindKey(freddy, 'greet'); +test('Binds function to an object context', () => { + expect(freddyBound('hi', '!')).toBe('hi fred!'); }); diff --git a/test/binomialCoefficient/binomialCoefficient.test.js b/test/binomialCoefficient/binomialCoefficient.test.js index 2f0e8ab20..e4ca4f3ce 100644 --- a/test/binomialCoefficient/binomialCoefficient.test.js +++ b/test/binomialCoefficient/binomialCoefficient.test.js @@ -1,18 +1,21 @@ -const test = require('tape'); +const expect = require('expect'); const binomialCoefficient = require('./binomialCoefficient.js'); -test('Testing binomialCoefficient', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof binomialCoefficient === 'function', 'binomialCoefficient is a Function'); - t.equal(binomialCoefficient(8, 2), 28, 'Returns the appropriate value'); - t.equal(binomialCoefficient(0, 0), 1, 'Returns the appropriate value'); - t.equal(binomialCoefficient(5, 3), 10, 'Returns the appropriate value'); - t.true(Number.isNaN(binomialCoefficient(NaN, 3)), 'Returns NaN'); - t.true(Number.isNaN(binomialCoefficient(5, NaN)), 'Returns NaN'); - //t.deepEqual(binomialCoefficient(args..), 'Expected'); - //t.equal(binomialCoefficient(args..), 'Expected'); - //t.false(binomialCoefficient(args..), 'Expected'); - //t.throws(binomialCoefficient(args..), 'Expected'); - t.end(); +test('binomialCoefficient is a Function', () => { + expect(binomialCoefficient).toBeInstanceOf(Function); +}); +test('Returns the appropriate value', () => { + expect(binomialCoefficient(8, 2)).toBe(28); +}); +test('Returns the appropriate value', () => { + expect(binomialCoefficient(0, 0)).toBe(1); +}); +test('Returns the appropriate value', () => { + expect(binomialCoefficient(5, 3)).toBe(10); +}); +test('Returns NaN', () => { + expect(Number.isNaN(binomialCoefficient(NaN, 3))).toBeTruthy(); +}); +test('Returns NaN', () => { + expect(Number.isNaN(binomialCoefficient(5, NaN))).toBeTruthy(); }); diff --git a/test/bottomVisible/bottomVisible.test.js b/test/bottomVisible/bottomVisible.test.js index b9be1fc89..6769b3cbd 100644 --- a/test/bottomVisible/bottomVisible.test.js +++ b/test/bottomVisible/bottomVisible.test.js @@ -1,14 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const bottomVisible = require('./bottomVisible.js'); -test('Testing bottomVisible', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof bottomVisible === 'function', 'bottomVisible is a Function'); - t.pass('Tested on 09/02/2018 by @chalarangelo'); - //t.deepEqual(bottomVisible(args..), 'Expected'); - //t.equal(bottomVisible(args..), 'Expected'); - //t.false(bottomVisible(args..), 'Expected'); - //t.throws(bottomVisible(args..), 'Expected'); - t.end(); +test('bottomVisible is a Function', () => { + expect(bottomVisible).toBeInstanceOf(Function); }); diff --git a/test/btoa/btoa.test.js b/test/btoa/btoa.test.js index 85690e99b..36b740293 100644 --- a/test/btoa/btoa.test.js +++ b/test/btoa/btoa.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const btoa = require('./btoa.js'); -test('Testing btoa', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof btoa === 'function', 'btoa is a Function'); - t.equals(btoa('foobar'), 'Zm9vYmFy', 'btoa("foobar") equals "Zm9vYmFy"'); - //t.deepEqual(btoa(args..), 'Expected'); - //t.equal(btoa(args..), 'Expected'); - //t.false(btoa(args..), 'Expected'); - //t.throws(btoa(args..), 'Expected'); - t.end(); +test('btoa is a Function', () => { + expect(btoa).toBeInstanceOf(Function); +}); +test('btoa("foobar") equals "Zm9vYmFy"', () => { + expect(btoa('foobar')).toBe('Zm9vYmFy'); }); diff --git a/test/byteSize/byteSize.test.js b/test/byteSize/byteSize.test.js index 423c63ce4..ad6371480 100644 --- a/test/byteSize/byteSize.test.js +++ b/test/byteSize/byteSize.test.js @@ -1,5 +1,4 @@ -const test = require('tape'); -// Custom implementation of Blob for the requirements of this snippet. +const expect = require('expect'); const Blob = class{ constructor(s) { return { @@ -7,24 +6,17 @@ const Blob = class{ }; } }; -// const byteSize = require('./byteSize.js'); -// Override const byteSize = str => new Blob([str]).size; -test('Testing byteSize', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof byteSize === 'function', 'byteSize is a Function'); - t.equal(byteSize('a'), 1, 'Works for a single letter'); - t.equal(byteSize('Hello World'), 11, 'Works for a common string'); - t.equal(byteSize('😀'), 4, 'Works for emoji'); - // Blob is not part of Node apparently? - //t.equal(byteSize('Hello World'), 11, 'Works for text'); - //t.equal(byteSize('😀'), 4, 'Works for emojis'); - // Works only in browser - // t.equal(byteSize('Hello World'), 11, "Returns the length of a string in bytes"); - //t.deepEqual(byteSize(args..), 'Expected'); - //t.equal(byteSize(args..), 'Expected'); - //t.false(byteSize(args..), 'Expected'); - //t.throws(byteSize(args..), 'Expected'); - t.end(); + +test('byteSize is a Function', () => { + expect(byteSize).toBeInstanceOf(Function); +}); +test('Works for a single letter', () => { + expect(byteSize('a')).toBe(1); +}); +test('Works for a common string', () => { + expect(byteSize('Hello World')).toBe(11); +}); +test('Works for emoji', () => { + expect(byteSize('😀')).toBe(4); }); diff --git a/test/call/call.test.js b/test/call/call.test.js index bf1ed5e56..a90669ddf 100644 --- a/test/call/call.test.js +++ b/test/call/call.test.js @@ -1,13 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const call = require('./call.js'); -test('Testing call', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof call === 'function', 'call is a Function'); - //t.deepEqual(call(args..), 'Expected'); - t.looseEqual(call('map', x => x * 2)([1, 2, 3]), [2, 4, 6], 'Calls function on given object'); - //t.false(call(args..), 'Expected'); - //t.throws(call(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('call is a Function', () => { + expect(call).toBeInstanceOf(Function); +}); +test('Calls function on given object', () => { + expect(call('map', x => x * 2)([1, 2, 3])).toEqual([2, 4, 6]); +}); diff --git a/test/capitalize/capitalize.test.js b/test/capitalize/capitalize.test.js index 9a19686af..68fe363e7 100644 --- a/test/capitalize/capitalize.test.js +++ b/test/capitalize/capitalize.test.js @@ -1,17 +1,18 @@ -const test = require('tape'); +const expect = require('expect'); const capitalize = require('./capitalize.js'); -test('Testing capitalize', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof capitalize === 'function', 'capitalize is a Function'); - t.equal(capitalize('fooBar'), 'FooBar', "Capitalizes the first letter of a string"); - t.equal(capitalize('fooBar', true), 'Foobar', "Capitalizes the first letter of a string"); - t.equal(capitalize('#!#', true), '#!#', "Works with characters"); - t.equal(capitalize('a', true), 'A', "Works with single character words"); - //t.deepEqual(capitalize(args..), 'Expected'); - //t.equal(capitalize(args..), 'Expected'); - //t.false(capitalize(args..), 'Expected'); - //t.throws(capitalize(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('capitalize is a Function', () => { + expect(capitalize).toBeInstanceOf(Function); +}); +test('Capitalizes the first letter of a string', () => { + expect(capitalize('fooBar')).toBe('FooBar'); +}); +test('Capitalizes the first letter of a string', () => { + expect(capitalize('fooBar', true)).toBe('Foobar'); +}); +test('Works with characters', () => { + expect(capitalize('#!#', true)).toBe('#!#'); +}); +test('"Works with single character words', () => { + expect(capitalize('a', true)).toBe('A'); +}); diff --git a/test/capitalizeEveryWord/capitalizeEveryWord.test.js b/test/capitalizeEveryWord/capitalizeEveryWord.test.js index 5ea7eb4d7..a57e2619d 100644 --- a/test/capitalizeEveryWord/capitalizeEveryWord.test.js +++ b/test/capitalizeEveryWord/capitalizeEveryWord.test.js @@ -1,16 +1,15 @@ -const test = require('tape'); +const expect = require('expect'); const capitalizeEveryWord = require('./capitalizeEveryWord.js'); -test('Testing capitalizeEveryWord', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof capitalizeEveryWord === 'function', 'capitalizeEveryWord is a Function'); - t.equal(capitalizeEveryWord('hello world!'), 'Hello World!', "Capitalizes the first letter of every word in a string"); - t.equal(capitalizeEveryWord('$# @!'), '$# @!', "Works with characters"); - t.equal(capitalizeEveryWord('a'), 'A', "Works with one word string"); - //t.deepEqual(capitalizeEveryWord(args..), 'Expected'); - //t.equal(capitalizeEveryWord(args..), 'Expected'); - //t.false(capitalizeEveryWord(args..), 'Expected'); - //t.throws(capitalizeEveryWord(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('capitalizeEveryWord is a Function', () => { + expect(capitalizeEveryWord).toBeInstanceOf(Function); +}); +test('Capitalizes the first letter of every word in a string', () => { + expect(capitalizeEveryWord('hello world!')).toBe('Hello World!'); +}); +test('Works with characters', () => { + expect(capitalizeEveryWord('$# @!')).toBe('$# @!'); +}); +test('Works with one word string', () => { + expect(capitalizeEveryWord('a')).toBe('A'); +}); diff --git a/test/castArray/castArray.test.js b/test/castArray/castArray.test.js index a0961a491..246a8cd48 100644 --- a/test/castArray/castArray.test.js +++ b/test/castArray/castArray.test.js @@ -1,18 +1,21 @@ -const test = require('tape'); +const expect = require('expect'); const castArray = require('./castArray.js'); -test('Testing castArray', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof castArray === 'function', 'castArray is a Function'); - t.deepEqual(castArray(1), [1], 'Works for single values'); - t.deepEqual(castArray([1]), [1], 'Works for arrays with one value'); - t.deepEqual(castArray([1,2,3]), [1,2,3], 'Works for arrays with multiple value'); - t.deepEqual(castArray('test'), ['test'], 'Works for strings'); - t.deepEqual(castArray({}), [{}], 'Works for objects'); - //t.deepEqual(castArray(args..), 'Expected'); - //t.equal(castArray(args..), 'Expected'); - //t.false(castArray(args..), 'Expected'); - //t.throws(castArray(args..), 'Expected'); - t.end(); +test('castArray is a Function', () => { + expect(castArray).toBeInstanceOf(Function); +}); +test('Works for single values', () => { + expect(castArray(1)).toEqual([1]); +}); +test('Works for arrays with one value', () => { + expect(castArray([1])).toEqual([1]); +}); +test('Works for arrays with multiple value', () => { + expect(castArray([1,2,3])).toEqual( [1,2,3]); +}); +test('Works for strings', () => { + expect(castArray('test')).toEqual(['test']); +}); +test('Works for objects', () => { + expect(castArray({})).toEqual([{}]); }); diff --git a/test/chainAsync/chainAsync.test.js b/test/chainAsync/chainAsync.test.js index a1e6edd06..9d69ef316 100644 --- a/test/chainAsync/chainAsync.test.js +++ b/test/chainAsync/chainAsync.test.js @@ -1,10 +1,11 @@ -const test = require('tape'); +const expect = require('expect'); const chainAsync = require('./chainAsync.js'); -test('Testing chainAsync', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof chainAsync === 'function', 'chainAsync is a Function'); +test('chainAsync is a Function', () => { + expect(chainAsync).toBeInstanceOf(Function); +}); + +test('Calls all functions in an array', () => { chainAsync([ next => { next(); @@ -15,13 +16,7 @@ test('Testing chainAsync', (t) => { })(); }, next => { - t.pass("Calls all functions in an array"); + expect(true).toBeTruthy(); } ]); - // // Ensure we wait for the 2nd assertion to be made - // t.plan(2); - - //t.false(chainAsync(args..), 'Expected'); - //t.throws(chainAsync(args..), 'Expected'); - t.end(); }); diff --git a/test/chunk/chunk.test.js b/test/chunk/chunk.test.js index bd5c5334c..0509cdd6a 100644 --- a/test/chunk/chunk.test.js +++ b/test/chunk/chunk.test.js @@ -1,22 +1,36 @@ -const test = require('tape'); +const expect = require('expect'); const chunk = require('./chunk.js'); -test('Testing chunk', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof chunk === 'function', 'chunk is a Function'); - t.deepEqual(chunk([1, 2, 3, 4, 5], 2), [[1,2],[3,4],[5]], "chunk([1, 2, 3, 4, 5], 2) returns [[1,2],[3,4],[5]] "); - t.deepEqual(chunk([]), [], 'chunk([]) returns []'); - t.deepEqual(chunk(123), [], 'chunk(123) returns []'); - t.deepEqual(chunk({ a: 123}), [], 'chunk({ a: 123}) returns []'); - t.deepEqual(chunk('string', 2), [ 'st', 'ri', 'ng' ], 'chunk(string, 2) returns [ st, ri, ng ]'); - t.throws(() => chunk(), 'chunk() throws an error'); - t.throws(() => chunk(undefined), 'chunk(undefined) throws an error'); - t.throws(() => chunk(null), 'chunk(null) throws an error'); - - let start = new Date().getTime(); - chunk('This is a string', 2); - let end = new Date().getTime(); - t.true((end - start) < 2000, 'chunk(This is a string, 2) takes less than 2s to run'); - t.end(); +test('chunk is a Function', () => { + expect(chunk).toBeInstanceOf(Function); +}); +test('chunk([1, 2, 3, 4, 5], 2) returns [[1,2],[3,4],[5]] ', () => { + expect(chunk([1, 2, 3, 4, 5], 2)).toEqual([[1,2],[3,4],[5]]); +}); +test('chunk([]) returns []', () => { + expect(chunk([])).toEqual([]); +}); +test('chunk(123) returns []', () => { + expect(chunk(123)).toEqual([]); +}); +test('chunk({ a: 123}) returns []', () => { + expect(chunk({ a: 123})).toEqual([]); +}); +test('chunk(string, 2) returns [ st, ri, ng ]', () => { + expect(chunk('string', 2)).toEqual( [ 'st', 'ri', 'ng' ]); +}); +test('chunk() throws an error', () => { + expect(() => {chunk();}).toThrow(); +}); +test('chunk(undefined) throws an error', () => { + expect(() => {chunk(undefined);}).toThrow(); +}); +test('chunk(null) throws an error', () => { + expect(() => {chunk(null);}).toThrow(); +}); +let start = new Date().getTime(); +chunk('This is a string', 2); +let end = new Date().getTime(); +test('chunk(This is a string, 2) takes less than 2s to run', () => { + expect((end - start) < 2000).toBeTruthy(); }); diff --git a/test/clampNumber/clampNumber.test.js b/test/clampNumber/clampNumber.test.js index 0e62c5b8f..828e82a05 100644 --- a/test/clampNumber/clampNumber.test.js +++ b/test/clampNumber/clampNumber.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const clampNumber = require('./clampNumber.js'); -test('Testing clampNumber', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof clampNumber === 'function', 'clampNumber is a Function'); - t.equal(clampNumber(2, 3, 5), 3, "Clamps num within the inclusive range specified by the boundary values a and b"); - //t.deepEqual(clampNumber(args..), 'Expected'); - //t.equal(clampNumber(args..), 'Expected'); - //t.false(clampNumber(args..), 'Expected'); - //t.throws(clampNumber(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('clampNumber is a Function', () => { + expect(clampNumber).toBeInstanceOf(Function); +}); +test('Clamps num within the inclusive range specified by the boundary values a and b', () => { + expect(clampNumber(2, 3, 5)).toBe(3); +}); diff --git a/test/cleanObj/cleanObj.test.js b/test/cleanObj/cleanObj.test.js index db490ed45..9e221f468 100644 --- a/test/cleanObj/cleanObj.test.js +++ b/test/cleanObj/cleanObj.test.js @@ -1,15 +1,10 @@ -const test = require('tape'); +const expect = require('expect'); const cleanObj = require('./cleanObj.js'); -test('Testing cleanObj', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof cleanObj === 'function', 'cleanObj is a Function'); - const testObj = { a: 1, b: 2, children: { a: 1, b: 2 } }; - t.deepEqual(cleanObj(testObj, ['a'], 'children'), { a: 1, children : { a: 1}}, "Removes any properties except the ones specified from a JSON object"); - //t.deepEqual(cleanObj(args..), 'Expected'); - //t.equal(cleanObj(args..), 'Expected'); - //t.false(cleanObj(args..), 'Expected'); - //t.throws(cleanObj(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('cleanObj is a Function', () => { + expect(cleanObj).toBeInstanceOf(Function); +}); +const testObj = { a: 1, b: 2, children: { a: 1, b: 2 } }; +test('Removes any properties except the ones specified from a JSON object', () => { + expect(cleanObj(testObj, ['a'], 'children')).toEqual({ a: 1, children : { a: 1}}); +}); diff --git a/test/cloneRegExp/cloneRegExp.test.js b/test/cloneRegExp/cloneRegExp.test.js index 17b2ce8c0..d16147c7a 100644 --- a/test/cloneRegExp/cloneRegExp.test.js +++ b/test/cloneRegExp/cloneRegExp.test.js @@ -1,15 +1,10 @@ -const test = require('tape'); +const expect = require('expect'); const cloneRegExp = require('./cloneRegExp.js'); -test('Testing cloneRegExp', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof cloneRegExp === 'function', 'cloneRegExp is a Function'); - const rgTest = /./g; - t.notEqual(cloneRegExp(rgTest), rgTest, 'Clones regular expressions properly'); - //t.deepEqual(cloneRegExp(args..), 'Expected'); - //t.equal(cloneRegExp(args..), 'Expected'); - //t.false(cloneRegExp(args..), 'Expected'); - //t.throws(cloneRegExp(args..), 'Expected'); - t.end(); +test('cloneRegExp is a Function', () => { + expect(cloneRegExp).toBeInstanceOf(Function); +}); +const rgTest = /./g; +test('Clones regular expressions properly', () => { + expect(cloneRegExp(rgTest)).not.toBe(rgTest); }); diff --git a/test/coalesce/coalesce.test.js b/test/coalesce/coalesce.test.js index e32afaf95..05a6a93c0 100644 --- a/test/coalesce/coalesce.test.js +++ b/test/coalesce/coalesce.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const coalesce = require('./coalesce.js'); -test('Testing coalesce', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof coalesce === 'function', 'coalesce is a Function'); - t.deepEqual(coalesce(null, undefined, '', NaN, 'Waldo'), '', "Returns the first non-null/undefined argument"); - //t.deepEqual(coalesce(args..), 'Expected'); - //t.equal(coalesce(args..), 'Expected'); - //t.false(coalesce(args..), 'Expected'); - //t.throws(coalesce(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('coalesce is a Function', () => { + expect(coalesce).toBeInstanceOf(Function); +}); +test('Returns the first non-null/undefined argument', () => { + expect(coalesce(null, undefined, '', NaN, 'Waldo')).toEqual(''); +}); diff --git a/test/coalesceFactory/coalesceFactory.test.js b/test/coalesceFactory/coalesceFactory.test.js index e0651ace2..a2836a57f 100644 --- a/test/coalesceFactory/coalesceFactory.test.js +++ b/test/coalesceFactory/coalesceFactory.test.js @@ -1,15 +1,10 @@ -const test = require('tape'); +const expect = require('expect'); const coalesceFactory = require('./coalesceFactory.js'); -test('Testing coalesceFactory', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof coalesceFactory === 'function', 'coalesceFactory is a Function'); - const customCoalesce = coalesceFactory(_ => ![null, undefined, '', NaN].includes(_)); - t.deepEqual(customCoalesce(undefined, null, NaN, '', 'Waldo'), 'Waldo', "Returns a customized coalesce function"); - //t.deepEqual(coalesceFactory(args..), 'Expected'); - //t.equal(coalesceFactory(args..), 'Expected'); - //t.false(coalesceFactory(args..), 'Expected'); - //t.throws(coalesceFactory(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('coalesceFactory is a Function', () => { + expect(coalesceFactory).toBeInstanceOf(Function); +}); +const customCoalesce = coalesceFactory(_ => ![null, undefined, '', NaN].includes(_)); +test('Returns a customized coalesce function', () => { + expect(customCoalesce(undefined, null, NaN, '', 'Waldo')).toEqual('Waldo'); +}); diff --git a/test/collatz/collatz.test.js b/test/collatz/collatz.test.js index 5b177db8d..a4bfa2125 100644 --- a/test/collatz/collatz.test.js +++ b/test/collatz/collatz.test.js @@ -1,24 +1,22 @@ -const test = require('tape'); +const expect = require('expect'); const collatz = require('./collatz.js'); -test('Testing collatz', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof collatz === 'function', 'collatz is a Function'); - //t.deepEqual(collatz(args..), 'Expected'); - t.equal(collatz(8), 4, 'When n is even, divide by 2'); - t.equal(collatz(9), 28, 'When n is odd, times by 3 and add 1'); - +test('collatz is a Function', () => { + expect(collatz).toBeInstanceOf(Function); +}); +test('When n is even, divide by 2', () => { + expect(collatz(8)).toBe(4); +}); +test('When n is odd, times by 3 and add 1', () => { + expect(collatz(9)).toBe(28); +}); +test('Eventually reaches 1', () => { let n = 9; while(true){ if (n === 1){ - t.pass('Eventually reaches 1'); + expect(n).toBe(1); break; } n = collatz(n); } - - //t.false(collatz(args..), 'Expected'); - //t.throws(collatz(args..), 'Expected'); - t.end(); }); diff --git a/test/collectInto/collectInto.test.js b/test/collectInto/collectInto.test.js index 347ccd34a..78b34607f 100644 --- a/test/collectInto/collectInto.test.js +++ b/test/collectInto/collectInto.test.js @@ -1,18 +1,13 @@ -const test = require('tape'); +const expect = require('expect'); const collectInto = require('./collectInto.js'); -test('Testing collectInto', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof collectInto === 'function', 'collectInto is a Function'); - const Pall = collectInto(Promise.all.bind(Promise)); - let p1 = Promise.resolve(1); - let p2 = Promise.resolve(2); - let p3 = new Promise(resolve => setTimeout(resolve, 2000, 3)); - Pall(p1, p2, p3).then(function(val){ t.deepEqual(val, [1,2,3], 'Works with multiple promises');}, function(reason){}); - //t.deepEqual(collectInto(args..), 'Expected'); - //t.equal(collectInto(args..), 'Expected'); - //t.false(collectInto(args..), 'Expected'); - //t.throws(collectInto(args..), 'Expected'); - t.end(); +test('collectInto is a Function', () => { + expect(collectInto).toBeInstanceOf(Function); +}); +const Pall = collectInto(Promise.all.bind(Promise)); +let p1 = Promise.resolve(1); +let p2 = Promise.resolve(2); +let p3 = new Promise(resolve => setTimeout(resolve, 2000, 3)); +test('Works with multiple promises', () => { + Pall(p1, p2, p3).then(function(val){ expect(val).toBe([1,2,3]);}, function(reason){}); }); diff --git a/test/colorize/colorize.test.js b/test/colorize/colorize.test.js index 77666f0ae..73658ae79 100644 --- a/test/colorize/colorize.test.js +++ b/test/colorize/colorize.test.js @@ -1,14 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const colorize = require('./colorize.js'); -test('Testing colorize', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof colorize === 'function', 'colorize is a Function'); - t.pass('Tested on 09/02/2018 by @chalarangelo'); - //t.deepEqual(colorize(args..), 'Expected'); - //t.equal(colorize(args..), 'Expected'); - //t.false(colorize(args..), 'Expected'); - //t.throws(colorize(args..), 'Expected'); - t.end(); +test('colorize is a Function', () => { + expect(colorize).toBeInstanceOf(Function); }); diff --git a/test/compact/compact.test.js b/test/compact/compact.test.js index 74de02b1b..5fe0ee12e 100644 --- a/test/compact/compact.test.js +++ b/test/compact/compact.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const compact = require('./compact.js'); -test('Testing compact', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof compact === 'function', 'compact is a Function'); - t.deepEqual(compact([0, 1, false, 2, '', 3, 'a', 'e' * 23, NaN, 's', 34]), [ 1, 2, 3, 'a', 's', 34 ], "Removes falsey values from an array"); - //t.deepEqual(compact(args..), 'Expected'); - //t.equal(compact(args..), 'Expected'); - //t.false(compact(args..), 'Expected'); - //t.throws(compact(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('compact is a Function', () => { + expect(compact).toBeInstanceOf(Function); +}); +test('Removes falsey values from an array', () => { + expect(compact([0, 1, false, 2, '', 3, 'a', 'e' * 23, NaN, 's', 34])).toEqual([ 1, 2, 3, 'a', 's', 34 ]); +}); diff --git a/test/compose/compose.test.js b/test/compose/compose.test.js index 87c2ea8bd..5da32630f 100644 --- a/test/compose/compose.test.js +++ b/test/compose/compose.test.js @@ -1,17 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const compose = require('./compose.js'); -test('Testing compose', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof compose === 'function', 'compose is a Function'); - const add5 = x => x + 5; - const multiply = (x, y) => x * y; - const multiplyAndAdd5 = compose(add5, multiply); - t.equal(multiplyAndAdd5(5, 2), 15, "Performs right-to-left function composition"); - //t.deepEqual(compose(args..), 'Expected'); - //t.equal(compose(args..), 'Expected'); - //t.false(compose(args..), 'Expected'); - //t.throws(compose(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('compose is a Function', () => { + expect(compose).toBeInstanceOf(Function); +}); +const add5 = x => x + 5; +const multiply = (x, y) => x * y; +const multiplyAndAdd5 = compose(add5, multiply); +test('Performs right-to-left function composition', () => { + expect(multiplyAndAdd5(5, 2)).toBe(15); +}); diff --git a/test/composeRight/composeRight.test.js b/test/composeRight/composeRight.test.js index c07f7e8a5..02cddf187 100644 --- a/test/composeRight/composeRight.test.js +++ b/test/composeRight/composeRight.test.js @@ -1,17 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const composeRight = require('./composeRight.js'); -test('Testing composeRight', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof composeRight === 'function', 'composeRight is a Function'); - const add = (x, y) => x + y; - const square = x => x * x; - const addAndSquare = composeRight(add, square); - t.equal(addAndSquare(1, 2), 9, "Performs left-to-right function composition"); - //t.deepEqual(composeRight(args..), 'Expected'); - //t.equal(composeRight(args..), 'Expected'); - //t.false(composeRight(args..), 'Expected'); - //t.throws(composeRight(args..), 'Expected'); - t.end(); +test('composeRight is a Function', () => { + expect(composeRight).toBeInstanceOf(Function); +}); +const add = (x, y) => x + y; +const square = x => x * x; +const addAndSquare = composeRight(add, square); +test('Performs left-to-right function composition', () => { + expect(addAndSquare(1, 2)).toBe(9); }); diff --git a/test/converge/converge.test.js b/test/converge/converge.test.js index 73cafbf11..67086df48 100644 --- a/test/converge/converge.test.js +++ b/test/converge/converge.test.js @@ -1,23 +1,20 @@ -const test = require('tape'); +const expect = require('expect'); const converge = require('./converge.js'); -test('Testing converge', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof converge === 'function', 'converge is a Function'); - const average = converge((a, b) => a / b, [ - arr => arr.reduce((a, v) => a + v, 0), - arr => arr.length, - ]); - t.equal(average([1, 2, 3, 4, 5, 6, 7]), 4, 'Produces the average of the array'); - const strangeConcat = converge((a, b) => a + b, [ - x => x.toUpperCase(), - x => x.toLowerCase()] - ); - t.equal(strangeConcat('Yodel'), "YODELyodel", 'Produces the strange concatenation'); - //t.deepEqual(converge(args..), 'Expected'); - //t.equal(converge(args..), 'Expected'); - //t.false(converge(args..), 'Expected'); - //t.throws(converge(args..), 'Expected'); - t.end(); +test('converge is a Function', () => { + expect(converge).toBeInstanceOf(Function); +}); +const average = converge((a, b) => a / b, [ + arr => arr.reduce((a, v) => a + v, 0), + arr => arr.length, +]); +test('Produces the average of the array', () => { + expect(average([1, 2, 3, 4, 5, 6, 7])).toBe(4); +}); +const strangeConcat = converge((a, b) => a + b, [ + x => x.toUpperCase(), + x => x.toLowerCase()] +); +test('Produces the strange concatenation', () => { + expect(strangeConcat('Yodel')).toBe('YODELyodel'); }); diff --git a/test/copyToClipboard/copyToClipboard.test.js b/test/copyToClipboard/copyToClipboard.test.js index 24118be8f..60c18bbb9 100644 --- a/test/copyToClipboard/copyToClipboard.test.js +++ b/test/copyToClipboard/copyToClipboard.test.js @@ -1,14 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const copyToClipboard = require('./copyToClipboard.js'); -test('Testing copyToClipboard', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof copyToClipboard === 'function', 'copyToClipboard is a Function'); - t.pass('Tested on 09/02/2018 by @chalarangelo'); - //t.deepEqual(copyToClipboard(args..), 'Expected'); - //t.equal(copyToClipboard(args..), 'Expected'); - //t.false(copyToClipboard(args..), 'Expected'); - //t.throws(copyToClipboard(args..), 'Expected'); - t.end(); +test('copyToClipboard is a Function', () => { + expect(copyToClipboard).toBeInstanceOf(Function); }); diff --git a/test/countBy/countBy.test.js b/test/countBy/countBy.test.js index 94296d017..a33769895 100644 --- a/test/countBy/countBy.test.js +++ b/test/countBy/countBy.test.js @@ -1,15 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const countBy = require('./countBy.js'); -test('Testing countBy', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof countBy === 'function', 'countBy is a Function'); - t.deepEqual(countBy([6.1, 4.2, 6.3], Math.floor), {4: 1, 6: 2}, 'Works for functions'); - t.deepEqual(countBy(['one', 'two', 'three'], 'length'), {3: 2, 5: 1}, 'Works for property names'); - //t.deepEqual(countBy(args..), 'Expected'); - //t.equal(countBy(args..), 'Expected'); - //t.false(countBy(args..), 'Expected'); - //t.throws(countBy(args..), 'Expected'); - t.end(); +test('countBy is a Function', () => { + expect(countBy).toBeInstanceOf(Function); +}); +test('Works for functions', () => { + expect(countBy([6.1, 4.2, 6.3], Math.floor)).toEqual({4: 1, 6: 2}); +}); +test('Works for property names', () => { + expect(countBy(['one', 'two', 'three'], 'length')).toEqual({3: 2, 5: 1}); }); diff --git a/test/countOccurrences/countOccurrences.test.js b/test/countOccurrences/countOccurrences.test.js index 1459d5ae8..f4cfab9b4 100644 --- a/test/countOccurrences/countOccurrences.test.js +++ b/test/countOccurrences/countOccurrences.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const countOccurrences = require('./countOccurrences.js'); -test('Testing countOccurrences', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof countOccurrences === 'function', 'countOccurrences is a Function'); - t.deepEqual(countOccurrences([1, 1, 2, 1, 2, 3], 1), 3, "Counts the occurrences of a value in an array"); - //t.deepEqual(countOccurrences(args..), 'Expected'); - //t.equal(countOccurrences(args..), 'Expected'); - //t.false(countOccurrences(args..), 'Expected'); - //t.throws(countOccurrences(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('countOccurrences is a Function', () => { + expect(countOccurrences).toBeInstanceOf(Function); +}); +test('Counts the occurrences of a value in an array', () => { + expect(countOccurrences([1, 1, 2, 1, 2, 3], 1)).toEqual(3); +}); diff --git a/test/countVowels/countVowels.test.js b/test/countVowels/countVowels.test.js index 98a67a2b1..64a1b0936 100644 --- a/test/countVowels/countVowels.test.js +++ b/test/countVowels/countVowels.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const countVowels = require('./countVowels.js'); -test('Testing countVowels', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof countVowels === 'function', 'countVowels is a Function'); - //t.deepEqual(countVowels(args..), 'Expected'); - //t.equal(countVowels(args..), 'Expected'); - //t.false(countVowels(args..), 'Expected'); - //t.throws(countVowels(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('countVowels is a Function', () => { + expect(countVowels).toBeInstanceOf(Function); +}); diff --git a/test/counter/counter.test.js b/test/counter/counter.test.js index f22689a34..a80d9c0f8 100644 --- a/test/counter/counter.test.js +++ b/test/counter/counter.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const counter = require('./counter.js'); -test('Testing counter', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof counter === 'function', 'counter is a Function'); - //t.deepEqual(counter(args..), 'Expected'); - //t.equal(counter(args..), 'Expected'); - //t.false(counter(args..), 'Expected'); - //t.throws(counter(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('counter is a Function', () => { + expect(counter).toBeInstanceOf(Function); +}); diff --git a/test/createElement/createElement.test.js b/test/createElement/createElement.test.js index 6923ec245..096080d8d 100644 --- a/test/createElement/createElement.test.js +++ b/test/createElement/createElement.test.js @@ -1,14 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const createElement = require('./createElement.js'); -test('Testing createElement', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof createElement === 'function', 'createElement is a Function'); - t.pass('Tested by @chalarangelo on 16/02/2018'); - //t.deepEqual(createElement(args..), 'Expected'); - //t.equal(createElement(args..), 'Expected'); - //t.false(createElement(args..), 'Expected'); - //t.throws(createElement(args..), 'Expected'); - t.end(); +test('createElement is a Function', () => { + expect(createElement).toBeInstanceOf(Function); }); diff --git a/test/createEventHub/createEventHub.test.js b/test/createEventHub/createEventHub.test.js index 101d07aef..701572373 100644 --- a/test/createEventHub/createEventHub.test.js +++ b/test/createEventHub/createEventHub.test.js @@ -1,14 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const createEventHub = require('./createEventHub.js'); -test('Testing createEventHub', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof createEventHub === 'function', 'createEventHub is a Function'); - t.pass('Tested by @chalarangelo on 16/02/2018'); - //t.deepEqual(createEventHub(args..), 'Expected'); - //t.equal(createEventHub(args..), 'Expected'); - //t.false(createEventHub(args..), 'Expected'); - //t.throws(createEventHub(args..), 'Expected'); - t.end(); +test('createEventHub is a Function', () => { + expect(createEventHub).toBeInstanceOf(Function); }); diff --git a/test/currentURL/currentURL.test.js b/test/currentURL/currentURL.test.js index e190ad429..779470bde 100644 --- a/test/currentURL/currentURL.test.js +++ b/test/currentURL/currentURL.test.js @@ -1,14 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const currentURL = require('./currentURL.js'); -test('Testing currentURL', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof currentURL === 'function', 'currentURL is a Function'); - t.pass('Tested by @chalarangelo on 16/02/2018'); - //t.deepEqual(currentURL(args..), 'Expected'); - //t.equal(currentURL(args..), 'Expected'); - //t.false(currentURL(args..), 'Expected'); - //t.throws(currentURL(args..), 'Expected'); - t.end(); +test('currentURL is a Function', () => { + expect(currentURL).toBeInstanceOf(Function); }); diff --git a/test/curry/curry.test.js b/test/curry/curry.test.js index 341b11811..4e7b215f6 100644 --- a/test/curry/curry.test.js +++ b/test/curry/curry.test.js @@ -1,15 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const curry = require('./curry.js'); -test('Testing curry', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof curry === 'function', 'curry is a Function'); - t.equal(curry(Math.pow)(2)(10), 1024, "curries a Math.pow"); - t.equal(curry(Math.min, 3)(10)(50)(2), 2, "curries a Math.min"); - //t.deepEqual(curry(args..), 'Expected'); - //t.equal(curry(args..), 'Expected'); - //t.false(curry(args..), 'Expected'); - //t.throws(curry(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('curry is a Function', () => { + expect(curry).toBeInstanceOf(Function); +}); +test('curries a Math.pow', () => { + expect(curry(Math.pow)(2)(10)).toBe(1024); +}); +test('curries a Math.min', () => { + expect(curry(Math.min, 3)(10)(50)(2)).toBe(2); +}); diff --git a/test/debounce/debounce.test.js b/test/debounce/debounce.test.js index 867aac93a..b261f5f6d 100644 --- a/test/debounce/debounce.test.js +++ b/test/debounce/debounce.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const debounce = require('./debounce.js'); -test('Testing debounce', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof debounce === 'function', 'debounce is a Function'); - debounce(() => {t.pass('Works as expected');}, 250); - //t.deepEqual(debounce(args..), 'Expected'); - //t.equal(debounce(args..), 'Expected'); - //t.false(debounce(args..), 'Expected'); - //t.throws(debounce(args..), 'Expected'); - t.end(); +test('debounce is a Function', () => { + expect(debounce).toBeInstanceOf(Function); }); +test('Works as expected', () => { + debounce(() => { expect(true).toBeTruthy(); }); +}); diff --git a/test/decapitalize/decapitalize.test.js b/test/decapitalize/decapitalize.test.js index 83bf6b32a..14ca0fa7a 100644 --- a/test/decapitalize/decapitalize.test.js +++ b/test/decapitalize/decapitalize.test.js @@ -1,15 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const decapitalize = require('./decapitalize.js'); -test('Testing decapitalize', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof decapitalize === 'function', 'decapitalize is a Function'); - t.equal(decapitalize('FooBar'), 'fooBar', 'Works with default parameter'); - t.equal(decapitalize('FooBar', true), 'fOOBAR', 'Works with second parameter set to true'); - //t.deepEqual(decapitalize(args..), 'Expected'); - //t.equal(decapitalize(args..), 'Expected'); - //t.false(decapitalize(args..), 'Expected'); - //t.throws(decapitalize(args..), 'Expected'); - t.end(); +test('decapitalize is a Function', () => { + expect(decapitalize).toBeInstanceOf(Function); +}); +test('Works with default parameter', () => { + expect(decapitalize('FooBar')).toBe('fooBar'); +}); +test('Works with second parameter set to true', () => { + expect(decapitalize('FooBar', true)).toBe('fOOBAR'); }); diff --git a/test/deepClone/deepClone.test.js b/test/deepClone/deepClone.test.js index c2276f6ae..7fdf04e01 100644 --- a/test/deepClone/deepClone.test.js +++ b/test/deepClone/deepClone.test.js @@ -1,21 +1,22 @@ -const test = require('tape'); +const expect = require('expect'); const deepClone = require('./deepClone.js'); -test('Testing deepClone', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof deepClone === 'function', 'deepClone is a Function'); - const a = { foo: 'bar', obj: { a: 1, b: 2 } }; - const b = deepClone(a); - const c = [{foo: "bar"}]; - const d = deepClone(c); - t.notEqual(a, b, 'Shallow cloning works'); - t.notEqual(a.obj, b.obj, 'Deep cloning works'); - t.notEqual(c, d, "Array shallow cloning works"); - t.notEqual(c[0], d[0], "Array deep cloning works"); - //t.deepEqual(deepClone(args..), 'Expected'); - //t.equal(deepClone(args..), 'Expected'); - //t.false(deepClone(args..), 'Expected'); - //t.throws(deepClone(args..), 'Expected'); - t.end(); +test('deepClone is a Function', () => { + expect(deepClone).toBeInstanceOf(Function); +}); +const a = { foo: 'bar', obj: { a: 1, b: 2 } }; +const b = deepClone(a); +const c = [{foo: "bar"}]; +const d = deepClone(c); +test('Shallow cloning works', () => { + expect(a).not.toBe(b); +}); +test('Deep cloning works', () => { + expect(a.obj).not.toBe(b.obj); +}); +test('Array shallow cloning works', () => { + expect(c).not.toBe(d); +}); +test('Array deep cloning works', () => { + expect(c[0]).not.toBe(d[0]); }); diff --git a/test/deepFlatten/deepFlatten.test.js b/test/deepFlatten/deepFlatten.test.js index d6225da28..fdaa404cb 100644 --- a/test/deepFlatten/deepFlatten.test.js +++ b/test/deepFlatten/deepFlatten.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const deepFlatten = require('./deepFlatten.js'); -test('Testing deepFlatten', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof deepFlatten === 'function', 'deepFlatten is a Function'); - t.deepEqual(deepFlatten([1, [2], [[3], 4], 5]), [1, 2, 3, 4, 5], "Deep flattens an array"); - //t.deepEqual(deepFlatten(args..), 'Expected'); - //t.equal(deepFlatten(args..), 'Expected'); - //t.false(deepFlatten(args..), 'Expected'); - //t.throws(deepFlatten(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('deepFlatten is a Function', () => { + expect(deepFlatten).toBeInstanceOf(Function); +}); +test('Deep flattens an array', () => { + expect(deepFlatten([1, [2], [[3], 4], 5])).toEqual( [1, 2, 3, 4, 5]); +}); diff --git a/test/defaults/defaults.test.js b/test/defaults/defaults.test.js index b3c519f9d..6a98064cd 100644 --- a/test/defaults/defaults.test.js +++ b/test/defaults/defaults.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const defaults = require('./defaults.js'); -test('Testing defaults', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof defaults === 'function', 'defaults is a Function'); - t.deepEqual(defaults({ a: 1 }, { b: 2 }, { b: 6 }, { a: 3 }), { a: 1, b: 2 }, 'Assigns default values for undefined properties'); - //t.deepEqual(defaults(args..), 'Expected'); - //t.equal(defaults(args..), 'Expected'); - //t.false(defaults(args..), 'Expected'); - //t.throws(defaults(args..), 'Expected'); - t.end(); +test('defaults is a Function', () => { + expect(defaults).toBeInstanceOf(Function); +}); +test('Assigns default values for undefined properties', () => { + expect(defaults({ a: 1 }, { b: 2 }, { b: 6 }, { a: 3 })).toEqual({ a: 1, b: 2 }); }); diff --git a/test/defer/defer.test.js b/test/defer/defer.test.js index 23e125b90..61f3665f1 100644 --- a/test/defer/defer.test.js +++ b/test/defer/defer.test.js @@ -1,14 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const defer = require('./defer.js'); -test('Testing defer', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof defer === 'function', 'defer is a Function'); - t.pass('Tested by @chalarangelo on 16/02/2018'); - //t.deepEqual(defer(args..), 'Expected'); - //t.equal(defer(args..), 'Expected'); - //t.false(defer(args..), 'Expected'); - //t.throws(defer(args..), 'Expected'); - t.end(); +test('defer is a Function', () => { + expect(defer).toBeInstanceOf(Function); }); diff --git a/test/degreesToRads/degreesToRads.test.js b/test/degreesToRads/degreesToRads.test.js index 8ec980a10..634140d76 100644 --- a/test/degreesToRads/degreesToRads.test.js +++ b/test/degreesToRads/degreesToRads.test.js @@ -1,15 +1,10 @@ -const test = require('tape'); +const expect = require('expect'); const degreesToRads = require('./degreesToRads.js'); -test('Testing degreesToRads', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - const approxeq = (v1,v2, diff = 0.001) => Math.abs(v1 - v2) < diff; // Use to account for rounding errors - t.true(typeof degreesToRads === 'function', 'degreesToRads is a Function'); - t.true(approxeq(degreesToRads(90.0), Math.PI / 2), 'Returns the appropriate value'); - //t.deepEqual(degreesToRads(args..), 'Expected'); - //t.equal(degreesToRads(args..), 'Expected'); - //t.false(degreesToRads(args..), 'Expected'); - //t.throws(degreesToRads(args..), 'Expected'); - t.end(); +// const approxeq = (v1,v2, diff = 0.001) => Math.abs(v1 - v2) < diff; +test('degreesToRads is a Function', () => { + expect(degreesToRads).toBeInstanceOf(Function); +}); +test('Returns the appropriate value', () => { + expect(degreesToRads(90.0)).toBeCloseTo(Math.PI / 2, 3); }); diff --git a/test/delay/delay.test.js b/test/delay/delay.test.js index 8404b3bcb..b43e12552 100644 --- a/test/delay/delay.test.js +++ b/test/delay/delay.test.js @@ -1,20 +1,15 @@ -const test = require('tape'); +const expect = require('expect'); const delay = require('./delay.js'); -test('Testing delay', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof delay === 'function', 'delay is a Function'); +test('delay is a Function', () => { + expect(delay).toBeInstanceOf(Function); +}); +test('Works as expecting, passing arguments properly', () => { delay( function(text) { - t.equals(text, 'test', 'Works as expecting, passing arguments properly'); + expect(text).toBe('test'); }, 1000, 'test' ); - //t.deepEqual(delay(args..), 'Expected'); - //t.equal(delay(args..), 'Expected'); - //t.false(delay(args..), 'Expected'); - //t.throws(delay(args..), 'Expected'); - t.end(); }); diff --git a/test/detectDeviceType/detectDeviceType.test.js b/test/detectDeviceType/detectDeviceType.test.js index 9a369fe00..695593771 100644 --- a/test/detectDeviceType/detectDeviceType.test.js +++ b/test/detectDeviceType/detectDeviceType.test.js @@ -1,14 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const detectDeviceType = require('./detectDeviceType.js'); -test('Testing detectDeviceType', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof detectDeviceType === 'function', 'detectDeviceType is a Function'); - t.pass('Tested on 09/02/2018 by @chalarangelo'); - //t.deepEqual(detectDeviceType(args..), 'Expected'); - //t.equal(detectDeviceType(args..), 'Expected'); - //t.false(detectDeviceType(args..), 'Expected'); - //t.throws(detectDeviceType(args..), 'Expected'); - t.end(); +test('detectDeviceType is a Function', () => { + expect(detectDeviceType).toBeInstanceOf(Function); }); diff --git a/test/difference/difference.test.js b/test/difference/difference.test.js index 17a5b7ba2..4d0f316f0 100644 --- a/test/difference/difference.test.js +++ b/test/difference/difference.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const difference = require('./difference.js'); -test('Testing difference', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof difference === 'function', 'difference is a Function'); - t.deepEqual(difference([1, 2, 3], [1, 2, 4]), [3], "Returns the difference between two arrays"); - //t.deepEqual(difference(args..), 'Expected'); - //t.equal(difference(args..), 'Expected'); - //t.false(difference(args..), 'Expected'); - //t.throws(difference(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('difference is a Function', () => { + expect(difference).toBeInstanceOf(Function); +}); +test('Returns the difference between two arrays', () => { + expect(difference([1, 2, 3], [1, 2, 4])).toEqual([3]); +}); diff --git a/test/differenceBy/differenceBy.test.js b/test/differenceBy/differenceBy.test.js index 36c220cac..6d312b981 100644 --- a/test/differenceBy/differenceBy.test.js +++ b/test/differenceBy/differenceBy.test.js @@ -1,15 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const differenceBy = require('./differenceBy.js'); -test('Testing differenceBy', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof differenceBy === 'function', 'differenceBy is a Function'); - t.deepEqual(differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor), [1.2], 'Works using a native function and numbers'); - t.deepEqual(differenceBy([{ x: 2 }, { x: 1 }], [{ x: 1 }], v => v.x), [ { x: 2 } ], 'Works with arrow function and objects'); - //t.deepEqual(differenceBy(args..), 'Expected'); - //t.equal(differenceBy(args..), 'Expected'); - //t.false(differenceBy(args..), 'Expected'); - //t.throws(differenceBy(args..), 'Expected'); - t.end(); +test('differenceBy is a Function', () => { + expect(differenceBy).toBeInstanceOf(Function); +}); +test('Works using a native function and numbers', () => { + expect(differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor)).toEqual( [1.2]); +}); +test('Works with arrow function and objects', () => { + expect(differenceBy([{ x: 2 }, { x: 1 }], [{ x: 1 }], v => v.x)).toEqual([ { x: 2 } ]); }); diff --git a/test/differenceWith/differenceWith.test.js b/test/differenceWith/differenceWith.test.js index b3dd65cd5..76865cce2 100644 --- a/test/differenceWith/differenceWith.test.js +++ b/test/differenceWith/differenceWith.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const differenceWith = require('./differenceWith.js'); -test('Testing differenceWith', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof differenceWith === 'function', 'differenceWith is a Function'); - t.deepEqual(differenceWith([1, 1.2, 1.5, 3, 0], [1.9, 3, 0], (a, b) => Math.round(a) === Math.round(b)), [1, 1.2], "Filters out all values from an array"); - //t.deepEqual(differenceWith(args..), 'Expected'); - //t.equal(differenceWith(args..), 'Expected'); - //t.false(differenceWith(args..), 'Expected'); - //t.throws(differenceWith(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('differenceWith is a Function', () => { + expect(differenceWith).toBeInstanceOf(Function); +}); +test('Filters out all values from an array', () => { + expect(differenceWith([1, 1.2, 1.5, 3, 0], [1.9, 3, 0], (a, b) => Math.round(a) === Math.round(b))).toEqual([1, 1.2]); +}); diff --git a/test/digitize/digitize.test.js b/test/digitize/digitize.test.js index 2fb81a471..9bf53102b 100644 --- a/test/digitize/digitize.test.js +++ b/test/digitize/digitize.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const digitize = require('./digitize.js'); -test('Testing digitize', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof digitize === 'function', 'digitize is a Function'); - t.deepEqual(digitize(123), [1, 2, 3], "Converts a number to an array of digits"); - //t.deepEqual(digitize(args..), 'Expected'); - //t.equal(digitize(args..), 'Expected'); - //t.false(digitize(args..), 'Expected'); - //t.throws(digitize(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('digitize is a Function', () => { + expect(digitize).toBeInstanceOf(Function); +}); +test('Converts a number to an array of digits', () => { + expect(digitize(123)).toEqual([1, 2,3]); +}); diff --git a/test/distance/distance.test.js b/test/distance/distance.test.js index 7939c3048..7831be85d 100644 --- a/test/distance/distance.test.js +++ b/test/distance/distance.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const distance = require('./distance.js'); -test('Testing distance', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof distance === 'function', 'distance is a Function'); - t.equals(distance(1, 1, 2, 3), 2.23606797749979, 'Calculates the distance between two points'); - //t.deepEqual(distance(args..), 'Expected'); - //t.equal(distance(args..), 'Expected'); - //t.false(distance(args..), 'Expected'); - //t.throws(distance(args..), 'Expected'); - t.end(); +test('distance is a Function', () => { + expect(distance).toBeInstanceOf(Function); +}); +test('Calculates the distance between two points', () => { + expect(distance(1, 1, 2, 3)).toBeCloseTo(2.23606797749979, 5); }); diff --git a/test/drop/drop.test.js b/test/drop/drop.test.js index 3b20fd1cd..f9cc2f57b 100644 --- a/test/drop/drop.test.js +++ b/test/drop/drop.test.js @@ -1,16 +1,15 @@ -const test = require('tape'); +const expect = require('expect'); const drop = require('./drop.js'); -test('Testing drop', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof drop === 'function', 'drop is a Function'); - t.deepEqual(drop([1, 2, 3]), [2,3], 'Works without the last argument'); - t.deepEqual(drop([1, 2, 3], 2), [3], 'Removes appropriate element count as specified'); - t.deepEqual(drop([1, 2, 3], 42), [], 'Empties array given a count greater than length'); - //t.deepEqual(drop(args..), 'Expected'); - //t.equal(drop(args..), 'Expected'); - //t.false(drop(args..), 'Expected'); - //t.throws(drop(args..), 'Expected'); - t.end(); +test('drop is a Function', () => { + expect(drop).toBeInstanceOf(Function); +}); +test('Works without the last argument', () => { + expect(drop([1, 2, 3])).toEqual([2,3]); +}); +test('Removes appropriate element count as specified', () => { + expect(drop([1, 2, 3], 2)).toEqual([3]); +}); +test('Empties array given a count greater than length', () => { + expect(drop([1, 2, 3], 42)).toEqual([]); }); diff --git a/test/dropRight/dropRight.test.js b/test/dropRight/dropRight.test.js index b224b0a47..5f36ec265 100644 --- a/test/dropRight/dropRight.test.js +++ b/test/dropRight/dropRight.test.js @@ -1,16 +1,15 @@ -const test = require('tape'); +const expect = require('expect'); const dropRight = require('./dropRight.js'); -test('Testing dropRight', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof dropRight === 'function', 'dropRight is a Function'); - t.deepEqual(dropRight([1, 2, 3]), [1,2], "Returns a new array with n elements removed from the right"); - t.deepEqual(dropRight([1, 2, 3], 2), [1], "Returns a new array with n elements removed from the right"); - t.deepEqual(dropRight([1, 2, 3], 42), [], "Returns a new array with n elements removed from the right"); - //t.deepEqual(dropRight(args..), 'Expected'); - //t.equal(dropRight(args..), 'Expected'); - //t.false(dropRight(args..), 'Expected'); - //t.throws(dropRight(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('dropRight is a Function', () => { + expect(dropRight).toBeInstanceOf(Function); +}); +test('Returns a new array with n elements removed from the right', () => { + expect(dropRight([1, 2, 3])).toEqual([1, 2]); +}); +test('Returns a new array with n elements removed from the right', () => { + expect(dropRight([1, 2, 3], 2)).toEqual([1]); +}); +test('Returns a new array with n elements removed from the right', () => { + expect(dropRight([1, 2, 3], 42)).toEqual([]); +}); diff --git a/test/dropRightWhile/dropRightWhile.test.js b/test/dropRightWhile/dropRightWhile.test.js index 50bba45c3..76cf162d9 100644 --- a/test/dropRightWhile/dropRightWhile.test.js +++ b/test/dropRightWhile/dropRightWhile.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const dropRightWhile = require('./dropRightWhile.js'); -test('Testing dropRightWhile', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof dropRightWhile === 'function', 'dropRightWhile is a Function'); - t.deepEqual(dropRightWhile([1, 2, 3, 4], n => n < 3), [1, 2], 'Removes elements from the end of an array until the passed function returns true.'); - //t.deepEqual(dropRightWhile(args..), 'Expected'); - //t.equal(dropRightWhile(args..), 'Expected'); - //t.false(dropRightWhile(args..), 'Expected'); - //t.throws(dropRightWhile(args..), 'Expected'); - t.end(); +test('dropRightWhile is a Function', () => { + expect(dropRightWhile).toBeInstanceOf(Function); +}); +test('Removes elements from the end of an array until the passed function returns true.', () => { + expect(dropRightWhile([1, 2, 3, 4], n => n < 3)).toEqual([1, 2]); }); diff --git a/test/dropWhile/dropWhile.test.js b/test/dropWhile/dropWhile.test.js index 0bbc55024..19aa31470 100644 --- a/test/dropWhile/dropWhile.test.js +++ b/test/dropWhile/dropWhile.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const dropWhile = require('./dropWhile.js'); -test('Testing dropWhile', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof dropWhile === 'function', 'dropWhile is a Function'); - t.deepEqual(dropWhile([1, 2, 3, 4], n => n >= 3), [3,4], 'Removes elements in an array until the passed function returns true.'); - //t.deepEqual(dropWhile(args..), 'Expected'); - //t.equal(dropWhile(args..), 'Expected'); - //t.false(dropWhile(args..), 'Expected'); - //t.throws(dropWhile(args..), 'Expected'); - t.end(); +test('dropWhile is a Function', () => { + expect(dropWhile).toBeInstanceOf(Function); +}); +test('Removes elements in an array until the passed function returns true.', () => { + expect(dropWhile([1, 2, 3, 4], n => n >= 3)).toEqual([3,4]); }); diff --git a/test/elementIsVisibleInViewport/elementIsVisibleInViewport.test.js b/test/elementIsVisibleInViewport/elementIsVisibleInViewport.test.js index a2b4b7a59..f3d70a2fd 100644 --- a/test/elementIsVisibleInViewport/elementIsVisibleInViewport.test.js +++ b/test/elementIsVisibleInViewport/elementIsVisibleInViewport.test.js @@ -1,14 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const elementIsVisibleInViewport = require('./elementIsVisibleInViewport.js'); -test('Testing elementIsVisibleInViewport', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof elementIsVisibleInViewport === 'function', 'elementIsVisibleInViewport is a Function'); - t.pass('Tested on 09/02/2018 by @chalarangelo'); - //t.deepEqual(elementIsVisibleInViewport(args..), 'Expected'); - //t.equal(elementIsVisibleInViewport(args..), 'Expected'); - //t.false(elementIsVisibleInViewport(args..), 'Expected'); - //t.throws(elementIsVisibleInViewport(args..), 'Expected'); - t.end(); +test('elementIsVisibleInViewport is a Function', () => { + expect(elementIsVisibleInViewport).toBeInstanceOf(Function); }); diff --git a/test/elo/elo.test.js b/test/elo/elo.test.js index c7f757a8e..a5e146384 100644 --- a/test/elo/elo.test.js +++ b/test/elo/elo.test.js @@ -1,16 +1,15 @@ -const test = require('tape'); +const expect = require('expect'); const elo = require('./elo.js'); -test('Testing elo', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof elo === 'function', 'elo is a Function'); - t.deepEqual(elo([1200, 1200]), [1216, 1184], "Standard 1v1s"); - t.deepEqual(elo([1200, 1200], 64), [1232, 1168]), "Standard 1v1s"; - t.deepEqual(elo([1200, 1200, 1200, 1200]).map(Math.round), [1246, 1215, 1185, 1154], "4 player FFA, all same rank"); - //t.deepEqual(elo(args..), 'Expected'); - //t.equal(elo(args..), 'Expected'); - //t.false(elo(args..), 'Expected'); - //t.throws(elo(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('elo is a Function', () => { + expect(elo).toBeInstanceOf(Function); +}); +test('Standard 1v1s', () => { + expect(elo([1200, 1200])).toEqual([1216,1184]); +}); +test('Standard 1v1s' ,() => { + expect(elo([1200, 1200], 64)).toEqual([1232, 1168]); +}); +test('4 player FFA, all same rank', () => { + expect(elo([1200, 1200, 1200, 1200]).map(Math.round)).toEqual([1246, 1215, 1185, 1154]); +}); diff --git a/test/equals/equals.test.js b/test/equals/equals.test.js index fd7f0e8f4..4d40b9b63 100644 --- a/test/equals/equals.test.js +++ b/test/equals/equals.test.js @@ -1,18 +1,21 @@ -const test = require('tape'); +const expect = require('expect'); const equals = require('./equals.js'); -test('Testing equals', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof equals === 'function', 'equals is a Function'); - t.true(equals({ a: [2, {e: 3}], b: [4], c: 'foo' }, { a: [2, {e: 3}], b: [4], c: 'foo' }), "{ a: [2, {e: 3}], b: [4], c: 'foo' } is equal to { a: [2, {e: 3}], b: [4], c: 'foo' }"); - t.true(equals([1, 2, 3], [1, 2, 3]), '[1,2,3] is equal to [1,2,3]'); - t.false(equals({ a: [2, 3], b: [4] }, { a: [2, 3], b: [6] }), '{ a: [2, 3], b: [4] } is not equal to { a: [2, 3], b: [6] }'); - t.false(equals([1, 2, 3], [1, 2, 4]), '[1,2,3] is not equal to [1,2,4]'); - t.true(equals([1, 2, 3], { 0: 1, 1: 2, 2: 3 }), '[1, 2, 3] should be equal to { 0: 1, 1: 2, 2: 3 }) - type is different, but their enumerable properties match.'); - //t.deepEqual(equals(args..), 'Expected'); - //t.equal(equals(args..), 'Expected'); - //t.false(equals(args..), 'Expected'); - //t.throws(equals(args..), 'Expected'); - t.end(); +test('equals is a Function', () => { + expect(equals).toBeInstanceOf(Function); +}); +test('{ a: [2, {e: 3}], b: [4], c: \'foo\' } is equal to { a: [2, {e: 3}], b: [4], c: \'foo\' }', () => { + expect(equals({ a: [2, {e: 3}], b: [4], c: 'foo' }, { a: [2, {e: 3}], b: [4], c: 'foo' })).toBeTruthy(); +}); +test('[1,2,3] is equal to [1,2,3]', () => { + expect(equals([1, 2, 3], [1, 2, 3])).toBeTruthy(); +}); +test('{ a: [2, 3], b: [4] } is not equal to { a: [2, 3], b: [6] }', () => { + expect(equals({ a: [2, 3], b: [4] }, { a: [2, 3], b: [6] })).toBeFalsy(); +}); +test('[1,2,3] is not equal to [1,2,4]', () => { + expect(equals([1, 2, 3], [1, 2, 4])).toBeFalsy(); +}); +test('[1, 2, 3] should be equal to { 0: 1, 1: 2, 2: 3 }) - type is different, but their enumerable properties match.', () => { + expect(equals([1, 2, 3], { 0: 1, 1: 2, 2: 3 })).toBeTruthy(); }); diff --git a/test/escapeHTML/escapeHTML.test.js b/test/escapeHTML/escapeHTML.test.js index 642cbfd5b..1865b7cd8 100644 --- a/test/escapeHTML/escapeHTML.test.js +++ b/test/escapeHTML/escapeHTML.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const escapeHTML = require('./escapeHTML.js'); -test('Testing escapeHTML', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof escapeHTML === 'function', 'escapeHTML is a Function'); - t.equal(escapeHTML('Me & you'), '<a href="#">Me & you</a>', "Escapes a string for use in HTML"); - //t.deepEqual(escapeHTML(args..), 'Expected'); - //t.equal(escapeHTML(args..), 'Expected'); - //t.false(escapeHTML(args..), 'Expected'); - //t.throws(escapeHTML(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('escapeHTML is a Function', () => { + expect(escapeHTML).toBeInstanceOf(Function); +}); +test('Escapes a string for use in HTML', () => { + expect(escapeHTML('Me & you')).toBe('<a href="#">Me & you</a>'); +}); diff --git a/test/escapeRegExp/escapeRegExp.test.js b/test/escapeRegExp/escapeRegExp.test.js index 9ecb9497a..bd3f2168f 100644 --- a/test/escapeRegExp/escapeRegExp.test.js +++ b/test/escapeRegExp/escapeRegExp.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const escapeRegExp = require('./escapeRegExp.js'); -test('Testing escapeRegExp', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof escapeRegExp === 'function', 'escapeRegExp is a Function'); - t.equal(escapeRegExp('(test)'), '\\(test\\)', "Escapes a string to use in a regular expression"); - //t.deepEqual(escapeRegExp(args..), 'Expected'); - //t.equal(escapeRegExp(args..), 'Expected'); - //t.false(escapeRegExp(args..), 'Expected'); - //t.throws(escapeRegExp(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('escapeRegExp is a Function', () => { + expect(escapeRegExp).toBeInstanceOf(Function); +}); +test('Escapes a string to use in a regular expression', () => { + expect(escapeRegExp('(test)')).toBe('\\(test\\)'); +}); diff --git a/test/everyNth/everyNth.test.js b/test/everyNth/everyNth.test.js index 53c3851ef..b54958fc7 100644 --- a/test/everyNth/everyNth.test.js +++ b/test/everyNth/everyNth.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const everyNth = require('./everyNth.js'); -test('Testing everyNth', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof everyNth === 'function', 'everyNth is a Function'); - t.deepEqual(everyNth([1, 2, 3, 4, 5, 6], 2), [ 2, 4, 6 ], "Returns every nth element in an array"); - //t.deepEqual(everyNth(args..), 'Expected'); - //t.equal(everyNth(args..), 'Expected'); - //t.false(everyNth(args..), 'Expected'); - //t.throws(everyNth(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('everyNth is a Function', () => { + expect(everyNth).toBeInstanceOf(Function); +}); +test('Returns every nth element in an array', () => { + expect(everyNth([1, 2, 3, 4, 5, 6], 2)).toEqual([ 2, 4, 6 ]); +}); diff --git a/test/extendHex/extendHex.test.js b/test/extendHex/extendHex.test.js index c9fd57973..a31a3c6d2 100644 --- a/test/extendHex/extendHex.test.js +++ b/test/extendHex/extendHex.test.js @@ -1,15 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const extendHex = require('./extendHex.js'); -test('Testing extendHex', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof extendHex === 'function', 'extendHex is a Function'); - t.equal(extendHex('#03f'), '#0033ff', "Extends a 3-digit color code to a 6-digit color code"); - t.equal(extendHex('05a'), '#0055aa', "Extends a 3-digit color code to a 6-digit color code"); - //t.deepEqual(extendHex(args..), 'Expected'); - //t.equal(extendHex(args..), 'Expected'); - //t.false(extendHex(args..), 'Expected'); - //t.throws(extendHex(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('extendHex is a Function', () => { + expect(extendHex).toBeInstanceOf(Function); +}); +test('Extends a 3-digit color code to a 6-digit color code', () => { + expect(extendHex('#03f')).toBe('#0033ff'); +}); +test('Extends a 3-digit color code to a 6-digit color code', () => { + expect(extendHex('05a')).toBe('#0055aa'); +}); diff --git a/test/factorial/factorial.test.js b/test/factorial/factorial.test.js index d8694b446..130d39a79 100644 --- a/test/factorial/factorial.test.js +++ b/test/factorial/factorial.test.js @@ -1,18 +1,21 @@ -const test = require('tape'); +const expect = require('expect'); const factorial = require('./factorial.js'); -test('Testing factorial', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof factorial === 'function', 'factorial is a Function'); - t.equal(factorial(6), 720, "Calculates the factorial of 720"); - t.equal(factorial(0), 1, "Calculates the factorial of 0"); - t.equal(factorial(1), 1, "Calculates the factorial of 1"); - t.equal(factorial(4), 24, "Calculates the factorial of 4"); - t.equal(factorial(10), 3628800, "Calculates the factorial of 10"); - //t.deepEqual(factorial(args..), 'Expected'); - //t.equal(factorial(args..), 'Expected'); - //t.false(factorial(args..), 'Expected'); - //t.throws(factorial(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('factorial is a Function', () => { + expect(factorial).toBeInstanceOf(Function); +}); +test('Calculates the factorial of 720', () => { + expect(factorial(6)).toBe(720); +}); +test('Calculates the factorial of 0', () => { + expect(factorial(0)).toBe(1); +}); +test('Calculates the factorial of 1', () => { + expect(factorial(1)).toBe(1); +}); +test('Calculates the factorial of 4', () => { + expect(factorial(4)).toBe(24); +}); +test('Calculates the factorial of 10', () => { + expect(factorial(10)).toBe(3628800); +}); diff --git a/test/factors/factors.test.js b/test/factors/factors.test.js index cd9d3a0c9..961098ef4 100644 --- a/test/factors/factors.test.js +++ b/test/factors/factors.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const factors = require('./factors.js'); -test('Testing factors', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof factors === 'function', 'factors is a Function'); - //t.deepEqual(factors(args..), 'Expected'); - //t.equal(factors(args..), 'Expected'); - //t.false(factors(args..), 'Expected'); - //t.throws(factors(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('factors is a Function', () => { + expect(factors).toBeInstanceOf(Function); +}); diff --git a/test/fibonacci/fibonacci.test.js b/test/fibonacci/fibonacci.test.js index 75951a4de..c13d3551b 100644 --- a/test/fibonacci/fibonacci.test.js +++ b/test/fibonacci/fibonacci.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const fibonacci = require('./fibonacci.js'); -test('Testing fibonacci', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof fibonacci === 'function', 'fibonacci is a Function'); - t.deepEqual(fibonacci(6), [0, 1, 1, 2, 3, 5], "Generates an array, containing the Fibonacci sequence"); - //t.deepEqual(fibonacci(args..), 'Expected'); - //t.equal(fibonacci(args..), 'Expected'); - //t.false(fibonacci(args..), 'Expected'); - //t.throws(fibonacci(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('fibonacci is a Function', () => { + expect(fibonacci).toBeInstanceOf(Function); +}); +test('Generates an array, containing the Fibonacci sequence', () => { + expect(fibonacci(6)).toEqual([0, 1, 1, 2, 3, 5]); +}); diff --git a/test/fibonacciCountUntilNum/fibonacciCountUntilNum.test.js b/test/fibonacciCountUntilNum/fibonacciCountUntilNum.test.js index 6d14331d3..249b4ae48 100644 --- a/test/fibonacciCountUntilNum/fibonacciCountUntilNum.test.js +++ b/test/fibonacciCountUntilNum/fibonacciCountUntilNum.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const fibonacciCountUntilNum = require('./fibonacciCountUntilNum.js'); -test('Testing fibonacciCountUntilNum', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof fibonacciCountUntilNum === 'function', 'fibonacciCountUntilNum is a Function'); - //t.deepEqual(fibonacciCountUntilNum(args..), 'Expected'); - //t.equal(fibonacciCountUntilNum(args..), 'Expected'); - //t.false(fibonacciCountUntilNum(args..), 'Expected'); - //t.throws(fibonacciCountUntilNum(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('fibonacciCountUntilNum is a Function', () => { + expect(fibonacciCountUntilNum).toBeInstanceOf(Function); +}); diff --git a/test/fibonacciUntilNum/fibonacciUntilNum.test.js b/test/fibonacciUntilNum/fibonacciUntilNum.test.js index a023c376c..a639afad4 100644 --- a/test/fibonacciUntilNum/fibonacciUntilNum.test.js +++ b/test/fibonacciUntilNum/fibonacciUntilNum.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const fibonacciUntilNum = require('./fibonacciUntilNum.js'); -test('Testing fibonacciUntilNum', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof fibonacciUntilNum === 'function', 'fibonacciUntilNum is a Function'); - //t.deepEqual(fibonacciUntilNum(args..), 'Expected'); - //t.equal(fibonacciUntilNum(args..), 'Expected'); - //t.false(fibonacciUntilNum(args..), 'Expected'); - //t.throws(fibonacciUntilNum(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('fibonacciUntilNum is a Function', () => { + expect(fibonacciUntilNum).toBeInstanceOf(Function); +}); diff --git a/test/filterNonUnique/filterNonUnique.test.js b/test/filterNonUnique/filterNonUnique.test.js index 9fd18bf41..b4ab55867 100644 --- a/test/filterNonUnique/filterNonUnique.test.js +++ b/test/filterNonUnique/filterNonUnique.test.js @@ -1,14 +1,10 @@ -const test = require('tape'); +const expect = require('expect'); const filterNonUnique = require('./filterNonUnique.js'); -test('Testing filterNonUnique', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof filterNonUnique === 'function', 'filterNonUnique is a Function'); - t.deepEqual(filterNonUnique([1, 2, 2, 3, 4, 4, 5]), [1,3,5], "Filters out the non-unique values in an array"); - //t.deepEqual(filterNonUnique(args..), 'Expected'); - //t.equal(filterNonUnique(args..), 'Expected'); - //t.false(filterNonUnique(args..), 'Expected'); - //t.throws(filterNonUnique(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('filterNonUnique is a Function', () => { + expect(filterNonUnique).toBeInstanceOf(Function); +}); +test('Filters out the non-unique values in an array', () => { + expect(filterNonUnique([1, 2, 2, 3, 4, 4, 5])).toEqual([1,3, 5]); +}); + diff --git a/test/findKey/findKey.test.js b/test/findKey/findKey.test.js index 7c505e561..54dcc5d33 100644 --- a/test/findKey/findKey.test.js +++ b/test/findKey/findKey.test.js @@ -1,21 +1,15 @@ -const test = require('tape'); +const expect = require('expect'); const findKey = require('./findKey.js'); -test('Testing findKey', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof findKey === 'function', 'findKey is a Function'); - t.deepEqual(findKey( +test('findKey is a Function', () => { + expect(findKey).toBeInstanceOf(Function); +}); +test('Returns the appropriate key', () => { + expect(findKey( { barney: { age: 36, active: true }, fred: { age: 40, active: false }, pebbles: { age: 1, active: true } }, - o => o['active'] -), 'barney', 'Returns the appropriate key'); - //t.deepEqual(findKey(args..), 'Expected'); - //t.equal(findKey(args..), 'Expected'); - //t.false(findKey(args..), 'Expected'); - //t.throws(findKey(args..), 'Expected'); - t.end(); + o => o['active'])).toBe('barney'); }); diff --git a/test/findLast/findLast.test.js b/test/findLast/findLast.test.js index a2d74405c..34fa06939 100644 --- a/test/findLast/findLast.test.js +++ b/test/findLast/findLast.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const findLast = require('./findLast.js'); -test('Testing findLast', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof findLast === 'function', 'findLast is a Function'); - t.equal(findLast([1, 2, 3, 4], n => n % 2 === 1), 3, 'Finds last element for which the given function returns true'); - //t.deepEqual(findLast(args..), 'Expected'); - //t.equal(findLast(args..), 'Expected'); - //t.false(findLast(args..), 'Expected'); - //t.throws(findLast(args..), 'Expected'); - t.end(); +test('findLast is a Function', () => { + expect(findLast).toBeInstanceOf(Function); +}); +test('Finds last element for which the given function returns true', () => { + expect(findLast([1, 2, 3, 4], n => n % 2 === 1)).toBe(3); }); diff --git a/test/findLastIndex/findLastIndex.test.js b/test/findLastIndex/findLastIndex.test.js index 2105f977a..6f438daf6 100644 --- a/test/findLastIndex/findLastIndex.test.js +++ b/test/findLastIndex/findLastIndex.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const findLastIndex = require('./findLastIndex.js'); -test('Testing findLastIndex', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof findLastIndex === 'function', 'findLastIndex is a Function'); - t.equal(findLastIndex([1, 2, 3, 4], n => n % 2 === 1), 2, 'Finds last index for which the given function returns true'); - //t.deepEqual(findLastIndex(args..), 'Expected'); - //t.equal(findLastIndex(args..), 'Expected'); - //t.false(findLastIndex(args..), 'Expected'); - //t.throws(findLastIndex(args..), 'Expected'); - t.end(); +test('findLastIndex is a Function', () => { + expect(findLastIndex).toBeInstanceOf(Function); +}); +test('Finds last index for which the given function returns true', () => { + expect(findLastIndex([1, 2, 3, 4], n => n % 2 === 1)).toBe(2); }); diff --git a/test/findLastKey/findLastKey.test.js b/test/findLastKey/findLastKey.test.js index 41bcf3624..434e3e031 100644 --- a/test/findLastKey/findLastKey.test.js +++ b/test/findLastKey/findLastKey.test.js @@ -1,21 +1,15 @@ -const test = require('tape'); +const expect = require('expect'); const findLastKey = require('./findLastKey.js'); -test('Testing findLastKey', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof findLastKey === 'function', 'findLastKey is a Function'); - t.equal(findLastKey( +test('findLastKey is a Function', () => { + expect(findLastKey).toBeInstanceOf(Function); +}); +test('eturns the appropriate key', () => { + expect(findLastKey( { barney: { age: 36, active: true }, fred: { age: 40, active: false }, pebbles: { age: 1, active: true } }, - o => o['active'] -), 'pebbles', 'Returns the appropriate key'); - //t.deepEqual(findLastKey(args..), 'Expected'); - //t.equal(findLastKey(args..), 'Expected'); - //t.false(findLastKey(args..), 'Expected'); - //t.throws(findLastKey(args..), 'Expected'); - t.end(); + o => o['active'])).toBe('pebbles'); }); diff --git a/test/flatten/flatten.test.js b/test/flatten/flatten.test.js index eb54b6c19..536a63637 100644 --- a/test/flatten/flatten.test.js +++ b/test/flatten/flatten.test.js @@ -1,15 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const flatten = require('./flatten.js'); -test('Testing flatten', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof flatten === 'function', 'flatten is a Function'); - t.deepEqual(flatten([1, [2], 3, 4]), [1, 2, 3, 4], "Flattens an array"); - t.deepEqual(flatten([1, [2, [3, [4, 5], 6], 7], 8], 2), [1, 2, 3, [4, 5], 6, 7, 8], "Flattens an array"); - //t.deepEqual(flatten(args..), 'Expected'); - //t.equal(flatten(args..), 'Expected'); - //t.false(flatten(args..), 'Expected'); - //t.throws(flatten(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('flatten is a Function', () => { + expect(flatten).toBeInstanceOf(Function); +}); +test('Flattens an array', () => { + expect(flatten([1, [2], 3, 4])).toEqual([1, 2, 3, 4]); +}); +test('Flattens an array', () => { + expect(flatten([1, [2, [3, [4, 5], 6], 7], 8], 2)).toEqual([1, 2, 3, [4, 5], 6, 7, 8]); +}); diff --git a/test/flattenObject/flattenObject.test.js b/test/flattenObject/flattenObject.test.js index 6fea9f795..8ccafaf3e 100644 --- a/test/flattenObject/flattenObject.test.js +++ b/test/flattenObject/flattenObject.test.js @@ -1,15 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const flattenObject = require('./flattenObject.js'); -test('Testing flattenObject', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof flattenObject === 'function', 'flattenObject is a Function'); - t.deepEqual(flattenObject({ a: { b: { c: 1 } }, d: 1 }), { 'a.b.c': 1, d: 1 }, 'Flattens an object with the paths for keys'); - t.deepEqual(flattenObject([0,1,[2,[1]],1]), { 0: 0, 1: 1, 3: 1, '2.0': 2, '2.1.0': 1 }, 'Works with arrays'); - //t.deepEqual(flattenObject(args..), 'Expected'); - //t.equal(flattenObject(args..), 'Expected'); - //t.false(flattenObject(args..), 'Expected'); - //t.throws(flattenObject(args..), 'Expected'); - t.end(); +test('flattenObject is a Function', () => { + expect(flattenObject).toBeInstanceOf(Function); +}); +test('Flattens an object with the paths for keys', () => { + expect(flattenObject({ a: { b: { c: 1 } }, d: 1 })).toEqual({ 'a.b.c': 1, d: 1 }); +}); +test('Works with arrays', () => { + expect(flattenObject([0,1,[2,[1]],1])).toEqual({ 0: 0, 1: 1, 3: 1, '2.0': 2, '2.1.0': 1 }); }); diff --git a/test/flip/flip.test.js b/test/flip/flip.test.js index e5cbedefc..26ad46f43 100644 --- a/test/flip/flip.test.js +++ b/test/flip/flip.test.js @@ -1,18 +1,13 @@ -const test = require('tape'); +const expect = require('expect'); const flip = require('./flip.js'); -test('Testing flip', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof flip === 'function', 'flip is a Function'); - let a = { name: 'John Smith' }; - let b = {}; - const mergeFrom = flip(Object.assign); - let mergePerson = mergeFrom.bind(null, a); - t.deepEqual(mergePerson(b), a, 'Flips argument order'); - //t.deepEqual(flip(args..), 'Expected'); - //t.equal(flip(args..), 'Expected'); - //t.false(flip(args..), 'Expected'); - //t.throws(flip(args..), 'Expected'); - t.end(); +test('flip is a Function', () => { + expect(flip).toBeInstanceOf(Function); +}); +let a = { name: 'John Smith' }; +let b = {}; +const mergeFrom = flip(Object.assign); +let mergePerson = mergeFrom.bind(null, a); +test('Flips argument order', () => { + expect(mergePerson(b)).toEqual(a); }); diff --git a/test/forEachRight/forEachRight.test.js b/test/forEachRight/forEachRight.test.js index 2b6b8a956..e137a68e2 100644 --- a/test/forEachRight/forEachRight.test.js +++ b/test/forEachRight/forEachRight.test.js @@ -1,16 +1,11 @@ -const test = require('tape'); +const expect = require('expect'); const forEachRight = require('./forEachRight.js'); -test('Testing forEachRight', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof forEachRight === 'function', 'forEachRight is a Function'); - let output = ''; - forEachRight([1, 2, 3, 4], val => output+=val); - t.equal(output, '4321', 'Iterates over the array in reverse'); - //t.deepEqual(forEachRight(args..), 'Expected'); - //t.equal(forEachRight(args..), 'Expected'); - //t.false(forEachRight(args..), 'Expected'); - //t.throws(forEachRight(args..), 'Expected'); - t.end(); +test('forEachRight is a Function', () => { + expect(forEachRight).toBeInstanceOf(Function); +}); +let output = ''; +forEachRight([1, 2, 3, 4], val => output+=val); +test('Iterates over the array in reverse', () => { + expect(output).toBe('4321'); }); diff --git a/test/forOwn/forOwn.test.js b/test/forOwn/forOwn.test.js index b6910eb1f..74c408c62 100644 --- a/test/forOwn/forOwn.test.js +++ b/test/forOwn/forOwn.test.js @@ -1,16 +1,11 @@ -const test = require('tape'); +const expect = require('expect'); const forOwn = require('./forOwn.js'); -test('Testing forOwn', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof forOwn === 'function', 'forOwn is a Function'); - let output = []; - forOwn({ foo: 'bar', a: 1 }, v => output.push(v)); // 'bar', 1 - t.deepEqual(output, ['bar', 1], 'Iterates over an element\'s key-value pairs'); - //t.deepEqual(forOwn(args..), 'Expected'); - //t.equal(forOwn(args..), 'Expected'); - //t.false(forOwn(args..), 'Expected'); - //t.throws(forOwn(args..), 'Expected'); - t.end(); +test('forOwn is a Function', () => { + expect(forOwn).toBeInstanceOf(Function); +}); +let output = []; +forOwn({ foo: 'bar', a: 1 }, v => output.push(v)); +test('Iterates over an element\'s key-value pairs', () => { + expect(output).toEqual(['bar', 1]); }); diff --git a/test/forOwnRight/forOwnRight.test.js b/test/forOwnRight/forOwnRight.test.js index 66c783785..781d287fe 100644 --- a/test/forOwnRight/forOwnRight.test.js +++ b/test/forOwnRight/forOwnRight.test.js @@ -1,16 +1,11 @@ -const test = require('tape'); +const expect = require('expect'); const forOwnRight = require('./forOwnRight.js'); -test('Testing forOwnRight', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof forOwnRight === 'function', 'forOwnRight is a Function'); - let output = []; - forOwnRight({ foo: 'bar', a: 1 }, v => output.push(v)); // 'bar', 1 - t.deepEqual(output, [1, 'bar'], 'Iterates over an element\'s key-value pairs in reverse'); - //t.deepEqual(forOwnRight(args..), 'Expected'); - //t.equal(forOwnRight(args..), 'Expected'); - //t.false(forOwnRight(args..), 'Expected'); - //t.throws(forOwnRight(args..), 'Expected'); - t.end(); +test('forOwnRight is a Function', () => { + expect(forOwnRight).toBeInstanceOf(Function); +}); +let output = []; +forOwnRight({ foo: 'bar', a: 1 }, v => output.push(v)); +test('Iterates over an element\'s key-value pairs in reverse', () => { + expect(output).toEqual([1, 'bar']); }); diff --git a/test/formatDuration/formatDuration.test.js b/test/formatDuration/formatDuration.test.js index 6c5cc23c3..780ffae26 100644 --- a/test/formatDuration/formatDuration.test.js +++ b/test/formatDuration/formatDuration.test.js @@ -1,15 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const formatDuration = require('./formatDuration.js'); -test('Testing formatDuration', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof formatDuration === 'function', 'formatDuration is a Function'); - t.equal(formatDuration(1001), '1 second, 1 millisecond', "Returns the human readable format of the given number of milliseconds"); - t.equal(formatDuration(34325055574), '397 days, 6 hours, 44 minutes, 15 seconds, 574 milliseconds', "Returns the human readable format of the given number of milliseconds"); - //t.deepEqual(formatDuration(args..), 'Expected'); - //t.equal(formatDuration(args..), 'Expected'); - //t.false(formatDuration(args..), 'Expected'); - //t.throws(formatDuration(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('formatDuration is a Function', () => { + expect(formatDuration).toBeInstanceOf(Function); +}); +test('Returns the human readable format of the given number of milliseconds', () => { + expect(formatDuration(1001)).toBe('1 second, 1 millisecond'); +}); +test('Returns the human readable format of the given number of milliseconds', () => { + expect(formatDuration(34325055574)).toBe('397 days, 6 hours, 44 minutes, 15 seconds, 574 milliseconds'); +}); diff --git a/test/fromCamelCase/fromCamelCase.test.js b/test/fromCamelCase/fromCamelCase.test.js index 58ecffed9..5491058ac 100644 --- a/test/fromCamelCase/fromCamelCase.test.js +++ b/test/fromCamelCase/fromCamelCase.test.js @@ -1,16 +1,15 @@ -const test = require('tape'); +const expect = require('expect'); const fromCamelCase = require('./fromCamelCase.js'); -test('Testing fromCamelCase', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof fromCamelCase === 'function', 'fromCamelCase is a Function'); - t.equal(fromCamelCase('someDatabaseFieldName', ' '), 'some database field name', "Converts a string from camelcase"); - t.equal(fromCamelCase('someLabelThatNeedsToBeCamelized', '-'), 'some-label-that-needs-to-be-camelized', "Converts a string from camelcase"); - t.equal(fromCamelCase('someJavascriptProperty', '_'), 'some_javascript_property', "Converts a string from camelcase"); - //t.deepEqual(fromCamelCase(args..), 'Expected'); - //t.equal(fromCamelCase(args..), 'Expected'); - //t.false(fromCamelCase(args..), 'Expected'); - //t.throws(fromCamelCase(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('fromCamelCase is a Function', () => { + expect(fromCamelCase).toBeInstanceOf(Function); +}); +test('Converts a string from camelcase', () => { + expect(fromCamelCase('someDatabaseFieldName', ' ')).toBe('some database field name'); +}); +test('Converts a string from camelcase', () => { + expect(fromCamelCase('someLabelThatNeedsToBeCamelized', '-')).toBe('some-label-that-needs-to-be-camelized'); +}); +test('Converts a string from camelcase', () => { + expect(fromCamelCase('someJavascriptProperty', '_')).toBe('some_javascript_property'); +}); diff --git a/test/functionName/functionName.test.js b/test/functionName/functionName.test.js index 4231f45c5..91c75a6a4 100644 --- a/test/functionName/functionName.test.js +++ b/test/functionName/functionName.test.js @@ -1,26 +1,18 @@ -const test = require('tape'); -//const functionName = require('./functionName.js'); -// Custom override for console.debug to check output. +const expect = require('expect'); let output = ''; -const console = {}; -console.debug = (x) => output = x; -// Override for testing -const functionName = fn => (console.debug(fn.name), fn); -test('Testing functionName', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof functionName === 'function', 'functionName is a Function'); - functionName(Math.max); - t.equal(output, 'max', 'Works for native functions'); - function fun(x) {return x;} - functionName(fun); - t.equal(output, 'fun', 'Works for functions'); - const fn = x => x; - functionName(fn); - t.equal(output, 'fn', 'Works for arrow functions'); - //t.deepEqual(functionName(args..), 'Expected'); - //t.equal(functionName(args..), 'Expected'); - //t.false(functionName(args..), 'Expected'); - //t.throws(functionName(args..), 'Expected'); - t.end(); +const functionName = fn => fn.name; + +test('functionName is a Function', () => { + expect(functionName).toBeInstanceOf(Function); +}); +test('Works for native functions', () => { + expect(functionName(Math.max)).toBe('max'); +}); +function fun(x) {return x;} +test('Works for functions', () => { + expect(functionName(fun)).toBe('fun'); +}); +const fn = x => x; +test('Works for arrow functions', () => { + expect(functionName(fn)).toBe('fn'); }); diff --git a/test/functions/functions.test.js b/test/functions/functions.test.js index 0177fa60a..b7193bf92 100644 --- a/test/functions/functions.test.js +++ b/test/functions/functions.test.js @@ -1,20 +1,17 @@ -const test = require('tape'); +const expect = require('expect'); const functions = require('./functions.js'); -test('Testing functions', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof functions === 'function', 'functions is a Function'); - function Foo() { - this.a = () => 1; - this.b = () => 2; - } - Foo.prototype.c = () => 3; - t.deepEqual(functions(new Foo()), ['a', 'b'], 'Returns own methods'); - t.deepEqual(functions(new Foo(), true), ['a', 'b', 'c'], 'Returns own and inherited methods'); - //t.deepEqual(functions(args..), 'Expected'); - //t.equal(functions(args..), 'Expected'); - //t.false(functions(args..), 'Expected'); - //t.throws(functions(args..), 'Expected'); - t.end(); +test('functions is a Function', () => { + expect(functions).toBeInstanceOf(Function); +}); +function Foo() { + this.a = () => 1; + this.b = () => 2; +} +Foo.prototype.c = () => 3; +test('Returns own methods', () => { + expect(functions(new Foo())).toEqual( ['a', 'b']); +}); +test('Returns own and inherited methods', () => { + expect(functions(new Foo(), true)).toEqual(['a', 'b', 'c']); }); diff --git a/test/gcd/gcd.test.js b/test/gcd/gcd.test.js index a222fe04b..8657042d6 100644 --- a/test/gcd/gcd.test.js +++ b/test/gcd/gcd.test.js @@ -1,15 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const gcd = require('./gcd.js'); -test('Testing gcd', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof gcd === 'function', 'gcd is a Function'); - t.equal(gcd(8, 36), 4, "Calculates the greatest common divisor between two or more numbers/arrays"); - t.deepEqual(gcd(...[12, 8, 32]), 4, "Calculates the greatest common divisor between two or more numbers/arrays"); - //t.deepEqual(gcd(args..), 'Expected'); - //t.equal(gcd(args..), 'Expected'); - //t.false(gcd(args..), 'Expected'); - //t.throws(gcd(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('gcd is a Function', () => { + expect(gcd).toBeInstanceOf(Function); +}); +test('Calculates the greatest common divisor between two or more numbers/arrays', () => { + expect(gcd(8, 36)).toBe(4); +}); +test('Calculates the greatest common divisor between two or more numbers/arrays', () => { + expect(gcd(...[12, 8, 32])).toEqual(4); +}); diff --git a/test/geometricProgression/geometricProgression.test.js b/test/geometricProgression/geometricProgression.test.js index 059e83682..6ac3ed8e4 100644 --- a/test/geometricProgression/geometricProgression.test.js +++ b/test/geometricProgression/geometricProgression.test.js @@ -1,16 +1,15 @@ -const test = require('tape'); +const expect = require('expect'); const geometricProgression = require('./geometricProgression.js'); -test('Testing geometricProgression', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof geometricProgression === 'function', 'geometricProgression is a Function'); - t.deepEqual(geometricProgression(256), [1, 2, 4, 8, 16, 32, 64, 128, 256], "Initializes an array containing the numbers in the specified range"); - t.deepEqual(geometricProgression(256, 3), [3, 6, 12, 24, 48, 96, 192], "Initializes an array containing the numbers in the specified range"); - t.deepEqual(geometricProgression(256, 1, 4), [1, 4, 16, 64, 256], "Initializes an array containing the numbers in the specified range"); - //t.deepEqual(geometricProgression(args..), 'Expected'); - //t.equal(geometricProgression(args..), 'Expected'); - //t.false(geometricProgression(args..), 'Expected'); - //t.throws(geometricProgression(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('geometricProgression is a Function', () => { + expect(geometricProgression).toBeInstanceOf(Function); +}); +test('Initializes an array containing the numbers in the specified range', () => { + expect(geometricProgression(256)).toEqual([1, 2, 4, 8, 16, 32, 64, 128, 256]); +}); +test('Initializes an array containing the numbers in the specified range', () => { + expect(geometricProgression(256, 3)).toEqual([3, 6, 12, 24, 48, 96, 192]); +}); +test('Initializes an array containing the numbers in the specified range', () => { + expect(geometricProgression(256, 1, 4)).toEqual([1, 4, 16, 64, 256]); +}); diff --git a/test/get/get.test.js b/test/get/get.test.js index d8448a171..715ee0033 100644 --- a/test/get/get.test.js +++ b/test/get/get.test.js @@ -1,15 +1,10 @@ -const test = require('tape'); +const expect = require('expect'); const get = require('./get.js'); -test('Testing get', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof get === 'function', 'get is a Function'); - const obj = { selector: { to: { val: 'val to get' } } }; - t.deepEqual(get(obj, 'selector.to.val'), ['val to get'], "Retrieve a property indicated by the selector from an object."); - //t.deepEqual(get(args..), 'Expected'); - //t.equal(get(args..), 'Expected'); - //t.false(get(args..), 'Expected'); - //t.throws(get(args..), 'Expected'); - t.end(); +test('get is a Function', () => { + expect(get).toBeInstanceOf(Function); +}); +const obj = { selector: { to: { val: 'val to get' } } }; +test('Retrieve a property indicated by the selector from an object.', () => { + expect(get(obj, 'selector.to.val')).toEqual(['val to get']); }); diff --git a/test/getColonTimeFromDate/getColonTimeFromDate.test.js b/test/getColonTimeFromDate/getColonTimeFromDate.test.js index d1f0f3789..e834ac265 100644 --- a/test/getColonTimeFromDate/getColonTimeFromDate.test.js +++ b/test/getColonTimeFromDate/getColonTimeFromDate.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const getColonTimeFromDate = require('./getColonTimeFromDate.js'); -test('Testing getColonTimeFromDate', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof getColonTimeFromDate === 'function', 'getColonTimeFromDate is a Function'); - //t.deepEqual(getColonTimeFromDate(args..), 'Expected'); - //t.equal(getColonTimeFromDate(args..), 'Expected'); - //t.false(getColonTimeFromDate(args..), 'Expected'); - //t.throws(getColonTimeFromDate(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('getColonTimeFromDate is a Function', () => { + expect(getColonTimeFromDate).toBeInstanceOf(Function); +}); diff --git a/test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js b/test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js index 56bf82f8c..2128fe077 100644 --- a/test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js +++ b/test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const getDaysDiffBetweenDates = require('./getDaysDiffBetweenDates.js'); -test('Testing getDaysDiffBetweenDates', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof getDaysDiffBetweenDates === 'function', 'getDaysDiffBetweenDates is a Function'); - t.equal(getDaysDiffBetweenDates(new Date('2017-12-13'), new Date('2017-12-22')), 9, "Returns the difference in days between two dates"); - //t.deepEqual(getDaysDiffBetweenDates(args..), 'Expected'); - //t.equal(getDaysDiffBetweenDates(args..), 'Expected'); - //t.false(getDaysDiffBetweenDates(args..), 'Expected'); - //t.throws(getDaysDiffBetweenDates(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('getDaysDiffBetweenDates is a Function', () => { + expect(getDaysDiffBetweenDates).toBeInstanceOf(Function); +}); +test('Returns the difference in days between two dates', () => { + expect(getDaysDiffBetweenDates(new Date('2017-12-13'), new Date('2017-12-22'))).toBe(9); +}); diff --git a/test/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.test.js b/test/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.test.js index 7df3d24df..936eb3c13 100644 --- a/test/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.test.js +++ b/test/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const getMeridiemSuffixOfInteger = require('./getMeridiemSuffixOfInteger.js'); -test('Testing getMeridiemSuffixOfInteger', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof getMeridiemSuffixOfInteger === 'function', 'getMeridiemSuffixOfInteger is a Function'); - //t.deepEqual(getMeridiemSuffixOfInteger(args..), 'Expected'); - //t.equal(getMeridiemSuffixOfInteger(args..), 'Expected'); - //t.false(getMeridiemSuffixOfInteger(args..), 'Expected'); - //t.throws(getMeridiemSuffixOfInteger(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('getMeridiemSuffixOfInteger is a Function', () => { + expect(getMeridiemSuffixOfInteger).toBeInstanceOf(Function); +}); diff --git a/test/getScrollPosition/getScrollPosition.test.js b/test/getScrollPosition/getScrollPosition.test.js index 9f7fd14d7..0137c4eb4 100644 --- a/test/getScrollPosition/getScrollPosition.test.js +++ b/test/getScrollPosition/getScrollPosition.test.js @@ -1,14 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const getScrollPosition = require('./getScrollPosition.js'); -test('Testing getScrollPosition', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof getScrollPosition === 'function', 'getScrollPosition is a Function'); - t.pass('Tested by @chalarangelo on 16/02/2018'); - //t.deepEqual(getScrollPosition(args..), 'Expected'); - //t.equal(getScrollPosition(args..), 'Expected'); - //t.false(getScrollPosition(args..), 'Expected'); - //t.throws(getScrollPosition(args..), 'Expected'); - t.end(); +test('getScrollPosition is a Function', () => { + expect(getScrollPosition).toBeInstanceOf(Function); }); diff --git a/test/getStyle/getStyle.test.js b/test/getStyle/getStyle.test.js index 23bac0147..6f279ab81 100644 --- a/test/getStyle/getStyle.test.js +++ b/test/getStyle/getStyle.test.js @@ -1,14 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const getStyle = require('./getStyle.js'); -test('Testing getStyle', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof getStyle === 'function', 'getStyle is a Function'); - t.pass('Tested by @chalarangelo on 16/02/2018'); - //t.deepEqual(getStyle(args..), 'Expected'); - //t.equal(getStyle(args..), 'Expected'); - //t.false(getStyle(args..), 'Expected'); - //t.throws(getStyle(args..), 'Expected'); - t.end(); +test('getStyle is a Function', () => { + expect(getStyle).toBeInstanceOf(Function); }); diff --git a/test/getType/getType.test.js b/test/getType/getType.test.js index 359e9ea07..660a7f020 100644 --- a/test/getType/getType.test.js +++ b/test/getType/getType.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const getType = require('./getType.js'); -test('Testing getType', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof getType === 'function', 'getType is a Function'); - t.equal(getType(new Set([1, 2, 3])), 'set', "Returns the native type of a value"); - //t.deepEqual(getType(args..), 'Expected'); - //t.equal(getType(args..), 'Expected'); - //t.false(getType(args..), 'Expected'); - //t.throws(getType(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('getType is a Function', () => { + expect(getType).toBeInstanceOf(Function); +}); +test('Returns the native type of a value', () => { + expect(getType(new Set([1, 2, 3]))).toBe('set'); +}); diff --git a/test/getURLParameters/getURLParameters.test.js b/test/getURLParameters/getURLParameters.test.js index a030f86ee..f23854b52 100644 --- a/test/getURLParameters/getURLParameters.test.js +++ b/test/getURLParameters/getURLParameters.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const getURLParameters = require('./getURLParameters.js'); -test('Testing getURLParameters', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof getURLParameters === 'function', 'getURLParameters is a Function'); - t.deepEqual(getURLParameters('http://url.com/page?name=Adam&surname=Smith'), {name: 'Adam', surname: 'Smith'}, "Returns an object containing the parameters of the current URL"); - //t.deepEqual(getURLParameters(args..), 'Expected'); - //t.equal(getURLParameters(args..), 'Expected'); - //t.false(getURLParameters(args..), 'Expected'); - //t.throws(getURLParameters(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('getURLParameters is a Function', () => { + expect(getURLParameters).toBeInstanceOf(Function); +}); +test('Returns an object containing the parameters of the current URL', () => { + expect(getURLParameters('http://url.com/page?name=Adam&surname=Smith')).toEqual({name: 'Adam', surname: 'Smith'}); +}); diff --git a/test/groupBy/groupBy.test.js b/test/groupBy/groupBy.test.js index e3e8528bb..7f1c61eae 100644 --- a/test/groupBy/groupBy.test.js +++ b/test/groupBy/groupBy.test.js @@ -1,15 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const groupBy = require('./groupBy.js'); -test('Testing groupBy', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof groupBy === 'function', 'groupBy is a Function'); - t.deepEqual(groupBy([6.1, 4.2, 6.3], Math.floor), {4: [4.2], 6: [6.1, 6.3]}, "Groups the elements of an array based on the given function"); - t.deepEqual(groupBy(['one', 'two', 'three'], 'length'), {3: ['one', 'two'], 5: ['three']}, "Groups the elements of an array based on the given function"); - //t.deepEqual(groupBy(args..), 'Expected'); - //t.equal(groupBy(args..), 'Expected'); - //t.false(groupBy(args..), 'Expected'); - //t.throws(groupBy(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('groupBy is a Function', () => { + expect(groupBy).toBeInstanceOf(Function); +}); +test('Groups the elements of an array based on the given function', () => { + expect(groupBy([6.1, 4.2, 6.3], Math.floor)).toEqual({4: [4.2], 6: [6.1, 6.3]}); +}); +test('Groups the elements of an array based on the given function', () => { + expect(groupBy(['one', 'two', 'three'], 'length')).toEqual({3: ['one', 'two'], 5: ['three']}); +}); diff --git a/test/hammingDistance/hammingDistance.test.js b/test/hammingDistance/hammingDistance.test.js index 6ada1733c..b884b6c89 100644 --- a/test/hammingDistance/hammingDistance.test.js +++ b/test/hammingDistance/hammingDistance.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const hammingDistance = require('./hammingDistance.js'); -test('Testing hammingDistance', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof hammingDistance === 'function', 'hammingDistance is a Function'); - t.equal(hammingDistance(2, 3), 1, "retuns hamming disance between 2 values"); - //t.deepEqual(hammingDistance(args..), 'Expected'); - //t.equal(hammingDistance(args..), 'Expected'); - //t.false(hammingDistance(args..), 'Expected'); - //t.throws(hammingDistance(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('hammingDistance is a Function', () => { + expect(hammingDistance).toBeInstanceOf(Function); +}); +test('retuns hamming disance between 2 values', () => { + expect(hammingDistance(2, 3)).toBe(1); +}); diff --git a/test/hasClass/hasClass.test.js b/test/hasClass/hasClass.test.js index 43932ea01..74198e04e 100644 --- a/test/hasClass/hasClass.test.js +++ b/test/hasClass/hasClass.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const hasClass = require('./hasClass.js'); -test('Testing hasClass', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof hasClass === 'function', 'hasClass is a Function'); - //t.deepEqual(hasClass(args..), 'Expected'); - //t.equal(hasClass(args..), 'Expected'); - //t.false(hasClass(args..), 'Expected'); - //t.throws(hasClass(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('hasClass is a Function', () => { + expect(hasClass).toBeInstanceOf(Function); +}); diff --git a/test/hasFlags/hasFlags.test.js b/test/hasFlags/hasFlags.test.js index be0d4c301..b709e53f5 100644 --- a/test/hasFlags/hasFlags.test.js +++ b/test/hasFlags/hasFlags.test.js @@ -1,14 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const hasFlags = require('./hasFlags.js'); -test('Testing hasFlags', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof hasFlags === 'function', 'hasFlags is a Function'); - t.pass('Tested by @chalarangelo on 16/02/2018'); - //t.deepEqual(hasFlags(args..), 'Expected'); - //t.equal(hasFlags(args..), 'Expected'); - //t.false(hasFlags(args..), 'Expected'); - //t.throws(hasFlags(args..), 'Expected'); - t.end(); +test('hasFlags is a Function', () => { + expect(hasFlags).toBeInstanceOf(Function); }); diff --git a/test/hashBrowser/hashBrowser.test.js b/test/hashBrowser/hashBrowser.test.js index 5464dd95d..e51fe281c 100644 --- a/test/hashBrowser/hashBrowser.test.js +++ b/test/hashBrowser/hashBrowser.test.js @@ -1,14 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const hashBrowser = require('./hashBrowser.js'); -test('Testing hashBrowser', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof hashBrowser === 'function', 'hashBrowser is a Function'); - t.pass('Tested by @chalarangelo on 16/02/2018'); - //t.deepEqual(hashBrowser(args..), 'Expected'); - //t.equal(hashBrowser(args..), 'Expected'); - //t.false(hashBrowser(args..), 'Expected'); - //t.throws(hashBrowser(args..), 'Expected'); - t.end(); +test('hashBrowser is a Function', () => { + expect(hashBrowser).toBeInstanceOf(Function); }); diff --git a/test/hashNode/hashNode.test.js b/test/hashNode/hashNode.test.js index 51345a607..250701418 100644 --- a/test/hashNode/hashNode.test.js +++ b/test/hashNode/hashNode.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const hashNode = require('./hashNode.js'); -test('Testing hashNode', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof hashNode === 'function', 'hashNode is a Function'); - hashNode(JSON.stringify({ a: 'a', b: [1, 2, 3, 4], foo: { c: 'bar' } })).then(v => t.equal(v, '04aa106279f5977f59f9067fa9712afc4aedc6f5862a8defc34552d8c7206393', 'Produces the appropriate hash')); - //t.deepEqual(hashNode(args..), 'Expected'); - //t.equal(hashNode(args..), 'Expected'); - //t.false(hashNode(args..), 'Expected'); - //t.throws(hashNode(args..), 'Expected'); - t.end(); +test('hashNode is a Function', () => { + expect(hashNode).toBeInstanceOf(Function); +}); +test('Produces the appropriate hash', () => { + hashNode(JSON.stringify({ a: 'a', b: [1, 2, 3, 4], foo: { c: 'bar' } })).then(v => expect(v).toBe('04aa106279f5977f59f9067fa9712afc4aedc6f5862a8defc34552d8c7206393')); }); diff --git a/test/head/head.test.js b/test/head/head.test.js index b6fa2d188..ec707eb30 100644 --- a/test/head/head.test.js +++ b/test/head/head.test.js @@ -1,21 +1,33 @@ -const test = require('tape'); +const expect = require('expect'); const head = require('./head.js'); -test('Testing head', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof head === 'function', 'head is a Function'); - t.true(head({ a: 1234}) === undefined, 'head({ a: 1234}) returns undefined'); - t.equal(head([1, 2, 3]), 1, "head([1, 2, 3]) returns 1"); - t.equal(head({ 0: false}), false, 'head({ 0: false}) returns false'); - t.equal(head('String'), 'S', 'head(String) returns S'); - t.throws(() => head(null), 'head(null) throws an Error'); - t.throws(() => head(undefined), 'head(undefined) throws an Error'); - t.throws(() => head(), 'head() throws an Error'); - - let start = new Date().getTime(); - head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]); - let end = new Date().getTime(); - t.true((end - start) < 2000, 'head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run'); - t.end(); -}); \ No newline at end of file +test('head is a Function', () => { + expect(head).toBeInstanceOf(Function); +}); +test('head({ a: 1234}) returns undefined', () => { + expect(head({ a: 1234}) === undefined).toBeTruthy(); +}); +test('head([1, 2, 3]) returns 1', () => { + expect(head([1, 2, 3])).toBe(1); +}); +test('head({ 0: false}) returns false', () => { + expect(head({ 0: false})).toBeFalsy(); +}); +test('head(String) returns S', () => { + expect(head('String')).toBe('S'); +}); +test('head(null) throws an Error', () => { + expect(() => { head(null); }).toThrow(); +}); +test('head(undefined) throws an Error', () => { + expect(() => { head(undefined); }).toThrow(); +}); +test('head() throws an Error', () => { + expect(() => { head(); }).toThrow(); +}); +let start = new Date().getTime(); +head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]); +let end = new Date().getTime(); +test('head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run', () => { + expect((end - start) < 2000).toBeTruthy(); +}); diff --git a/test/hexToRGB/hexToRGB.test.js b/test/hexToRGB/hexToRGB.test.js index 4b3d0fdd8..2f2bf427e 100644 --- a/test/hexToRGB/hexToRGB.test.js +++ b/test/hexToRGB/hexToRGB.test.js @@ -1,16 +1,15 @@ -const test = require('tape'); +const expect = require('expect'); const hexToRGB = require('./hexToRGB.js'); -test('Testing hexToRGB', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof hexToRGB === 'function', 'hexToRGB is a Function'); - t.equal(hexToRGB('#27ae60ff'), 'rgba(39, 174, 96, 255)', "Converts a color code to a rgb() or rgba() string"); - t.equal(hexToRGB('27ae60'), 'rgb(39, 174, 96)', "Converts a color code to a rgb() or rgba() string"); - t.equal(hexToRGB('#fff'), 'rgb(255, 255, 255)', "Converts a color code to a rgb() or rgba() string"); - //t.deepEqual(hexToRGB(args..), 'Expected'); - //t.equal(hexToRGB(args..), 'Expected'); - //t.false(hexToRGB(args..), 'Expected'); - //t.throws(hexToRGB(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('hexToRGB is a Function', () => { + expect(hexToRGB).toBeInstanceOf(Function); +}); +test('Converts a color code to a rgb() or rgba() string', () => { + expect(hexToRGB('#27ae60ff')).toBe('rgba(39, 174, 96, 255)'); +}); +test('Converts a color code to a rgb() or rgba() string', () => { + expect(hexToRGB('27ae60')).toBe('rgb(39, 174, 96)'); +}); +test('Converts a color code to a rgb() or rgba() string', () => { + expect(hexToRGB('#fff')).toBe('rgb(255, 255, 255)'); +}); diff --git a/test/hide/hide.test.js b/test/hide/hide.test.js index af1971858..7cfa1ec53 100644 --- a/test/hide/hide.test.js +++ b/test/hide/hide.test.js @@ -1,14 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const hide = require('./hide.js'); -test('Testing hide', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof hide === 'function', 'hide is a Function'); - t.pass('Tested by @chalarangelo on 16/02/2018'); - //t.deepEqual(hide(args..), 'Expected'); - //t.equal(hide(args..), 'Expected'); - //t.false(hide(args..), 'Expected'); - //t.throws(hide(args..), 'Expected'); - t.end(); +test('hide is a Function', () => { + expect(hide).toBeInstanceOf(Function); }); diff --git a/test/howManyTimes/howManyTimes.test.js b/test/howManyTimes/howManyTimes.test.js index 250b542ce..e0d7efe30 100644 --- a/test/howManyTimes/howManyTimes.test.js +++ b/test/howManyTimes/howManyTimes.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const howManyTimes = require('./howManyTimes.js'); -test('Testing howManyTimes', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof howManyTimes === 'function', 'howManyTimes is a Function'); - //t.deepEqual(howManyTimes(args..), 'Expected'); - //t.equal(howManyTimes(args..), 'Expected'); - //t.false(howManyTimes(args..), 'Expected'); - //t.throws(howManyTimes(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('howManyTimes is a Function', () => { + expect(howManyTimes).toBeInstanceOf(Function); +}); diff --git a/test/httpDelete/httpDelete.test.js b/test/httpDelete/httpDelete.test.js index d4edd42a9..6603d33bd 100644 --- a/test/httpDelete/httpDelete.test.js +++ b/test/httpDelete/httpDelete.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const httpDelete = require('./httpDelete.js'); -test('Testing httpDelete', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof httpDelete === 'function', 'httpDelete is a Function'); - //t.deepEqual(httpDelete(args..), 'Expected'); - //t.equal(httpDelete(args..), 'Expected'); - //t.false(httpDelete(args..), 'Expected'); - //t.throws(httpDelete(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('httpDelete is a Function', () => { + expect(httpDelete).toBeInstanceOf(Function); +}); diff --git a/test/httpGet/httpGet.test.js b/test/httpGet/httpGet.test.js index a23ff2131..5a19d5adc 100644 --- a/test/httpGet/httpGet.test.js +++ b/test/httpGet/httpGet.test.js @@ -1,640 +1,6 @@ -const test = require('tape'); -//const httpGet = require('./httpGet.js'); -// Override -const httpGet = (url, callback, err = console.error) => { - const request = new XMLHttpRequest(); - request.open('GET', url, true); - request.onload = () => callback(request.responseText); - request.onerror = () => err(request); - request.send(); -}; +const expect = require('expect'); +const httpGet = require('./httpGet.js'); -test('Testing httpGet', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof httpGet === 'function', 'httpGet is a Function'); - httpGet('https://jsonplaceholder.typicode.com/posts/1', response => { - t.deepEqual(JSON.parse(response), { - userId: 1, - id: 1, - title: - 'sunt aut facere repellat provident occaecati excepturi optio reprehenderit', - body: - 'quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto', - }, 'Sends a GET request'); - }); - - //t.deepEqual(httpGet(args..), 'Expected'); - //t.equal(httpGet(args..), 'Expected'); - //t.false(httpGet(args..), 'Expected'); - //t.throws(httpGet(args..), 'Expected'); - t.end(); +test('httpGet is a Function', () => { + expect(httpGet).toBeInstanceOf(Function); }); -// Custom implementation of XMLHttpRequest for the requirements of this snippet. -// Based on https://github.com/driverdan/node-XMLHttpRequest -var Url = require("url"); -var spawn = require("child_process").spawn; -var fs = require("fs"); -XMLHttpRequest = function() { - "use strict"; - - /** - * Private variables - */ - var self = this; - var http = require("http"); - var https = require("https"); - - // Holds http.js objects - var request; - var response; - - // Request settings - var settings = {}; - - // Disable header blacklist. - // Not part of XHR specs. - var disableHeaderCheck = false; - - // Set some default headers - var defaultHeaders = { - "User-Agent": "node-XMLHttpRequest", - "Accept": "*/*", - }; - - var headers = {}; - var headersCase = {}; - - // These headers are not user setable. - // The following are allowed but banned in the spec: - // * user-agent - var forbiddenRequestHeaders = [ - "accept-charset", - "accept-encoding", - "access-control-request-headers", - "access-control-request-method", - "connection", - "content-length", - "content-transfer-encoding", - "cookie", - "cookie2", - "date", - "expect", - "host", - "keep-alive", - "origin", - "referer", - "te", - "trailer", - "transfer-encoding", - "upgrade", - "via" - ]; - - // These request methods are not allowed - var forbiddenRequestMethods = [ - "TRACE", - "TRACK", - "CONNECT" - ]; - - // Send flag - var sendFlag = false; - // Error flag, used when errors occur or abort is called - var errorFlag = false; - - // Event listeners - var listeners = {}; - - /** - * Constants - */ - - this.UNSENT = 0; - this.OPENED = 1; - this.HEADERS_RECEIVED = 2; - this.LOADING = 3; - this.DONE = 4; - - /** - * Public vars - */ - - // Current state - this.readyState = this.UNSENT; - - // default ready state change handler in case one is not set or is set late - this.onreadystatechange = null; - - // Result & response - this.responseText = ""; - this.responseXML = ""; - this.status = null; - this.statusText = null; - - // Whether cross-site Access-Control requests should be made using - // credentials such as cookies or authorization headers - this.withCredentials = false; - - /** - * Private methods - */ - - /** - * Check if the specified header is allowed. - * - * @param string header Header to validate - * @return boolean False if not allowed, otherwise true - */ - var isAllowedHttpHeader = function(header) { - return disableHeaderCheck || (header && forbiddenRequestHeaders.indexOf(header.toLowerCase()) === -1); - }; - - /** - * Check if the specified method is allowed. - * - * @param string method Request method to validate - * @return boolean False if not allowed, otherwise true - */ - var isAllowedHttpMethod = function(method) { - return (method && forbiddenRequestMethods.indexOf(method) === -1); - }; - - /** - * Public methods - */ - - /** - * Open the connection. Currently supports local server requests. - * - * @param string method Connection method (eg GET, POST) - * @param string url URL for the connection. - * @param boolean async Asynchronous connection. Default is true. - * @param string user Username for basic authentication (optional) - * @param string password Password for basic authentication (optional) - */ - this.open = function(method, url, async, user, password) { - this.abort(); - errorFlag = false; - - // Check for valid request method - if (!isAllowedHttpMethod(method)) { - throw new Error("SecurityError: Request method not allowed"); - } - - settings = { - "method": method, - "url": url.toString(), - "async": (typeof async !== "boolean" ? true : async), - "user": user || null, - "password": password || null - }; - - setState(this.OPENED); - }; - - /** - * Disables or enables isAllowedHttpHeader() check the request. Enabled by default. - * This does not conform to the W3C spec. - * - * @param boolean state Enable or disable header checking. - */ - this.setDisableHeaderCheck = function(state) { - disableHeaderCheck = state; - }; - - /** - * Sets a header for the request or appends the value if one is already set. - * - * @param string header Header name - * @param string value Header value - */ - this.setRequestHeader = function(header, value) { - if (this.readyState !== this.OPENED) { - throw new Error("INVALID_STATE_ERR: setRequestHeader can only be called when state is OPEN"); - } - if (!isAllowedHttpHeader(header)) { - console.warn("Refused to set unsafe header \"" + header + "\""); - return; - } - if (sendFlag) { - throw new Error("INVALID_STATE_ERR: send flag is true"); - } - header = headersCase[header.toLowerCase()] || header; - headersCase[header.toLowerCase()] = header; - headers[header] = headers[header] ? headers[header] + ', ' + value : value; - }; - - /** - * Gets a header from the server response. - * - * @param string header Name of header to get. - * @return string Text of the header or null if it doesn't exist. - */ - this.getResponseHeader = function(header) { - if (typeof header === "string" - && this.readyState > this.OPENED - && response - && response.headers - && response.headers[header.toLowerCase()] - && !errorFlag - ) { - return response.headers[header.toLowerCase()]; - } - - return null; - }; - - /** - * Gets all the response headers. - * - * @return string A string with all response headers separated by CR+LF - */ - this.getAllResponseHeaders = function() { - if (this.readyState < this.HEADERS_RECEIVED || errorFlag) { - return ""; - } - var result = ""; - - for (var i in response.headers) { - // Cookie headers are excluded - if (i !== "set-cookie" && i !== "set-cookie2") { - result += i + ": " + response.headers[i] + "\r\n"; - } - } - return result.substr(0, result.length - 2); - }; - - /** - * Gets a request header - * - * @param string name Name of header to get - * @return string Returns the request header or empty string if not set - */ - this.getRequestHeader = function(name) { - if (typeof name === "string" && headersCase[name.toLowerCase()]) { - return headers[headersCase[name.toLowerCase()]]; - } - - return ""; - }; - - /** - * Sends the request to the server. - * - * @param string data Optional data to send as request body. - */ - this.send = function(data) { - if (this.readyState !== this.OPENED) { - throw new Error("INVALID_STATE_ERR: connection must be opened before send() is called"); - } - - if (sendFlag) { - throw new Error("INVALID_STATE_ERR: send has already been called"); - } - - var ssl = false, local = false; - var url = Url.parse(settings.url); - var host; - // Determine the server - switch (url.protocol) { - case "https:": - ssl = true; - // SSL & non-SSL both need host, no break here. - case "http:": - host = url.hostname; - break; - - case "file:": - local = true; - break; - - case undefined: - case null: - case "": - host = "localhost"; - break; - - default: - throw new Error("Protocol not supported."); - } - - // Load files off the local filesystem (file://) - if (local) { - if (settings.method !== "GET") { - throw new Error("XMLHttpRequest: Only GET method is supported"); - } - - if (settings.async) { - fs.readFile(url.pathname, "utf8", function(error, data) { - if (error) { - self.handleError(error); - } else { - self.status = 200; - self.responseText = data; - setState(self.DONE); - } - }); - } else { - try { - this.responseText = fs.readFileSync(url.pathname, "utf8"); - this.status = 200; - setState(self.DONE); - } catch(e) { - this.handleError(e); - } - } - - return; - } - - // Default to port 80. If accessing localhost on another port be sure - // to use http://localhost:port/path - var port = url.port || (ssl ? 443 : 80); - // Add query string if one is used - var uri = url.pathname + (url.search ? url.search : ""); - - // Set the defaults if they haven't been set - for (var name in defaultHeaders) { - if (!headersCase[name.toLowerCase()]) { - headers[name] = defaultHeaders[name]; - } - } - - // Set the Host header or the server may reject the request - headers.Host = host; - if (!((ssl && port === 443) || port === 80)) { - headers.Host += ":" + url.port; - } - - // Set Basic Auth if necessary - if (settings.user) { - if (typeof settings.password === "undefined") { - settings.password = ""; - } - var authBuf = new Buffer(settings.user + ":" + settings.password); - headers.Authorization = "Basic " + authBuf.toString("base64"); - } - - // Set content length header - if (settings.method === "GET" || settings.method === "HEAD") { - data = null; - } else if (data) { - headers["Content-Length"] = Buffer.isBuffer(data) ? data.length : Buffer.byteLength(data); - - if (!headers["Content-Type"]) { - headers["Content-Type"] = "text/plain;charset=UTF-8"; - } - } else if (settings.method === "POST") { - // For a post with no data set Content-Length: 0. - // This is required by buggy servers that don't meet the specs. - headers["Content-Length"] = 0; - } - - var options = { - host: host, - port: port, - path: uri, - method: settings.method, - headers: headers, - agent: false, - withCredentials: self.withCredentials - }; - - // Reset error flag - errorFlag = false; - - // Handle async requests - if (settings.async) { - // Use the proper protocol - var doRequest = ssl ? https.request : http.request; - - // Request is being sent, set send flag - sendFlag = true; - - // As per spec, this is called here for historical reasons. - self.dispatchEvent("readystatechange"); - - // Handler for the response - var responseHandler = function responseHandler(resp) { - // Set response var to the response we got back - // This is so it remains accessable outside this scope - response = resp; - // Check for redirect - // @TODO Prevent looped redirects - if (response.statusCode === 301 || response.statusCode === 302 || response.statusCode === 303 || response.statusCode === 307) { - // Change URL to the redirect location - settings.url = response.headers.location; - var url = Url.parse(settings.url); - // Set host var in case it's used later - host = url.hostname; - // Options for the new request - var newOptions = { - hostname: url.hostname, - port: url.port, - path: url.path, - method: response.statusCode === 303 ? "GET" : settings.method, - headers: headers, - withCredentials: self.withCredentials - }; - - // Issue the new request - request = doRequest(newOptions, responseHandler).on("error", errorHandler); - request.end(); - // @TODO Check if an XHR event needs to be fired here - return; - } - - response.setEncoding("utf8"); - - setState(self.HEADERS_RECEIVED); - self.status = response.statusCode; - - response.on("data", function(chunk) { - // Make sure there's some data - if (chunk) { - self.responseText += chunk; - } - // Don't emit state changes if the connection has been aborted. - if (sendFlag) { - setState(self.LOADING); - } - }); - - response.on("end", function() { - if (sendFlag) { - // Discard the end event if the connection has been aborted - setState(self.DONE); - sendFlag = false; - } - }); - - response.on("error", function(error) { - self.handleError(error); - }); - }; - - // Error handler for the request - var errorHandler = function errorHandler(error) { - self.handleError(error); - }; - - // Create the request - request = doRequest(options, responseHandler).on("error", errorHandler); - - // Node 0.4 and later won't accept empty data. Make sure it's needed. - if (data) { - request.write(data); - } - - request.end(); - - self.dispatchEvent("loadstart"); - } else { // Synchronous - // Create a temporary file for communication with the other Node process - var contentFile = ".node-xmlhttprequest-content-" + process.pid; - var syncFile = ".node-xmlhttprequest-sync-" + process.pid; - fs.writeFileSync(syncFile, "", "utf8"); - // The async request the other Node process executes - var execString = "var http = require('http'), https = require('https'), fs = require('fs');" - + "var doRequest = http" + (ssl ? "s" : "") + ".request;" - + "var options = " + JSON.stringify(options) + ";" - + "var responseText = '';" - + "var req = doRequest(options, function(response) {" - + "response.setEncoding('utf8');" - + "response.on('data', function(chunk) {" - + " responseText += chunk;" - + "});" - + "response.on('end', function() {" - + "fs.writeFileSync('" + contentFile + "', JSON.stringify({err: null, data: {statusCode: response.statusCode, headers: response.headers, text: responseText}}), 'utf8');" - + "fs.unlinkSync('" + syncFile + "');" - + "});" - + "response.on('error', function(error) {" - + "fs.writeFileSync('" + contentFile + "', JSON.stringify({err: error}), 'utf8');" - + "fs.unlinkSync('" + syncFile + "');" - + "});" - + "}).on('error', function(error) {" - + "fs.writeFileSync('" + contentFile + "', JSON.stringify({err: error}), 'utf8');" - + "fs.unlinkSync('" + syncFile + "');" - + "});" - + (data ? "req.write('" + JSON.stringify(data).slice(1,-1).replace(/'/g, "\\'") + "');":"") - + "req.end();"; - // Start the other Node Process, executing this string - var syncProc = spawn(process.argv[0], ["-e", execString]); - while(fs.existsSync(syncFile)) { - // Wait while the sync file is empty - } - var resp = JSON.parse(fs.readFileSync(contentFile, 'utf8')); - // Kill the child process once the file has data - syncProc.stdin.end(); - // Remove the temporary file - fs.unlinkSync(contentFile); - - if (resp.err) { - self.handleError(resp.err); - } else { - response = resp.data; - self.status = resp.data.statusCode; - self.responseText = resp.data.text; - setState(self.DONE); - } - } - }; - - /** - * Called when an error is encountered to deal with it. - */ - this.handleError = function(error) { - this.status = 0; - this.statusText = error; - this.responseText = error.stack; - errorFlag = true; - setState(this.DONE); - this.dispatchEvent('error'); - }; - - /** - * Aborts a request. - */ - this.abort = function() { - if (request) { - request.abort(); - request = null; - } - - headers = defaultHeaders; - this.status = 0; - this.responseText = ""; - this.responseXML = ""; - - errorFlag = true; - - if (this.readyState !== this.UNSENT - && (this.readyState !== this.OPENED || sendFlag) - && this.readyState !== this.DONE) { - sendFlag = false; - setState(this.DONE); - } - this.readyState = this.UNSENT; - this.dispatchEvent('abort'); - }; - - /** - * Adds an event listener. Preferred method of binding to events. - */ - this.addEventListener = function(event, callback) { - if (!(event in listeners)) { - listeners[event] = []; - } - // Currently allows duplicate callbacks. Should it? - listeners[event].push(callback); - }; - - /** - * Remove an event callback that has already been bound. - * Only works on the matching funciton, cannot be a copy. - */ - this.removeEventListener = function(event, callback) { - if (event in listeners) { - // Filter will return a new array with the callback removed - listeners[event] = listeners[event].filter(function(ev) { - return ev !== callback; - }); - } - }; - - /** - * Dispatch any events, including both "on" methods and events attached using addEventListener. - */ - this.dispatchEvent = function(event) { - if (typeof self["on" + event] === "function") { - self["on" + event](); - } - if (event in listeners) { - for (var i = 0, len = listeners[event].length; i < len; i++) { - listeners[event][i].call(self); - } - } - }; - - /** - * Changes readyState and calls onreadystatechange. - * - * @param int state New state - */ - var setState = function(state) { - if (state == self.LOADING || self.readyState !== state) { - self.readyState = state; - - if (settings.async || self.readyState < self.OPENED || self.readyState === self.DONE) { - self.dispatchEvent("readystatechange"); - } - - if (self.readyState === self.DONE && !errorFlag) { - self.dispatchEvent("load"); - // @TODO figure out InspectorInstrumentation::didLoadXHR(cookie) - self.dispatchEvent("loadend"); - } - } - }; -}; diff --git a/test/httpPost/httpPost.test.js b/test/httpPost/httpPost.test.js index 05fc7f421..13ec36ccd 100644 --- a/test/httpPost/httpPost.test.js +++ b/test/httpPost/httpPost.test.js @@ -1,637 +1,6 @@ -const test = require('tape'); -//const httpPost = require('./httpPost.js'); -const httpPost = (url, data, callback, err = console.error) => { - const request = new XMLHttpRequest(); - request.open('POST', url, true); - request.setRequestHeader('Content-type', 'application/json; charset=utf-8'); - request.onload = () => callback(request.responseText); - request.onerror = () => err(request); - request.send(data); -}; -test('Testing httpPost', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof httpPost === 'function', 'httpPost is a Function'); - const data = { - title: 'foo', - body: 'bar', - userId: 1 - }; - httpPost('https://jsonplaceholder.typicode.com/posts', JSON.stringify(data), response => { - t.deepEqual(JSON.parse(response).id, 101, 'Sends a POST request'); - }); - //t.deepEqual(httpPost(args..), 'Expected'); - //t.equal(httpPost(args..), 'Expected'); - //t.false(httpPost(args..), 'Expected'); - //t.throws(httpPost(args..), 'Expected'); - t.end(); +const expect = require('expect'); +const httpPost = require('./httpPost.js'); + +test('httpPost is a Function', () => { + expect(httpPost).toBeInstanceOf(Function); }); - -// Custom implementation of XMLHttpRequest for the requirements of this snippet. -// Based on https://github.com/driverdan/node-XMLHttpRequest -var Url = require("url"); -var spawn = require("child_process").spawn; -var fs = require("fs"); -XMLHttpRequest = function() { - "use strict"; - - /** - * Private variables - */ - var self = this; - var http = require("http"); - var https = require("https"); - - // Holds http.js objects - var request; - var response; - - // Request settings - var settings = {}; - - // Disable header blacklist. - // Not part of XHR specs. - var disableHeaderCheck = false; - - // Set some default headers - var defaultHeaders = { - "User-Agent": "node-XMLHttpRequest", - "Accept": "*/*", - }; - - var headers = {}; - var headersCase = {}; - - // These headers are not user setable. - // The following are allowed but banned in the spec: - // * user-agent - var forbiddenRequestHeaders = [ - "accept-charset", - "accept-encoding", - "access-control-request-headers", - "access-control-request-method", - "connection", - "content-length", - "content-transfer-encoding", - "cookie", - "cookie2", - "date", - "expect", - "host", - "keep-alive", - "origin", - "referer", - "te", - "trailer", - "transfer-encoding", - "upgrade", - "via" - ]; - - // These request methods are not allowed - var forbiddenRequestMethods = [ - "TRACE", - "TRACK", - "CONNECT" - ]; - - // Send flag - var sendFlag = false; - // Error flag, used when errors occur or abort is called - var errorFlag = false; - - // Event listeners - var listeners = {}; - - /** - * Constants - */ - - this.UNSENT = 0; - this.OPENED = 1; - this.HEADERS_RECEIVED = 2; - this.LOADING = 3; - this.DONE = 4; - - /** - * Public vars - */ - - // Current state - this.readyState = this.UNSENT; - - // default ready state change handler in case one is not set or is set late - this.onreadystatechange = null; - - // Result & response - this.responseText = ""; - this.responseXML = ""; - this.status = null; - this.statusText = null; - - // Whether cross-site Access-Control requests should be made using - // credentials such as cookies or authorization headers - this.withCredentials = false; - - /** - * Private methods - */ - - /** - * Check if the specified header is allowed. - * - * @param string header Header to validate - * @return boolean False if not allowed, otherwise true - */ - var isAllowedHttpHeader = function(header) { - return disableHeaderCheck || (header && forbiddenRequestHeaders.indexOf(header.toLowerCase()) === -1); - }; - - /** - * Check if the specified method is allowed. - * - * @param string method Request method to validate - * @return boolean False if not allowed, otherwise true - */ - var isAllowedHttpMethod = function(method) { - return (method && forbiddenRequestMethods.indexOf(method) === -1); - }; - - /** - * Public methods - */ - - /** - * Open the connection. Currently supports local server requests. - * - * @param string method Connection method (eg GET, POST) - * @param string url URL for the connection. - * @param boolean async Asynchronous connection. Default is true. - * @param string user Username for basic authentication (optional) - * @param string password Password for basic authentication (optional) - */ - this.open = function(method, url, async, user, password) { - this.abort(); - errorFlag = false; - - // Check for valid request method - if (!isAllowedHttpMethod(method)) { - throw new Error("SecurityError: Request method not allowed"); - } - - settings = { - "method": method, - "url": url.toString(), - "async": (typeof async !== "boolean" ? true : async), - "user": user || null, - "password": password || null - }; - - setState(this.OPENED); - }; - - /** - * Disables or enables isAllowedHttpHeader() check the request. Enabled by default. - * This does not conform to the W3C spec. - * - * @param boolean state Enable or disable header checking. - */ - this.setDisableHeaderCheck = function(state) { - disableHeaderCheck = state; - }; - - /** - * Sets a header for the request or appends the value if one is already set. - * - * @param string header Header name - * @param string value Header value - */ - this.setRequestHeader = function(header, value) { - if (this.readyState !== this.OPENED) { - throw new Error("INVALID_STATE_ERR: setRequestHeader can only be called when state is OPEN"); - } - if (!isAllowedHttpHeader(header)) { - console.warn("Refused to set unsafe header \"" + header + "\""); - return; - } - if (sendFlag) { - throw new Error("INVALID_STATE_ERR: send flag is true"); - } - header = headersCase[header.toLowerCase()] || header; - headersCase[header.toLowerCase()] = header; - headers[header] = headers[header] ? headers[header] + ', ' + value : value; - }; - - /** - * Gets a header from the server response. - * - * @param string header Name of header to get. - * @return string Text of the header or null if it doesn't exist. - */ - this.getResponseHeader = function(header) { - if (typeof header === "string" - && this.readyState > this.OPENED - && response - && response.headers - && response.headers[header.toLowerCase()] - && !errorFlag - ) { - return response.headers[header.toLowerCase()]; - } - - return null; - }; - - /** - * Gets all the response headers. - * - * @return string A string with all response headers separated by CR+LF - */ - this.getAllResponseHeaders = function() { - if (this.readyState < this.HEADERS_RECEIVED || errorFlag) { - return ""; - } - var result = ""; - - for (var i in response.headers) { - // Cookie headers are excluded - if (i !== "set-cookie" && i !== "set-cookie2") { - result += i + ": " + response.headers[i] + "\r\n"; - } - } - return result.substr(0, result.length - 2); - }; - - /** - * Gets a request header - * - * @param string name Name of header to get - * @return string Returns the request header or empty string if not set - */ - this.getRequestHeader = function(name) { - if (typeof name === "string" && headersCase[name.toLowerCase()]) { - return headers[headersCase[name.toLowerCase()]]; - } - - return ""; - }; - - /** - * Sends the request to the server. - * - * @param string data Optional data to send as request body. - */ - this.send = function(data) { - if (this.readyState !== this.OPENED) { - throw new Error("INVALID_STATE_ERR: connection must be opened before send() is called"); - } - - if (sendFlag) { - throw new Error("INVALID_STATE_ERR: send has already been called"); - } - - var ssl = false, local = false; - var url = Url.parse(settings.url); - var host; - // Determine the server - switch (url.protocol) { - case "https:": - ssl = true; - // SSL & non-SSL both need host, no break here. - case "http:": - host = url.hostname; - break; - - case "file:": - local = true; - break; - - case undefined: - case null: - case "": - host = "localhost"; - break; - - default: - throw new Error("Protocol not supported."); - } - - // Load files off the local filesystem (file://) - if (local) { - if (settings.method !== "GET") { - throw new Error("XMLHttpRequest: Only GET method is supported"); - } - - if (settings.async) { - fs.readFile(url.pathname, "utf8", function(error, data) { - if (error) { - self.handleError(error); - } else { - self.status = 200; - self.responseText = data; - setState(self.DONE); - } - }); - } else { - try { - this.responseText = fs.readFileSync(url.pathname, "utf8"); - this.status = 200; - setState(self.DONE); - } catch(e) { - this.handleError(e); - } - } - - return; - } - - // Default to port 80. If accessing localhost on another port be sure - // to use http://localhost:port/path - var port = url.port || (ssl ? 443 : 80); - // Add query string if one is used - var uri = url.pathname + (url.search ? url.search : ""); - - // Set the defaults if they haven't been set - for (var name in defaultHeaders) { - if (!headersCase[name.toLowerCase()]) { - headers[name] = defaultHeaders[name]; - } - } - - // Set the Host header or the server may reject the request - headers.Host = host; - if (!((ssl && port === 443) || port === 80)) { - headers.Host += ":" + url.port; - } - - // Set Basic Auth if necessary - if (settings.user) { - if (typeof settings.password === "undefined") { - settings.password = ""; - } - var authBuf = new Buffer(settings.user + ":" + settings.password); - headers.Authorization = "Basic " + authBuf.toString("base64"); - } - - // Set content length header - if (settings.method === "GET" || settings.method === "HEAD") { - data = null; - } else if (data) { - headers["Content-Length"] = Buffer.isBuffer(data) ? data.length : Buffer.byteLength(data); - - if (!headers["Content-Type"]) { - headers["Content-Type"] = "text/plain;charset=UTF-8"; - } - } else if (settings.method === "POST") { - // For a post with no data set Content-Length: 0. - // This is required by buggy servers that don't meet the specs. - headers["Content-Length"] = 0; - } - - var options = { - host: host, - port: port, - path: uri, - method: settings.method, - headers: headers, - agent: false, - withCredentials: self.withCredentials - }; - - // Reset error flag - errorFlag = false; - - // Handle async requests - if (settings.async) { - // Use the proper protocol - var doRequest = ssl ? https.request : http.request; - - // Request is being sent, set send flag - sendFlag = true; - - // As per spec, this is called here for historical reasons. - self.dispatchEvent("readystatechange"); - - // Handler for the response - var responseHandler = function responseHandler(resp) { - // Set response var to the response we got back - // This is so it remains accessable outside this scope - response = resp; - // Check for redirect - // @TODO Prevent looped redirects - if (response.statusCode === 301 || response.statusCode === 302 || response.statusCode === 303 || response.statusCode === 307) { - // Change URL to the redirect location - settings.url = response.headers.location; - var url = Url.parse(settings.url); - // Set host var in case it's used later - host = url.hostname; - // Options for the new request - var newOptions = { - hostname: url.hostname, - port: url.port, - path: url.path, - method: response.statusCode === 303 ? "GET" : settings.method, - headers: headers, - withCredentials: self.withCredentials - }; - - // Issue the new request - request = doRequest(newOptions, responseHandler).on("error", errorHandler); - request.end(); - // @TODO Check if an XHR event needs to be fired here - return; - } - - response.setEncoding("utf8"); - - setState(self.HEADERS_RECEIVED); - self.status = response.statusCode; - - response.on("data", function(chunk) { - // Make sure there's some data - if (chunk) { - self.responseText += chunk; - } - // Don't emit state changes if the connection has been aborted. - if (sendFlag) { - setState(self.LOADING); - } - }); - - response.on("end", function() { - if (sendFlag) { - // Discard the end event if the connection has been aborted - setState(self.DONE); - sendFlag = false; - } - }); - - response.on("error", function(error) { - self.handleError(error); - }); - }; - - // Error handler for the request - var errorHandler = function errorHandler(error) { - self.handleError(error); - }; - - // Create the request - request = doRequest(options, responseHandler).on("error", errorHandler); - - // Node 0.4 and later won't accept empty data. Make sure it's needed. - if (data) { - request.write(data); - } - - request.end(); - - self.dispatchEvent("loadstart"); - } else { // Synchronous - // Create a temporary file for communication with the other Node process - var contentFile = ".node-xmlhttprequest-content-" + process.pid; - var syncFile = ".node-xmlhttprequest-sync-" + process.pid; - fs.writeFileSync(syncFile, "", "utf8"); - // The async request the other Node process executes - var execString = "var http = require('http'), https = require('https'), fs = require('fs');" - + "var doRequest = http" + (ssl ? "s" : "") + ".request;" - + "var options = " + JSON.stringify(options) + ";" - + "var responseText = '';" - + "var req = doRequest(options, function(response) {" - + "response.setEncoding('utf8');" - + "response.on('data', function(chunk) {" - + " responseText += chunk;" - + "});" - + "response.on('end', function() {" - + "fs.writeFileSync('" + contentFile + "', JSON.stringify({err: null, data: {statusCode: response.statusCode, headers: response.headers, text: responseText}}), 'utf8');" - + "fs.unlinkSync('" + syncFile + "');" - + "});" - + "response.on('error', function(error) {" - + "fs.writeFileSync('" + contentFile + "', JSON.stringify({err: error}), 'utf8');" - + "fs.unlinkSync('" + syncFile + "');" - + "});" - + "}).on('error', function(error) {" - + "fs.writeFileSync('" + contentFile + "', JSON.stringify({err: error}), 'utf8');" - + "fs.unlinkSync('" + syncFile + "');" - + "});" - + (data ? "req.write('" + JSON.stringify(data).slice(1,-1).replace(/'/g, "\\'") + "');":"") - + "req.end();"; - // Start the other Node Process, executing this string - var syncProc = spawn(process.argv[0], ["-e", execString]); - while(fs.existsSync(syncFile)) { - // Wait while the sync file is empty - } - var resp = JSON.parse(fs.readFileSync(contentFile, 'utf8')); - // Kill the child process once the file has data - syncProc.stdin.end(); - // Remove the temporary file - fs.unlinkSync(contentFile); - - if (resp.err) { - self.handleError(resp.err); - } else { - response = resp.data; - self.status = resp.data.statusCode; - self.responseText = resp.data.text; - setState(self.DONE); - } - } - }; - - /** - * Called when an error is encountered to deal with it. - */ - this.handleError = function(error) { - this.status = 0; - this.statusText = error; - this.responseText = error.stack; - errorFlag = true; - setState(this.DONE); - this.dispatchEvent('error'); - }; - - /** - * Aborts a request. - */ - this.abort = function() { - if (request) { - request.abort(); - request = null; - } - - headers = defaultHeaders; - this.status = 0; - this.responseText = ""; - this.responseXML = ""; - - errorFlag = true; - - if (this.readyState !== this.UNSENT - && (this.readyState !== this.OPENED || sendFlag) - && this.readyState !== this.DONE) { - sendFlag = false; - setState(this.DONE); - } - this.readyState = this.UNSENT; - this.dispatchEvent('abort'); - }; - - /** - * Adds an event listener. Preferred method of binding to events. - */ - this.addEventListener = function(event, callback) { - if (!(event in listeners)) { - listeners[event] = []; - } - // Currently allows duplicate callbacks. Should it? - listeners[event].push(callback); - }; - - /** - * Remove an event callback that has already been bound. - * Only works on the matching funciton, cannot be a copy. - */ - this.removeEventListener = function(event, callback) { - if (event in listeners) { - // Filter will return a new array with the callback removed - listeners[event] = listeners[event].filter(function(ev) { - return ev !== callback; - }); - } - }; - - /** - * Dispatch any events, including both "on" methods and events attached using addEventListener. - */ - this.dispatchEvent = function(event) { - if (typeof self["on" + event] === "function") { - self["on" + event](); - } - if (event in listeners) { - for (var i = 0, len = listeners[event].length; i < len; i++) { - listeners[event][i].call(self); - } - } - }; - - /** - * Changes readyState and calls onreadystatechange. - * - * @param int state New state - */ - var setState = function(state) { - if (state == self.LOADING || self.readyState !== state) { - self.readyState = state; - - if (settings.async || self.readyState < self.OPENED || self.readyState === self.DONE) { - self.dispatchEvent("readystatechange"); - } - - if (self.readyState === self.DONE && !errorFlag) { - self.dispatchEvent("load"); - // @TODO figure out InspectorInstrumentation::didLoadXHR(cookie) - self.dispatchEvent("loadend"); - } - } - }; -}; diff --git a/test/httpPut/httpPut.test.js b/test/httpPut/httpPut.test.js index d7c3f1e86..d76892baf 100644 --- a/test/httpPut/httpPut.test.js +++ b/test/httpPut/httpPut.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const httpPut = require('./httpPut.js'); -test('Testing httpPut', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof httpPut === 'function', 'httpPut is a Function'); - //t.deepEqual(httpPut(args..), 'Expected'); - //t.equal(httpPut(args..), 'Expected'); - //t.false(httpPut(args..), 'Expected'); - //t.throws(httpPut(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('httpPut is a Function', () => { + expect(httpPut).toBeInstanceOf(Function); +}); diff --git a/test/httpsRedirect/httpsRedirect.test.js b/test/httpsRedirect/httpsRedirect.test.js index f86baf715..68dd20f32 100644 --- a/test/httpsRedirect/httpsRedirect.test.js +++ b/test/httpsRedirect/httpsRedirect.test.js @@ -1,14 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const httpsRedirect = require('./httpsRedirect.js'); -test('Testing httpsRedirect', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof httpsRedirect === 'function', 'httpsRedirect is a Function'); - t.pass('Tested on 09/02/2018 by @chalarangelo'); - //t.deepEqual(httpsRedirect(args..), 'Expected'); - //t.equal(httpsRedirect(args..), 'Expected'); - //t.false(httpsRedirect(args..), 'Expected'); - //t.throws(httpsRedirect(args..), 'Expected'); - t.end(); +test('httpsRedirect is a Function', () => { + expect(httpsRedirect).toBeInstanceOf(Function); }); diff --git a/test/hz/hz.test.js b/test/hz/hz.test.js index afd054442..58d0b4678 100644 --- a/test/hz/hz.test.js +++ b/test/hz/hz.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const hz = require('./hz.js'); -test('Testing hz', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof hz === 'function', 'hz is a Function'); - //t.deepEqual(hz(args..), 'Expected'); - //t.equal(hz(args..), 'Expected'); - //t.false(hz(args..), 'Expected'); - //t.throws(hz(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('hz is a Function', () => { + expect(hz).toBeInstanceOf(Function); +}); diff --git a/test/inRange/inRange.test.js b/test/inRange/inRange.test.js index 10b2a2bec..c72efec2d 100644 --- a/test/inRange/inRange.test.js +++ b/test/inRange/inRange.test.js @@ -1,17 +1,18 @@ -const test = require('tape'); +const expect = require('expect'); const inRange = require('./inRange.js'); -test('Testing inRange', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof inRange === 'function', 'inRange is a Function'); - t.equal(inRange(3, 2, 5), true, "The given number falls within the given range"); - t.equal(inRange(3, 4), true, "The given number falls within the given range"); - t.equal(inRange(2, 3, 5), false, "The given number does not falls within the given range"); - t.equal(inRange(3, 2), false, "The given number does not falls within the given range"); - //t.deepEqual(inRange(args..), 'Expected'); - //t.equal(inRange(args..), 'Expected'); - //t.false(inRange(args..), 'Expected'); - //t.throws(inRange(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('inRange is a Function', () => { + expect(inRange).toBeInstanceOf(Function); +}); +test('The given number falls within the given range', () => { + expect(inRange(3, 2, 5)).toBeTruthy(); +}); +test('The given number falls within the given range', () => { + expect(inRange(3, 4)).toBeTruthy(); +}); +test('The given number does not falls within the given range', () => { + expect(inRange(2, 3, 5)).toBeFalsy(); +}); +test('The given number does not falls within the given range', () => { + expect(inRange(3, 2)).toBeFalsy(); +}); diff --git a/test/indexOfAll/indexOfAll.test.js b/test/indexOfAll/indexOfAll.test.js index d9c681a65..0747df466 100644 --- a/test/indexOfAll/indexOfAll.test.js +++ b/test/indexOfAll/indexOfAll.test.js @@ -1,15 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const indexOfAll = require('./indexOfAll.js'); -test('Testing indexOfAll', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof indexOfAll === 'function', 'indexOfAll is a Function'); - t.deepEqual(indexOfAll([1, 2, 3, 1, 2, 3], 1), [0,3], "Returns all indices of val in an array"); - t.deepEqual(indexOfAll([1, 2, 3], 4), [], "Returns all indices of val in an array"); - //t.deepEqual(indexOfAll(args..), 'Expected'); - //t.equal(indexOfAll(args..), 'Expected'); - //t.false(indexOfAll(args..), 'Expected'); - //t.throws(indexOfAll(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('indexOfAll is a Function', () => { + expect(indexOfAll).toBeInstanceOf(Function); +}); +test('Returns all indices of val in an array', () => { + expect(indexOfAll([1, 2, 3, 1, 2, 3], 1)).toEqual([0,3]); +}); +test('Returns all indices of val in an array', () => { + expect(indexOfAll([1, 2, 3], 4)).toEqual([]); +}); diff --git a/test/initial/initial.test.js b/test/initial/initial.test.js index d4b0b76d6..2c8a8b944 100644 --- a/test/initial/initial.test.js +++ b/test/initial/initial.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const initial = require('./initial.js'); -test('Testing initial', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof initial === 'function', 'initial is a Function'); - t.deepEqual(initial([1, 2, 3]), [1, 2], "Returns all the elements of an array except the last one"); - //t.deepEqual(initial(args..), 'Expected'); - //t.equal(initial(args..), 'Expected'); - //t.false(initial(args..), 'Expected'); - //t.throws(initial(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('initial is a Function', () => { + expect(initial).toBeInstanceOf(Function); +}); +test('Returns all the elements of an array except the last one', () => { + expect(initial([1, 2, 3])).toEqual([1, 2]); +}); diff --git a/test/initialize2DArray/initialize2DArray.test.js b/test/initialize2DArray/initialize2DArray.test.js index d2436a46a..c0e33de36 100644 --- a/test/initialize2DArray/initialize2DArray.test.js +++ b/test/initialize2DArray/initialize2DArray.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const initialize2DArray = require('./initialize2DArray.js'); -test('Testing initialize2DArray', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof initialize2DArray === 'function', 'initialize2DArray is a Function'); - t.deepEqual(initialize2DArray(2, 2, 0), [[0,0], [0,0]], "Initializes a 2D array of given width and height and value"); - //t.deepEqual(initialize2DArray(args..), 'Expected'); - //t.equal(initialize2DArray(args..), 'Expected'); - //t.false(initialize2DArray(args..), 'Expected'); - //t.throws(initialize2DArray(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('initialize2DArray is a Function', () => { + expect(initialize2DArray).toBeInstanceOf(Function); +}); +test('Initializes a 2D array of given width and height and value', () => { + expect(initialize2DArray(2, 2, 0)).toEqual([[0,0], [0,0]]); +}); diff --git a/test/initializeArrayWithRange/initializeArrayWithRange.test.js b/test/initializeArrayWithRange/initializeArrayWithRange.test.js index c35b1f557..8d0febed9 100644 --- a/test/initializeArrayWithRange/initializeArrayWithRange.test.js +++ b/test/initializeArrayWithRange/initializeArrayWithRange.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const initializeArrayWithRange = require('./initializeArrayWithRange.js'); -test('Testing initializeArrayWithRange', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof initializeArrayWithRange === 'function', 'initializeArrayWithRange is a Function'); - t.deepEqual(initializeArrayWithRange(5), [0, 1, 2, 3, 4, 5], "Initializes an array containing the numbers in the specified range"); - //t.deepEqual(initializeArrayWithRange(args..), 'Expected'); - //t.equal(initializeArrayWithRange(args..), 'Expected'); - //t.false(initializeArrayWithRange(args..), 'Expected'); - //t.throws(initializeArrayWithRange(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('initializeArrayWithRange is a Function', () => { + expect(initializeArrayWithRange).toBeInstanceOf(Function); +}); +test('Initializes an array containing the numbers in the specified range', () => { + expect(initializeArrayWithRange(5)).toEqual([0, 1, 2, 3, 4, 5]); +}); diff --git a/test/initializeArrayWithRangeRight/initializeArrayWithRangeRight.test.js b/test/initializeArrayWithRangeRight/initializeArrayWithRangeRight.test.js index f630da0c4..61f60f825 100644 --- a/test/initializeArrayWithRangeRight/initializeArrayWithRangeRight.test.js +++ b/test/initializeArrayWithRangeRight/initializeArrayWithRangeRight.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const initializeArrayWithRangeRight = require('./initializeArrayWithRangeRight.js'); -test('Testing initializeArrayWithRangeRight', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof initializeArrayWithRangeRight === 'function', 'initializeArrayWithRangeRight is a Function'); - //t.deepEqual(initializeArrayWithRangeRight(args..), 'Expected'); - //t.equal(initializeArrayWithRangeRight(args..), 'Expected'); - //t.false(initializeArrayWithRangeRight(args..), 'Expected'); - //t.throws(initializeArrayWithRangeRight(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('initializeArrayWithRangeRight is a Function', () => { + expect(initializeArrayWithRangeRight).toBeInstanceOf(Function); +}); diff --git a/test/initializeArrayWithValues/initializeArrayWithValues.test.js b/test/initializeArrayWithValues/initializeArrayWithValues.test.js index e4590fcaa..6b1b22eb3 100644 --- a/test/initializeArrayWithValues/initializeArrayWithValues.test.js +++ b/test/initializeArrayWithValues/initializeArrayWithValues.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const initializeArrayWithValues = require('./initializeArrayWithValues.js'); -test('Testing initializeArrayWithValues', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof initializeArrayWithValues === 'function', 'initializeArrayWithValues is a Function'); - t.deepEqual(initializeArrayWithValues(5, 2), [2, 2, 2, 2, 2], "Initializes and fills an array with the specified values"); - //t.deepEqual(initializeArrayWithValues(args..), 'Expected'); - //t.equal(initializeArrayWithValues(args..), 'Expected'); - //t.false(initializeArrayWithValues(args..), 'Expected'); - //t.throws(initializeArrayWithValues(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('initializeArrayWithValues is a Function', () => { + expect(initializeArrayWithValues).toBeInstanceOf(Function); +}); +test('Initializes and fills an array with the specified values', () => { + expect(initializeArrayWithValues(5, 2)).toEqual([2, 2, 2, 2, 2]); +}); diff --git a/test/initializeNDArray/initializeNDArray.test.js b/test/initializeNDArray/initializeNDArray.test.js index 82b015be3..df9199213 100644 --- a/test/initializeNDArray/initializeNDArray.test.js +++ b/test/initializeNDArray/initializeNDArray.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const initializeNDArray = require('./initializeNDArray.js'); -test('Testing initializeNDArray', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof initializeNDArray === 'function', 'initializeNDArray is a Function'); - //t.deepEqual(initializeNDArray(args..), 'Expected'); - //t.equal(initializeNDArray(args..), 'Expected'); - //t.false(initializeNDArray(args..), 'Expected'); - //t.throws(initializeNDArray(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('initializeNDArray is a Function', () => { + expect(initializeNDArray).toBeInstanceOf(Function); +}); diff --git a/test/intersection/intersection.test.js b/test/intersection/intersection.test.js index 065d86356..39186b7bb 100644 --- a/test/intersection/intersection.test.js +++ b/test/intersection/intersection.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const intersection = require('./intersection.js'); -test('Testing intersection', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof intersection === 'function', 'intersection is a Function'); - t.deepEqual(intersection([1, 2, 3], [4, 3, 2]), [2, 3], "Returns a list of elements that exist in both arrays"); - //t.deepEqual(intersection(args..), 'Expected'); - //t.equal(intersection(args..), 'Expected'); - //t.false(intersection(args..), 'Expected'); - //t.throws(intersection(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('intersection is a Function', () => { + expect(intersection).toBeInstanceOf(Function); +}); +test('Returns a list of elements that exist in both arrays', () => { + expect(intersection([1, 2, 3], [4, 3, 2])).toEqual([2, 3]); +}); diff --git a/test/intersectionBy/intersectionBy.test.js b/test/intersectionBy/intersectionBy.test.js index 499153b91..5d69246bd 100644 --- a/test/intersectionBy/intersectionBy.test.js +++ b/test/intersectionBy/intersectionBy.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const intersectionBy = require('./intersectionBy.js'); -test('Testing intersectionBy', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof intersectionBy === 'function', 'intersectionBy is a Function'); - t.deepEqual(intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor), [2.1], 'Returns a list of elements that exist in both arrays, after applying the provided function to each array element of both'); - //t.deepEqual(intersectionBy(args..), 'Expected'); - //t.equal(intersectionBy(args..), 'Expected'); - //t.false(intersectionBy(args..), 'Expected'); - //t.throws(intersectionBy(args..), 'Expected'); - t.end(); +test('intersectionBy is a Function', () => { + expect(intersectionBy).toBeInstanceOf(Function); +}); +test('Returns a list of elements that exist in both arrays, after applying the provided function to each array element of both', () => { + expect(intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor)).toEqual([2.1]); }); diff --git a/test/intersectionWith/intersectionWith.test.js b/test/intersectionWith/intersectionWith.test.js index 1fac234c2..7063575a7 100644 --- a/test/intersectionWith/intersectionWith.test.js +++ b/test/intersectionWith/intersectionWith.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const intersectionWith = require('./intersectionWith.js'); -test('Testing intersectionWith', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof intersectionWith === 'function', 'intersectionWith is a Function'); - t.deepEqual(intersectionWith([1, 1.2, 1.5, 3, 0], [1.9, 3, 0, 3.9], (a, b) => Math.round(a) === Math.round(b)), [1.5, 3, 0], 'Returns a list of elements that exist in both arrays, using a provided comparator function'); - //t.deepEqual(intersectionWith(args..), 'Expected'); - //t.equal(intersectionWith(args..), 'Expected'); - //t.false(intersectionWith(args..), 'Expected'); - //t.throws(intersectionWith(args..), 'Expected'); - t.end(); +test('intersectionWith is a Function', () => { + expect(intersectionWith).toBeInstanceOf(Function); +}); +test('Returns a list of elements that exist in both arrays, using a provided comparator function', () => { + expect(intersectionWith([1, 1.2, 1.5, 3, 0], [1.9, 3, 0, 3.9], (a, b) => Math.round(a) === Math.round(b))).toEqual([1.5, 3, 0]); }); diff --git a/test/invertKeyValues/invertKeyValues.test.js b/test/invertKeyValues/invertKeyValues.test.js index 948a80889..00c6d5f85 100644 --- a/test/invertKeyValues/invertKeyValues.test.js +++ b/test/invertKeyValues/invertKeyValues.test.js @@ -1,15 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const invertKeyValues = require('./invertKeyValues.js'); -test('Testing invertKeyValues', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof invertKeyValues === 'function', 'invertKeyValues is a Function'); - t.deepEqual(invertKeyValues({ a: 1, b: 2, c: 1 }), { 1: [ 'a', 'c' ], 2: [ 'b' ] }, "invertKeyValues({ a: 1, b: 2, c: 1 }) returns { 1: [ 'a', 'c' ], 2: [ 'b' ] }"); - t.deepEqual(invertKeyValues({ a: 1, b: 2, c: 1 }, value => 'group' + value), { group1: [ 'a', 'c' ], group2: [ 'b' ] }, "invertKeyValues({ a: 1, b: 2, c: 1 }, value => 'group' + value) returns { group1: [ 'a', 'c' ], group2: [ 'b' ] }"); - //t.deepEqual(invertKeyValues(args..), 'Expected'); - //t.equal(invertKeyValues(args..), 'Expected'); - //t.false(invertKeyValues(args..), 'Expected'); - //t.throws(invertKeyValues(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('invertKeyValues is a Function', () => { + expect(invertKeyValues).toBeInstanceOf(Function); +}); +test('invertKeyValues({ a: 1, b: 2, c: 1 }) returns { 1: [ \'a\', \'c\' ], 2: [ \'b\' ] }', () => { + expect(invertKeyValues({ a: 1, b: 2, c: 1 })).toEqual({ 1: [ 'a', 'c' ], 2: [ 'b' ] }); +}); +test('invertKeyValues({ a: 1, b: 2, c: 1 }, value => \'group\' + value) returns { group1: [ \'a\', \'c\' ], group2: [ \'b\' ] }', () => { + expect(invertKeyValues({ a: 1, b: 2, c: 1 }, value => 'group' + value)).toEqual( { group1: [ 'a', 'c' ], group2: [ 'b' ] }); +}); diff --git a/test/is/is.test.js b/test/is/is.test.js index 9671e766d..5309f0c08 100644 --- a/test/is/is.test.js +++ b/test/is/is.test.js @@ -1,29 +1,54 @@ -const test = require('tape'); +const expect = require('expect'); const is = require('./is.js'); -test('Testing is', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof is === 'function', 'is is a Function'); - t.true(is(Array, [1]), `Works for arrays with data`); - t.true(is(Array, []), `Works for empty arrays`); - t.false(is(Array, {}), `Works for arrays, not objects`); - t.true(is(Object, {}), `Works for objects`); - t.true(is(Map, new Map()), `Works for maps`); - t.true(is(RegExp, /./g), `Works for regular expressions`); - t.true(is(Set, new Set()), `Works for sets`); - t.true(is(WeakMap, new WeakMap()), `Works for weak maps`); - t.true(is(WeakSet, new WeakSet()), `Works for weak sets`); - t.true(is(String, ''), `Works for strings - returns true for primitive`); - t.true(is(String, new String('')), `Works for strings - returns true when using constructor`); - t.true(is(Number, 1), `Works for numbers - returns true for primitive`); - t.true(is(Number, new Number('10')), `Works for numbers - returns true when using constructor`); - t.true(is(Boolean, false), `Works for booleans - returns true for primitive`); - t.true(is(Boolean, new Boolean(false)), `Works for booleans - returns true when using constructor`); - t.true(is(Function, () => null), `Works for functions`); - //t.deepEqual(is(args..), 'Expected'); - //t.equal(is(args..), 'Expected'); - //t.false(is(args..), 'Expected'); - //t.throws(is(args..), 'Expected'); - t.end(); +test('is is a Function', () => { + expect(is).toBeInstanceOf(Function); +}); +test('Works for arrays with data', () => { + expect(is(Array, [1])).toBeTruthy(); +}); +test('Works for empty arrays', () => { + expect(is(Array, [])).toBeTruthy(); +}); +test('Works for arrays, not objects', () => { + expect(is(Array, {})).toBeFalsy(); +}); +test('Works for objects', () => { + expect(is(Object, {})).toBeTruthy(); +}); +test('Works for maps', () => { + expect(is(Map, new Map())).toBeTruthy(); +}); +test('Works for regular expressions', () => { + expect(is(RegExp, /./g)).toBeTruthy(); +}); +test('Works for sets', () => { + expect(is(Set, new Set())).toBeTruthy(); +}); +test('Works for weak maps', () => { + expect(is(WeakMap, new WeakMap())).toBeTruthy(); +}); +test('Works for weak sets', () => { + expect(is(WeakSet, new WeakSet())).toBeTruthy(); +}); +test('Works for strings - returns true for primitive', () => { + expect(is(String, '')).toBeTruthy(); +}); +test('Works for strings - returns true when using constructor', () => { + expect(is(String, new String(''))).toBeTruthy(); +}); +test('Works for numbers - returns true for primitive', () => { + expect(is(Number, 1)).toBeTruthy(); +}); +test('Works for numbers - returns true when using constructor', () => { + expect(is(Number, new Number('10'))).toBeTruthy(); +}); +test('Works for booleans - returns true for primitive', () => { + expect(is(Boolean, false)).toBeTruthy(); +}); +test('Works for booleans - returns true when using constructor', () => { + expect(is(Boolean, new Boolean(false))).toBeTruthy(); +}); +test('Works for functions', () => { + expect(is(Function, () => null)).toBeTruthy(); }); diff --git a/test/isAbsoluteURL/isAbsoluteURL.test.js b/test/isAbsoluteURL/isAbsoluteURL.test.js index 965d48cdc..806ac881c 100644 --- a/test/isAbsoluteURL/isAbsoluteURL.test.js +++ b/test/isAbsoluteURL/isAbsoluteURL.test.js @@ -1,16 +1,15 @@ -const test = require('tape'); +const expect = require('expect'); const isAbsoluteURL = require('./isAbsoluteURL.js'); -test('Testing isAbsoluteURL', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isAbsoluteURL === 'function', 'isAbsoluteURL is a Function'); - t.equal(isAbsoluteURL('https://google.com'), true, "Given string is an absolute URL"); - t.equal(isAbsoluteURL('ftp://www.myserver.net'), true, "Given string is an absolute URL"); - t.equal(isAbsoluteURL('/foo/bar'), false, "Given string is not an absolute URL"); - //t.deepEqual(isAbsoluteURL(args..), 'Expected'); - //t.equal(isAbsoluteURL(args..), 'Expected'); - //t.false(isAbsoluteURL(args..), 'Expected'); - //t.throws(isAbsoluteURL(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('isAbsoluteURL is a Function', () => { + expect(isAbsoluteURL).toBeInstanceOf(Function); +}); +test('Given string is an absolute URL', () => { + expect(isAbsoluteURL('https://google.com')).toBeTruthy(); +}); +test('Given string is an absolute URL', () => { + expect(isAbsoluteURL('ftp://www.myserver.net')).toBeTruthy(); +}); +test('Given string is not an absolute URL', () => { + expect(isAbsoluteURL('/foo/bar')).toBeFalsy(); +}); diff --git a/test/isAnagram/isAnagram.test.js b/test/isAnagram/isAnagram.test.js index 915d14aba..6fc0a9cb6 100644 --- a/test/isAnagram/isAnagram.test.js +++ b/test/isAnagram/isAnagram.test.js @@ -1,17 +1,18 @@ -const test = require('tape'); +const expect = require('expect'); const isAnagram = require('./isAnagram.js'); -test('Testing isAnagram', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isAnagram === 'function', 'isAnagram is a Function'); - t.true(isAnagram('iceman', 'cinema'), 'Checks valid anagram'); - t.true(isAnagram('rail safety', 'fairy tales'), 'Works with spaces'); - t.true(isAnagram('roast beef', 'eat for BSE'), 'Ignores case'); - t.true(isAnagram('Regera Dowdy', 'E. G. Deadworry'), 'Ignores special characters'); - //t.deepEqual(isAnagram(args..), 'Expected'); - //t.equal(isAnagram(args..), 'Expected'); - //t.false(isAnagram(args..), 'Expected'); - //t.throws(isAnagram(args..), 'Expected'); - t.end(); +test('isAnagram is a Function', () => { + expect(isAnagram).toBeInstanceOf(Function); +}); +test('Checks valid anagram', () => { + expect(isAnagram('iceman', 'cinema')).toBeTruthy(); +}); +test('Works with spaces', () => { + expect(isAnagram('rail safety', 'fairy tales')).toBeTruthy(); +}); +test('Ignores case', () => { + expect(isAnagram('roast beef', 'eat for BSE')).toBeTruthy(); +}); +test('Ignores special characters', () => { + expect(isAnagram('Regera Dowdy', 'E. G. Deadworry')).toBeTruthy(); }); diff --git a/test/isArmstrongNumber/isArmstrongNumber.test.js b/test/isArmstrongNumber/isArmstrongNumber.test.js index dbebfbfd0..946cfa76f 100644 --- a/test/isArmstrongNumber/isArmstrongNumber.test.js +++ b/test/isArmstrongNumber/isArmstrongNumber.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const isArmstrongNumber = require('./isArmstrongNumber.js'); -test('Testing isArmstrongNumber', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isArmstrongNumber === 'function', 'isArmstrongNumber is a Function'); - //t.deepEqual(isArmstrongNumber(args..), 'Expected'); - //t.equal(isArmstrongNumber(args..), 'Expected'); - //t.false(isArmstrongNumber(args..), 'Expected'); - //t.throws(isArmstrongNumber(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('isArmstrongNumber is a Function', () => { + expect(isArmstrongNumber).toBeInstanceOf(Function); +}); diff --git a/test/isArray/isArray.test.js b/test/isArray/isArray.test.js index 7d56d1112..5ca77144b 100644 --- a/test/isArray/isArray.test.js +++ b/test/isArray/isArray.test.js @@ -1,14 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const isArray = require('./isArray.js'); -test('Testing isArray', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isArray === 'function', 'isArray is a Function'); - t.equal(isArray([1]), true, "passed value is an array"); - t.equal(isArray('array'), false, "passed value is not an array"); - //t.equal(isArray(args..), 'Expected'); - //t.false(isArray(args..), 'Expected'); - //t.throws(isArray(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('isArray is a Function', () => { + expect(isArray).toBeInstanceOf(Function); +}); +test('passed value is an array', () => { + expect(isArray([1])).toBeTruthy(); +}); +test('passed value is not an array', () => { + expect(isArray('array')).toBeFalsy(); +}); diff --git a/test/isArrayBuffer/isArrayBuffer.test.js b/test/isArrayBuffer/isArrayBuffer.test.js index 1d9cffa97..fb65e81de 100644 --- a/test/isArrayBuffer/isArrayBuffer.test.js +++ b/test/isArrayBuffer/isArrayBuffer.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const isArrayBuffer = require('./isArrayBuffer.js'); -test('Testing isArrayBuffer', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isArrayBuffer === 'function', 'isArrayBuffer is a Function'); - //t.deepEqual(isArrayBuffer(args..), 'Expected'); - //t.equal(isArrayBuffer(args..), 'Expected'); - //t.false(isArrayBuffer(args..), 'Expected'); - //t.throws(isArrayBuffer(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('isArrayBuffer is a Function', () => { + expect(isArrayBuffer).toBeInstanceOf(Function); +}); diff --git a/test/isArrayLike/isArrayLike.test.js b/test/isArrayLike/isArrayLike.test.js index 97b41b827..c2b83ecf9 100644 --- a/test/isArrayLike/isArrayLike.test.js +++ b/test/isArrayLike/isArrayLike.test.js @@ -1,16 +1,15 @@ -const test = require('tape'); +const expect = require('expect'); const isArrayLike = require('./isArrayLike.js'); -test('Testing isArrayLike', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isArrayLike === 'function', 'isArrayLike is a Function'); - t.equal(isArrayLike('abc'), true, 'Returns true for a string'); - t.equal(isArrayLike([1,2,3]), true, 'Returns true for an array'); - t.equal(isArrayLike(null), false, 'Returns false for null'); - //t.deepEqual(isArrayLike(args..), 'Expected'); - //t.equal(isArrayLike(args..), 'Expected'); - //t.false(isArrayLike(args..), 'Expected'); - //t.throws(isArrayLike(args..), 'Expected'); - t.end(); +test('isArrayLike is a Function', () => { + expect(isArrayLike).toBeInstanceOf(Function); +}); +test('Returns true for a string', () => { + expect(isArrayLike('abc')).toBeTruthy(); +}); +test('Returns true for an array', () => { + expect(isArrayLike([1,2,3])).toBeTruthy(); +}); +test('Returns false for null', () => { + expect(isArrayLike(null)).toBeFalsy(); }); diff --git a/test/isBoolean/isBoolean.test.js b/test/isBoolean/isBoolean.test.js index 68334e925..31074f1f4 100644 --- a/test/isBoolean/isBoolean.test.js +++ b/test/isBoolean/isBoolean.test.js @@ -1,15 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const isBoolean = require('./isBoolean.js'); -test('Testing isBoolean', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isBoolean === 'function', 'isBoolean is a Function'); - t.equal(isBoolean(null), false, "passed value is not a boolean"); - t.equal(isBoolean(false), true, "passed value is not a boolean"); - //t.deepEqual(isBoolean(args..), 'Expected'); - //t.equal(isBoolean(args..), 'Expected'); - //t.false(isBoolean(args..), 'Expected'); - //t.throws(isBoolean(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('isBoolean is a Function', () => { + expect(isBoolean).toBeInstanceOf(Function); +}); +test('passed value is not a boolean', () => { + expect(isBoolean(null)).toBeFalsy(); +}); +test('passed value is not a boolean', () => { + expect(isBoolean(false)).toBeTruthy(); +}); diff --git a/test/isBrowser/isBrowser.test.js b/test/isBrowser/isBrowser.test.js index 3f0c1adf9..a6c32ee74 100644 --- a/test/isBrowser/isBrowser.test.js +++ b/test/isBrowser/isBrowser.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const isBrowser = require('./isBrowser.js'); -test('Testing isBrowser', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isBrowser === 'function', 'isBrowser is a Function'); - //t.deepEqual(isBrowser(args..), 'Expected'); - //t.equal(isBrowser(args..), 'Expected'); - //t.false(isBrowser(args..), 'Expected'); - //t.throws(isBrowser(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('isBrowser is a Function', () => { + expect(isBrowser).toBeInstanceOf(Function); +}); diff --git a/test/isBrowserTabFocused/isBrowserTabFocused.test.js b/test/isBrowserTabFocused/isBrowserTabFocused.test.js index d3a5b5133..780a52095 100644 --- a/test/isBrowserTabFocused/isBrowserTabFocused.test.js +++ b/test/isBrowserTabFocused/isBrowserTabFocused.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const isBrowserTabFocused = require('./isBrowserTabFocused.js'); -test('Testing isBrowserTabFocused', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isBrowserTabFocused === 'function', 'isBrowserTabFocused is a Function'); - //t.deepEqual(isBrowserTabFocused(args..), 'Expected'); - //t.equal(isBrowserTabFocused(args..), 'Expected'); - //t.false(isBrowserTabFocused(args..), 'Expected'); - //t.throws(isBrowserTabFocused(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('isBrowserTabFocused is a Function', () => { + expect(isBrowserTabFocused).toBeInstanceOf(Function); +}); diff --git a/test/isDivisible/isDivisible.test.js b/test/isDivisible/isDivisible.test.js index bdfa8a5c2..3f71c4f03 100644 --- a/test/isDivisible/isDivisible.test.js +++ b/test/isDivisible/isDivisible.test.js @@ -1,13 +1,10 @@ -const test = require('tape'); +const expect = require('expect'); const isDivisible = require('./isDivisible.js'); -test('Testing isDivisible', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isDivisible === 'function', 'isDivisible is a Function'); - t.equal(isDivisible(6, 3), true, 'The number 6 is divisible by 3'); - //t.deepEqual(isDivisible(args..), 'Expected'); - //t.false(isDivisible(args..), 'Expected'); - //t.throws(isDivisible(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('isDivisible is a Function', () => { + expect(isDivisible).toBeInstanceOf(Function); +}); +test('The number 6 is divisible by 3', () => { + expect(isDivisible(6, 3)).toBeTruthy(); +}); + diff --git a/test/isEmpty/isEmpty.test.js b/test/isEmpty/isEmpty.test.js index 76fc0aef8..da27a5581 100644 --- a/test/isEmpty/isEmpty.test.js +++ b/test/isEmpty/isEmpty.test.js @@ -1,23 +1,36 @@ -const test = require('tape'); +const expect = require('expect'); const isEmpty = require('./isEmpty.js'); -test('Testing isEmpty', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isEmpty === 'function', 'isEmpty is a Function'); - t.equal(isEmpty(new Map()), true, 'Returns true for empty Map'); - t.equal(isEmpty(new Set()), true, 'Returns true for empty Set'); - t.equal(isEmpty([]), true, 'Returns true for empty array'); - t.equal(isEmpty({}), true, 'Returns true for empty object'); - t.equal(isEmpty(''), true, 'Returns true for empty string'); - t.equal(isEmpty([1, 2]), false, 'Returns false for non-empty array'); - t.equal(isEmpty({ a: 1, b: 2 }), false, 'Returns false for non-empty object'); - t.equal(isEmpty('text'), false, 'Returns false for non-empty string'); - t.equal(isEmpty(123), true, 'Returns true - type is not considered a collection'); - t.equal(isEmpty(true), true, 'Returns true - type is not considered a collection'); - //t.deepEqual(isEmpty(args..), 'Expected'); - //t.equal(isEmpty(args..), 'Expected'); - //t.false(isEmpty(args..), 'Expected'); - //t.throws(isEmpty(args..), 'Expected'); - t.end(); +test('isEmpty is a Function', () => { + expect(isEmpty).toBeInstanceOf(Function); +}); +test('Returns true for empty Map', () => { + expect(isEmpty(new Map())).toBeTruthy(); +}); +test('Returns true for empty Set', () => { + expect(isEmpty(new Set())).toBeTruthy(); +}); +test('Returns true for empty array', () => { + expect(isEmpty([])).toBeTruthy(); +}); +test('Returns true for empty object', () => { + expect(isEmpty({})).toBeTruthy(); +}); +test('Returns true for empty string', () => { + expect(isEmpty('')).toBeTruthy(); +}); +test('Returns false for non-empty array', () => { + expect(isEmpty([1, 2])).toBeFalsy(); +}); +test('Returns false for non-empty object', () => { + expect(isEmpty({ a: 1, b: 2 })).toBeFalsy(); +}); +test('Returns false for non-empty string', () => { + expect(isEmpty('text')).toBeFalsy(); +}); +test('Returns true - type is not considered a collection', () => { + expect(isEmpty(123)).toBeTruthy(); +}); +test('Returns true - type is not considered a collection', () => { + expect(isEmpty(true)).toBeTruthy(); }); diff --git a/test/isEven/isEven.test.js b/test/isEven/isEven.test.js index 8c9e29455..906f42b7b 100644 --- a/test/isEven/isEven.test.js +++ b/test/isEven/isEven.test.js @@ -1,13 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const isEven = require('./isEven.js'); -test('Testing isEven', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isEven === 'function', 'isEven is a Function'); - t.equal(isEven(4), true, '4 is even number'); - t.false(isEven(5), false, '5 is not an even number'); - //t.deepEqual(isEven(args..), 'Expected'); - //t.throws(isEven(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('isEven is a Function', () => { + expect(isEven).toBeInstanceOf(Function); +}); +test('4 is even number', () => { + expect(isEven(4)).toBeTruthy(); +}); +test('5 is not an even number', () => { + expect(isEven(5)).toBeFalsy(); +}); diff --git a/test/isFunction/isFunction.test.js b/test/isFunction/isFunction.test.js index 7311b25d4..2d6d8db81 100644 --- a/test/isFunction/isFunction.test.js +++ b/test/isFunction/isFunction.test.js @@ -1,14 +1,13 @@ -const test = require('tape'); +const expect = require('expect'); const isFunction = require('./isFunction.js'); -test('Testing isFunction', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isFunction === 'function', 'isFunction is a Function'); - t.equal(isFunction(x => x), true, "passed value is a function"); - t.equal(isFunction('x'), false, "passed value is not a function"); - //t.equal(isFunction(args..), 'Expected'); - //t.false(isFunction(args..), 'Expected'); - //t.throws(isFunction(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('isFunction is a Function', () => { + expect(isFunction).toBeInstanceOf(Function); +}); +test('passed value is a function', () => { + expect(isFunction(x => x)).toBeTruthy(); +}); +test('passed value is not a function', () => { + expect(isFunction('x')).toBeFalsy(); +}); + diff --git a/test/isLowerCase/isLowerCase.test.js b/test/isLowerCase/isLowerCase.test.js index 0e596dff9..9c6542476 100644 --- a/test/isLowerCase/isLowerCase.test.js +++ b/test/isLowerCase/isLowerCase.test.js @@ -1,16 +1,15 @@ -const test = require('tape'); +const expect = require('expect'); const isLowerCase = require('./isLowerCase.js'); -test('Testing isLowerCase', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isLowerCase === 'function', 'isLowerCase is a Function'); - t.equal(isLowerCase('abc'), true, "passed string is a lowercase"); - t.equal(isLowerCase('a3@$'), true, "passed string is a lowercase"); - t.equal(isLowerCase('A3@$'), false, "passed value is not a lowercase"); - //t.deepEqual(isLowerCase(args..), 'Expected'); - //t.equal(isLowerCase(args..), 'Expected'); - //t.false(isLowerCase(args..), 'Expected'); - //t.throws(isLowerCase(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('isLowerCase is a Function', () => { + expect(isLowerCase).toBeInstanceOf(Function); +}); +test('passed string is a lowercase', () => { + expect(isLowerCase('abc')).toBeTruthy(); +}); +test('passed string is a lowercase', () => { + expect(isLowerCase('a3@$')).toBeTruthy(); +}); +test('passed value is not a lowercase', () => { + expect(isLowerCase('A3@$')).toBeFalsy(); +}); diff --git a/test/isMap/isMap.test.js b/test/isMap/isMap.test.js index bc9fe3187..e6e434636 100644 --- a/test/isMap/isMap.test.js +++ b/test/isMap/isMap.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const isMap = require('./isMap.js'); -test('Testing isMap', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isMap === 'function', 'isMap is a Function'); - //t.deepEqual(isMap(args..), 'Expected'); - //t.equal(isMap(args..), 'Expected'); - //t.false(isMap(args..), 'Expected'); - //t.throws(isMap(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('isMap is a Function', () => { + expect(isMap).toBeInstanceOf(Function); +}); diff --git a/test/isNil/isNil.test.js b/test/isNil/isNil.test.js index c5e11d1f4..be77815a2 100644 --- a/test/isNil/isNil.test.js +++ b/test/isNil/isNil.test.js @@ -1,16 +1,15 @@ -const test = require('tape'); +const expect = require('expect'); const isNil = require('./isNil.js'); -test('Testing isNil', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isNil === 'function', 'isNil is a Function'); - t.equal(isNil(null), true, 'Returns true for null'); - t.equal(isNil(undefined), true, 'Returns true for undefined'); - t.equal(isNil(''), false, 'Returns false for an empty string'); - //t.deepEqual(isNil(args..), 'Expected'); - //t.equal(isNil(args..), 'Expected'); - //t.false(isNil(args..), 'Expected'); - //t.throws(isNil(args..), 'Expected'); - t.end(); +test('isNil is a Function', () => { + expect(isNil).toBeInstanceOf(Function); +}); +test('Returns true for null', () => { + expect(isNil(null)).toBeTruthy(); +}); +test('Returns true for undefined', () => { + expect(isNil(undefined)).toBeTruthy(); +}); +test('Returns false for an empty string', () => { + expect(isNil('')).toBeFalsy(); }); diff --git a/test/isNull/isNull.test.js b/test/isNull/isNull.test.js index dbc7d20c8..fdf97d069 100644 --- a/test/isNull/isNull.test.js +++ b/test/isNull/isNull.test.js @@ -1,15 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const isNull = require('./isNull.js'); -test('Testing isNull', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isNull === 'function', 'isNull is a Function'); - t.equal(isNull(null), true, "passed argument is a null"); - t.equal(isNull(NaN), false, "passed argument is a null"); - //t.deepEqual(isNull(args..), 'Expected'); - //t.equal(isNull(args..), 'Expected'); - //t.false(isNull(args..), 'Expected'); - //t.throws(isNull(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('isNull is a Function', () => { + expect(isNull).toBeInstanceOf(Function); +}); +test('passed argument is a null', () => { + expect(isNull(null)).toBeTruthy(); +}); +test('passed argument is a null', () => { + expect(isNull(NaN)).toBeFalsy(); +}); diff --git a/test/isNumber/isNumber.test.js b/test/isNumber/isNumber.test.js index 90af5bb5b..9b4872778 100644 --- a/test/isNumber/isNumber.test.js +++ b/test/isNumber/isNumber.test.js @@ -1,16 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const isNumber = require('./isNumber.js'); -test('Testing isNumber', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isNumber === 'function', 'isNumber is a Function'); - t.equal(isNumber(1), true, "passed argument is a number"); - t.equal(isNumber('1'), false, "passed argument is not a number"); - - //t.deepEqual(isNumber(args..), 'Expected'); - //t.equal(isNumber(args..), 'Expected'); - //t.false(isNumber(args..), 'Expected'); - //t.throws(isNumber(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('isNumber is a Function', () => { + expect(isNumber).toBeInstanceOf(Function); +}); +test('passed argument is a number', () => { + expect(isNumber(1)).toBeTruthy(); +}); +test('passed argument is not a number', () => { + expect(isNumber('1')).toBeFalsy(); +}); diff --git a/test/isObject/isObject.test.js b/test/isObject/isObject.test.js index 8ed7620c8..d5e58c496 100644 --- a/test/isObject/isObject.test.js +++ b/test/isObject/isObject.test.js @@ -1,19 +1,19 @@ -const test = require('tape'); +const expect = require('expect'); const isObject = require('./isObject.js'); -test('Testing isObject', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isObject === 'function', 'isObject is a Function'); - - t.true(isObject([1, 2, 3, 4]), 'isObject([1, 2, 3, 4]) is a object'); - t.true(isObject([]), 'isObject([]) is a object'); - t.true(isObject({ a:1 }), 'isObject({ a:1 }) is a object'); - t.false(isObject(true), 'isObject(true) is not a object'); - - //t.deepEqual(isObject(args..), 'Expected'); - //t.equal(isObject(args..), 'Expected'); - //t.false(isObject(args..), 'Expected'); - //t.throws(isObject(args..), 'Expected'); - t.end(); +test('isObject is a Function', () => { + expect(isObject).toBeInstanceOf(Function); }); +test('isObject([1, 2, 3, 4]) is a object', () => { + expect(isObject([1, 2, 3, 4])).toBeTruthy(); +}); +test('isObject([]) is a object', () => { + expect(isObject([])).toBeTruthy(); +}); +test('isObject({ a:1 }) is a object', () => { + expect(isObject({ a:1 })).toBeTruthy(); +}); +test('isObject(true) is not a object', () => { + expect(isObject(true)).toBeFalsy(); +}); + diff --git a/test/isObjectLike/isObjectLike.test.js b/test/isObjectLike/isObjectLike.test.js index fe414423b..410878d8e 100644 --- a/test/isObjectLike/isObjectLike.test.js +++ b/test/isObjectLike/isObjectLike.test.js @@ -1,17 +1,18 @@ -const test = require('tape'); +const expect = require('expect'); const isObjectLike = require('./isObjectLike.js'); -test('Testing isObjectLike', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isObjectLike === 'function', 'isObjectLike is a Function'); - t.equal(isObjectLike({}), true, 'Returns true for an object'); - t.equal(isObjectLike([1, 2, 3]), true, 'Returns true for an array'); - t.equal(isObjectLike(x => x), false, 'Returns false for a function'); - t.equal(isObjectLike(null), false, 'Returns false for null'); - //t.deepEqual(isObjectLike(args..), 'Expected'); - //t.equal(isObjectLike(args..), 'Expected'); - //t.false(isObjectLike(args..), 'Expected'); - //t.throws(isObjectLike(args..), 'Expected'); - t.end(); +test('isObjectLike is a Function', () => { + expect(isObjectLike).toBeInstanceOf(Function); +}); +test('Returns true for an object', () => { + expect(isObjectLike({})).toBeTruthy(); +}); +test('Returns true for an array', () => { + expect(isObjectLike([1, 2, 3])).toBeTruthy(); +}); +test('Returns false for a function', () => { + expect(isObjectLike(x => x)).toBeFalsy(); +}); +test('Returns false for null', () => { + expect(isObjectLike(null)).toBeFalsy(); }); diff --git a/test/isPlainObject/isPlainObject.test.js b/test/isPlainObject/isPlainObject.test.js index 515b61b2d..eda33dabc 100644 --- a/test/isPlainObject/isPlainObject.test.js +++ b/test/isPlainObject/isPlainObject.test.js @@ -1,15 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const isPlainObject = require('./isPlainObject.js'); -test('Testing isPlainObject', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isPlainObject === 'function', 'isPlainObject is a Function'); - t.equal(isPlainObject({ a: 1 }), true, 'Returns true for a plain object'); - t.equal(isPlainObject(new Map()), false, 'Returns false for a Map (example of non-plain object)'); - //t.deepEqual(isPlainObject(args..), 'Expected'); - //t.equal(isPlainObject(args..), 'Expected'); - //t.false(isPlainObject(args..), 'Expected'); - //t.throws(isPlainObject(args..), 'Expected'); - t.end(); +test('isPlainObject is a Function', () => { + expect(isPlainObject).toBeInstanceOf(Function); +}); +test('Returns true for a plain object', () => { + expect(isPlainObject({ a: 1 })).toBeTruthy(); +}); +test('Returns false for a Map (example of non-plain object)', () => { + expect(isPlainObject(new Map())).toBeFalsy(); }); diff --git a/test/isPrime/isPrime.test.js b/test/isPrime/isPrime.test.js index 8d7ce3b8b..f6776f687 100644 --- a/test/isPrime/isPrime.test.js +++ b/test/isPrime/isPrime.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const isPrime = require('./isPrime.js'); -test('Testing isPrime', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isPrime === 'function', 'isPrime is a Function'); - t.equal(isPrime(11), true, "passed number is a prime"); - //t.deepEqual(isPrime(args..), 'Expected'); - //t.equal(isPrime(args..), 'Expected'); - //t.false(isPrime(args..), 'Expected'); - //t.throws(isPrime(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('isPrime is a Function', () => { + expect(isPrime).toBeInstanceOf(Function); +}); +test('passed number is a prime', () => { + expect(isPrime(11)).toBeTruthy(); +}); diff --git a/test/isPrimitive/isPrimitive.test.js b/test/isPrimitive/isPrimitive.test.js index 3e0a21076..ac7e593e9 100644 --- a/test/isPrimitive/isPrimitive.test.js +++ b/test/isPrimitive/isPrimitive.test.js @@ -1,24 +1,42 @@ -const test = require('tape'); +const expect = require('expect'); const isPrimitive = require('./isPrimitive.js'); -test('Testing isPrimitive', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isPrimitive === 'function', 'isPrimitive is a Function'); - t.true(isPrimitive(null), "isPrimitive(null) is primitive"); - t.true(isPrimitive(undefined), "isPrimitive(undefined) is primitive"); - t.true(isPrimitive('string'), "isPrimitive(string) is primitive"); - t.true(isPrimitive(true), "isPrimitive(true) is primitive"); - t.true(isPrimitive(50), "isPrimitive(50) is primitive"); - t.true(isPrimitive('Hello'), "isPrimitive('Hello') is primitive"); - t.true(isPrimitive(false), "isPrimitive(false) is primitive"); - t.true(isPrimitive(Symbol()), "isPrimitive(Symbol()) is primitive"); - t.false(isPrimitive([1, 2, 3]), "isPrimitive([1, 2, 3]) is not primitive"); - t.false(isPrimitive({ a: 123 }), "isPrimitive({ a: 123 }) is not primitive"); - - let start = new Date().getTime(); - isPrimitive({ a: 123 }); - let end = new Date().getTime(); - t.true((end - start) < 2000, 'isPrimitive({ a: 123 }) takes less than 2s to run'); - t.end(); -}); \ No newline at end of file +test('isPrimitive is a Function', () => { + expect(isPrimitive).toBeInstanceOf(Function); +}); +test('isPrimitive(null) is primitive', () => { + expect(isPrimitive(null)).toBeTruthy(); +}); +test('isPrimitive(undefined) is primitive', () => { + expect(isPrimitive(undefined)).toBeTruthy(); +}); +test('isPrimitive(string) is primitive', () => { + expect(isPrimitive('string')).toBeTruthy(); +}); +test('isPrimitive(true) is primitive', () => { + expect(isPrimitive(true)).toBeTruthy(); +}); +test('isPrimitive(50) is primitive', () => { + expect(isPrimitive(50)).toBeTruthy(); +}); +test('isPrimitive(\'Hello\') is primitive', () => { + expect(isPrimitive('Hello')).toBeTruthy(); +}); +test('isPrimitive(false) is primitive', () => { + expect(isPrimitive(false)).toBeTruthy(); +}); +test('isPrimitive(Symbol()) is primitive', () => { + expect(isPrimitive(Symbol())).toBeTruthy(); +}); +test('isPrimitive([1, 2, 3]) is not primitive', () => { + expect(isPrimitive([1, 2, 3])).toBeFalsy(); +}); +test('isPrimitive({ a: 123 }) is not primitive', () => { + expect(isPrimitive({ a: 123 })).toBeFalsy(); +}); +let start = new Date().getTime(); +isPrimitive({ a: 123 }); +let end = new Date().getTime(); +test('isPrimitive({ a: 123 }) takes less than 2s to run', () => { + expect((end - start) < 2000).toBeTruthy(); +}); diff --git a/test/isPromiseLike/isPromiseLike.test.js b/test/isPromiseLike/isPromiseLike.test.js index 5ce5d856b..10877b4ec 100644 --- a/test/isPromiseLike/isPromiseLike.test.js +++ b/test/isPromiseLike/isPromiseLike.test.js @@ -1,20 +1,16 @@ -const test = require('tape'); +const expect = require('expect'); const isPromiseLike = require('./isPromiseLike.js'); -test('Testing isPromiseLike', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isPromiseLike === 'function', 'isPromiseLike is a Function'); - t.equal(isPromiseLike({ +test('isPromiseLike is a Function', () => { + expect(isPromiseLike).toBeInstanceOf(Function); +}); +test('Returns true for a promise-like object', () => { + expect(isPromiseLike({ then: function() { return ''; } - }), true, 'Returns true for a promise-like object'); - t.equal(isPromiseLike(null), false, 'Returns false for null'); - t.equal(isPromiseLike({}), false, 'Returns false for an empty object'); - //t.deepEqual(isPromiseLike(args..), 'Expected'); - //t.equal(isPromiseLike(args..), 'Expected'); - //t.false(isPromiseLike(args..), 'Expected'); - //t.throws(isPromiseLike(args..), 'Expected'); - t.end(); + })).toBeTruthy(); +}); +test('Returns false for an empty object', () => { + expect(isPromiseLike({})).toBeFalsy(); }); diff --git a/test/isRegExp/isRegExp.test.js b/test/isRegExp/isRegExp.test.js index 2580a138d..ec565713f 100644 --- a/test/isRegExp/isRegExp.test.js +++ b/test/isRegExp/isRegExp.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const isRegExp = require('./isRegExp.js'); -test('Testing isRegExp', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isRegExp === 'function', 'isRegExp is a Function'); - //t.deepEqual(isRegExp(args..), 'Expected'); - //t.equal(isRegExp(args..), 'Expected'); - //t.false(isRegExp(args..), 'Expected'); - //t.throws(isRegExp(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('isRegExp is a Function', () => { + expect(isRegExp).toBeInstanceOf(Function); +}); diff --git a/test/isSet/isSet.test.js b/test/isSet/isSet.test.js index 81fae132b..559889443 100644 --- a/test/isSet/isSet.test.js +++ b/test/isSet/isSet.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const isSet = require('./isSet.js'); -test('Testing isSet', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isSet === 'function', 'isSet is a Function'); - //t.deepEqual(isSet(args..), 'Expected'); - //t.equal(isSet(args..), 'Expected'); - //t.false(isSet(args..), 'Expected'); - //t.throws(isSet(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('isSet is a Function', () => { + expect(isSet).toBeInstanceOf(Function); +}); diff --git a/test/isSimilar/isSimilar.test.js b/test/isSimilar/isSimilar.test.js index bcc980a18..0a632774e 100644 --- a/test/isSimilar/isSimilar.test.js +++ b/test/isSimilar/isSimilar.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const isSimilar = require('./isSimilar.js'); -test('Testing isSimilar', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isSimilar === 'function', 'isSimilar is a Function'); - //t.deepEqual(isSimilar(args..), 'Expected'); - //t.equal(isSimilar(args..), 'Expected'); - //t.false(isSimilar(args..), 'Expected'); - //t.throws(isSimilar(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('isSimilar is a Function', () => { + expect(isSimilar).toBeInstanceOf(Function); +}); diff --git a/test/isSorted/isSorted.test.js b/test/isSorted/isSorted.test.js index a55dfe962..d1d9fcfd9 100644 --- a/test/isSorted/isSorted.test.js +++ b/test/isSorted/isSorted.test.js @@ -1,23 +1,39 @@ -const test = require('tape'); +const expect = require('expect'); const isSorted = require('./isSorted.js'); -test('Testing isSorted', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isSorted === 'function', 'isSorted is a Function'); - //t.deepEqual(isSorted(args..), 'Expected'); - t.equal(isSorted([0, 1, 2]), 1, 'Array is sorted in ascending order'); - t.equal(isSorted([0, 1, 2, 2]), 1, 'Array is sorted in ascending order'); - t.equal(isSorted([-4, -3, -2]), 1, 'Array is sorted in ascending order'); - t.equal(isSorted([0, 0, 1, 2]), 1, 'Array is sorted in ascending order'); - t.equal(isSorted([2, 1, 0]), -1, 'Array is sorted in descending order'); - t.equal(isSorted([2, 2, 1, 0]), -1, 'Array is sorted in descending order'); - t.equal(isSorted([-2, -3, -4]), -1, 'Array is sorted in descending order'); - t.equal(isSorted([2, 1, 0, 0]), -1, 'Array is sorted in descending order'); - t.equal(isSorted([]), undefined, 'Array is empty'); - t.equal(isSorted([1]), 0, 'Array is not sorted, direction changed in array'); - t.equal(isSorted([1, 2, 1]), 0, 'Array is not sorted, direction changed in array'); - //t.false(isSorted(args..), 'Expected'); - //t.throws(isSorted(args..), 'Expected'); - t.end(); +test('isSorted is a Function', () => { + expect(isSorted).toBeInstanceOf(Function); +}); +test('Array is sorted in ascending order', () => { + expect(isSorted([0, 1, 2])).toBe(1); +}); +test('Array is sorted in ascending order', () => { + expect(isSorted([0, 1, 2, 2])).toBe(1); +}); +test('Array is sorted in ascending order', () => { + expect(isSorted([-4, -3, -2])).toBe(1); +}); +test('Array is sorted in ascending order', () => { + expect(isSorted([0, 0, 1, 2])).toBe(1); +}); +test('Array is sorted in descending order', () => { + expect(isSorted([2, 1, 0])).toBe(-1); +}); +test('Array is sorted in descending order', () => { + expect(isSorted([2, 2, 1, 0])).toBe(-1); +}); +test('Array is sorted in descending order', () => { + expect(isSorted([-2, -3, -4])).toBe(-1); +}); +test('Array is sorted in descending order', () => { + expect(isSorted([2, 1, 0, 0])).toBe(-1); +}); +test('Array is empty', () => { + expect(isSorted([])).toBe(undefined); +}); +test('Array is not sorted, direction changed in array', () => { + expect(isSorted([1])).toBe(0); +}); +test('Array is not sorted, direction changed in array', () => { + expect(isSorted([1, 2, 1])).toBe(0); }); diff --git a/test/isString/isString.test.js b/test/isString/isString.test.js index f48d8cfe0..d3021b275 100644 --- a/test/isString/isString.test.js +++ b/test/isString/isString.test.js @@ -1,19 +1,21 @@ -const test = require('tape'); +const expect = require('expect'); const isString = require('./isString.js'); -test('Testing isString', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isString === 'function', 'isString is a Function'); - t.equal(isString('foo'), true, 'foo is a string'); - t.equal(isString('10'), true, '"10" is a string'); - t.equal(isString(''), true, 'Empty string is a string'); - t.equal(isString(10), false, '10 is not a string'); - t.equal(isString(true), false, 'true is not string'); - - //t.deepEqual(isString(args..), 'Expected'); - //t.equal(isString(args..), 'Expected'); - //t.false(isString(args..), 'Expected'); - //t.throws(isString(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('isString is a Function', () => { + expect(isString).toBeInstanceOf(Function); +}); +test('foo is a string', () => { + expect(isString('foo')).toBeTruthy(); +}); +test('"10" is a string', () => { + expect(isString('10')).toBeTruthy(); +}); +test('Empty string is a string', () => { + expect(isString('')).toBeTruthy(); +}); +test('10 is not a string', () => { + expect(isString(10)).toBeFalsy(); +}); +test('true is not string', () => { + expect(isString(true)).toBeFalsy(); +}); diff --git a/test/isSymbol/isSymbol.test.js b/test/isSymbol/isSymbol.test.js index 24a4defdf..7b614771b 100644 --- a/test/isSymbol/isSymbol.test.js +++ b/test/isSymbol/isSymbol.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const isSymbol = require('./isSymbol.js'); -test('Testing isSymbol', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isSymbol === 'function', 'isSymbol is a Function'); - t.equal(isSymbol(Symbol('x')), true, "Checks if the given argument is a symbol"); - //t.deepEqual(isSymbol(args..), 'Expected'); - //t.equal(isSymbol(args..), 'Expected'); - //t.false(isSymbol(args..), 'Expected'); - //t.throws(isSymbol(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('isSymbol is a Function', () => { + expect(isSymbol).toBeInstanceOf(Function); +}); +test('Checks if the given argument is a symbol', () => { + expect(isSymbol(Symbol('x'))).toBeTruthy(); +}); diff --git a/test/isTravisCI/isTravisCI.test.js b/test/isTravisCI/isTravisCI.test.js index c807bcd67..3417f7776 100644 --- a/test/isTravisCI/isTravisCI.test.js +++ b/test/isTravisCI/isTravisCI.test.js @@ -1,17 +1,14 @@ -const test = require('tape'); +const expect = require('expect'); const isTravisCI = require('./isTravisCI.js'); -test('Testing isTravisCI', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isTravisCI === 'function', 'isTravisCI is a Function'); - if(isTravisCI()) - t.true(isTravisCI(), 'Running on Travis, correctly evaluates'); - else - t.false(isTravisCI(), 'Not running on Travis, correctly evaluates'); - //t.deepEqual(isTravisCI(args..), 'Expected'); - //t.equal(isTravisCI(args..), 'Expected'); - //t.false(isTravisCI(args..), 'Expected'); - //t.throws(isTravisCI(args..), 'Expected'); - t.end(); +test('isTravisCI is a Function', () => { + expect(isTravisCI).toBeInstanceOf(Function); }); +if(isTravisCI()) + test('Running on Travis, correctly evaluates', () => { + expect(isTravisCI()).toBeTruthy(); + }); +else + test('Not running on Travis, correctly evaluates', () => { + expect(isTravisCI()).toBeFalsy(); + }); diff --git a/test/isTypedArray/isTypedArray.test.js b/test/isTypedArray/isTypedArray.test.js index 75253822d..4264f8835 100644 --- a/test/isTypedArray/isTypedArray.test.js +++ b/test/isTypedArray/isTypedArray.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const isTypedArray = require('./isTypedArray.js'); -test('Testing isTypedArray', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isTypedArray === 'function', 'isTypedArray is a Function'); - //t.deepEqual(isTypedArray(args..), 'Expected'); - //t.equal(isTypedArray(args..), 'Expected'); - //t.false(isTypedArray(args..), 'Expected'); - //t.throws(isTypedArray(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('isTypedArray is a Function', () => { + expect(isTypedArray).toBeInstanceOf(Function); +}); diff --git a/test/isUndefined/isUndefined.test.js b/test/isUndefined/isUndefined.test.js index 43029fcf8..60a725190 100644 --- a/test/isUndefined/isUndefined.test.js +++ b/test/isUndefined/isUndefined.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const isUndefined = require('./isUndefined.js'); -test('Testing isUndefined', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isUndefined === 'function', 'isUndefined is a Function'); - t.true(isUndefined(undefined), 'Returns true for undefined'); - //t.deepEqual(isUndefined(args..), 'Expected'); - //t.equal(isUndefined(args..), 'Expected'); - //t.false(isUndefined(args..), 'Expected'); - //t.throws(isUndefined(args..), 'Expected'); - t.end(); +test('isUndefined is a Function', () => { + expect(isUndefined).toBeInstanceOf(Function); +}); +test('Returns true for undefined', () => { + expect(isUndefined(undefined)).toBeTruthy(); }); diff --git a/test/isUpperCase/isUpperCase.test.js b/test/isUpperCase/isUpperCase.test.js index a0b8e8a89..d094ca53e 100644 --- a/test/isUpperCase/isUpperCase.test.js +++ b/test/isUpperCase/isUpperCase.test.js @@ -1,15 +1,15 @@ -const test = require('tape'); +const expect = require('expect'); const isUpperCase = require('./isUpperCase.js'); -test('Testing isUpperCase', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isUpperCase === 'function', 'isUpperCase is a Function'); - //t.deepEqual(isUpperCase(args..), 'Expected'); - t.equal(isUpperCase('ABC'), true, 'ABC is all upper case'); - t.equal(isUpperCase('abc'), false, 'abc is not all upper case'); - t.equal(isUpperCase('A3@$'), true, 'A3@$ is all uppercase'); - //t.false(isUpperCase(args..), 'Expected'); - //t.throws(isUpperCase(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('isUpperCase is a Function', () => { + expect(isUpperCase).toBeInstanceOf(Function); +}); +test('ABC is all upper case', () => { + expect(isUpperCase('ABC')).toBeTruthy(); +}); + test('abc is not all upper case', () => { + expect(isUpperCase('abc')).toBeFalsy(); +}); + test('A3@$ is all uppercase', () => { + expect(isUpperCase('A3@$')).toBeTruthy(); +}); diff --git a/test/isValidJSON/isValidJSON.test.js b/test/isValidJSON/isValidJSON.test.js index b0ad1dac5..6426d77ab 100644 --- a/test/isValidJSON/isValidJSON.test.js +++ b/test/isValidJSON/isValidJSON.test.js @@ -1,16 +1,15 @@ -const test = require('tape'); +const expect = require('expect'); const isValidJSON = require('./isValidJSON.js'); -test('Testing isValidJSON', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isValidJSON === 'function', 'isValidJSON is a Function'); - t.equal(isValidJSON('{"name":"Adam","age":20}'), true, '{"name":"Adam","age":20} is a valid JSON'); - t.equal(isValidJSON('{"name":"Adam",age:"20"}'), false, '{"name":"Adam",age:"20"} is not a valid JSON'); - t.equal(isValidJSON(null), true, 'null is a valid JSON'); - //t.deepEqual(isValidJSON(args..), 'Expected'); - //t.equal(isValidJSON(args..), 'Expected'); - //t.false(isValidJSON(args..), 'Expected'); - //t.throws(isValidJSON(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('isValidJSON is a Function', () => { + expect(isValidJSON).toBeInstanceOf(Function); +}); +test('{"name":"Adam","age":20} is a valid JSON', () => { + expect(isValidJSON('{"name":"Adam","age":20}')).toBeTruthy(); +}); +test('{"name":"Adam",age:"20"} is not a valid JSON', () => { + expect(isValidJSON('{"name":"Adam",age:"20"}')).toBeFalsy(); +}); +test('null is a valid JSON', () => { + expect(isValidJSON(null)).toBeTruthy(); +}); diff --git a/test/isWeakMap/isWeakMap.test.js b/test/isWeakMap/isWeakMap.test.js index 72bb4544a..6643677e9 100644 --- a/test/isWeakMap/isWeakMap.test.js +++ b/test/isWeakMap/isWeakMap.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const isWeakMap = require('./isWeakMap.js'); -test('Testing isWeakMap', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isWeakMap === 'function', 'isWeakMap is a Function'); - //t.deepEqual(isWeakMap(args..), 'Expected'); - //t.equal(isWeakMap(args..), 'Expected'); - //t.false(isWeakMap(args..), 'Expected'); - //t.throws(isWeakMap(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('isWeakMap is a Function', () => { + expect(isWeakMap).toBeInstanceOf(Function); +}); diff --git a/test/isWeakSet/isWeakSet.test.js b/test/isWeakSet/isWeakSet.test.js index 3bb390cde..2466138af 100644 --- a/test/isWeakSet/isWeakSet.test.js +++ b/test/isWeakSet/isWeakSet.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const isWeakSet = require('./isWeakSet.js'); -test('Testing isWeakSet', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof isWeakSet === 'function', 'isWeakSet is a Function'); - //t.deepEqual(isWeakSet(args..), 'Expected'); - //t.equal(isWeakSet(args..), 'Expected'); - //t.false(isWeakSet(args..), 'Expected'); - //t.throws(isWeakSet(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('isWeakSet is a Function', () => { + expect(isWeakSet).toBeInstanceOf(Function); +}); diff --git a/test/join/join.test.js b/test/join/join.test.js index 385ef56b8..d9bf08285 100644 --- a/test/join/join.test.js +++ b/test/join/join.test.js @@ -1,17 +1,15 @@ -const test = require('tape'); +const expect = require('expect'); const join = require('./join.js'); -test('Testing join', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof join === 'function', 'join is a Function'); - t.deepEqual(join(['pen', 'pineapple', 'apple', 'pen'], ',', '&'), "pen,pineapple,apple&pen", "Joins all elements of an array into a string and returns this string"); - t.deepEqual(join(['pen', 'pineapple', 'apple', 'pen'], ','), "pen,pineapple,apple,pen", "Joins all elements of an array into a string and returns this string"); - t.deepEqual(join(['pen', 'pineapple', 'apple', 'pen']), "pen,pineapple,apple,pen", "Joins all elements of an array into a string and returns this string"); - - //t.deepEqual(join(args..), 'Expected'); - //t.equal(join(args..), 'Expected'); - //t.false(join(args..), 'Expected'); - //t.throws(join(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('join is a Function', () => { + expect(join).toBeInstanceOf(Function); +}); +test('Joins all elements of an array into a string and returns this string', () => { + expect(join(['pen', 'pineapple', 'apple', 'pen'], ',', '&')).toEqual('pen,pineapple,apple&pen'); +}); +test('Joins all elements of an array into a string and returns this string', () => { + expect(join(['pen', 'pineapple', 'apple', 'pen'], ',')).toEqual('pen,pineapple,apple,pen'); +}); +test('Joins all elements of an array into a string and returns this string', () => { + expect(join(['pen', 'pineapple', 'apple', 'pen'])).toEqual('pen,pineapple,apple,pen'); +}); diff --git a/test/last/last.test.js b/test/last/last.test.js index fc0ba799c..48f7b4179 100644 --- a/test/last/last.test.js +++ b/test/last/last.test.js @@ -1,21 +1,33 @@ -const test = require('tape'); +const expect = require('expect'); const last = require('./last.js'); -test('Testing last', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof last === 'function', 'last is a Function'); - t.true(last({ a: 1234}) === undefined, 'last({ a: 1234}) returns undefined'); - t.equal(last([1, 2, 3]), 3, "last([1, 2, 3]) returns 3"); - t.equal(last({ 0: false}), undefined, 'last({ 0: false}) returns undefined'); - t.equal(last('String'), 'g', 'last(String) returns g'); - t.throws(() => last(null), 'last(null) throws an Error'); - t.throws(() => last(undefined), 'last(undefined) throws an Error'); - t.throws(() => last(), 'last() throws an Error'); - - let start = new Date().getTime(); - last([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]); - let end = new Date().getTime(); - t.true((end - start) < 2000, 'last([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run'); - t.end(); -}); \ No newline at end of file +test('last is a Function', () => { + expect(last).toBeInstanceOf(Function); +}); +test('last({ a: 1234}) returns undefined', () => { + expect(last({ a: 1234}) === undefined).toBeTruthy(); +}); +test('last([1, 2, 3]) returns 3', () => { + expect(last([1, 2, 3])).toBe(3); +}); +test('last({ 0: false}) returns undefined', () => { + expect(last({ 0: false})).toBe(undefined); +}); +test('last(String) returns g', () => { + expect(last('String')).toBe('g'); +}); +test('last(null) throws an Error', () => { + expect(() => { last(null); }).toThrow(); +}); +test('last(undefined) throws an Error', () => { + expect(() => { last(undefined); }).toThrow(); +}); +test('last() throws an Error', () => { + expect(() => { last(); }).toThrow(); +}); +let start = new Date().getTime(); +last([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]); +let end = new Date().getTime(); +test('last([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run', () => { + expect((end - start) < 2000).toBeTruthy(); +}); diff --git a/test/lcm/lcm.test.js b/test/lcm/lcm.test.js index cba81345c..dfa340b88 100644 --- a/test/lcm/lcm.test.js +++ b/test/lcm/lcm.test.js @@ -1,15 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const lcm = require('./lcm.js'); -test('Testing lcm', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof lcm === 'function', 'lcm is a Function'); - t.equal(lcm(12, 7), 84, "Returns the least common multiple of two or more numbers."); - t.equal(lcm(...[1, 3, 4, 5]), 60, "Returns the least common multiple of two or more numbers."); - //t.deepEqual(lcm(args..), 'Expected'); - //t.equal(lcm(args..), 'Expected'); - //t.false(lcm(args..), 'Expected'); - //t.throws(lcm(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('lcm is a Function', () => { + expect(lcm).toBeInstanceOf(Function); +}); +test('Returns the least common multiple of two or more numbers.', () => { + expect(lcm(12, 7)).toBe(84); +}); +test('Returns the least common multiple of two or more numbers.', () => { + expect(lcm(...[1, 3, 4, 5])).toBe(60); +}); diff --git a/test/levenshteinDistance/levenshteinDistance.test.js b/test/levenshteinDistance/levenshteinDistance.test.js index 3c3c74404..c5556114d 100644 --- a/test/levenshteinDistance/levenshteinDistance.test.js +++ b/test/levenshteinDistance/levenshteinDistance.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const levenshteinDistance = require('./levenshteinDistance.js'); -test('Testing levenshteinDistance', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof levenshteinDistance === 'function', 'levenshteinDistance is a Function'); - //t.deepEqual(levenshteinDistance(args..), 'Expected'); - //t.equal(levenshteinDistance(args..), 'Expected'); - //t.false(levenshteinDistance(args..), 'Expected'); - //t.throws(levenshteinDistance(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('levenshteinDistance is a Function', () => { + expect(levenshteinDistance).toBeInstanceOf(Function); +}); diff --git a/test/longestItem/longestItem.test.js b/test/longestItem/longestItem.test.js index ae4b53739..7e8c01357 100644 --- a/test/longestItem/longestItem.test.js +++ b/test/longestItem/longestItem.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const longestItem = require('./longestItem.js'); -test('Testing longestItem', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof longestItem === 'function', 'longestItem is a Function'); - t.deepEqual(longestItem('this', 'is', 'a', 'testcase'), 'testcase', "Returns the longest object"); - //t.deepEqual(longestItem(args..), 'Expected'); - //t.equal(longestItem(args..), 'Expected'); - //t.false(longestItem(args..), 'Expected'); - //t.throws(longestItem(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('longestItem is a Function', () => { + expect(longestItem).toBeInstanceOf(Function); +}); +test('Returns the longest object', () => { + expect(longestItem('this', 'is', 'a', 'testcase')).toEqual('testcase'); +}); diff --git a/test/lowercaseKeys/lowercaseKeys.test.js b/test/lowercaseKeys/lowercaseKeys.test.js index 6b7937773..37868e338 100644 --- a/test/lowercaseKeys/lowercaseKeys.test.js +++ b/test/lowercaseKeys/lowercaseKeys.test.js @@ -1,17 +1,14 @@ -const test = require('tape'); +const expect = require('expect'); const lowercaseKeys = require('./lowercaseKeys.js'); -test('Testing lowercaseKeys', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof lowercaseKeys === 'function', 'lowercaseKeys is a Function'); - const myObj = { Name: 'Adam', sUrnAME: 'Smith' }; - const myObjLower = lowercaseKeys(myObj); - t.deepEqual(myObjLower, {name: 'Adam', surname: 'Smith'}, 'Lowercases object keys'); - t.deepEqual(myObj, { Name: 'Adam', sUrnAME: 'Smith' }, 'Does not mutate original object'); - //t.deepEqual(lowercaseKeys(args..), 'Expected'); - //t.equal(lowercaseKeys(args..), 'Expected'); - //t.false(lowercaseKeys(args..), 'Expected'); - //t.throws(lowercaseKeys(args..), 'Expected'); - t.end(); +test('lowercaseKeys is a Function', () => { + expect(lowercaseKeys).toBeInstanceOf(Function); +}); +const myObj = { Name: 'Adam', sUrnAME: 'Smith' }; +const myObjLower = lowercaseKeys(myObj); +test('Lowercases object keys', () => { + expect(myObjLower).toEqual( {name: 'Adam', surname: 'Smith'}); +}); +test('Does not mutate original object', () => { + expect(myObj).toEqual({ Name: 'Adam', sUrnAME: 'Smith' }); }); diff --git a/test/luhnCheck/luhnCheck.test.js b/test/luhnCheck/luhnCheck.test.js index e044cbd85..28d176fe5 100644 --- a/test/luhnCheck/luhnCheck.test.js +++ b/test/luhnCheck/luhnCheck.test.js @@ -1,16 +1,15 @@ -const test = require('tape'); +const expect = require('expect'); const luhnCheck = require('./luhnCheck.js'); -test('Testing luhnCheck', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof luhnCheck === 'function', 'luhnCheck is a Function'); - t.equal(luhnCheck(6011329933655299), false, "validates identification number"); - t.equal(luhnCheck('4485275742308327'), true, "validates identification number"); - t.equal(luhnCheck(123456789), false, "validates identification number"); - //t.deepEqual(luhnCheck(args..), 'Expected'); - //t.equal(luhnCheck(args..), 'Expected'); - //t.false(luhnCheck(args..), 'Expected'); - //t.throws(luhnCheck(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('luhnCheck is a Function', () => { + expect(luhnCheck).toBeInstanceOf(Function); +}); +test('validates identification number', () => { + expect(luhnCheck(6011329933655299)).toBeFalsy(); +}); +test('validates identification number', () => { + expect(luhnCheck('4485275742308327')).toBeTruthy(); +}); +test('validates identification number', () => { + expect(luhnCheck(123456789)).toBeFalsy(); +}); diff --git a/test/mapKeys/mapKeys.test.js b/test/mapKeys/mapKeys.test.js index 1ce44e71f..076f1fabe 100644 --- a/test/mapKeys/mapKeys.test.js +++ b/test/mapKeys/mapKeys.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const mapKeys = require('./mapKeys.js'); -test('Testing mapKeys', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof mapKeys === 'function', 'mapKeys is a Function'); - t.deepEqual(mapKeys({ a: 1, b: 2 }, (val, key) => key + val), { a1: 1, b2: 2 }, 'Maps keys'); - //t.deepEqual(mapKeys(args..), 'Expected'); - //t.equal(mapKeys(args..), 'Expected'); - //t.false(mapKeys(args..), 'Expected'); - //t.throws(mapKeys(args..), 'Expected'); - t.end(); +test('mapKeys is a Function', () => { + expect(mapKeys).toBeInstanceOf(Function); +}); +test('Maps keys', () => { + expect(mapKeys({ a: 1, b: 2 }, (val, key) => key + val)).toEqual({ a1: 1, b2: 2 }); }); diff --git a/test/mapObject/mapObject.test.js b/test/mapObject/mapObject.test.js index 294bdcd00..86d5cf698 100644 --- a/test/mapObject/mapObject.test.js +++ b/test/mapObject/mapObject.test.js @@ -1,16 +1,15 @@ -const test = require('tape'); +const expect = require('expect'); const mapObject = require('./mapObject.js'); -test('Testing mapObject', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof mapObject === 'function', 'mapObject is a Function'); - t.deepEqual(mapObject([1, 2, 3], a => a * a), { 1: 1, 2: 4, 3: 9 }, "mapObject([1, 2, 3], a => a * a) returns { 1: 1, 2: 4, 3: 9 }"); - t.deepEqual(mapObject([1, 2, 3, 4], (a, b) => b - a), { 1: -1, 2: -1, 3: -1, 4: -1 }, 'mapObject([1, 2, 3, 4], (a, b) => b - a) returns { 1: -1, 2: -1, 3: -1, 4: -1 }'); - t.deepEqual(mapObject([1, 2, 3, 4], (a, b) => a - b), { 1: 1, 2: 1, 3: 1, 4: 1 }, 'mapObject([1, 2, 3, 4], (a, b) => a - b) returns { 1: 1, 2: 1, 3: 1, 4: 1 }'); - - //t.equal(mapObject(args..), 'Expected'); - //t.false(mapObject(args..), 'Expected'); - //t.throws(mapObject(args..), 'Expected'); - t.end(); +test('mapObject is a Function', () => { + expect(mapObject).toBeInstanceOf(Function); +}); +test('mapObject([1, 2, 3], a => a * a) returns { 1: 1, 2: 4, 3: 9 }', () => { + expect(mapObject([1, 2, 3], a => a * a)).toEqual({ 1: 1, 2: 4, 3: 9 }); +}); +test('mapObject([1, 2, 3, 4], (a, b) => b - a) returns { 1: -1, 2: -1, 3: -1, 4: -1 }', () => { + expect(mapObject([1, 2, 3, 4], (a, b) => b - a)).toEqual({ 1: -1, 2: -1, 3: -1, 4: -1 }); +}); +test('mapObject([1, 2, 3, 4], (a, b) => a - b) returns { 1: 1, 2: 1, 3: 1, 4: 1 }', () => { + expect(mapObject([1, 2, 3, 4], (a, b) => a - b)).toEqual({ 1: 1, 2: 1, 3: 1, 4: 1 }); }); diff --git a/test/mapValues/mapValues.test.js b/test/mapValues/mapValues.test.js index 273ada753..24273703c 100644 --- a/test/mapValues/mapValues.test.js +++ b/test/mapValues/mapValues.test.js @@ -1,18 +1,13 @@ -const test = require('tape'); +const expect = require('expect'); const mapValues = require('./mapValues.js'); -test('Testing mapValues', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof mapValues === 'function', 'mapValues is a Function'); - const users = { - fred: { user: 'fred', age: 40 }, - pebbles: { user: 'pebbles', age: 1 } - }; - t.deepEqual(mapValues(users, u => u.age), { fred: 40, pebbles: 1 }, 'Maps values'); - //t.deepEqual(mapValues(args..), 'Expected'); - //t.equal(mapValues(args..), 'Expected'); - //t.false(mapValues(args..), 'Expected'); - //t.throws(mapValues(args..), 'Expected'); - t.end(); +test('mapValues is a Function', () => { + expect(mapValues).toBeInstanceOf(Function); +}); +const users = { + fred: { user: 'fred', age: 40 }, + pebbles: { user: 'pebbles', age: 1 } +}; +test('Maps values', () => { + expect(mapValues(users, u => u.age)).toEqual({ fred: 40, pebbles: 1 }); }); diff --git a/test/mask/mask.test.js b/test/mask/mask.test.js index dc57ed888..11c8e4cb5 100644 --- a/test/mask/mask.test.js +++ b/test/mask/mask.test.js @@ -1,16 +1,15 @@ -const test = require('tape'); +const expect = require('expect'); const mask = require('./mask.js'); -test('Testing mask', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof mask === 'function', 'mask is a Function'); - t.equal(mask(1234567890), '******7890', "Replaces all but the last num of characters with the specified mask character"); - t.equal(mask(1234567890, 3), '*******890', "Replaces all but the last num of characters with the specified mask character"); - t.equal(mask(1234567890, -4, '$'), '$$$$567890', "Replaces all but the last num of characters with the specified mask character"); - - //t.equal(mask(args..), 'Expected'); - //t.false(mask(args..), 'Expected'); - //t.throws(mask(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('mask is a Function', () => { + expect(mask).toBeInstanceOf(Function); +}); +test('Replaces all but the last num of characters with the specified mask character', () => { + expect(mask(1234567890)).toBe('******7890'); +}); +test('Replaces all but the last num of characters with the specified mask character', () => { + expect(mask(1234567890, 3)).toBe('*******890'); +}); +test('Replaces all but the last num of characters with the specified mask character', () => { + expect(mask(1234567890, -4, '$')).toBe('$$$$567890'); +}); diff --git a/test/matches/matches.test.js b/test/matches/matches.test.js index e28065fa5..221c9d950 100644 --- a/test/matches/matches.test.js +++ b/test/matches/matches.test.js @@ -1,15 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const matches = require('./matches.js'); -test('Testing matches', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof matches === 'function', 'matches is a Function'); - t.true(matches({ age: 25, hair: 'long', beard: true }, { hair: 'long', beard: true }), 'Matches returns true for two similar objects'); - t.false(matches({ hair: 'long', beard: true }, { age: 25, hair: 'long', beard: true }), 'Matches returns false for two non-similar objects'); - //t.deepEqual(matches(args..), 'Expected'); - //t.equal(matches(args..), 'Expected'); - //t.false(matches(args..), 'Expected'); - //t.throws(matches(args..), 'Expected'); - t.end(); +test('matches is a Function', () => { + expect(matches).toBeInstanceOf(Function); +}); +test('Matches returns true for two similar objects', () => { + expect(matches({ age: 25, hair: 'long', beard: true }, { hair: 'long', beard: true })).toBeTruthy(); +}); +test('Matches returns false for two non-similar objects', () => { + expect(matches({ hair: 'long', beard: true }, { age: 25, hair: 'long', beard: true })).toBeFalsy(); }); diff --git a/test/matchesWith/matchesWith.test.js b/test/matchesWith/matchesWith.test.js index 9ce717785..5de34f836 100644 --- a/test/matchesWith/matchesWith.test.js +++ b/test/matchesWith/matchesWith.test.js @@ -1,19 +1,14 @@ -const test = require('tape'); +const expect = require('expect'); const matchesWith = require('./matchesWith.js'); -test('Testing matchesWith', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof matchesWith === 'function', 'matchesWith is a Function'); - const isGreeting = val => /^h(?:i|ello)$/.test(val); - t.true(matchesWith( +test('matchesWith is a Function', () => { + expect(matchesWith).toBeInstanceOf(Function); +}); +const isGreeting = val => /^h(?:i|ello)$/.test(val); +test('Returns true for two objects with similar values, based on the provided function', () => { + expect(matchesWith( { greeting: 'hello' }, { greeting: 'hi' }, (oV, sV) => isGreeting(oV) && isGreeting(sV) - ), 'Returns true for two objects with similar values, based on the provided function'); - //t.deepEqual(matchesWith(args..), 'Expected'); - //t.equal(matchesWith(args..), 'Expected'); - //t.false(matchesWith(args..), 'Expected'); - //t.throws(matchesWith(args..), 'Expected'); - t.end(); + )).toBeTruthy(); }); diff --git a/test/maxBy/maxBy.test.js b/test/maxBy/maxBy.test.js index 3c0d156b3..2cd581553 100644 --- a/test/maxBy/maxBy.test.js +++ b/test/maxBy/maxBy.test.js @@ -1,15 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const maxBy = require('./maxBy.js'); -test('Testing maxBy', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof maxBy === 'function', 'maxBy is a Function'); - t.equals(maxBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], o => o.n), 8, 'Produces the right result with a function'); - t.equals(maxBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], 'n'), 8, 'Produces the right result with a property name'); - //t.deepEqual(maxBy(args..), 'Expected'); - //t.equal(maxBy(args..), 'Expected'); - //t.false(maxBy(args..), 'Expected'); - //t.throws(maxBy(args..), 'Expected'); - t.end(); +test('maxBy is a Function', () => { + expect(maxBy).toBeInstanceOf(Function); +}); +test('Produces the right result with a function', () => { + expect(maxBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], o => o.n)).toBe(8); +}); +test('Produces the right result with a property name', () => { + expect(maxBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], 'n')).toBe(8); }); diff --git a/test/maxN/maxN.test.js b/test/maxN/maxN.test.js index 89e14ab98..dc100b2f7 100644 --- a/test/maxN/maxN.test.js +++ b/test/maxN/maxN.test.js @@ -1,15 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const maxN = require('./maxN.js'); -test('Testing maxN', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof maxN === 'function', 'maxN is a Function'); - t.deepEqual(maxN([1, 2, 3]), [3], "Returns the n maximum elements from the provided array"); - t.deepEqual(maxN([1, 2, 3], 2), [3, 2], "Returns the n maximum elements from the provided array"); - //t.deepEqual(maxN(args..), 'Expected'); - //t.equal(maxN(args..), 'Expected'); - //t.false(maxN(args..), 'Expected'); - //t.throws(maxN(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('maxN is a Function', () => { + expect(maxN).toBeInstanceOf(Function); +}); +test('Returns the n maximum elements from the provided array', () => { + expect(maxN([1, 2, 3])).toEqual([3]); +}); +test('Returns the n maximum elements from the provided array', () => { + expect(maxN([1, 2, 3], 2)).toEqual([3, 2]); +}); diff --git a/test/median/median.test.js b/test/median/median.test.js index 9fa44be9c..76835c0b8 100644 --- a/test/median/median.test.js +++ b/test/median/median.test.js @@ -1,15 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const median = require('./median.js'); -test('Testing median', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof median === 'function', 'median is a Function'); - t.equal(median([5, 6, 50, 1, -5]), 5, "Returns the median of an array of numbers"); - t.equal(median([1, 2, 3]), 2, "Returns the median of an array of numbers"); - //t.deepEqual(median(args..), 'Expected'); - //t.equal(median(args..), 'Expected'); - //t.false(median(args..), 'Expected'); - //t.throws(median(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('median is a Function', () => { + expect(median).toBeInstanceOf(Function); +}); +test('Returns the median of an array of numbers', () => { + expect(median([5, 6, 50, 1, -5])).toBe(5); +}); +test('Returns the median of an array of numbers', () => { + expect(median([1, 2, 3])).toBe(2); +}); diff --git a/test/memoize/memoize.test.js b/test/memoize/memoize.test.js index e90eb2b05..ec8b0ca9e 100644 --- a/test/memoize/memoize.test.js +++ b/test/memoize/memoize.test.js @@ -1,18 +1,17 @@ -const test = require('tape'); +const expect = require('expect'); const memoize = require('./memoize.js'); -test('Testing memoize', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof memoize === 'function', 'memoize is a Function'); - const f = x => x * x; - const square = memoize(f); - t.equal(square(2), 4, 'Function works properly'); - t.equal(square(3), 9, 'Function works properly'); - t.deepEqual(Array.from(square.cache), [[2,4],[3,9]], 'Cache stores values'); - //t.deepEqual(memoize(args..), 'Expected'); - //t.equal(memoize(args..), 'Expected'); - //t.false(memoize(args..), 'Expected'); - //t.throws(memoize(args..), 'Expected'); - t.end(); +test('memoize is a Function', () => { + expect(memoize).toBeInstanceOf(Function); +}); +const f = x => x * x; +const square = memoize(f); +test('Function works properly', () => { + expect(square(2)).toBe(4); +}); +test('Function works properly', () => { + expect(square(3)).toBe(9); +}); +test('Cache stores values', () => { + expect(Array.from(square.cache)).toEqual([[2,4],[3,9]]); }); diff --git a/test/merge/merge.test.js b/test/merge/merge.test.js index 2ed73d89a..e46ac3b4b 100644 --- a/test/merge/merge.test.js +++ b/test/merge/merge.test.js @@ -1,23 +1,18 @@ -const test = require('tape'); +const expect = require('expect'); const merge = require('./merge.js'); -test('Testing merge', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof merge === 'function', 'merge is a Function'); - const object = { - a: [{ x: 2 }, { y: 4 }], - b: 1 - }; - const other = { - a: { z: 3 }, - b: [2, 3], - c: 'foo' - }; - t.deepEqual(merge(object, other), { a: [ { x: 2 }, { y: 4 }, { z: 3 } ], b: [ 1, 2, 3 ], c: 'foo' }, 'Merges two objects'); - //t.deepEqual(merge(args..), 'Expected'); - //t.equal(merge(args..), 'Expected'); - //t.false(merge(args..), 'Expected'); - //t.throws(merge(args..), 'Expected'); - t.end(); +test('merge is a Function', () => { + expect(merge).toBeInstanceOf(Function); +}); +const object = { + a: [{ x: 2 }, { y: 4 }], + b: 1 +}; +const other = { + a: { z: 3 }, + b: [2, 3], + c: 'foo' +}; +test('Merges two objects', () => { + expect(merge(object, other)).toEqual({ a: [ { x: 2 }, { y: 4 }, { z: 3 } ], b: [ 1, 2, 3 ], c: 'foo' }); }); diff --git a/test/minBy/minBy.test.js b/test/minBy/minBy.test.js index f2a0ca5ff..82a1beeed 100644 --- a/test/minBy/minBy.test.js +++ b/test/minBy/minBy.test.js @@ -1,15 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const minBy = require('./minBy.js'); -test('Testing minBy', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof minBy === 'function', 'minBy is a Function'); - t.equals(minBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], o => o.n), 2, 'Produces the right result with a function'); - t.equals(minBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], 'n'), 2, 'Produces the right result with a property name'); - //t.deepEqual(minBy(args..), 'Expected'); - //t.equal(minBy(args..), 'Expected'); - //t.false(minBy(args..), 'Expected'); - //t.throws(minBy(args..), 'Expected'); - t.end(); +test('minBy is a Function', () => { + expect(minBy).toBeInstanceOf(Function); +}); +test('Produces the right result with a function', () => { + expect(minBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], o => o.n)).toBe(2); +}); +test('Produces the right result with a property name', () => { + expect(minBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], 'n')).toBe(2); }); diff --git a/test/minN/minN.test.js b/test/minN/minN.test.js index edfd36631..dd4269711 100644 --- a/test/minN/minN.test.js +++ b/test/minN/minN.test.js @@ -1,14 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const minN = require('./minN.js'); -test('Testing minN', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof minN === 'function', 'minN is a Function'); - t.deepEqual(minN([1, 2, 3]), [1], "Returns the n minimum elements from the provided array"); - t.deepEqual(minN([1, 2, 3], 2), [1, 2], "Returns the n minimum elements from the provided array"); - //t.equal(minN(args..), 'Expected'); - //t.false(minN(args..), 'Expected'); - //t.throws(minN(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('minN is a Function', () => { + expect(minN).toBeInstanceOf(Function); +}); +test('Returns the n minimum elements from the provided array', () => { + expect(minN([1, 2, 3])).toEqual([1]); +}); +test('Returns the n minimum elements from the provided array', () => { + expect(minN([1, 2, 3], 2), ).toEqual([1, 2]); +}); diff --git a/test/mostPerformant/mostPerformant.test.js b/test/mostPerformant/mostPerformant.test.js index 95a560f91..877fcdfa8 100644 --- a/test/mostPerformant/mostPerformant.test.js +++ b/test/mostPerformant/mostPerformant.test.js @@ -1,14 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const mostPerformant = require('./mostPerformant.js'); -test('Testing mostPerformant', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof mostPerformant === 'function', 'mostPerformant is a Function'); - t.pass('Tested by @chalarangelo on 16/02/2018'); - //t.deepEqual(mostPerformant(args..), 'Expected'); - //t.equal(mostPerformant(args..), 'Expected'); - //t.false(mostPerformant(args..), 'Expected'); - //t.throws(mostPerformant(args..), 'Expected'); - t.end(); +test('mostPerformant is a Function', () => { + expect(mostPerformant).toBeInstanceOf(Function); }); diff --git a/test/negate/negate.test.js b/test/negate/negate.test.js index a356b8a2d..7dfd8b080 100644 --- a/test/negate/negate.test.js +++ b/test/negate/negate.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const negate = require('./negate.js'); -test('Testing negate', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof negate === 'function', 'negate is a Function'); - t.deepEqual([1, 2, 3, 4, 5, 6].filter(negate(n => n % 2 === 0)), [1, 3, 5], "Negates a predicate function"); - //t.deepEqual(negate(args..), 'Expected'); - //t.equal(negate(args..), 'Expected'); - //t.false(negate(args..), 'Expected'); - //t.throws(negate(args..), 'Expected'); - t.end(); +test('negate is a Function', () => { + expect(negate).toBeInstanceOf(Function); +}); +test('Negates a predicate function', () => { + expect([1, 2, 3, 4, 5, 6].filter(negate(n => n % 2 === 0))).toEqual([1, 3, 5]); }); diff --git a/test/nest/nest.test.js b/test/nest/nest.test.js index f3b177255..894a17001 100644 --- a/test/nest/nest.test.js +++ b/test/nest/nest.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const nest = require('./nest.js'); -test('Testing nest', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof nest === 'function', 'nest is a Function'); - //t.deepEqual(nest(args..), 'Expected'); - //t.equal(nest(args..), 'Expected'); - //t.false(nest(args..), 'Expected'); - //t.throws(nest(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('nest is a Function', () => { + expect(nest).toBeInstanceOf(Function); +}); diff --git a/test/nodeListToArray/nodeListToArray.test.js b/test/nodeListToArray/nodeListToArray.test.js index 12d99435c..3ebb00c14 100644 --- a/test/nodeListToArray/nodeListToArray.test.js +++ b/test/nodeListToArray/nodeListToArray.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const nodeListToArray = require('./nodeListToArray.js'); -test('Testing nodeListToArray', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof nodeListToArray === 'function', 'nodeListToArray is a Function'); - //t.deepEqual(nodeListToArray(args..), 'Expected'); - //t.equal(nodeListToArray(args..), 'Expected'); - //t.false(nodeListToArray(args..), 'Expected'); - //t.throws(nodeListToArray(args..), 'Expected'); - t.end(); +test('nodeListToArray is a Function', () => { + expect(nodeListToArray).toBeInstanceOf(Function); }); \ No newline at end of file diff --git a/test/none/none.test.js b/test/none/none.test.js index af6209d91..f46e207b0 100644 --- a/test/none/none.test.js +++ b/test/none/none.test.js @@ -1,17 +1,18 @@ -const test = require('tape'); +const expect = require('expect'); const none = require('./none.js'); -test('Testing none', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof none === 'function', 'none is a Function'); - t.true(none([0,undefined,NaN,null,'']), 'Returns true for arrays with no truthy values'); - t.false(none([0,1]), 'Returns false for arrays with at least one truthy value'); - t.true(none([4,1,0,3], x => x < 0), 'Returns true with a predicate function'); - t.false(none([0,1,2], x => x === 1), 'Returns false with predicate function'); - //t.deepEqual(none(args..), 'Expected'); - //t.equal(none(args..), 'Expected'); - //t.false(none(args..), 'Expected'); - //t.throws(none(args..), 'Expected'); - t.end(); +test('none is a Function', () => { + expect(none).toBeInstanceOf(Function); +}); +test('Returns true for arrays with no truthy values', () => { + expect(none([0,undefined,NaN,null,''])).toBeTruthy(); +}); +test('Returns false for arrays with at least one truthy value', () => { + expect(none([0,1])).toBeFalsy(); +}); +test('Returns true with a predicate function', () => { + expect(none([4,1,0,3], x => x < 0)).toBeTruthy(); +}); +test('Returns false with predicate function', () => { + expect(none([0,1,2], x => x === 1)).toBeFalsy(); }); diff --git a/test/nthArg/nthArg.test.js b/test/nthArg/nthArg.test.js index b8cc4b62c..621f91dac 100644 --- a/test/nthArg/nthArg.test.js +++ b/test/nthArg/nthArg.test.js @@ -1,18 +1,18 @@ -const test = require('tape'); +const expect = require('expect'); const nthArg = require('./nthArg.js'); -test('Testing nthArg', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof nthArg === 'function', 'nthArg is a Function'); - const third = nthArg(2); - t.equal(third(1, 2, 3), 3, 'Returns the nth argument'); - t.equal(third(1, 2), undefined, 'Returns undefined if arguments too few'); - const last = nthArg(-1); - t.equal(last(1, 2, 3, 4, 5), 5, 'Works for negative values'); - //t.deepEqual(nthArg(args..), 'Expected'); - //t.equal(nthArg(args..), 'Expected'); - //t.false(nthArg(args..), 'Expected'); - //t.throws(nthArg(args..), 'Expected'); - t.end(); +test('nthArg is a Function', () => { + expect(nthArg).toBeInstanceOf(Function); }); +const third = nthArg(2); +test('Returns the nth argument', () => { + expect(third(1, 2, 3)).toBe(3); +}); +test('Returns undefined if arguments too few', () => { + expect(third(1, 2)).toBe(undefined); +}); +const last = nthArg(-1); +test('Works for negative values', () => { + expect(last(1, 2, 3, 4, 5)).toBe(5); +}); + diff --git a/test/nthElement/nthElement.test.js b/test/nthElement/nthElement.test.js index 6db6ddd4a..774de6f78 100644 --- a/test/nthElement/nthElement.test.js +++ b/test/nthElement/nthElement.test.js @@ -1,15 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const nthElement = require('./nthElement.js'); -test('Testing nthElement', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof nthElement === 'function', 'nthElement is a Function'); - t.equal(nthElement(['a', 'b', 'c'], 1), 'b', "Returns the nth element of an array."); - t.equal(nthElement(['a', 'b', 'c'], -3), 'a', "Returns the nth element of an array."); - //t.deepEqual(nthElement(args..), 'Expected'); - //t.equal(nthElement(args..), 'Expected'); - //t.false(nthElement(args..), 'Expected'); - //t.throws(nthElement(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('nthElement is a Function', () => { + expect(nthElement).toBeInstanceOf(Function); +}); +test('Returns the nth element of an array.', () => { + expect(nthElement(['a', 'b', 'c'], 1)).toBe('b'); +}); +test('Returns the nth element of an array.', () => { + expect(nthElement(['a', 'b', 'c'], -3)).toBe('a'); +}); diff --git a/test/objectFromPairs/objectFromPairs.test.js b/test/objectFromPairs/objectFromPairs.test.js index af270b7cf..d1d4db8f8 100644 --- a/test/objectFromPairs/objectFromPairs.test.js +++ b/test/objectFromPairs/objectFromPairs.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const objectFromPairs = require('./objectFromPairs.js'); -test('Testing objectFromPairs', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof objectFromPairs === 'function', 'objectFromPairs is a Function'); - t.deepEqual(objectFromPairs([['a', 1], ['b', 2]]), {a: 1, b: 2}, "Creates an object from the given key-value pairs."); - //t.deepEqual(objectFromPairs(args..), 'Expected'); - //t.equal(objectFromPairs(args..), 'Expected'); - //t.false(objectFromPairs(args..), 'Expected'); - //t.throws(objectFromPairs(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('objectFromPairs is a Function', () => { + expect(objectFromPairs).toBeInstanceOf(Function); +}); + test('Creates an object from the given key-value pairs.', () => { + expect(objectFromPairs([['a', 1], ['b', 2]])).toEqual({a: 1, b: 2}); +}); diff --git a/test/objectToPairs/objectToPairs.test.js b/test/objectToPairs/objectToPairs.test.js index e3477d39b..5db49742a 100644 --- a/test/objectToPairs/objectToPairs.test.js +++ b/test/objectToPairs/objectToPairs.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const objectToPairs = require('./objectToPairs.js'); -test('Testing objectToPairs', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof objectToPairs === 'function', 'objectToPairs is a Function'); - t.deepEqual(objectToPairs({ a: 1, b: 2 }), [['a',1],['b',2]], "Creates an array of key-value pair arrays from an object."); - //t.deepEqual(objectToPairs(args..), 'Expected'); - //t.equal(objectToPairs(args..), 'Expected'); - //t.false(objectToPairs(args..), 'Expected'); - //t.throws(objectToPairs(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('objectToPairs is a Function', () => { + expect(objectToPairs).toBeInstanceOf(Function); +}); +test('Creates an array of key-value pair arrays from an object.', () => { + expect(objectToPairs({ a: 1, b: 2 })).toEqual([['a',1],['b', 2]]); +}); diff --git a/test/observeMutations/observeMutations.test.js b/test/observeMutations/observeMutations.test.js index fe42861a2..314cdf633 100644 --- a/test/observeMutations/observeMutations.test.js +++ b/test/observeMutations/observeMutations.test.js @@ -1,14 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const observeMutations = require('./observeMutations.js'); -test('Testing observeMutations', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof observeMutations === 'function', 'observeMutations is a Function'); - t.pass('Tested on 09/02/2018 by @chalarangelo'); - //t.deepEqual(observeMutations(args..), 'Expected'); - //t.equal(observeMutations(args..), 'Expected'); - //t.false(observeMutations(args..), 'Expected'); - //t.throws(observeMutations(args..), 'Expected'); - t.end(); +test('observeMutations is a Function', () => { + expect(observeMutations).toBeInstanceOf(Function); }); diff --git a/test/off/off.test.js b/test/off/off.test.js index 8a3eca663..59b87132d 100644 --- a/test/off/off.test.js +++ b/test/off/off.test.js @@ -1,14 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const off = require('./off.js'); -test('Testing off', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof off === 'function', 'off is a Function'); - t.pass('Tested by @chalarangelo on 16/02/2018'); - //t.deepEqual(off(args..), 'Expected'); - //t.equal(off(args..), 'Expected'); - //t.false(off(args..), 'Expected'); - //t.throws(off(args..), 'Expected'); - t.end(); +test('off is a Function', () => { + expect(off).toBeInstanceOf(Function); }); diff --git a/test/offset/offset.test.js b/test/offset/offset.test.js index b122f8dbb..73ee2fe04 100644 --- a/test/offset/offset.test.js +++ b/test/offset/offset.test.js @@ -1,19 +1,24 @@ -const test = require('tape'); +const expect = require('expect'); const offset = require('./offset.js'); -test('Testing offset', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof offset === 'function', 'offset is a Function'); - t.deepEqual(offset([1, 2, 3, 4, 5], 0), [1, 2, 3, 4, 5], 'Offset of 0 returns the same array.'); - t.deepEqual(offset([1, 2, 3, 4, 5], 2), [3, 4, 5, 1, 2], 'Offset > 0 returns the offsetted array.'); - t.deepEqual(offset([1, 2, 3, 4, 5], -2), [4, 5, 1, 2, 3], 'Offset < 0 returns the reverse offsetted array.'); - t.deepEqual(offset([1, 2, 3, 4, 5], 6),[1, 2, 3, 4, 5], 'Offset greater than the length of the array returns the same array.'); - t.deepEqual(offset([1, 2, 3, 4, 5], -6), [1, 2, 3, 4, 5], 'Offset less than the negative length of the array returns the same array.'); - t.deepEqual(offset([], 3), [], 'Offsetting empty array returns an empty array.'); - //t.deepEqual(offset(args..), 'Expected'); - //t.equal(offset(args..), 'Expected'); - //t.false(offset(args..), 'Expected'); - //t.throws(offset(args..), 'Expected'); - t.end(); +test('offset is a Function', () => { + expect(offset).toBeInstanceOf(Function); +}); +test('Offset of 0 returns the same array.', () => { + expect(offset([1, 2, 3, 4, 5], 0)).toEqual([1, 2, 3, 4, 5]); +}); +test('Offset > 0 returns the offsetted array.', () => { + expect(offset([1, 2, 3, 4, 5], 2)).toEqual([3, 4, 5, 1, 2]); +}); +test('Offset < 0 returns the reverse offsetted array.', () => { + expect(offset([1, 2, 3, 4, 5], -2)).toEqual([4, 5, 1, 2, 3]); +}); +test('Offset greater than the length of the array returns the same array.', () => { + expect(offset([1, 2, 3, 4, 5], 6)).toEqual([1, 2, 3, 4, 5]); +}); +test('Offset less than the negative length of the array returns the same array.', () => { + expect(offset([1, 2, 3, 4, 5], -6)).toEqual([1, 2, 3, 4, 5]); +}); +test('Offsetting empty array returns an empty array.', () => { + expect(offset([], 3)).toEqual([]); }); diff --git a/test/omit/omit.test.js b/test/omit/omit.test.js index 296505687..50339eef4 100644 --- a/test/omit/omit.test.js +++ b/test/omit/omit.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const omit = require('./omit.js'); -test('Testing omit', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof omit === 'function', 'omit is a Function'); - t.deepEqual(omit({ a: 1, b: '2', c: 3 }, ['b']), { 'a': 1, 'c': 3 }, 'Omits the key-value pairs corresponding to the given keys from an object'); - //t.deepEqual(omit(args..), 'Expected'); - //t.equal(omit(args..), 'Expected'); - //t.false(omit(args..), 'Expected'); - //t.throws(omit(args..), 'Expected'); - t.end(); +test('omit is a Function', () => { + expect(omit).toBeInstanceOf(Function); +}); +test('Omits the key-value pairs corresponding to the given keys from an object', () => { + expect(omit({ a: 1, b: '2', c: 3 }, ['b'])).toEqual({ 'a': 1, 'c': 3 }); }); diff --git a/test/omitBy/omitBy.test.js b/test/omitBy/omitBy.test.js index cf01f902b..b380731b6 100644 --- a/test/omitBy/omitBy.test.js +++ b/test/omitBy/omitBy.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const omitBy = require('./omitBy.js'); -test('Testing omitBy', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof omitBy === 'function', 'omitBy is a Function'); - t.deepEqual(omitBy({ a: 1, b: '2', c: 3 }, x => typeof x === 'number'), { b: '2' }, 'Creates an object composed of the properties the given function returns falsey for'); - //t.deepEqual(omitBy(args..), 'Expected'); - //t.equal(omitBy(args..), 'Expected'); - //t.false(omitBy(args..), 'Expected'); - //t.throws(omitBy(args..), 'Expected'); - t.end(); +test('omitBy is a Function', () => { + expect(omitBy).toBeInstanceOf(Function); +}); +test('Creates an object composed of the properties the given function returns falsey for', () => { + expect(omitBy({ a: 1, b: '2', c: 3 }, x => typeof x === 'number')).toEqual( { b: '2' }); }); diff --git a/test/on/on.test.js b/test/on/on.test.js index f14e85ad0..8c1912742 100644 --- a/test/on/on.test.js +++ b/test/on/on.test.js @@ -1,14 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const on = require('./on.js'); -test('Testing on', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof on === 'function', 'on is a Function'); - t.pass('Tested by @chalarangelo on 16/02/2018'); - //t.deepEqual(on(args..), 'Expected'); - //t.equal(on(args..), 'Expected'); - //t.false(on(args..), 'Expected'); - //t.throws(on(args..), 'Expected'); - t.end(); +test('on is a Function', () => { + expect(on).toBeInstanceOf(Function); }); diff --git a/test/onUserInputChange/onUserInputChange.test.js b/test/onUserInputChange/onUserInputChange.test.js index bbc726d63..675143979 100644 --- a/test/onUserInputChange/onUserInputChange.test.js +++ b/test/onUserInputChange/onUserInputChange.test.js @@ -1,14 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const onUserInputChange = require('./onUserInputChange.js'); -test('Testing onUserInputChange', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof onUserInputChange === 'function', 'onUserInputChange is a Function'); - t.pass('Tested by @chalarangelo on 16/02/2018'); - //t.deepEqual(onUserInputChange(args..), 'Expected'); - //t.equal(onUserInputChange(args..), 'Expected'); - //t.false(onUserInputChange(args..), 'Expected'); - //t.throws(onUserInputChange(args..), 'Expected'); - t.end(); +test('onUserInputChange is a Function', () => { + expect(onUserInputChange).toBeInstanceOf(Function); }); diff --git a/test/once/once.test.js b/test/once/once.test.js index 89aba3872..ecd7ed6f0 100644 --- a/test/once/once.test.js +++ b/test/once/once.test.js @@ -1,14 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const once = require('./once.js'); -test('Testing once', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof once === 'function', 'once is a Function'); - t.pass('Tested by @chalarangelo on 16/02/2018'); - //t.deepEqual(once(args..), 'Expected'); - //t.equal(once(args..), 'Expected'); - //t.false(once(args..), 'Expected'); - //t.throws(once(args..), 'Expected'); - t.end(); +test('once is a Function', () => { + expect(once).toBeInstanceOf(Function); }); diff --git a/test/orderBy/orderBy.test.js b/test/orderBy/orderBy.test.js index 2a721f61e..48d838468 100644 --- a/test/orderBy/orderBy.test.js +++ b/test/orderBy/orderBy.test.js @@ -1,16 +1,13 @@ -const test = require('tape'); +const expect = require('expect'); const orderBy = require('./orderBy.js'); -test('Testing orderBy', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof orderBy === 'function', 'orderBy is a Function'); - const users = [{ name: 'fred', age: 48 }, { name: 'barney', age: 36 }, { name: 'fred', age: 40 }]; - t.deepEqual(orderBy(users, ['name', 'age'], ['asc', 'desc']), [{name: 'barney', age: 36}, {name: 'fred', age: 48}, {name: 'fred', age: 40}], "Returns a sorted array of objects ordered by properties and orders."); - t.deepEqual(orderBy(users, ['name', 'age']), [{name: 'barney', age: 36}, {name: 'fred', age: 40}, {name: 'fred', age: 48}], "Returns a sorted array of objects ordered by properties and orders."); - //t.deepEqual(orderBy(args..), 'Expected'); - //t.equal(orderBy(args..), 'Expected'); - //t.false(orderBy(args..), 'Expected'); - //t.throws(orderBy(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('orderBy is a Function', () => { + expect(orderBy).toBeInstanceOf(Function); +}); +const users = [{ name: 'fred', age: 48 }, { name: 'barney', age: 36 }, { name: 'fred', age: 40 }]; +test('Returns a sorted array of objects ordered by properties and orders.', () => { + expect(orderBy(users, ['name', 'age'], ['asc', 'desc'])).toEqual([{name: 'barney', age: 36}, {name: 'fred', age: 48}, {name: 'fred', age: 40}]); +}); +test('Returns a sorted array of objects ordered by properties and orders.', () => { + expect(orderBy(users, ['name', 'age'])).toEqual( [{name: 'barney', age: 36}, {name: 'fred', age: 40}, {name: 'fred', age: 48}]); +}); diff --git a/test/over/over.test.js b/test/over/over.test.js index c349f6049..1ca8f5885 100644 --- a/test/over/over.test.js +++ b/test/over/over.test.js @@ -1,15 +1,10 @@ -const test = require('tape'); +const expect = require('expect'); const over = require('./over.js'); -test('Testing over', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof over === 'function', 'over is a Function'); - const minMax = over(Math.min, Math.max); - t.deepEqual(minMax(1, 2, 3, 4, 5), [1,5], 'Applies given functions over multiple arguments'); - //t.deepEqual(over(args..), 'Expected'); - //t.equal(over(args..), 'Expected'); - //t.false(over(args..), 'Expected'); - //t.throws(over(args..), 'Expected'); - t.end(); +test('over is a Function', () => { + expect(over).toBeInstanceOf(Function); +}); +const minMax = over(Math.min, Math.max); +test('Applies given functions over multiple arguments', () => { + expect(minMax(1, 2, 3, 4, 5)).toEqual([1,5]); }); diff --git a/test/overArgs/overArgs.test.js b/test/overArgs/overArgs.test.js index 523cf3ff2..2025c109c 100644 --- a/test/overArgs/overArgs.test.js +++ b/test/overArgs/overArgs.test.js @@ -1,17 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const overArgs = require('./overArgs.js'); -test('Testing overArgs', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof overArgs === 'function', 'overArgs is a Function'); - const square = n => n * n; - const double = n => n * 2; - const fn = overArgs((x, y) => [x, y], [square, double]); - t.deepEqual(fn(9, 3), [81, 6], 'Invokes the provided function with its arguments transformed'); - //t.deepEqual(overArgs(args..), 'Expected'); - //t.equal(overArgs(args..), 'Expected'); - //t.false(overArgs(args..), 'Expected'); - //t.throws(overArgs(args..), 'Expected'); - t.end(); +test('overArgs is a Function', () => { + expect(overArgs).toBeInstanceOf(Function); +}); +const square = n => n * n; +const double = n => n * 2; +const fn = overArgs((x, y) => [x, y], [square, double]); +test('Invokes the provided function with its arguments transformed', () => { + expect(fn(9, 3)).toEqual([81, 6]); }); diff --git a/test/pad/pad.test.js b/test/pad/pad.test.js index 035ebf91b..a90623980 100644 --- a/test/pad/pad.test.js +++ b/test/pad/pad.test.js @@ -1,13 +1,18 @@ -const test = require('tape'); +const expect = require('expect'); const pad = require('./pad.js'); -test('Testing pad', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof pad === 'function', 'pad is a Function'); - t.equal(pad('cat',8), ' cat ', 'cat is padded on both sides'); - t.equal(pad('cat',8).length, 8, 'length of string is 8'); - t.equal(pad(String(42), 6, '0'), '004200', 'pads 42 with "0"'); - t.equal(pad('foobar', 3), 'foobar', 'does not truncates if string exceeds length'); - t.end(); +test('pad is a Function', () => { + expect(pad).toBeInstanceOf(Function); +}); +test('cat is padded on both sides', () => { + expect(pad('cat',8)).toBe(' cat '); +}); + test('length of string is 8', () => { + expect(pad('cat',8).length).toBe(8); +}); + test('pads 42 with "0"', () => { + expect(pad(String(42), 6, '0')).toBe('004200'); +}); + test('does not truncates if string exceeds length', () => { + expect(pad('foobar', 3)).toBe('foobar'); }); diff --git a/test/palindrome/palindrome.test.js b/test/palindrome/palindrome.test.js index 2c65f5995..ae174bbec 100644 --- a/test/palindrome/palindrome.test.js +++ b/test/palindrome/palindrome.test.js @@ -1,15 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const palindrome = require('./palindrome.js'); -test('Testing palindrome', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof palindrome === 'function', 'palindrome is a Function'); - t.equal(palindrome('taco cat'), true, "Given string is a palindrome"); - t.equal(palindrome('foobar'), false, "Given string is not a palindrome"); - //t.deepEqual(palindrome(args..), 'Expected'); - //t.equal(palindrome(args..), 'Expected'); - //t.false(palindrome(args..), 'Expected'); - //t.throws(palindrome(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('palindrome is a Function', () => { + expect(palindrome).toBeInstanceOf(Function); +}); +test('Given string is a palindrome', () => { + expect(palindrome('taco cat')).toBeTruthy(); +}); +test('Given string is not a palindrome', () => { + expect(palindrome('foobar')).toBeFalsy(); +}); diff --git a/test/parseCookie/parseCookie.test.js b/test/parseCookie/parseCookie.test.js index 2c6712d21..42e942538 100644 --- a/test/parseCookie/parseCookie.test.js +++ b/test/parseCookie/parseCookie.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const parseCookie = require('./parseCookie.js'); -test('Testing parseCookie', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof parseCookie === 'function', 'parseCookie is a Function'); - t.deepEqual(parseCookie('foo=bar; equation=E%3Dmc%5E2'), { foo: 'bar', equation: 'E=mc^2' }, 'Parses the cookie'); - //t.deepEqual(parseCookie(args..), 'Expected'); - //t.equal(parseCookie(args..), 'Expected'); - //t.false(parseCookie(args..), 'Expected'); - //t.throws(parseCookie(args..), 'Expected'); - t.end(); +test('parseCookie is a Function', () => { + expect(parseCookie).toBeInstanceOf(Function); +}); +test('Parses the cookie', () => { + expect(parseCookie('foo=bar; equation=E%3Dmc%5E2')).toEqual({ foo: 'bar', equation: 'E=mc^2' }); }); diff --git a/test/partial/partial.test.js b/test/partial/partial.test.js index 4c7b32d1d..5b3fd8f2b 100644 --- a/test/partial/partial.test.js +++ b/test/partial/partial.test.js @@ -1,18 +1,13 @@ -const test = require('tape'); +const expect = require('expect'); const partial = require('./partial.js'); -test('Testing partial', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof partial === 'function', 'partial is a Function'); - function greet(greeting, name) { - return greeting + ' ' + name + '!'; - } - const greetHello = partial(greet, 'Hello'); - t.equal(greetHello('John'), 'Hello John!', 'Prepends arguments'); - //t.deepEqual(partial(args..), 'Expected'); - //t.equal(partial(args..), 'Expected'); - //t.false(partial(args..), 'Expected'); - //t.throws(partial(args..), 'Expected'); - t.end(); +test('partial is a Function', () => { + expect(partial).toBeInstanceOf(Function); +}); +function greet(greeting, name) { + return greeting + ' ' + name + '!'; +} +const greetHello = partial(greet, 'Hello'); +test('Prepends arguments', () => { + expect(greetHello('John')).toBe('Hello John!'); }); diff --git a/test/partialRight/partialRight.test.js b/test/partialRight/partialRight.test.js index 75b3113b5..7e04a83ba 100644 --- a/test/partialRight/partialRight.test.js +++ b/test/partialRight/partialRight.test.js @@ -1,18 +1,13 @@ -const test = require('tape'); +const expect = require('expect'); const partialRight = require('./partialRight.js'); -test('Testing partialRight', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof partialRight === 'function', 'partialRight is a Function'); - function greet(greeting, name) { - return greeting + ' ' + name + '!'; - } - const greetJohn = partialRight(greet, 'John'); - t.equal(greetJohn('Hello'), 'Hello John!', 'Appends arguments'); - //t.deepEqual(partialRight(args..), 'Expected'); - //t.equal(partialRight(args..), 'Expected'); - //t.false(partialRight(args..), 'Expected'); - //t.throws(partialRight(args..), 'Expected'); - t.end(); +test('partialRight is a Function', () => { + expect(partialRight).toBeInstanceOf(Function); +}); +function greet(greeting, name) { + return greeting + ' ' + name + '!'; +} +const greetJohn = partialRight(greet, 'John'); +test('Appends arguments', () => { + expect(greetJohn('Hello')).toBe('Hello John!'); }); diff --git a/test/partition/partition.test.js b/test/partition/partition.test.js index 429fae050..b90671943 100644 --- a/test/partition/partition.test.js +++ b/test/partition/partition.test.js @@ -1,15 +1,10 @@ -const test = require('tape'); +const expect = require('expect'); const partition = require('./partition.js'); -test('Testing partition', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof partition === 'function', 'partition is a Function'); - const users = [{ user: 'barney', age: 36, active: false }, { user: 'fred', age: 40, active: true }]; - t.deepEqual(partition(users, o => o.active), [[{ 'user': 'fred', 'age': 40, 'active': true }],[{ 'user': 'barney', 'age': 36, 'active': false }]], "Groups the elements into two arrays, depending on the provided function's truthiness for each element."); - //t.deepEqual(partition(args..), 'Expected'); - //t.equal(partition(args..), 'Expected'); - //t.false(partition(args..), 'Expected'); - //t.throws(partition(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('partition is a Function', () => { + expect(partition).toBeInstanceOf(Function); +}); +const users = [{ user: 'barney', age: 36, active: false }, { user: 'fred', age: 40, active: true }]; +test('Groups the elements into two arrays, depending on the provided function\'s truthiness for each element.', () => { + expect(partition(users, o => o.active)).toEqual([[{ 'user': 'fred', 'age': 40, 'active': true }],[{ 'user': 'barney', 'age': 36, 'active': false }]]); +}); diff --git a/test/percentile/percentile.test.js b/test/percentile/percentile.test.js index 63cf07868..689c1be26 100644 --- a/test/percentile/percentile.test.js +++ b/test/percentile/percentile.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const percentile = require('./percentile.js'); -test('Testing percentile', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof percentile === 'function', 'percentile is a Function'); - t.equal(percentile([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 6), 55, "Uses the percentile formula to calculate how many numbers in the given array are less or equal to the given value."); - //t.deepEqual(percentile(args..), 'Expected'); - //t.equal(percentile(args..), 'Expected'); - //t.false(percentile(args..), 'Expected'); - //t.throws(percentile(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('percentile is a Function', () => { + expect(percentile).toBeInstanceOf(Function); +}); +test('Uses the percentile formula to calculate how many numbers in the given array are less or equal to the given value.', () => { + expect(percentile([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 6)).toBe(55); +}); diff --git a/test/permutations/permutations.test.js b/test/permutations/permutations.test.js index fe9b08e46..3dee8589c 100644 --- a/test/permutations/permutations.test.js +++ b/test/permutations/permutations.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const permutations = require('./permutations.js'); -test('Testing permutations', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof permutations === 'function', 'permutations is a Function'); - t.deepEqual(permutations([1, 33, 5]), [ [ 1, 33, 5 ], [ 1, 5, 33 ], [ 33, 1, 5 ], [ 33, 5, 1 ], [ 5, 1, 33 ], [ 5, 33, 1 ] ], 'Generates all permutations of an array'); - //t.deepEqual(permuteAll(args..), 'Expected'); - //t.equal(permuteAll(args..), 'Expected'); - //t.false(permuteAll(args..), 'Expected'); - //t.throws(permuteAll(args..), 'Expected'); - t.end(); +test('permutations is a Function', () => { + expect(permutations).toBeInstanceOf(Function); +}); +test('Generates all permutations of an array', () => { + expect(permutations([1, 33, 5])).toEqual([ [ 1, 33, 5 ], [ 1, 5, 33 ], [ 33, 1, 5 ], [ 33, 5, 1 ], [ 5, 1, 33 ], [ 5, 33, 1 ] ]); }); diff --git a/test/pick/pick.test.js b/test/pick/pick.test.js index 61565a0a2..95281c19a 100644 --- a/test/pick/pick.test.js +++ b/test/pick/pick.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const pick = require('./pick.js'); -test('Testing pick', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof pick === 'function', 'pick is a Function'); - t.deepEqual(pick({ a: 1, b: '2', c: 3 }, ['a', 'c']), { 'a': 1, 'c': 3 }, "Picks the key-value pairs corresponding to the given keys from an object."); - //t.deepEqual(pick(args..), 'Expected'); - //t.equal(pick(args..), 'Expected'); - //t.false(pick(args..), 'Expected'); - //t.throws(pick(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('pick is a Function', () => { + expect(pick).toBeInstanceOf(Function); +}); +test('Picks the key-value pairs corresponding to the given keys from an object.', () => { + expect(pick({ a: 1, b: '2', c: 3 }, ['a', 'c'])).toEqual({ 'a': 1, 'c': 3 }); +}); diff --git a/test/pickBy/pickBy.test.js b/test/pickBy/pickBy.test.js index 523ed0bdd..1d302187c 100644 --- a/test/pickBy/pickBy.test.js +++ b/test/pickBy/pickBy.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const pickBy = require('./pickBy.js'); -test('Testing pickBy', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof pickBy === 'function', 'pickBy is a Function'); - t.deepEqual(pickBy({ a: 1, b: '2', c: 3 }, x => typeof x === 'number'), { 'a': 1, 'c': 3 }, 'Creates an object composed of the properties the given function returns truthy for.'); - //t.deepEqual(pickBy(args..), 'Expected'); - //t.equal(pickBy(args..), 'Expected'); - //t.false(pickBy(args..), 'Expected'); - //t.throws(pickBy(args..), 'Expected'); - t.end(); +test('pickBy is a Function', () => { + expect(pickBy).toBeInstanceOf(Function); +}); +test('Creates an object composed of the properties the given function returns truthy for.', () => { + expect(pickBy({ a: 1, b: '2', c: 3 }, x => typeof x === 'number')).toEqual({ 'a': 1, 'c': 3 }); }); diff --git a/test/pipeAsyncFunctions/pipeAsyncFunctions.test.js b/test/pipeAsyncFunctions/pipeAsyncFunctions.test.js index 7a4ae346e..53ec89173 100644 --- a/test/pipeAsyncFunctions/pipeAsyncFunctions.test.js +++ b/test/pipeAsyncFunctions/pipeAsyncFunctions.test.js @@ -1,24 +1,15 @@ -const test = require('tape'); +const expect = require('expect'); const pipeAsyncFunctions = require('./pipeAsyncFunctions.js'); -test('Testing pipeAsyncFunctions', async (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof pipeAsyncFunctions === 'function', 'pipeAsyncFunctions is a Function'); - //t.deepEqual(pipeAsyncFunctions(args..), 'Expected'); - //t.equal(pipeAsyncFunctions(args..), 'Expected'); - //t.false(pipeAsyncFunctions(args..), 'Expected'); - //t.throws(pipeAsyncFunctions(args..), 'Expected'); - t.equal( - await pipeAsyncFunctions( - (x) => x + 1, - (x) => new Promise((resolve) => setTimeout(() => resolve(x + 2), 0)), - (x) => x + 3, - async (x) => await x + 4, - ) - (5), - 15, - 'pipeAsyncFunctions result should be 15' - ); - t.end(); -}); \ No newline at end of file +test('pipeAsyncFunctions is a Function', () => { + expect(pipeAsyncFunctions).toBeInstanceOf(Function); +}); +test('pipeAsyncFunctions result should be 15', () => { + expect(pipeAsyncFunctions( + (x) => x + 1, + (x) => new Promise((resolve) => setTimeout(() => resolve(x + 2), 0)), + (x) => x + 3, + async (x) => await x + 4, + ) + (5)).resolves.toBe(15); +}); diff --git a/test/pipeFunctions/pipeFunctions.test.js b/test/pipeFunctions/pipeFunctions.test.js index a9703858f..b121c9612 100644 --- a/test/pipeFunctions/pipeFunctions.test.js +++ b/test/pipeFunctions/pipeFunctions.test.js @@ -1,17 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const pipeFunctions = require('./pipeFunctions.js'); -test('Testing pipeFunctions', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof pipeFunctions === 'function', 'pipeFunctions is a Function'); - const add5 = x => x + 5; - const multiply = (x, y) => x * y; - const multiplyAndAdd5 = pipeFunctions(multiply, add5); - t.equal(multiplyAndAdd5(5, 2), 15, 'Performs left-to-right function composition'); - //t.deepEqual(pipeFunctions(args..), 'Expected'); - //t.equal(pipeFunctions(args..), 'Expected'); - //t.false(pipeFunctions(args..), 'Expected'); - //t.throws(pipeFunctions(args..), 'Expected'); - t.end(); +test('pipeFunctions is a Function', () => { + expect(pipeFunctions).toBeInstanceOf(Function); +}); +const add5 = x => x + 5; +const multiply = (x, y) => x * y; +const multiplyAndAdd5 = pipeFunctions(multiply, add5); +test('Performs left-to-right function composition', () => { + expect(multiplyAndAdd5(5, 2)).toBe(15); }); diff --git a/test/pluralize/pluralize.test.js b/test/pluralize/pluralize.test.js index 674244ca7..2a61e63b9 100644 --- a/test/pluralize/pluralize.test.js +++ b/test/pluralize/pluralize.test.js @@ -1,23 +1,26 @@ -const test = require('tape'); +const expect = require('expect'); const pluralize = require('./pluralize.js'); -test('Testing pluralize', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof pluralize === 'function', 'pluralize is a Function'); - t.equal(pluralize(0, 'apple'), 'apples', 'Produces the plural of the word'); - t.equal(pluralize(1, 'apple'), 'apple', 'Produces the singular of the word'); - t.equal(pluralize(2, 'apple'), 'apples', 'Produces the plural of the word'); - t.equal(pluralize(2, 'person', 'people'), 'people', 'Prodices the defined plural of the word'); - const PLURALS = { - person: 'people', - radius: 'radii' - }; - const autoPluralize = pluralize(PLURALS); - t.equal(autoPluralize(2, 'person'), 'people', 'Works with a dictionary'); - //t.deepEqual(pluralize(args..), 'Expected'); - //t.equal(pluralize(args..), 'Expected'); - //t.false(pluralize(args..), 'Expected'); - //t.throws(pluralize(args..), 'Expected'); - t.end(); +test('pluralize is a Function', () => { + expect(pluralize).toBeInstanceOf(Function); +}); +test('Produces the plural of the word', () => { + expect(pluralize(0, 'apple')).toBe('apples'); +}); +test('Produces the singular of the word', () => { + expect(pluralize(1, 'apple')).toBe('apple'); +}); +test('Produces the plural of the word', () => { + expect(pluralize(2, 'apple')).toBe('apples'); +}); +test('Prodices the defined plural of the word', () => { + expect(pluralize(2, 'person', 'people')).toBe('people'); +}); +const PLURALS = { + person: 'people', + radius: 'radii' +}; +const autoPluralize = pluralize(PLURALS); +test('Works with a dictionary', () => { + expect(autoPluralize(2, 'person')).toBe('people'); }); diff --git a/test/powerset/powerset.test.js b/test/powerset/powerset.test.js index a9bf7ba6a..50fd91f89 100644 --- a/test/powerset/powerset.test.js +++ b/test/powerset/powerset.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const powerset = require('./powerset.js'); -test('Testing powerset', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof powerset === 'function', 'powerset is a Function'); - t.deepEqual(powerset([1, 2]), [[], [1], [2], [2,1]], "Returns the powerset of a given array of numbers."); - //t.deepEqual(powerset(args..), 'Expected'); - //t.equal(powerset(args..), 'Expected'); - //t.false(powerset(args..), 'Expected'); - //t.throws(powerset(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('powerset is a Function', () => { + expect(powerset).toBeInstanceOf(Function); +}); +test('Returns the powerset of a given array of numbers.', () => { + expect(powerset([1, 2])).toEqual([[], [1], [2], [2, 1]]); +}); diff --git a/test/prefix/prefix.test.js b/test/prefix/prefix.test.js index 846d951c1..4f6e86f19 100644 --- a/test/prefix/prefix.test.js +++ b/test/prefix/prefix.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const prefix = require('./prefix.js'); -test('Testing prefix', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof prefix === 'function', 'prefix is a Function'); - //t.deepEqual(prefix(args..), 'Expected'); - //t.equal(prefix(args..), 'Expected'); - //t.false(prefix(args..), 'Expected'); - //t.throws(prefix(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('prefix is a Function', () => { + expect(prefix).toBeInstanceOf(Function); +}); diff --git a/test/prettyBytes/prettyBytes.test.js b/test/prettyBytes/prettyBytes.test.js index 7553e5304..4bf4e3794 100644 --- a/test/prettyBytes/prettyBytes.test.js +++ b/test/prettyBytes/prettyBytes.test.js @@ -1,17 +1,15 @@ -const test = require('tape'); +const expect = require('expect'); const prettyBytes = require('./prettyBytes.js'); -test('Testing prettyBytes', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof prettyBytes === 'function', 'prettyBytes is a Function'); - t.equal(prettyBytes(1000), '1 KB', "Converts a number in bytes to a human-readable string."); - t.equal(prettyBytes(-27145424323.5821, 5), '-27.145 GB', "Converts a number in bytes to a human-readable string."); - t.equal(prettyBytes(123456789, 3, false), '123MB', "Converts a number in bytes to a human-readable string."); - - //t.deepEqual(prettyBytes(args..), 'Expected'); - //t.equal(prettyBytes(args..), 'Expected'); - //t.false(prettyBytes(args..), 'Expected'); - //t.throws(prettyBytes(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('prettyBytes is a Function', () => { + expect(prettyBytes).toBeInstanceOf(Function); +}); +test('Converts a number in bytes to a human-readable string.', () => { + expect(prettyBytes(1000)).toBe('1 KB'); +}); +test('Converts a number in bytes to a human-readable string.', () => { + expect(prettyBytes(-27145424323.5821, 5)).toBe('-27.145 GB'); +}); +test('Converts a number in bytes to a human-readable string.', () => { + expect(prettyBytes(123456789, 3, false)).toBe('123MB'); +}); diff --git a/test/primes/primes.test.js b/test/primes/primes.test.js index d64602713..b0561c953 100644 --- a/test/primes/primes.test.js +++ b/test/primes/primes.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const primes = require('./primes.js'); -test('Testing primes', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof primes === 'function', 'primes is a Function'); - t.deepEqual(primes(10), [2, 3, 5, 7], "Generates primes up to a given number, using the Sieve of Eratosthenes."); - //t.deepEqual(primes(args..), 'Expected'); - //t.equal(primes(args..), 'Expected'); - //t.false(primes(args..), 'Expected'); - //t.throws(primes(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('primes is a Function', () => { + expect(primes).toBeInstanceOf(Function); +}); +test('Generates primes up to a given number, using the Sieve of Eratosthenes.', () => { + expect(primes(10)).toEqual([2, 3, 5, 7]); +}); diff --git a/test/promisify/promisify.test.js b/test/promisify/promisify.test.js index cd313631e..9a65b98fc 100644 --- a/test/promisify/promisify.test.js +++ b/test/promisify/promisify.test.js @@ -1,17 +1,14 @@ -const test = require('tape'); +const expect = require('expect'); const promisify = require('./promisify.js'); -test('Testing promisify', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof promisify === 'function', 'promisify is a Function'); - const x = promisify(Math.max); - t.true(x() instanceof Promise, 'Returns a promise'); - const delay = promisify((d, cb) => setTimeout(cb, d)); - delay(200).then(() => t.pass('Runs the function provided')); - //t.deepEqual(promisify(args..), 'Expected'); - //t.equal(promisify(args..), 'Expected'); - //t.false(promisify(args..), 'Expected'); - //t.throws(promisify(args..), 'Expected'); - t.end(); +test('promisify is a Function', () => { + expect(promisify).toBeInstanceOf(Function); +}); +const x = promisify(Math.max); +test('Returns a promise', () => { + expect(x() instanceof Promise).toBeTruthy(); +}); +test('Runs the function provided', () => { + const delay = promisify((d, cb) => setTimeout(cb, d)); + delay(200).then(() => expect(true).toBeTruthy()); }); diff --git a/test/pull/pull.test.js b/test/pull/pull.test.js index 81299a3f8..3afff9097 100644 --- a/test/pull/pull.test.js +++ b/test/pull/pull.test.js @@ -1,16 +1,11 @@ -const test = require('tape'); +const expect = require('expect'); const pull = require('./pull.js'); -test('Testing pull', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof pull === 'function', 'pull is a Function'); - let myArray = ['a', 'b', 'c', 'a', 'b', 'c']; - pull(myArray, 'a', 'c'); - t.deepEqual(myArray, ['b','b'], 'Pulls the specified values'); - //t.deepEqual(pull(args..), 'Expected'); - //t.equal(pull(args..), 'Expected'); - //t.false(pull(args..), 'Expected'); - //t.throws(pull(args..), 'Expected'); - t.end(); +test('pull is a Function', () => { + expect(pull).toBeInstanceOf(Function); +}); +let myArray = ['a', 'b', 'c', 'a', 'b', 'c']; +pull(myArray, 'a', 'c'); +test('Pulls the specified values', () => { + expect(myArray).toEqual(['b','b']); }); diff --git a/test/pullAtIndex/pullAtIndex.test.js b/test/pullAtIndex/pullAtIndex.test.js index 7ee05dc01..4ebe0b1a5 100644 --- a/test/pullAtIndex/pullAtIndex.test.js +++ b/test/pullAtIndex/pullAtIndex.test.js @@ -1,17 +1,14 @@ -const test = require('tape'); +const expect = require('expect'); const pullAtIndex = require('./pullAtIndex.js'); -test('Testing pullAtIndex', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof pullAtIndex === 'function', 'pullAtIndex is a Function'); - let myArray = ['a', 'b', 'c', 'd']; - let pulled = pullAtIndex(myArray, [1, 3]); - t.deepEqual(myArray, [ 'a', 'c' ], 'Pulls the given values'); - t.deepEqual(pulled, [ 'b', 'd' ], 'Pulls the given values'); - //t.deepEqual(pullAtIndex(args..), 'Expected'); - //t.equal(pullAtIndex(args..), 'Expected'); - //t.false(pullAtIndex(args..), 'Expected'); - //t.throws(pullAtIndex(args..), 'Expected'); - t.end(); +test('pullAtIndex is a Function', () => { + expect(pullAtIndex).toBeInstanceOf(Function); +}); +let myArray = ['a', 'b', 'c', 'd']; +let pulled = pullAtIndex(myArray, [1, 3]); +test('Pulls the given values', () => { + expect(myArray).toEqual([ 'a', 'c' ]); +}); + test('Pulls the given values', () => { + expect(pulled).toEqual([ 'b', 'd' ]); }); diff --git a/test/pullAtValue/pullAtValue.test.js b/test/pullAtValue/pullAtValue.test.js index 00e22c122..778f215bc 100644 --- a/test/pullAtValue/pullAtValue.test.js +++ b/test/pullAtValue/pullAtValue.test.js @@ -1,17 +1,14 @@ -const test = require('tape'); +const expect = require('expect'); const pullAtValue = require('./pullAtValue.js'); -test('Testing pullAtValue', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof pullAtValue === 'function', 'pullAtValue is a Function'); - let myArray = ['a', 'b', 'c', 'd']; - let pulled = pullAtValue(myArray, ['b', 'd']); - t.deepEqual(myArray, [ 'a', 'c' ], 'Pulls the specified values'); - t.deepEqual(pulled, [ 'b', 'd' ], 'Pulls the specified values'); - //t.deepEqual(pullAtValue(args..), 'Expected'); - //t.equal(pullAtValue(args..), 'Expected'); - //t.false(pullAtValue(args..), 'Expected'); - //t.throws(pullAtValue(args..), 'Expected'); - t.end(); +test('pullAtValue is a Function', () => { + expect(pullAtValue).toBeInstanceOf(Function); +}); +let myArray = ['a', 'b', 'c', 'd']; +let pulled = pullAtValue(myArray, ['b', 'd']); +test('Pulls the specified values', () => { + expect(myArray).toEqual([ 'a', 'c' ]); +}); + test('Pulls the specified values', () => { + expect(pulled).toEqual([ 'b', 'd' ]); }); diff --git a/test/pullBy/pullBy.test.js b/test/pullBy/pullBy.test.js index 29082d3e0..a1a7f1852 100644 --- a/test/pullBy/pullBy.test.js +++ b/test/pullBy/pullBy.test.js @@ -1,16 +1,11 @@ -const test = require('tape'); +const expect = require('expect'); const pullBy = require('./pullBy.js'); -test('Testing pullBy', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof pullBy === 'function', 'pullBy is a Function'); - var myArray = [{ x: 1 }, { x: 2 }, { x: 3 }, { x: 1 }]; - pullBy(myArray, [{ x: 1 }, { x: 3 }], o => o.x); - t.deepEqual(myArray, [{ x: 2 }], 'Pulls the specified values'); - //t.deepEqual(pullBy(args..), 'Expected'); - //t.equal(pullBy(args..), 'Expected'); - //t.false(pullBy(args..), 'Expected'); - //t.throws(pullBy(args..), 'Expected'); - t.end(); +test('pullBy is a Function', () => { + expect(pullBy).toBeInstanceOf(Function); +}); +var myArray = [{ x: 1 }, { x: 2 }, { x: 3 }, { x: 1 }]; +pullBy(myArray, [{ x: 1 }, { x: 3 }], o => o.x); +test('Pulls the specified values', () => { + expect(myArray).toEqual([{ x: 2 }]); }); diff --git a/test/quickSort/quickSort.test.js b/test/quickSort/quickSort.test.js index 86ef548a4..b15e58969 100644 --- a/test/quickSort/quickSort.test.js +++ b/test/quickSort/quickSort.test.js @@ -1,22 +1,33 @@ -const test = require('tape'); +const expect = require('expect'); const quickSort = require('./quickSort.js'); -test('Testing quickSort', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof quickSort === 'function', 'quickSort is a Function'); - t.deepEqual(quickSort([5, 6, 4, 3, 1, 2]), [1, 2, 3, 4, 5, 6], 'quickSort([5, 6, 4, 3, 1, 2]) returns [1, 2, 3, 4, 5, 6]'); - t.deepEqual(quickSort([-1, 0, -2]), [-2, -1, 0], 'quickSort([-1, 0, -2]) returns [-2, -1, 0]'); - t.throws(() => quickSort(), 'quickSort() throws an error'); - t.throws(() => quickSort(123), 'quickSort(123) throws an error'); - t.throws(() => quickSort({ 234: string}), 'quickSort({ 234: string}) throws an error'); - t.throws(() => quickSort(null), 'quickSort(null) throws an error'); - t.throws(() => quickSort(undefined), 'quickSort(undefined) throws an error'); - - let start = new Date().getTime(); - quickSort([11, 1, 324, 23232, -1, 53, 2, 524, 32, 13, 156, 133, 62, 12, 4]); - let end = new Date().getTime(); - t.true((end - start) < 2000, 'quickSort([11, 1, 324, 23232, -1, 53, 2, 524, 32, 13, 156, 133, 62, 12, 4]) takes less than 2s to run'); - - t.end(); +test('quickSort is a Function', () => { + expect(quickSort).toBeInstanceOf(Function); +}); +test('quickSort([5, 6, 4, 3, 1, 2]) returns [1, 2, 3, 4, 5, 6]', () => { + expect(quickSort([5, 6, 4, 3, 1, 2])).toEqual([1, 2, 3, 4, 5, 6]); +}); +test('quickSort([-1, 0, -2]) returns [-2, -1, 0]', () => { + expect(quickSort([-1, 0, -2])).toEqual([-2, -1, 0]); +}); +test('quickSort() throws an error', () => { + expect(() => { quickSort(); }).toThrow(); +}); +test('quickSort(123) throws an error', () => { + expect(() => { quickSort(123); }).toThrow(); +}); +test('quickSort({ 234: string}) throws an error', () => { + expect(() => { quickSort({ 234: string}); }).toThrow(); +}); +test('quickSort(null) throws an error', () => { + expect(() => { quickSort(null); }).toThrow(); +}); +test('quickSort(undefined) throws an error', () => { + expect(() => { quickSort(undefined); }).toThrow(); +}); +let start = new Date().getTime(); +quickSort([11, 1, 324, 23232, -1, 53, 2, 524, 32, 13, 156, 133, 62, 12, 4]); +let end = new Date().getTime(); +test('quickSort([11, 1, 324, 23232, -1, 53, 2, 524, 32, 13, 156, 133, 62, 12, 4]) takes less than 2s to run', () => { + expect((end - start) < 2000).toBeTruthy(); }); diff --git a/test/radsToDegrees/radsToDegrees.test.js b/test/radsToDegrees/radsToDegrees.test.js index 446485d76..5e7bdea5c 100644 --- a/test/radsToDegrees/radsToDegrees.test.js +++ b/test/radsToDegrees/radsToDegrees.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const radsToDegrees = require('./radsToDegrees.js'); -test('Testing radsToDegrees', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof radsToDegrees === 'function', 'radsToDegrees is a Function'); - t.equal(radsToDegrees(Math.PI / 2), 90, 'Returns the appropriate value'); - //t.deepEqual(radsToDegrees(args..), 'Expected'); - //t.equal(radsToDegrees(args..), 'Expected'); - //t.false(radsToDegrees(args..), 'Expected'); - //t.throws(radsToDegrees(args..), 'Expected'); - t.end(); +test('radsToDegrees is a Function', () => { + expect(radsToDegrees).toBeInstanceOf(Function); +}); +test('Returns the appropriate value', () => { + expect(radsToDegrees(Math.PI / 2)).toBe(90); }); diff --git a/test/randomHexColorCode/randomHexColorCode.test.js b/test/randomHexColorCode/randomHexColorCode.test.js index 7d9946955..bc38748a7 100644 --- a/test/randomHexColorCode/randomHexColorCode.test.js +++ b/test/randomHexColorCode/randomHexColorCode.test.js @@ -1,15 +1,15 @@ -const test = require('tape'); +const expect = require('expect'); const randomHexColorCode = require('./randomHexColorCode.js'); -test('Testing randomHexColorCode', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof randomHexColorCode === 'function', 'randomHexColorCode is a Function'); - //t.deepEqual(randomHexColorCode(args..), 'Expected'); - t.equal(randomHexColorCode().length, 7); - t.true(randomHexColorCode().startsWith('#'),'The color code starts with "#"'); - t.true(randomHexColorCode().slice(1).match(/[^0123456789abcdef]/i) === null,'The color code contains only valid hex-digits'); - //t.false(randomHexColorCode(args..), 'Expected'); - //t.throws(randomHexColorCode(args..), 'Expected'); - t.end(); +test('randomHexColorCode is a Function', () => { + expect(randomHexColorCode).toBeInstanceOf(Function); +}); +test('randomHexColorCode has to proper length', () => { + expect(randomHexColorCode().length).toBe(7); +}); +test('The color code starts with "#"', () => { + expect(randomHexColorCode().startsWith('#')).toBeTruthy(); +}); +test('The color code contains only valid hex-digits', () => { + expect(randomHexColorCode().slice(1).match(/[^0123456789abcdef]/i) === null).toBeTruthy(); }); diff --git a/test/randomIntArrayInRange/randomIntArrayInRange.test.js b/test/randomIntArrayInRange/randomIntArrayInRange.test.js index 093fdba64..9a2c1acb3 100644 --- a/test/randomIntArrayInRange/randomIntArrayInRange.test.js +++ b/test/randomIntArrayInRange/randomIntArrayInRange.test.js @@ -1,19 +1,18 @@ -const test = require('tape'); +const expect = require('expect'); const randomIntArrayInRange = require('./randomIntArrayInRange.js'); -test('Testing randomIntArrayInRange', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof randomIntArrayInRange === 'function', 'randomIntArrayInRange is a Function'); - const lowerLimit = Math.floor(Math.random() * 20); - const upperLimit = Math.floor(lowerLimit + Math.random() * 10); - const arr = randomIntArrayInRange(lowerLimit,upperLimit, 10); - t.true(arr.every(x => typeof x === 'number'), 'The returned array contains only integers'); - t.equal(arr.length, 10, 'The returned array has the proper length'); - t.true(arr.every(x => (x >= lowerLimit) && (x <= upperLimit)),'The returned array\'s values lie between provided lowerLimit and upperLimit (both inclusive).'); - //t.deepEqual(randomIntArrayInRange(args..), 'Expected'); - //t.equal(randomIntArrayInRange(args..), 'Expected'); - //t.false(randomIntArrayInRange(args..), 'Expected'); - //t.throws(randomIntArrayInRange(args..), 'Expected'); - t.end(); +test('randomIntArrayInRange is a Function', () => { + expect(randomIntArrayInRange).toBeInstanceOf(Function); +}); +const lowerLimit = Math.floor(Math.random() * 20); +const upperLimit = Math.floor(lowerLimit + Math.random() * 10); +const arr = randomIntArrayInRange(lowerLimit,upperLimit, 10); +test('The returned array contains only integers', () => { + expect(arr.every(x => typeof x === 'number')).toBeTruthy(); +}); +test('The returned array has the proper length', () => { + expect(arr.length).toBe(10); +}); +test('The returned array\'s values lie between provided lowerLimit and upperLimit (both inclusive).', () => { + expect(arr.every(x => (x >= lowerLimit) && (x <= upperLimit))).toBeTruthy(); }); diff --git a/test/randomIntegerInRange/randomIntegerInRange.test.js b/test/randomIntegerInRange/randomIntegerInRange.test.js index 41309c7e5..ff19ca7f9 100644 --- a/test/randomIntegerInRange/randomIntegerInRange.test.js +++ b/test/randomIntegerInRange/randomIntegerInRange.test.js @@ -1,18 +1,15 @@ -const test = require('tape'); +const expect = require('expect'); const randomIntegerInRange = require('./randomIntegerInRange.js'); -test('Testing randomIntegerInRange', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof randomIntegerInRange === 'function', 'randomIntegerInRange is a Function'); - const lowerLimit = Math.floor(Math.random() * 20); - const upperLimit = Math.floor(lowerLimit + Math.random() * 10); - t.true(Number.isInteger(randomIntegerInRange(lowerLimit,upperLimit)),'The returned value is an integer'); - const numberForTest = randomIntegerInRange(lowerLimit,upperLimit); - t.true((numberForTest >= lowerLimit) && (numberForTest <= upperLimit),'The returned value lies between provided lowerLimit and upperLimit (both inclusive).'); - //t.deepEqual(randomIntegerInRange(args..), 'Expected'); - //t.equal(randomIntegerInRange(args..), 'Expected'); - //t.false(randomIntegerInRange(args..), 'Expected'); - //t.throws(randomIntegerInRange(args..), 'Expected'); - t.end(); +test('randomIntegerInRange is a Function', () => { + expect(randomIntegerInRange).toBeInstanceOf(Function); +}); +const lowerLimit = Math.floor(Math.random() * 20); +const upperLimit = Math.floor(lowerLimit + Math.random() * 10); +test('The returned value is an integer', () => { + expect(Number.isInteger(randomIntegerInRange(lowerLimit,upperLimit))).toBeTruthy(); +}); +const numberForTest = randomIntegerInRange(lowerLimit,upperLimit); +test('The returned value lies between provided lowerLimit and upperLimit (both inclusive).', () => { + expect((numberForTest >= lowerLimit) && (numberForTest <= upperLimit)).toBeTruthy(); }); diff --git a/test/randomNumberInRange/randomNumberInRange.test.js b/test/randomNumberInRange/randomNumberInRange.test.js index 15359481d..b688cf3fe 100644 --- a/test/randomNumberInRange/randomNumberInRange.test.js +++ b/test/randomNumberInRange/randomNumberInRange.test.js @@ -1,18 +1,15 @@ -const test = require('tape'); +const expect = require('expect'); const randomNumberInRange = require('./randomNumberInRange.js'); -test('Testing randomNumberInRange', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof randomNumberInRange === 'function', 'randomNumberInRange is a Function'); - const lowerLimit = Math.floor(Math.random() * 20); - const upperLimit = Math.floor(lowerLimit + Math.random() * 10); - t.true(typeof randomNumberInRange(lowerLimit,upperLimit) === 'number','The returned value is a number'); - const numberForTest = randomNumberInRange(lowerLimit,upperLimit); - t.true((numberForTest >= lowerLimit) && (numberForTest <= upperLimit),'The returned value lies between provided lowerLimit and upperLimit (both inclusive).'); - //t.deepEqual(randomNumberInRange(args..), 'Expected'); - //t.equal(randomNumberInRange(args..), 'Expected'); - //t.false(randomNumberInRange(args..), 'Expected'); - //t.throws(randomNumberInRange(args..), 'Expected'); - t.end(); +test('randomNumberInRange is a Function', () => { + expect(randomNumberInRange).toBeInstanceOf(Function); +}); +const lowerLimit = Math.floor(Math.random() * 20); +const upperLimit = Math.floor(lowerLimit + Math.random() * 10); +test('The returned value is a number', () => { + expect(typeof randomNumberInRange(lowerLimit,upperLimit) === 'number').toBeTruthy(); +}); +const numberForTest = randomNumberInRange(lowerLimit,upperLimit); +test('The returned value lies between provided lowerLimit and upperLimit (both inclusive).', () => { + expect((numberForTest >= lowerLimit) && (numberForTest <= upperLimit)).toBeTruthy(); }); diff --git a/test/readFileLines/readFileLines.test.js b/test/readFileLines/readFileLines.test.js index db0658908..604c87d79 100644 --- a/test/readFileLines/readFileLines.test.js +++ b/test/readFileLines/readFileLines.test.js @@ -1,14 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const readFileLines = require('./readFileLines.js'); -test('Testing readFileLines', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof readFileLines === 'function', 'readFileLines is a Function'); - t.pass('Tested on 09/02/2018 by @chalarangelo'); - //t.deepEqual(readFileLines(args..), 'Expected'); - //t.equal(readFileLines(args..), 'Expected'); - //t.false(readFileLines(args..), 'Expected'); - //t.throws(readFileLines(args..), 'Expected'); - t.end(); +test('readFileLines is a Function', () => { + expect(readFileLines).toBeInstanceOf(Function); }); diff --git a/test/rearg/rearg.test.js b/test/rearg/rearg.test.js index 781b5c5a0..28a589db3 100644 --- a/test/rearg/rearg.test.js +++ b/test/rearg/rearg.test.js @@ -1,20 +1,15 @@ -const test = require('tape'); +const expect = require('expect'); const rearg = require('./rearg.js'); -test('Testing rearg', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof rearg === 'function', 'rearg is a Function'); - var rearged = rearg( - function(a, b, c) { - return [a, b, c]; - }, - [2, 0, 1] - ); - t.deepEqual(rearged('b', 'c', 'a'), ['a', 'b', 'c'], 'Reorders arguments in invoked function'); - //t.deepEqual(rearg(args..), 'Expected'); - //t.equal(rearg(args..), 'Expected'); - //t.false(rearg(args..), 'Expected'); - //t.throws(rearg(args..), 'Expected'); - t.end(); +test('rearg is a Function', () => { + expect(rearg).toBeInstanceOf(Function); +}); +var rearged = rearg( + function(a, b, c) { + return [a, b, c]; + }, + [2, 0, 1] +); +test('Reorders arguments in invoked function', () => { + expect(rearged('b', 'c', 'a')).toEqual(['a', 'b', 'c']); }); diff --git a/test/recordAnimationFrames/recordAnimationFrames.test.js b/test/recordAnimationFrames/recordAnimationFrames.test.js index 2d366d62a..7c95d8452 100644 --- a/test/recordAnimationFrames/recordAnimationFrames.test.js +++ b/test/recordAnimationFrames/recordAnimationFrames.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const recordAnimationFrames = require('./recordAnimationFrames.js'); -test('Testing recordAnimationFrames', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof recordAnimationFrames === 'function', 'recordAnimationFrames is a Function'); - //t.deepEqual(recordAnimationFrames(args..), 'Expected'); - //t.equal(recordAnimationFrames(args..), 'Expected'); - //t.false(recordAnimationFrames(args..), 'Expected'); - //t.throws(recordAnimationFrames(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('recordAnimationFrames is a Function', () => { + expect(recordAnimationFrames).toBeInstanceOf(Function); +}); diff --git a/test/redirect/redirect.test.js b/test/redirect/redirect.test.js index d6dbce35d..831a1d75d 100644 --- a/test/redirect/redirect.test.js +++ b/test/redirect/redirect.test.js @@ -1,14 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const redirect = require('./redirect.js'); -test('Testing redirect', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof redirect === 'function', 'redirect is a Function'); - t.pass('Tested on 09/02/2018 by @chalarangelo'); - //t.deepEqual(redirect(args..), 'Expected'); - //t.equal(redirect(args..), 'Expected'); - //t.false(redirect(args..), 'Expected'); - //t.throws(redirect(args..), 'Expected'); - t.end(); +test('redirect is a Function', () => { + expect(redirect).toBeInstanceOf(Function); }); diff --git a/test/reduceSuccessive/reduceSuccessive.test.js b/test/reduceSuccessive/reduceSuccessive.test.js index 411438820..5045bed01 100644 --- a/test/reduceSuccessive/reduceSuccessive.test.js +++ b/test/reduceSuccessive/reduceSuccessive.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const reduceSuccessive = require('./reduceSuccessive.js'); -test('Testing reduceSuccessive', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof reduceSuccessive === 'function', 'reduceSuccessive is a Function'); - t.deepEqual(reduceSuccessive([1, 2, 3, 4, 5, 6], (acc, val) => acc + val, 0), [0, 1, 3, 6, 10, 15, 21], 'Returns the array of successively reduced values'); - //t.deepEqual(reduceSuccessive(args..), 'Expected'); - //t.equal(reduceSuccessive(args..), 'Expected'); - //t.false(reduceSuccessive(args..), 'Expected'); - //t.throws(reduceSuccessive(args..), 'Expected'); - t.end(); +test('reduceSuccessive is a Function', () => { + expect(reduceSuccessive).toBeInstanceOf(Function); +}); +test('Returns the array of successively reduced values', () => { + expect(reduceSuccessive([1, 2, 3, 4, 5, 6], (acc, val) => acc + val, 0)).toEqual([0, 1, 3, 6, 10, 15, 21]); }); diff --git a/test/reduceWhich/reduceWhich.test.js b/test/reduceWhich/reduceWhich.test.js index 7e38f36d0..dc9625699 100644 --- a/test/reduceWhich/reduceWhich.test.js +++ b/test/reduceWhich/reduceWhich.test.js @@ -1,19 +1,18 @@ -const test = require('tape'); +const expect = require('expect'); const reduceWhich = require('./reduceWhich.js'); -test('Testing reduceWhich', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof reduceWhich === 'function', 'reduceWhich is a Function'); - t.equal(reduceWhich([1, 3, 2]), 1, 'Returns the minimum of an array'); - t.equal(reduceWhich([1, 3, 2], (a, b) => b - a), 3, 'Returns the maximum of an array'); - t.deepEqual(reduceWhich( +test('reduceWhich is a Function', () => { + expect(reduceWhich).toBeInstanceOf(Function); +}); +test('Returns the minimum of an array', () => { + expect(reduceWhich([1, 3, 2])).toBe(1); +}); +test('Returns the maximum of an array', () => { + expect(reduceWhich([1, 3, 2], (a, b) => b - a)).toBe(3); +}); +test('Returns the object with the minimum specified value in an array', () => { + expect(reduceWhich( [{ name: 'Tom', age: 12 }, { name: 'Jack', age: 18 }, { name: 'Lucy', age: 9 }], (a, b) => a.age - b.age -), {name: "Lucy", age: 9}, 'Returns the object with the minimum specified value in an array'); - //t.deepEqual(reduceWhich(args..), 'Expected'); - //t.equal(reduceWhich(args..), 'Expected'); - //t.false(reduceWhich(args..), 'Expected'); - //t.throws(reduceWhich(args..), 'Expected'); - t.end(); +)).toEqual({name: "Lucy", age: 9}); }); diff --git a/test/reducedFilter/reducedFilter.test.js b/test/reducedFilter/reducedFilter.test.js index db6dcdc9e..4fb7a0b94 100644 --- a/test/reducedFilter/reducedFilter.test.js +++ b/test/reducedFilter/reducedFilter.test.js @@ -1,26 +1,21 @@ -const test = require('tape'); +const expect = require('expect'); const reducedFilter = require('./reducedFilter.js'); -test('Testing reducedFilter', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof reducedFilter === 'function', 'reducedFilter is a Function'); - const data = [ - { - id: 1, - name: 'john', - age: 24 - }, - { - id: 2, - name: 'mike', - age: 50 - } - ]; - t.deepEqual(reducedFilter(data, ['id', 'name'], item => item.age > 24), [{ id: 2, name: 'mike'}], "Filter an array of objects based on a condition while also filtering out unspecified keys."); - //t.deepEqual(reducedFilter(args..), 'Expected'); - //t.equal(reducedFilter(args..), 'Expected'); - //t.false(reducedFilter(args..), 'Expected'); - //t.throws(reducedFilter(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('reducedFilter is a Function', () => { + expect(reducedFilter).toBeInstanceOf(Function); +}); +const data = [ +{ + id: 1, + name: 'john', + age: 24 +}, +{ + id: 2, + name: 'mike', + age: 50 +} +]; +test('Filter an array of objects based on a condition while also filtering out unspecified keys.', () => { + expect(reducedFilter(data, ['id', 'name'], item => item.age > 24)).toEqual([{ id: 2, name: 'mike'}]); +}); diff --git a/test/reject/reject.test.js b/test/reject/reject.test.js index a82244682..f14e41299 100644 --- a/test/reject/reject.test.js +++ b/test/reject/reject.test.js @@ -1,24 +1,20 @@ -const test = require('tape'); +const expect = require('expect'); const reject = require('./reject.js'); -test('Testing reject', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof reject === 'function', 'reject is a Function'); - - const noEvens = reject( - (x) => x % 2 === 0, - [1, 2, 3, 4, 5] - ); - - t.deepEqual(noEvens, [1, 3, 5]); - - const fourLettersOrLess = reject( - (word) => word.length > 4, - ['Apple', 'Pear', 'Kiwi', 'Banana'] - ); - - t.deepEqual(fourLettersOrLess, ['Pear', 'Kiwi']); - - t.end(); +test('reject is a Function', () => { + expect(reject).toBeInstanceOf(Function); +}); +const noEvens = reject( + (x) => x % 2 === 0, + [1, 2, 3, 4, 5] +); +test('Works with numbers', () => { + expect(noEvens).toEqual([1, 3, 5]); +}); +const fourLettersOrLess = reject( + (word) => word.length > 4, + ['Apple', 'Pear', 'Kiwi', 'Banana'] +); +test('Works with strings', () => { + expect(fourLettersOrLess).toEqual(['Pear', 'Kiwi']); }); diff --git a/test/remove/remove.test.js b/test/remove/remove.test.js index 64c00696c..efafcc3da 100644 --- a/test/remove/remove.test.js +++ b/test/remove/remove.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const remove = require('./remove.js'); -test('Testing remove', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof remove === 'function', 'remove is a Function'); - t.deepEqual(remove([1, 2, 3, 4], n => n % 2 === 0), [2, 4], "Removes elements from an array for which the given function returns false"); - //t.deepEqual(remove(args..), 'Expected'); - //t.equal(remove(args..), 'Expected'); - //t.false(remove(args..), 'Expected'); - //t.throws(remove(args..), 'Expected'); - t.end(); +test('remove is a Function', () => { + expect(remove).toBeInstanceOf(Function); +}); +test('Removes elements from an array for which the given function returns false', () => { + expect(remove([1, 2, 3, 4], n => n % 2 === 0)).toEqual([2, 4]); }); diff --git a/test/removeNonASCII/removeNonASCII.test.js b/test/removeNonASCII/removeNonASCII.test.js index 03aedfed1..4e8f6f7bd 100644 --- a/test/removeNonASCII/removeNonASCII.test.js +++ b/test/removeNonASCII/removeNonASCII.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const removeNonASCII = require('./removeNonASCII.js'); -test('Testing removeNonASCII', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof removeNonASCII === 'function', 'removeNonASCII is a Function'); - t.equal(removeNonASCII('äÄçÇéÉêlorem-ipsumöÖÐþúÚ'), 'lorem-ipsum', 'Removes non-ASCII characters'); - //t.deepEqual(removeNonASCII(args..), 'Expected'); - //t.equal(removeNonASCII(args..), 'Expected'); - //t.false(removeNonASCII(args..), 'Expected'); - //t.throws(removeNonASCII(args..), 'Expected'); - t.end(); +test('removeNonASCII is a Function', () => { + expect(removeNonASCII).toBeInstanceOf(Function); +}); +test('Removes non-ASCII characters', () => { + expect(removeNonASCII('äÄçÇéÉêlorem-ipsumöÖÐþúÚ')).toBe('lorem-ipsum'); }); diff --git a/test/removeVowels/removeVowels.test.js b/test/removeVowels/removeVowels.test.js index 67a187869..437f32157 100644 --- a/test/removeVowels/removeVowels.test.js +++ b/test/removeVowels/removeVowels.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const removeVowels = require('./removeVowels.js'); -test('Testing removeVowels', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof removeVowels === 'function', 'removeVowels is a Function'); - //t.deepEqual(removeVowels(args..), 'Expected'); - //t.equal(removeVowels(args..), 'Expected'); - //t.false(removeVowels(args..), 'Expected'); - //t.throws(removeVowels(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('removeVowels is a Function', () => { + expect(removeVowels).toBeInstanceOf(Function); +}); diff --git a/test/renameKeys/renameKeys.test.js b/test/renameKeys/renameKeys.test.js index 42900ec17..574c18289 100644 --- a/test/renameKeys/renameKeys.test.js +++ b/test/renameKeys/renameKeys.test.js @@ -1,15 +1,11 @@ -const test = require('tape'); +const expect = require('expect'); const renameKeys = require('./renameKeys.js'); -test('Testing renameKeys', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof renameKeys === 'function', 'renameKeys is a Function'); - - const obj = { name: 'Bobo', job: 'Front-End Master', shoeSize: 100 }; - const renamedObj = renameKeys({ name: 'firstName', job: 'passion' }, obj); - - t.deepEqual(renamedObj, { firstName: 'Bobo', passion: 'Front-End Master', shoeSize: 100 }); - - t.end(); +test('renameKeys is a Function', () => { + expect(renameKeys).toBeInstanceOf(Function); +}); +const obj = { name: 'Bobo', job: 'Front-End Master', shoeSize: 100 }; +const renamedObj = renameKeys({ name: 'firstName', job: 'passion' }, obj); +test('renameKeys is a Function', () => { + expect(renamedObj).toEqual({ firstName: 'Bobo', passion: 'Front-End Master', shoeSize: 100 }); }); diff --git a/test/reverseString/reverseString.test.js b/test/reverseString/reverseString.test.js index 7aeca53df..8eef925d7 100644 --- a/test/reverseString/reverseString.test.js +++ b/test/reverseString/reverseString.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const reverseString = require('./reverseString.js'); -test('Testing reverseString', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof reverseString === 'function', 'reverseString is a Function'); - t.equal(reverseString('foobar'), 'raboof', "Reverses a string."); - //t.deepEqual(reverseString(args..), 'Expected'); - //t.equal(reverseString(args..), 'Expected'); - //t.false(reverseString(args..), 'Expected'); - //t.throws(reverseString(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('reverseString is a Function', () => { + expect(reverseString).toBeInstanceOf(Function); +}); +test('Reverses a string.', () => { + expect(reverseString('foobar')).toBe('raboof'); +}); diff --git a/test/round/round.test.js b/test/round/round.test.js index 2aa705899..c72bb69c9 100644 --- a/test/round/round.test.js +++ b/test/round/round.test.js @@ -1,23 +1,39 @@ -const test = require('tape'); +const expect = require('expect'); const round = require('./round.js'); -test('Testing round', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof round === 'function', 'round is a Function'); - t.equal(round(1.005, 2), 1.01, "round(1.005, 2) returns 1.01"); - t.equal(round(123.3423345345345345344, 11), 123.34233453453, "round(123.3423345345345345344, 11) returns 123.34233453453"); - t.equal(round(3.342, 11), 3.342, "round(3.342, 11) returns 3.342"); - t.equal(round(1.005), 1, "round(1.005) returns 1"); - t.true(isNaN(round([1.005, 2])), 'round([1.005, 2]) returns NaN'); - t.true(isNaN(round('string')), 'round(string) returns NaN'); - t.true(isNaN(round()), 'round() returns NaN'); - t.true(isNaN(round(132, 413, 4134)), 'round(132, 413, 4134) returns NaN'); - t.true(isNaN(round({a: 132}, 413)), 'round({a: 132}, 413) returns NaN'); - - let start = new Date().getTime(); - round(123.3423345345345345344, 11); - let end = new Date().getTime(); - t.true((end - start) < 2000, 'round(123.3423345345345345344, 11) takes less than 2s to run'); - t.end(); +test('round is a Function', () => { + expect(round).toBeInstanceOf(Function); +}); +test('round(1.005, 2) returns 1.01', () => { + expect(round(1.005, 2)).toBe(1.01); +}); +test('round(123.3423345345345345344, 11) returns 123.34233453453', () => { + expect(round(123.3423345345345345344, 11)).toBe(123.34233453453); +}); +test('round(3.342, 11) returns 3.342', () => { + expect(round(3.342, 11)).toBe(3.342); +}); +test('round(1.005) returns 1', () => { + expect(round(1.005)).toBe(1); +}); +test('round([1.005, 2]) returns NaN', () => { + expect(isNaN(round([1.005, 2]))).toBeTruthy(); +}); + test('round(string) returns NaN', () => { + expect(isNaN(round('string'))).toBeTruthy(); +}); + test('round() returns NaN', () => { + expect(isNaN(round())).toBeTruthy(); +}); + test('round(132, 413, 4134) returns NaN', () => { + expect(isNaN(round(132, 413, 4134))).toBeTruthy(); +}); + test('round({a: 132}, 413) returns NaN', () => { + expect(isNaN(round({a: 132}, 413))).toBeTruthy(); +}); +let start = new Date().getTime(); +round(123.3423345345345345344, 11); +let end = new Date().getTime(); +test('round(123.3423345345345345344, 11) takes less than 2s to run', () => { + expect((end - start) < 2000).toBeTruthy(); }); diff --git a/test/runAsync/runAsync.test.js b/test/runAsync/runAsync.test.js index cbe70590b..fb2806ed4 100644 --- a/test/runAsync/runAsync.test.js +++ b/test/runAsync/runAsync.test.js @@ -1,14 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const runAsync = require('./runAsync.js'); -test('Testing runAsync', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof runAsync === 'function', 'runAsync is a Function'); - t.pass('Tested on 09/02/2018 by @chalarangelo'); - //t.deepEqual(runAsync(args..), 'Expected'); - //t.equal(runAsync(args..), 'Expected'); - //t.false(runAsync(args..), 'Expected'); - //t.throws(runAsync(args..), 'Expected'); - t.end(); +test('runAsync is a Function', () => { + expect(runAsync).toBeInstanceOf(Function); }); diff --git a/test/runPromisesInSeries/runPromisesInSeries.test.js b/test/runPromisesInSeries/runPromisesInSeries.test.js index 288878bf2..1fb99d262 100644 --- a/test/runPromisesInSeries/runPromisesInSeries.test.js +++ b/test/runPromisesInSeries/runPromisesInSeries.test.js @@ -1,15 +1,11 @@ -const test = require('tape'); +const expect = require('expect'); const runPromisesInSeries = require('./runPromisesInSeries.js'); -test('Testing runPromisesInSeries', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof runPromisesInSeries === 'function', 'runPromisesInSeries is a Function'); - const delay = d => new Promise(r => setTimeout(r, d)); - runPromisesInSeries([() => delay(100), () => delay(200).then(() => t.pass('Runs promises in series'))]); - //t.deepEqual(runPromisesInSeries(args..), 'Expected'); - //t.equal(runPromisesInSeries(args..), 'Expected'); - //t.false(runPromisesInSeries(args..), 'Expected'); - //t.throws(runPromisesInSeries(args..), 'Expected'); - t.end(); + +test('runPromisesInSeries is a Function', () => { + expect(runPromisesInSeries).toBeInstanceOf(Function); +}); +const delay = d => new Promise(r => setTimeout(r, d)); +test('Runs promises in series', () => { + runPromisesInSeries([() => delay(100), () => delay(200).then(() => expect(true).toBeTruthy())]); }); diff --git a/test/sample/sample.test.js b/test/sample/sample.test.js index 258d58e6f..199f8504b 100644 --- a/test/sample/sample.test.js +++ b/test/sample/sample.test.js @@ -1,17 +1,16 @@ -const test = require('tape'); +const expect = require('expect'); const sample = require('./sample.js'); -test('Testing sample', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof sample === 'function', 'sample is a Function'); - const arr = [3,7,9,11]; - t.true(arr.includes(sample(arr)), 'Returns a random element from the array'); - t.equal(sample([1]), 1, 'Works for single-element arrays'); - t.equal(sample([]), undefined, 'Returns undefined for empty array'); - //t.deepEqual(sample(args..), 'Expected'); - //t.equal(sample(args..), 'Expected'); - //t.false(sample(args..), 'Expected'); - //t.throws(sample(args..), 'Expected'); - t.end(); +test('sample is a Function', () => { + expect(sample).toBeInstanceOf(Function); +}); +const arr = [3,7,9,11]; +test('Returns a random element from the array', () => { + expect(arr.includes(sample(arr))).toBeTruthy(); +}); +test('Works for single-element arrays', () => { + expect(sample([1])).toBe(1); +}); +test('Returns undefined for empty array', () => { + expect(sample([])).toBe(undefined); }); diff --git a/test/sampleSize/sampleSize.test.js b/test/sampleSize/sampleSize.test.js index 6c610fa2d..22d72d238 100644 --- a/test/sampleSize/sampleSize.test.js +++ b/test/sampleSize/sampleSize.test.js @@ -1,19 +1,22 @@ -const test = require('tape'); +const expect = require('expect'); const sampleSize = require('./sampleSize.js'); -test('Testing sampleSize', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof sampleSize === 'function', 'sampleSize is a Function'); - const arr = [3,7,9,11]; - t.equal(sampleSize(arr).length, 1, 'Returns a single element without n specified'); - t.true(sampleSize(arr, 2).every(x => arr.includes(x)), 'Returns a random sample of specified size from an array'); - t.equal(sampleSize(arr, 5).length, 4, 'Returns all elements in an array if n >= length'); - t.deepEqual(sampleSize([], 2), [], 'Returns an empty array if original array is empty'); - t.deepEqual(sampleSize(arr, 0), [], 'Returns an empty array if n = 0'); - //t.deepEqual(sampleSize(args..), 'Expected'); - //t.equal(sampleSize(args..), 'Expected'); - //t.false(sampleSize(args..), 'Expected'); - //t.throws(sampleSize(args..), 'Expected'); - t.end(); +test('sampleSize is a Function', () => { + expect(sampleSize).toBeInstanceOf(Function); +}); +const arr = [3,7,9,11]; +test('Returns a single element without n specified', () => { + expect(sampleSize(arr).length).toBe(1); +}); +test('Returns a random sample of specified size from an array', () => { + expect(sampleSize(arr, 2).every(x => arr.includes(x))).toBeTruthy(); +}); +test('Returns all elements in an array if n >= length', () => { + expect(sampleSize(arr, 5).length).toBe(4); +}); +test('Returns an empty array if original array is empty', () => { + expect(sampleSize([], 2)).toEqual([]); +}); +test('Returns an empty array if n = 0', () => { + expect(sampleSize(arr, 0)).toEqual([]); }); diff --git a/test/scrollToTop/scrollToTop.test.js b/test/scrollToTop/scrollToTop.test.js index 1772b8fe9..c92677b1b 100644 --- a/test/scrollToTop/scrollToTop.test.js +++ b/test/scrollToTop/scrollToTop.test.js @@ -1,14 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const scrollToTop = require('./scrollToTop.js'); -test('Testing scrollToTop', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof scrollToTop === 'function', 'scrollToTop is a Function'); - t.pass('Tested on 09/02/2018 by @chalarangelo'); - //t.deepEqual(scrollToTop(args..), 'Expected'); - //t.equal(scrollToTop(args..), 'Expected'); - //t.false(scrollToTop(args..), 'Expected'); - //t.throws(scrollToTop(args..), 'Expected'); - t.end(); +test('scrollToTop is a Function', () => { + expect(scrollToTop).toBeInstanceOf(Function); }); diff --git a/test/sdbm/sdbm.test.js b/test/sdbm/sdbm.test.js index 8152041bb..58567bc40 100644 --- a/test/sdbm/sdbm.test.js +++ b/test/sdbm/sdbm.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const sdbm = require('./sdbm.js'); -test('Testing sdbm', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof sdbm === 'function', 'sdbm is a Function'); - t.equal(sdbm('name'), -3521204949, "Hashes the input string into a whole number."); - //t.deepEqual(sdbm(args..), 'Expected'); - //t.equal(sdbm(args..), 'Expected'); - //t.false(sdbm(args..), 'Expected'); - //t.throws(sdbm(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('sdbm is a Function', () => { + expect(sdbm).toBeInstanceOf(Function); +}); +test('Hashes the input string into a whole number.', () => { + expect(sdbm('name')).toBe(-3521204949); +}); diff --git a/test/serializeCookie/serializeCookie.test.js b/test/serializeCookie/serializeCookie.test.js index 45db4324f..211ca7c21 100644 --- a/test/serializeCookie/serializeCookie.test.js +++ b/test/serializeCookie/serializeCookie.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const serializeCookie = require('./serializeCookie.js'); -test('Testing serializeCookie', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof serializeCookie === 'function', 'serializeCookie is a Function'); - t.equal(serializeCookie('foo', 'bar'), 'foo=bar', 'Serializes the cookie'); - //t.deepEqual(serializeCookie(args..), 'Expected'); - //t.equal(serializeCookie(args..), 'Expected'); - //t.false(serializeCookie(args..), 'Expected'); - //t.throws(serializeCookie(args..), 'Expected'); - t.end(); +test('serializeCookie is a Function', () => { + expect(serializeCookie).toBeInstanceOf(Function); +}); +test('Serializes the cookie', () => { + expect(serializeCookie('foo', 'bar')).toBe('foo=bar'); }); diff --git a/test/setStyle/setStyle.test.js b/test/setStyle/setStyle.test.js index 3c8e4aa94..92be89a6e 100644 --- a/test/setStyle/setStyle.test.js +++ b/test/setStyle/setStyle.test.js @@ -1,14 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const setStyle = require('./setStyle.js'); -test('Testing setStyle', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof setStyle === 'function', 'setStyle is a Function'); - t.pass('Tested by @chalarangelo on 16/02/2018'); - //t.deepEqual(setStyle(args..), 'Expected'); - //t.equal(setStyle(args..), 'Expected'); - //t.false(setStyle(args..), 'Expected'); - //t.throws(setStyle(args..), 'Expected'); - t.end(); -}); +test('setStyle is a Function', () => { + expect(setStyle).toBeInstanceOf(Function); +}); diff --git a/test/shallowClone/shallowClone.test.js b/test/shallowClone/shallowClone.test.js index 71223569b..14c8fdf1c 100644 --- a/test/shallowClone/shallowClone.test.js +++ b/test/shallowClone/shallowClone.test.js @@ -1,17 +1,14 @@ -const test = require('tape'); +const expect = require('expect'); const shallowClone = require('./shallowClone.js'); -test('Testing shallowClone', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof shallowClone === 'function', 'shallowClone is a Function'); - const a = { foo: 'bar', obj: { a: 1, b: 2 } }; - const b = shallowClone(a); - t.notEqual(a, b, 'Shallow cloning works'); - t.equal(a.obj, b.obj, 'Does not clone deeply'); - //t.deepEqual(shallowClone(args..), 'Expected'); - //t.equal(shallowClone(args..), 'Expected'); - //t.false(shallowClone(args..), 'Expected'); - //t.throws(shallowClone(args..), 'Expected'); - t.end(); +test('shallowClone is a Function', () => { + expect(shallowClone).toBeInstanceOf(Function); +}); +const a = { foo: 'bar', obj: { a: 1, b: 2 } }; +const b = shallowClone(a); +test('Shallow cloning works', () => { + expect(a).not.toBe(b); +}); +test('Does not clone deeply', () => { + expect(a.obj).toBe(b.obj); }); diff --git a/test/show/show.test.js b/test/show/show.test.js index 859735338..81c5ea492 100644 --- a/test/show/show.test.js +++ b/test/show/show.test.js @@ -1,14 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const show = require('./show.js'); -test('Testing show', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof show === 'function', 'show is a Function'); - t.pass('Tested by @chalarangelo on 16/02/2018'); - //t.deepEqual(show(args..), 'Expected'); - //t.equal(show(args..), 'Expected'); - //t.false(show(args..), 'Expected'); - //t.throws(show(args..), 'Expected'); - t.end(); +test('show is a Function', () => { + expect(show).toBeInstanceOf(Function); }); diff --git a/test/shuffle/shuffle.test.js b/test/shuffle/shuffle.test.js index aed55ad03..ae6630c2f 100644 --- a/test/shuffle/shuffle.test.js +++ b/test/shuffle/shuffle.test.js @@ -1,18 +1,19 @@ -const test = require('tape'); +const expect = require('expect'); const shuffle = require('./shuffle.js'); -test('Testing shuffle', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof shuffle === 'function', 'shuffle is a Function'); - const arr = [1,2,3,4,5,6]; - t.notEqual(shuffle(arr), arr, 'Shuffles the array'); - t.true(shuffle(arr).every(x => arr.includes(x)), 'New array contains all original elements'); - t.deepEqual(shuffle([]),[],'Works for empty arrays'); - t.deepEqual(shuffle([1]),[1],'Works for single-element arrays'); - //t.deepEqual(shuffle(args..), 'Expected'); - //t.equal(shuffle(args..), 'Expected'); - //t.false(shuffle(args..), 'Expected'); - //t.throws(shuffle(args..), 'Expected'); - t.end(); +test('shuffle is a Function', () => { + expect(shuffle).toBeInstanceOf(Function); +}); +const arr = [1,2,3,4,5,6]; +test('Shuffles the array', () => { + expect(shuffle(arr)).not.toEqual(arr); +}); +test('New array contains all original elements', () => { + expect(shuffle(arr).every(x => arr.includes(x))).toBeTruthy(); +}); +test('Works for empty arrays', () => { + expect(shuffle([])).toEqual([]); +}); +test('Works for single-element arrays', () => { + expect(shuffle([1])).toEqual([1]); }); diff --git a/test/similarity/similarity.test.js b/test/similarity/similarity.test.js index b82022707..479c64b9c 100644 --- a/test/similarity/similarity.test.js +++ b/test/similarity/similarity.test.js @@ -1,12 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const similarity = require('./similarity.js'); -test('Testing similarity', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof similarity === 'function', 'similarity is a Function'); - t.deepEqual(similarity([1, 2, 3], [1, 2, 4]), [1, 2], "Returns an array of elements that appear in both arrays."); //t.equal(similarity(args..), 'Expected'); - //t.false(similarity(args..), 'Expected'); - //t.throws(similarity(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('similarity is a Function', () => { + expect(similarity).toBeInstanceOf(Function); +}); +test('Returns an array of elements that appear in both arrays.', () => { + expect(similarity([1, 2, 3], [1, 2, 4])).toEqual([1, 2]); +}); diff --git a/test/size/size.test.js b/test/size/size.test.js index 5c8410b23..54622aa01 100644 --- a/test/size/size.test.js +++ b/test/size/size.test.js @@ -1,17 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const size = require('./size.js'); -test('Testing size', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof size === 'function', 'size is a Function'); - t.equal(size([1, 2, 3, 4, 5]), 5, "Get size of arrays, objects or strings."); - // t.equal(size('size'), 4, "Get size of arrays, objects or strings."); DOESN'T WORK IN NODE ENV - t.equal(size({ one: 1, two: 2, three: 3 }), 3, "Get size of arrays, objects or strings."); - - //t.deepEqual(size(args..), 'Expected'); - //t.equal(size(args..), 'Expected'); - //t.false(size(args..), 'Expected'); - //t.throws(size(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('size is a Function', () => { + expect(size).toBeInstanceOf(Function); +}); +test('Get size of arrays, objects or strings.', () => { + expect(size([1, 2, 3, 4, 5])).toBe(5); +}); +test('Get size of arrays, objects or strings.', () => { + expect(size({ one: 1, two: 2, three: 3 })).toBe(3); +}); diff --git a/test/sleep/sleep.test.js b/test/sleep/sleep.test.js index 57beb16e2..faff7c0f2 100644 --- a/test/sleep/sleep.test.js +++ b/test/sleep/sleep.test.js @@ -1,17 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const sleep = require('./sleep.js'); -test('Testing sleep', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof sleep === 'function', 'sleep is a Function'); +test('sleep is a Function', () => { + expect(sleep).toBeInstanceOf(Function); +}); +test('Works as expected', () => { async function sleepyWork() { await sleep(1000); - t.pass('Works as expected'); + expect(true).toBeTruthy(); } - //t.deepEqual(sleep(args..), 'Expected'); - //t.equal(sleep(args..), 'Expected'); - //t.false(sleep(args..), 'Expected'); - //t.throws(sleep(args..), 'Expected'); - t.end(); }); diff --git a/test/smoothScroll/smoothScroll.test.js b/test/smoothScroll/smoothScroll.test.js index e74581e2c..269e7252c 100644 --- a/test/smoothScroll/smoothScroll.test.js +++ b/test/smoothScroll/smoothScroll.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const smoothScroll = require('./smoothScroll.js'); -test('Testing smoothScroll', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof smoothScroll === 'function', 'smoothScroll is a Function'); - //t.deepEqual(smoothScroll(args..), 'Expected'); - //t.equal(smoothScroll(args..), 'Expected'); - //t.false(smoothScroll(args..), 'Expected'); - //t.throws(smoothScroll(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('smoothScroll is a Function', () => { + expect(smoothScroll).toBeInstanceOf(Function); +}); diff --git a/test/solveRPN/solveRPN.test.js b/test/solveRPN/solveRPN.test.js index 78cea6cdf..c6a2fee8b 100644 --- a/test/solveRPN/solveRPN.test.js +++ b/test/solveRPN/solveRPN.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const solveRPN = require('./solveRPN.js'); -test('Testing solveRPN', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof solveRPN === 'function', 'solveRPN is a Function'); - //t.deepEqual(solveRPN(args..), 'Expected'); - //t.equal(solveRPN(args..), 'Expected'); - //t.false(solveRPN(args..), 'Expected'); - //t.throws(solveRPN(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('solveRPN is a Function', () => { + expect(solveRPN).toBeInstanceOf(Function); +}); diff --git a/test/sortCharactersInString/sortCharactersInString.test.js b/test/sortCharactersInString/sortCharactersInString.test.js index 25fc97bd8..8979fe2b7 100644 --- a/test/sortCharactersInString/sortCharactersInString.test.js +++ b/test/sortCharactersInString/sortCharactersInString.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const sortCharactersInString = require('./sortCharactersInString.js'); -test('Testing sortCharactersInString', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof sortCharactersInString === 'function', 'sortCharactersInString is a Function'); - t.equal(sortCharactersInString('cabbage'), 'aabbceg', "Alphabetically sorts the characters in a string."); - //t.deepEqual(sortCharactersInString(args..), 'Expected'); - //t.equal(sortCharactersInString(args..), 'Expected'); - //t.false(sortCharactersInString(args..), 'Expected'); - //t.throws(sortCharactersInString(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('sortCharactersInString is a Function', () => { + expect(sortCharactersInString).toBeInstanceOf(Function); +}); +test('Alphabetically sorts the characters in a string.', () => { + expect(sortCharactersInString('cabbage')).toBe('aabbceg'); +}); diff --git a/test/sortedIndex/sortedIndex.test.js b/test/sortedIndex/sortedIndex.test.js index c60ba058f..0bfe6ff39 100644 --- a/test/sortedIndex/sortedIndex.test.js +++ b/test/sortedIndex/sortedIndex.test.js @@ -1,15 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const sortedIndex = require('./sortedIndex.js'); -test('Testing sortedIndex', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof sortedIndex === 'function', 'sortedIndex is a Function'); - t.equal(sortedIndex([5, 3, 2, 1], 4), 1, "Returns the lowest index at which value should be inserted into array in order to maintain its sort order."); - t.equal(sortedIndex([30, 50], 40), 1, "Returns the lowest index at which value should be inserted into array in order to maintain its sort order."); - //t.deepEqual(sortedIndex(args..), 'Expected'); - //t.equal(sortedIndex(args..), 'Expected'); - //t.false(sortedIndex(args..), 'Expected'); - //t.throws(sortedIndex(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('sortedIndex is a Function', () => { + expect(sortedIndex).toBeInstanceOf(Function); +}); +test('Returns the lowest index at which value should be inserted into array in order to maintain its sort order.', () => { + expect(sortedIndex([5, 3, 2, 1], 4)).toBe(1); +}); +test('Returns the lowest index at which value should be inserted into array in order to maintain its sort order.', () => { + expect(sortedIndex([30, 50], 40)).toBe(1); +}); diff --git a/test/sortedIndexBy/sortedIndexBy.test.js b/test/sortedIndexBy/sortedIndexBy.test.js index 6f173a5b6..6e02b36a4 100644 --- a/test/sortedIndexBy/sortedIndexBy.test.js +++ b/test/sortedIndexBy/sortedIndexBy.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const sortedIndexBy = require('./sortedIndexBy.js'); -test('Testing sortedIndexBy', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof sortedIndexBy === 'function', 'sortedIndexBy is a Function'); - t.equal(sortedIndexBy([{ x: 4 }, { x: 5 }], { x: 4 }, o => o.x), 0, 'Returns the lowest index to insert the element without messing up the list order'); - //t.deepEqual(sortedIndexBy(args..), 'Expected'); - //t.equal(sortedIndexBy(args..), 'Expected'); - //t.false(sortedIndexBy(args..), 'Expected'); - //t.throws(sortedIndexBy(args..), 'Expected'); - t.end(); +test('sortedIndexBy is a Function', () => { + expect(sortedIndexBy).toBeInstanceOf(Function); +}); +test('Returns the lowest index to insert the element without messing up the list order', () => { + expect(sortedIndexBy([{ x: 4 }, { x: 5 }], { x: 4 }, o => o.x)).toBe(0); }); diff --git a/test/sortedLastIndex/sortedLastIndex.test.js b/test/sortedLastIndex/sortedLastIndex.test.js index a80ef11dc..84a9ff63a 100644 --- a/test/sortedLastIndex/sortedLastIndex.test.js +++ b/test/sortedLastIndex/sortedLastIndex.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const sortedLastIndex = require('./sortedLastIndex.js'); -test('Testing sortedLastIndex', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof sortedLastIndex === 'function', 'sortedLastIndex is a Function'); - t.equal(sortedLastIndex([10, 20, 30, 30, 40], 30), 4, 'Returns the highest index to insert the element without messing up the list order'); - //t.deepEqual(sortedLastIndex(args..), 'Expected'); - //t.equal(sortedLastIndex(args..), 'Expected'); - //t.false(sortedLastIndex(args..), 'Expected'); - //t.throws(sortedLastIndex(args..), 'Expected'); - t.end(); +test('sortedLastIndex is a Function', () => { + expect(sortedLastIndex).toBeInstanceOf(Function); +}); +test('Returns the highest index to insert the element without messing up the list order', () => { + expect(sortedLastIndex([10, 20, 30, 30, 40], 30)).toBe(4); }); diff --git a/test/sortedLastIndexBy/sortedLastIndexBy.test.js b/test/sortedLastIndexBy/sortedLastIndexBy.test.js index e7f19f6e9..ad0bfc718 100644 --- a/test/sortedLastIndexBy/sortedLastIndexBy.test.js +++ b/test/sortedLastIndexBy/sortedLastIndexBy.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const sortedLastIndexBy = require('./sortedLastIndexBy.js'); -test('Testing sortedLastIndexBy', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof sortedLastIndexBy === 'function', 'sortedLastIndexBy is a Function'); - t.equal(sortedLastIndexBy([{ x: 4 }, { x: 5 }], { x: 4 }, o => o.x), 1, 'Returns the highest index to insert the element without messing up the list order'); - //t.deepEqual(sortedLastIndexBy(args..), 'Expected'); - //t.equal(sortedLastIndexBy(args..), 'Expected'); - //t.false(sortedLastIndexBy(args..), 'Expected'); - //t.throws(sortedLastIndexBy(args..), 'Expected'); - t.end(); +test('sortedLastIndexBy is a Function', () => { + expect(sortedLastIndexBy).toBeInstanceOf(Function); +}); +test('Returns the highest index to insert the element without messing up the list order', () => { + expect(sortedLastIndexBy([{ x: 4 }, { x: 5 }], { x: 4 }, o => o.x)).toBe(1); }); diff --git a/test/speechSynthesis/speechSynthesis.test.js b/test/speechSynthesis/speechSynthesis.test.js index 16d2f891f..9981924c8 100644 --- a/test/speechSynthesis/speechSynthesis.test.js +++ b/test/speechSynthesis/speechSynthesis.test.js @@ -1,13 +1,6 @@ -const test = require('tape'); +const expect = require('expect'); const speechSynthesis = require('./speechSynthesis.js'); -test('Testing speechSynthesis', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof speechSynthesis === 'function', 'speechSynthesis is a Function'); - //t.deepEqual(speechSynthesis(args..), 'Expected'); - //t.equal(speechSynthesis(args..), 'Expected'); - //t.false(speechSynthesis(args..), 'Expected'); - //t.throws(speechSynthesis(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('speechSynthesis is a Function', () => { + expect(speechSynthesis).toBeInstanceOf(Function); +}); diff --git a/test/splitLines/splitLines.test.js b/test/splitLines/splitLines.test.js index 7d03fd581..18a591ba3 100644 --- a/test/splitLines/splitLines.test.js +++ b/test/splitLines/splitLines.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const splitLines = require('./splitLines.js'); -test('Testing splitLines', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof splitLines === 'function', 'splitLines is a Function'); - t.deepEqual(splitLines('This\nis a\nmultiline\nstring.\n'), ['This', 'is a', 'multiline', 'string.' , ''], "Splits a multiline string into an array of lines."); - //t.deepEqual(splitLines(args..), 'Expected'); - //t.equal(splitLines(args..), 'Expected'); - //t.false(splitLines(args..), 'Expected'); - //t.throws(splitLines(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('splitLines is a Function', () => { + expect(splitLines).toBeInstanceOf(Function); +}); +test('Splits a multiline string into an array of lines.', () => { + expect(splitLines('This\nis a\nmultiline\nstring.\n')).toEqual(['This', 'is a', 'multiline', 'string.', '']); +}); diff --git a/test/spreadOver/spreadOver.test.js b/test/spreadOver/spreadOver.test.js index d294b4f52..7f101c1d9 100644 --- a/test/spreadOver/spreadOver.test.js +++ b/test/spreadOver/spreadOver.test.js @@ -1,15 +1,10 @@ -const test = require('tape'); +const expect = require('expect'); const spreadOver = require('./spreadOver.js'); -test('Testing spreadOver', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof spreadOver === 'function', 'spreadOver is a Function'); - const arrayMax = spreadOver(Math.max); - t.equal(arrayMax([1, 2, 3]), 3, "Takes a variadic function and returns a closure that accepts an array of arguments to map to the inputs of the function."); - //t.deepEqual(spreadOver(args..), 'Expected'); - //t.equal(spreadOver(args..), 'Expected'); - //t.false(spreadOver(args..), 'Expected'); - //t.throws(spreadOver(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('spreadOver is a Function', () => { + expect(spreadOver).toBeInstanceOf(Function); +}); +const arrayMax = spreadOver(Math.max); +test('Takes a variadic function and returns a closure that accepts an array of arguments to map to the inputs of the function.', () => { + expect(arrayMax([1, 2, 3])).toBe(3); +}); diff --git a/test/stableSort/stableSort.test.js b/test/stableSort/stableSort.test.js index e8cf95496..4c2f3a37b 100644 --- a/test/stableSort/stableSort.test.js +++ b/test/stableSort/stableSort.test.js @@ -1,17 +1,11 @@ -const test = require('tape'); +const expect = require('expect'); const stableSort = require('./stableSort.js'); -test('Testing stableSort', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof stableSort === 'function', 'stableSort is a Function'); - //t.deepEqual(stableSort(args..), 'Expected'); - //t.equal(stableSort(args..), 'Expected'); - //t.false(stableSort(args..), 'Expected'); - //t.throws(stableSort(args..), 'Expected'); - - const arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; - const compare = () => 0; - t.deepEqual(stableSort(arr, compare), arr, 'Array is properly sorted'); - t.end(); +test('stableSort is a Function', () => { + expect(stableSort).toBeInstanceOf(Function); +}); +const arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; +const compare = () => 0; +test('Array is properly sorted', () => { + expect(stableSort(arr, compare)).toEqual(arr); }); diff --git a/test/standardDeviation/standardDeviation.test.js b/test/standardDeviation/standardDeviation.test.js index ad43efb90..0bf680689 100644 --- a/test/standardDeviation/standardDeviation.test.js +++ b/test/standardDeviation/standardDeviation.test.js @@ -1,15 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const standardDeviation = require('./standardDeviation.js'); -test('Testing standardDeviation', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof standardDeviation === 'function', 'standardDeviation is a Function'); - t.equal(standardDeviation([10, 2, 38, 23, 38, 23, 21]), 13.284434142114991, "Returns the standard deviation of an array of numbers"); - t.equal(standardDeviation([10, 2, 38, 23, 38, 23, 21], true), 12.29899614287479, "Returns the standard deviation of an array of numbers"); - //t.deepEqual(standardDeviation(args..), 'Expected'); - //t.equal(standardDeviation(args..), 'Expected'); - //t.false(standardDeviation(args..), 'Expected'); - //t.throws(standardDeviation(args..), 'Expected'); - t.end(); -}); \ No newline at end of file +test('standardDeviation is a Function', () => { + expect(standardDeviation).toBeInstanceOf(Function); +}); +test('Returns the standard deviation of an array of numbers', () => { + expect(standardDeviation([10, 2, 38, 23, 38, 23, 21])).toBeCloseTo(13.284434142114991,5); +}); +test('Returns the standard deviation of an array of numbers', () => { + expect(standardDeviation([10, 2, 38, 23, 38, 23, 21], true)).toBeCloseTo(12.29899614287479,5); +}); diff --git a/test/stringPermutations/stringPermutations.test.js b/test/stringPermutations/stringPermutations.test.js index 6b5bb11ad..b97252f6d 100644 --- a/test/stringPermutations/stringPermutations.test.js +++ b/test/stringPermutations/stringPermutations.test.js @@ -1,16 +1,15 @@ -const test = require('tape'); +const expect = require('expect'); const stringPermutations = require('./stringPermutations.js'); -test('Testing stringPermutations', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof stringPermutations === 'function', 'stringPermutations is a Function'); - t.deepEqual(stringPermutations('abc'), ['abc','acb','bac','bca','cab','cba'], "Generates all stringPermutations of a string"); - t.deepEqual(stringPermutations('a'), ['a'], "Works for single-letter strings"); - t.deepEqual(stringPermutations(''), [''], "Works for empty strings"); - //t.deepEqual(anagrams(args..), 'Expected'); - //t.equal(anagrams(args..), 'Expected'); - //t.false(anagrams(args..), 'Expected'); - //t.throws(anagrams(args..), 'Expected'); - t.end(); +test('stringPermutations is a Function', () => { + expect(stringPermutations).toBeInstanceOf(Function); +}); +test('Generates all stringPermutations of a string', () => { + expect(stringPermutations('abc')).toEqual(['abc','acb','bac','bca','cab','cba']); +}); +test('Works for single-letter strings', () => { + expect(stringPermutations('a')).toEqual(['a']); +}); +test('Works for empty strings', () => { + expect(stringPermutations('')).toEqual(['']); }); diff --git a/test/stripHTMLTags/stripHTMLTags.test.js b/test/stripHTMLTags/stripHTMLTags.test.js index 7aad3d6fe..fe434e44f 100644 --- a/test/stripHTMLTags/stripHTMLTags.test.js +++ b/test/stripHTMLTags/stripHTMLTags.test.js @@ -1,14 +1,9 @@ -const test = require('tape'); +const expect = require('expect'); const stripHTMLTags = require('./stripHTMLTags.js'); -test('Testing stripHTMLTags', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof stripHTMLTags === 'function', 'stripHTMLTags is a Function'); - t.equals(stripHTMLTags('
lorem ipsum
lorem ipsum