From 5afe81452ada15c9e0315de45797bd645ed1d320 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Mon, 18 Jun 2018 14:18:25 +0300 Subject: [PATCH 01/19] Migrated tests to jest Used jest-codemods to migrate, will have to pass everything by hand before we can merge. --- package-lock.json | 3656 +++++++++++++++++ package.json | 4 +- test/JSONToDate/JSONToDate.test.js | 13 - test/JSONToFile/JSONToFile.test.js | 14 - test/RGBToHex/RGBToHex.test.js | 14 - test/URLJoin/URLJoin.test.js | 15 - .../UUIDGeneratorBrowser.test.js | 14 - .../UUIDGeneratorNode.test.js | 16 - test/all/all.test.js | 27 +- test/any/any.test.js | 21 +- .../approximatelyEqual.test.js | 19 +- test/arrayToHtmlList/arrayToHtmlList.test.js | 12 +- test/ary/ary.test.js | 13 +- test/atob/atob.test.js | 15 +- test/attempt/attempt.test.js | 15 +- test/average/average.test.js | 31 +- test/averageBy/averageBy.test.js | 15 +- test/bifurcate/bifurcate.test.js | 13 +- test/bifurcateBy/bifurcateBy.test.js | 13 +- test/binarySearch/binarySearch.test.js | 17 +- test/bind/bind.test.js | 13 +- test/bindAll/bindAll.test.js | 13 +- test/bindKey/bindKey.test.js | 13 +- .../binomialCoefficient.test.js | 21 +- test/bottomVisible/bottomVisible.test.js | 12 +- test/btoa/btoa.test.js | 13 +- test/byteSize/byteSize.test.js | 23 +- test/call/call.test.js | 9 +- test/capitalize/capitalize.test.js | 19 +- .../capitalizeEveryWord.test.js | 17 +- test/castArray/castArray.test.js | 21 +- test/chainAsync/chainAsync.test.js | 16 +- test/chunk/chunk.test.js | 25 +- test/clampNumber/clampNumber.test.js | 13 +- test/cleanObj/cleanObj.test.js | 13 +- test/cloneRegExp/cloneRegExp.test.js | 13 +- test/coalesce/coalesce.test.js | 13 +- test/coalesceFactory/coalesceFactory.test.js | 13 +- test/collatz/collatz.test.js | 15 +- test/collectInto/collectInto.test.js | 13 +- test/colorize/colorize.test.js | 12 +- test/compact/compact.test.js | 13 +- test/compose/compose.test.js | 13 +- test/composeRight/composeRight.test.js | 13 +- test/converge/converge.test.js | 15 +- test/copyToClipboard/copyToClipboard.test.js | 12 +- test/countBy/countBy.test.js | 15 +- .../countOccurrences/countOccurrences.test.js | 13 +- test/countVowels/countVowels.test.js | 11 +- test/counter/counter.test.js | 11 +- test/createElement/createElement.test.js | 12 +- test/createEventHub/createEventHub.test.js | 12 +- test/currentURL/currentURL.test.js | 12 +- test/curry/curry.test.js | 15 +- test/debounce/debounce.test.js | 13 +- test/decapitalize/decapitalize.test.js | 15 +- test/deepClone/deepClone.test.js | 19 +- test/deepFlatten/deepFlatten.test.js | 13 +- test/defaults/defaults.test.js | 14 - test/defer/defer.test.js | 14 - test/degreesToRads/degreesToRads.test.js | 15 - test/delay/delay.test.js | 20 - .../detectDeviceType/detectDeviceType.test.js | 14 - test/difference/difference.test.js | 14 - test/differenceBy/differenceBy.test.js | 15 - test/differenceWith/differenceWith.test.js | 14 - test/digitize/digitize.test.js | 14 - test/distance/distance.test.js | 14 - test/drop/drop.test.js | 16 - test/dropRight/dropRight.test.js | 16 - test/dropRightWhile/dropRightWhile.test.js | 14 - test/dropWhile/dropWhile.test.js | 14 - .../elementIsVisibleInViewport.test.js | 14 - test/elo/elo.test.js | 16 - test/equals/equals.test.js | 18 - test/escapeHTML/escapeHTML.test.js | 14 - test/escapeRegExp/escapeRegExp.test.js | 14 - test/everyNth/everyNth.test.js | 14 - test/extendHex/extendHex.test.js | 15 - test/factorial/factorial.test.js | 18 - test/factors/factors.test.js | 13 - test/fibonacci/fibonacci.test.js | 14 - .../fibonacciCountUntilNum.test.js | 13 - .../fibonacciUntilNum.test.js | 13 - test/filterNonUnique/filterNonUnique.test.js | 14 - test/findKey/findKey.test.js | 21 - test/findLast/findLast.test.js | 14 - test/findLastIndex/findLastIndex.test.js | 14 - test/findLastKey/findLastKey.test.js | 21 - test/flatten/flatten.test.js | 15 - test/flattenObject/flattenObject.test.js | 15 - test/flip/flip.test.js | 18 - test/forEachRight/forEachRight.test.js | 16 - test/forOwn/forOwn.test.js | 16 - test/forOwnRight/forOwnRight.test.js | 16 - test/formatDuration/formatDuration.test.js | 15 - test/fromCamelCase/fromCamelCase.test.js | 16 - test/functionName/functionName.test.js | 26 - test/functions/functions.test.js | 20 - test/gcd/gcd.test.js | 15 - .../geometricProgression.test.js | 16 - test/get/get.test.js | 15 - .../getColonTimeFromDate.test.js | 13 - .../getDaysDiffBetweenDates.test.js | 14 - .../getMeridiemSuffixOfInteger.test.js | 13 - .../getScrollPosition.test.js | 14 - test/getStyle/getStyle.test.js | 14 - test/getType/getType.test.js | 14 - .../getURLParameters/getURLParameters.test.js | 14 - test/groupBy/groupBy.test.js | 15 - test/hammingDistance/hammingDistance.test.js | 14 - test/hasClass/hasClass.test.js | 13 - test/hasFlags/hasFlags.test.js | 14 - test/hashBrowser/hashBrowser.test.js | 14 - test/hashNode/hashNode.test.js | 14 - test/head/head.test.js | 21 - test/hexToRGB/hexToRGB.test.js | 16 - test/hide/hide.test.js | 14 - test/howManyTimes/howManyTimes.test.js | 13 - test/httpDelete/httpDelete.test.js | 13 - test/httpPut/httpPut.test.js | 13 - test/httpsRedirect/httpsRedirect.test.js | 14 - test/hz/hz.test.js | 13 - test/inRange/inRange.test.js | 17 - test/indexOfAll/indexOfAll.test.js | 15 - test/initial/initial.test.js | 14 - .../initialize2DArray.test.js | 14 - .../initializeArrayWithRange.test.js | 14 - .../initializeArrayWithRangeRight.test.js | 13 - .../initializeArrayWithValues.test.js | 14 - .../initializeNDArray.test.js | 13 - test/intersection/intersection.test.js | 14 - test/intersectionBy/intersectionBy.test.js | 14 - .../intersectionWith/intersectionWith.test.js | 14 - test/invertKeyValues/invertKeyValues.test.js | 15 - test/is/is.test.js | 29 - test/isAbsoluteURL/isAbsoluteURL.test.js | 16 - test/isAnagram/isAnagram.test.js | 17 - .../isArmstrongNumber.test.js | 13 - test/isArray/isArray.test.js | 14 - test/isArrayBuffer/isArrayBuffer.test.js | 13 - test/isArrayLike/isArrayLike.test.js | 16 - test/isBoolean/isBoolean.test.js | 15 - test/isBrowser/isBrowser.test.js | 13 - .../isBrowserTabFocused.test.js | 13 - test/isDivisible/isDivisible.test.js | 13 - test/isEmpty/isEmpty.test.js | 23 - test/isEven/isEven.test.js | 13 - test/isFunction/isFunction.test.js | 14 - test/isLowerCase/isLowerCase.test.js | 16 - test/isMap/isMap.test.js | 13 - test/isNil/isNil.test.js | 16 - test/isNull/isNull.test.js | 15 - test/isNumber/isNumber.test.js | 16 - test/isObject/isObject.test.js | 19 - test/isObjectLike/isObjectLike.test.js | 17 - test/isPlainObject/isPlainObject.test.js | 15 - test/isPrime/isPrime.test.js | 14 - test/isPrimitive/isPrimitive.test.js | 24 - test/isPromiseLike/isPromiseLike.test.js | 20 - test/isRegExp/isRegExp.test.js | 13 - test/isSet/isSet.test.js | 13 - test/isSimilar/isSimilar.test.js | 13 - test/isSorted/isSorted.test.js | 23 - test/isString/isString.test.js | 19 - test/isSymbol/isSymbol.test.js | 14 - test/isTravisCI/isTravisCI.test.js | 17 - test/isTypedArray/isTypedArray.test.js | 13 - test/isUndefined/isUndefined.test.js | 14 - test/isUpperCase/isUpperCase.test.js | 15 - test/isValidJSON/isValidJSON.test.js | 16 - test/isWeakMap/isWeakMap.test.js | 13 - test/isWeakSet/isWeakSet.test.js | 13 - test/join/join.test.js | 17 - test/last/last.test.js | 21 - test/lcm/lcm.test.js | 15 - .../levenshteinDistance.test.js | 13 - test/longestItem/longestItem.test.js | 14 - test/lowercaseKeys/lowercaseKeys.test.js | 17 - test/luhnCheck/luhnCheck.test.js | 16 - test/mapKeys/mapKeys.test.js | 14 - test/mapObject/mapObject.test.js | 16 - test/mapValues/mapValues.test.js | 18 - test/mask/mask.test.js | 16 - test/matches/matches.test.js | 15 - test/matchesWith/matchesWith.test.js | 19 - test/maxBy/maxBy.test.js | 15 - test/maxN/maxN.test.js | 15 - test/median/median.test.js | 15 - test/memoize/memoize.test.js | 18 - test/merge/merge.test.js | 23 - test/minBy/minBy.test.js | 15 - test/minN/minN.test.js | 14 - test/mostPerformant/mostPerformant.test.js | 14 - test/negate/negate.test.js | 14 - test/nest/nest.test.js | 13 - test/nodeListToArray/nodeListToArray.test.js | 13 - test/none/none.test.js | 17 - test/nthArg/nthArg.test.js | 18 - test/nthElement/nthElement.test.js | 15 - test/objectFromPairs/objectFromPairs.test.js | 14 - test/objectToPairs/objectToPairs.test.js | 14 - .../observeMutations/observeMutations.test.js | 14 - test/off/off.test.js | 14 - test/offset/offset.test.js | 19 - test/omit/omit.test.js | 14 - test/omitBy/omitBy.test.js | 14 - test/on/on.test.js | 14 - .../onUserInputChange.test.js | 14 - test/once/once.test.js | 14 - test/orderBy/orderBy.test.js | 16 - test/over/over.test.js | 15 - test/overArgs/overArgs.test.js | 17 - test/pad/pad.test.js | 13 - test/palindrome/palindrome.test.js | 15 - test/parseCookie/parseCookie.test.js | 14 - test/partial/partial.test.js | 18 - test/partialRight/partialRight.test.js | 18 - test/partition/partition.test.js | 15 - test/percentile/percentile.test.js | 14 - test/permutations/permutations.test.js | 14 - test/pick/pick.test.js | 14 - test/pickBy/pickBy.test.js | 14 - .../pipeAsyncFunctions.test.js | 24 - test/pipeFunctions/pipeFunctions.test.js | 17 - test/pluralize/pluralize.test.js | 23 - test/powerset/powerset.test.js | 14 - test/prefix/prefix.test.js | 13 - test/prettyBytes/prettyBytes.test.js | 17 - test/primes/primes.test.js | 14 - test/promisify/promisify.test.js | 17 - test/pull/pull.test.js | 16 - test/pullAtIndex/pullAtIndex.test.js | 17 - test/pullAtValue/pullAtValue.test.js | 17 - test/pullBy/pullBy.test.js | 16 - test/quickSort/quickSort.test.js | 22 - test/radsToDegrees/radsToDegrees.test.js | 14 - .../randomHexColorCode.test.js | 15 - .../randomIntArrayInRange.test.js | 19 - .../randomIntegerInRange.test.js | 18 - .../randomNumberInRange.test.js | 18 - test/readFileLines/readFileLines.test.js | 14 - test/rearg/rearg.test.js | 20 - .../recordAnimationFrames.test.js | 13 - test/redirect/redirect.test.js | 14 - .../reduceSuccessive/reduceSuccessive.test.js | 14 - test/reduceWhich/reduceWhich.test.js | 19 - test/reducedFilter/reducedFilter.test.js | 26 - test/remove/remove.test.js | 14 - test/removeNonASCII/removeNonASCII.test.js | 14 - test/removeVowels/removeVowels.test.js | 13 - test/reverseString/reverseString.test.js | 14 - test/round/round.test.js | 23 - test/runAsync/runAsync.test.js | 14 - .../runPromisesInSeries.test.js | 15 - test/sample/sample.test.js | 17 - test/sampleSize/sampleSize.test.js | 19 - test/scrollToTop/scrollToTop.test.js | 14 - test/sdbm/sdbm.test.js | 14 - test/serializeCookie/serializeCookie.test.js | 14 - test/setStyle/setStyle.test.js | 14 - test/shallowClone/shallowClone.test.js | 17 - test/show/show.test.js | 14 - test/shuffle/shuffle.test.js | 18 - test/similarity/similarity.test.js | 12 - test/size/size.test.js | 17 - test/sleep/sleep.test.js | 17 - test/smoothScroll/smoothScroll.test.js | 13 - test/solveRPN/solveRPN.test.js | 13 - .../sortCharactersInString.test.js | 14 - test/sortedIndex/sortedIndex.test.js | 15 - test/sortedIndexBy/sortedIndexBy.test.js | 14 - test/sortedLastIndex/sortedLastIndex.test.js | 14 - .../sortedLastIndexBy.test.js | 14 - test/speechSynthesis/speechSynthesis.test.js | 13 - test/splitLines/splitLines.test.js | 14 - test/spreadOver/spreadOver.test.js | 15 - .../standardDeviation.test.js | 15 - .../stringPermutations.test.js | 16 - test/stripHTMLTags/stripHTMLTags.test.js | 14 - test/sum/sum.test.js | 14 - test/sumBy/sumBy.test.js | 13 - test/sumPower/sumPower.test.js | 16 - .../symmetricDifference.test.js | 14 - .../symmetricDifferenceBy.test.js | 14 - .../symmetricDifferenceWith.test.js | 18 - test/tail/tail.test.js | 15 - test/take/take.test.js | 15 - test/takeRight/takeRight.test.js | 15 - test/takeRightWhile/takeRightWhile.test.js | 14 - test/takeWhile/takeWhile.test.js | 14 - test/testlog | 2054 --------- test/throttle/throttle.test.js | 14 - test/timeTaken/timeTaken.test.js | 14 - test/times/times.test.js | 16 - test/toCamelCase/toCamelCase.test.js | 22 - test/toCurrency/toCurrency.test.js | 18 - test/toDecimalMark/toDecimalMark.test.js | 14 - test/toHash/toHash.test.js | 13 - test/toKebabCase/toKebabCase.test.js | 22 - test/toOrdinalSuffix/toOrdinalSuffix.test.js | 18 - test/toSafeInteger/toSafeInteger.test.js | 24 - test/toSnakeCase/toSnakeCase.test.js | 22 - test/toggleClass/toggleClass.test.js | 14 - test/tomorrow/tomorrow.test.js | 18 - test/transform/transform.test.js | 21 - test/truncateString/truncateString.test.js | 13 - .../truthCheckCollection.test.js | 14 - test/unary/unary.test.js | 14 - test/uncurry/uncurry.test.js | 20 - test/unescapeHTML/unescapeHTML.test.js | 14 - test/unflattenObject/unflattenObject.test.js | 14 - test/unfold/unfold.test.js | 15 - test/union/union.test.js | 24 - test/unionBy/unionBy.test.js | 14 - test/unionWith/unionWith.test.js | 14 - test/uniqueElements/uniqueElements.test.js | 28 - test/untildify/untildify.test.js | 16 - test/unzip/unzip.test.js | 15 - test/unzipWith/unzipWith.test.js | 13 - test/validateNumber/validateNumber.test.js | 22 - test/without/without.test.js | 19 - test/words/words.test.js | 19 - test/xProd/xProd.test.js | 14 - test/yesNo/yesNo.test.js | 22 - test/zip/zip.test.js | 18 - test/zipObject/zipObject.test.js | 19 - test/zipWith/zipWith.test.js | 13 - {test => test2}/defaults/defaults.js | 0 test2/defaults/defaults.test.js | 9 + {test => test2}/defer/defer.js | 0 test2/defer/defer.test.js | 8 + .../degreesToRads/degreesToRads.js | 0 test2/degreesToRads/degreesToRads.test.js | 10 + {test => test2}/delay/delay.js | 0 test2/delay/delay.test.js | 15 + .../detectDeviceType/detectDeviceType.js | 0 .../detectDeviceType/detectDeviceType.test.js | 8 + {test => test2}/difference/difference.js | 0 test2/difference/difference.test.js | 9 + {test => test2}/differenceBy/differenceBy.js | 0 test2/differenceBy/differenceBy.test.js | 10 + .../differenceWith/differenceWith.js | 0 test2/differenceWith/differenceWith.test.js | 11 + {test => test2}/digitize/digitize.js | 0 test2/digitize/digitize.test.js | 9 + {test => test2}/distance/distance.js | 0 test2/distance/distance.test.js | 9 + {test => test2}/drop/drop.js | 0 test2/drop/drop.test.js | 11 + {test => test2}/dropRight/dropRight.js | 0 test2/dropRight/dropRight.test.js | 11 + .../dropRightWhile/dropRightWhile.js | 0 test2/dropRightWhile/dropRightWhile.test.js | 9 + {test => test2}/dropWhile/dropWhile.js | 0 test2/dropWhile/dropWhile.test.js | 9 + .../elementIsVisibleInViewport.js | 0 .../elementIsVisibleInViewport.test.js | 8 + {test => test2}/elo/elo.js | 0 test2/elo/elo.test.js | 11 + {test => test2}/equals/equals.js | 0 test2/equals/equals.test.js | 15 + {test => test2}/escapeHTML/escapeHTML.js | 0 test2/escapeHTML/escapeHTML.test.js | 9 + {test => test2}/escapeRegExp/escapeRegExp.js | 0 test2/escapeRegExp/escapeRegExp.test.js | 9 + {test => test2}/everyNth/everyNth.js | 0 test2/everyNth/everyNth.test.js | 9 + {test => test2}/extendHex/extendHex.js | 0 test2/extendHex/extendHex.test.js | 10 + {test => test2}/factorial/factorial.js | 0 test2/factorial/factorial.test.js | 13 + {test => test2}/factors/factors.js | 0 test2/factors/factors.test.js | 8 + {test => test2}/fibonacci/fibonacci.js | 0 test2/fibonacci/fibonacci.test.js | 9 + .../fibonacciCountUntilNum.js | 0 .../fibonacciCountUntilNum.test.js | 8 + .../fibonacciUntilNum/fibonacciUntilNum.js | 0 .../fibonacciUntilNum.test.js | 8 + .../filterNonUnique/filterNonUnique.js | 0 test2/filterNonUnique/filterNonUnique.test.js | 9 + {test => test2}/findKey/findKey.js | 0 test2/findKey/findKey.test.js | 16 + {test => test2}/findLast/findLast.js | 0 test2/findLast/findLast.test.js | 9 + .../findLastIndex/findLastIndex.js | 0 test2/findLastIndex/findLastIndex.test.js | 9 + {test => test2}/findLastKey/findLastKey.js | 0 test2/findLastKey/findLastKey.test.js | 16 + {test => test2}/flatten/flatten.js | 0 test2/flatten/flatten.test.js | 10 + .../flattenObject/flattenObject.js | 0 test2/flattenObject/flattenObject.test.js | 10 + {test => test2}/flip/flip.js | 0 test2/flip/flip.test.js | 13 + {test => test2}/forEachRight/forEachRight.js | 0 test2/forEachRight/forEachRight.test.js | 11 + {test => test2}/forOwn/forOwn.js | 0 test2/forOwn/forOwn.test.js | 11 + {test => test2}/forOwnRight/forOwnRight.js | 0 test2/forOwnRight/forOwnRight.test.js | 11 + .../formatDuration/formatDuration.js | 0 test2/formatDuration/formatDuration.test.js | 10 + .../fromCamelCase/fromCamelCase.js | 0 test2/fromCamelCase/fromCamelCase.test.js | 11 + {test => test2}/functionName/functionName.js | 0 test2/functionName/functionName.test.js | 19 + {test => test2}/functions/functions.js | 0 test2/functions/functions.test.js | 15 + {test => test2}/gcd/gcd.js | 0 test2/gcd/gcd.test.js | 10 + .../geometricProgression.js | 0 .../geometricProgression.test.js | 11 + {test => test2}/get/get.js | 0 test2/get/get.test.js | 10 + .../getColonTimeFromDate.js | 0 .../getColonTimeFromDate.test.js | 8 + .../getDaysDiffBetweenDates.js | 0 .../getDaysDiffBetweenDates.test.js | 9 + .../getMeridiemSuffixOfInteger.js | 0 .../getMeridiemSuffixOfInteger.test.js | 8 + .../getScrollPosition/getScrollPosition.js | 0 .../getScrollPosition.test.js | 8 + {test => test2}/getStyle/getStyle.js | 0 test2/getStyle/getStyle.test.js | 8 + {test => test2}/getType/getType.js | 0 test2/getType/getType.test.js | 9 + .../getURLParameters/getURLParameters.js | 0 .../getURLParameters/getURLParameters.test.js | 9 + {test => test3}/groupBy/groupBy.js | 0 test3/groupBy/groupBy.test.js | 10 + .../hammingDistance/hammingDistance.js | 0 test3/hammingDistance/hammingDistance.test.js | 9 + {test => test3}/hasClass/hasClass.js | 0 test3/hasClass/hasClass.test.js | 8 + {test => test3}/hasFlags/hasFlags.js | 0 test3/hasFlags/hasFlags.test.js | 8 + {test => test3}/hashBrowser/hashBrowser.js | 0 test3/hashBrowser/hashBrowser.test.js | 8 + {test => test3}/hashNode/hashNode.js | 0 test3/hashNode/hashNode.test.js | 9 + {test => test3}/head/head.js | 0 test3/head/head.test.js | 20 + {test => test3}/hexToRGB/hexToRGB.js | 0 test3/hexToRGB/hexToRGB.test.js | 11 + {test => test3}/hide/hide.js | 0 test3/hide/hide.test.js | 8 + {test => test3}/howManyTimes/howManyTimes.js | 0 test3/howManyTimes/howManyTimes.test.js | 8 + {test => test3}/httpDelete/httpDelete.js | 0 test3/httpDelete/httpDelete.test.js | 8 + {test => test3}/httpGet/httpGet.js | 0 {test => test3}/httpGet/httpGet.test.js | 18 +- {test => test3}/httpPost/httpPost.js | 0 {test => test3}/httpPost/httpPost.test.js | 14 +- {test => test3}/httpPut/httpPut.js | 0 test3/httpPut/httpPut.test.js | 8 + .../httpsRedirect/httpsRedirect.js | 0 test3/httpsRedirect/httpsRedirect.test.js | 8 + {test => test3}/hz/hz.js | 0 test3/hz/hz.test.js | 8 + {test => test3}/inRange/inRange.js | 0 test3/inRange/inRange.test.js | 12 + {test => test3}/indexOfAll/indexOfAll.js | 0 test3/indexOfAll/indexOfAll.test.js | 10 + {test => test3}/initial/initial.js | 0 test3/initial/initial.test.js | 9 + .../initialize2DArray/initialize2DArray.js | 0 .../initialize2DArray.test.js | 9 + .../initializeArrayWithRange.js | 0 .../initializeArrayWithRange.test.js | 9 + .../initializeArrayWithRangeRight.js | 0 .../initializeArrayWithRangeRight.test.js | 8 + .../initializeArrayWithValues.js | 0 .../initializeArrayWithValues.test.js | 9 + .../initializeNDArray/initializeNDArray.js | 0 .../initializeNDArray.test.js | 8 + {test => test3}/intersection/intersection.js | 0 test3/intersection/intersection.test.js | 9 + .../intersectionBy/intersectionBy.js | 0 test3/intersectionBy/intersectionBy.test.js | 9 + .../intersectionWith/intersectionWith.js | 0 .../intersectionWith/intersectionWith.test.js | 11 + .../invertKeyValues/invertKeyValues.js | 0 test3/invertKeyValues/invertKeyValues.test.js | 10 + {test => test3}/is/is.js | 0 test3/is/is.test.js | 24 + .../isAbsoluteURL/isAbsoluteURL.js | 0 test3/isAbsoluteURL/isAbsoluteURL.test.js | 11 + {test => test3}/isAnagram/isAnagram.js | 0 test3/isAnagram/isAnagram.test.js | 12 + .../isArmstrongNumber/isArmstrongNumber.js | 0 .../isArmstrongNumber.test.js | 8 + {test => test3}/isArray/isArray.js | 0 test3/isArray/isArray.test.js | 10 + .../isArrayBuffer/isArrayBuffer.js | 0 test3/isArrayBuffer/isArrayBuffer.test.js | 8 + {test => test3}/isArrayLike/isArrayLike.js | 0 test3/isArrayLike/isArrayLike.test.js | 11 + {test => test3}/isBoolean/isBoolean.js | 0 test3/isBoolean/isBoolean.test.js | 10 + {test => test3}/isBrowser/isBrowser.js | 0 test3/isBrowser/isBrowser.test.js | 8 + .../isBrowserTabFocused.js | 0 .../isBrowserTabFocused.test.js | 8 + {test => test3}/isDivisible/isDivisible.js | 0 test3/isDivisible/isDivisible.test.js | 9 + {test => test3}/isEmpty/isEmpty.js | 0 test3/isEmpty/isEmpty.test.js | 18 + {test => test3}/isEven/isEven.js | 0 test3/isEven/isEven.test.js | 10 + {test => test3}/isFunction/isFunction.js | 0 test3/isFunction/isFunction.test.js | 10 + {test => test3}/isLowerCase/isLowerCase.js | 0 test3/isLowerCase/isLowerCase.test.js | 11 + {test => test3}/isMap/isMap.js | 0 test3/isMap/isMap.test.js | 8 + {test => test3}/isNil/isNil.js | 0 test3/isNil/isNil.test.js | 11 + {test => test3}/isNull/isNull.js | 0 test3/isNull/isNull.test.js | 10 + {test => test3}/isNumber/isNumber.js | 0 test3/isNumber/isNumber.test.js | 10 + {test => test3}/isObject/isObject.js | 0 test3/isObject/isObject.test.js | 13 + {test => test3}/isObjectLike/isObjectLike.js | 0 test3/isObjectLike/isObjectLike.test.js | 12 + .../isPlainObject/isPlainObject.js | 0 test3/isPlainObject/isPlainObject.test.js | 10 + {test => test4}/JSONToDate/JSONToDate.js | 0 test4/JSONToDate/JSONToDate.test.js | 8 + {test => test4}/JSONToFile/JSONToFile.js | 0 test4/JSONToFile/JSONToFile.test.js | 8 + {test => test4}/isPrime/isPrime.js | 0 test4/isPrime/isPrime.test.js | 9 + {test => test4}/isPrimitive/isPrimitive.js | 0 test4/isPrimitive/isPrimitive.test.js | 23 + .../isPromiseLike/isPromiseLike.js | 0 test4/isPromiseLike/isPromiseLike.test.js | 15 + {test => test4}/isRegExp/isRegExp.js | 0 test4/isRegExp/isRegExp.test.js | 8 + {test => test4}/isSet/isSet.js | 0 test4/isSet/isSet.test.js | 8 + {test => test4}/isSimilar/isSimilar.js | 0 test4/isSimilar/isSimilar.test.js | 8 + {test => test4}/isSorted/isSorted.js | 0 test4/isSorted/isSorted.test.js | 20 + {test => test4}/isString/isString.js | 0 test4/isString/isString.test.js | 13 + {test => test4}/isSymbol/isSymbol.js | 0 test4/isSymbol/isSymbol.test.js | 9 + {test => test4}/isTravisCI/isTravisCI.js | 0 test4/isTravisCI/isTravisCI.test.js | 12 + {test => test4}/isTypedArray/isTypedArray.js | 0 test4/isTypedArray/isTypedArray.test.js | 8 + {test => test4}/isUndefined/isUndefined.js | 0 test4/isUndefined/isUndefined.test.js | 9 + {test => test4}/isUpperCase/isUpperCase.js | 0 test4/isUpperCase/isUpperCase.test.js | 12 + {test => test4}/isValidJSON/isValidJSON.js | 0 test4/isValidJSON/isValidJSON.test.js | 11 + {test => test4}/isWeakMap/isWeakMap.js | 0 test4/isWeakMap/isWeakMap.test.js | 8 + {test => test4}/isWeakSet/isWeakSet.js | 0 test4/isWeakSet/isWeakSet.test.js | 8 + {test => test4}/join/join.js | 0 test4/join/join.test.js | 11 + {test => test4}/last/last.js | 0 test4/last/last.test.js | 20 + {test => test4}/lcm/lcm.js | 0 test4/lcm/lcm.test.js | 10 + .../levenshteinDistance.js | 0 .../levenshteinDistance.test.js | 8 + {test => test4}/longestItem/longestItem.js | 0 test4/longestItem/longestItem.test.js | 9 + .../lowercaseKeys/lowercaseKeys.js | 0 test4/lowercaseKeys/lowercaseKeys.test.js | 12 + {test => test4}/luhnCheck/luhnCheck.js | 0 test4/luhnCheck/luhnCheck.test.js | 11 + {test => test4}/mapKeys/mapKeys.js | 0 test4/mapKeys/mapKeys.test.js | 9 + {test => test4}/mapObject/mapObject.js | 0 test4/mapObject/mapObject.test.js | 11 + {test => test4}/mapValues/mapValues.js | 0 test4/mapValues/mapValues.test.js | 13 + {test => test4}/mask/mask.js | 0 test4/mask/mask.test.js | 11 + {test => test4}/matches/matches.js | 0 test4/matches/matches.test.js | 14 + {test => test4}/matchesWith/matchesWith.js | 0 test4/matchesWith/matchesWith.test.js | 14 + {test => test4}/maxBy/maxBy.js | 0 test4/maxBy/maxBy.test.js | 10 + {test => test4}/maxN/maxN.js | 0 test4/maxN/maxN.test.js | 10 + {test => test4}/median/median.js | 0 test4/median/median.test.js | 10 + {test => test4}/memoize/memoize.js | 0 test4/memoize/memoize.test.js | 13 + {test => test4}/merge/merge.js | 0 test4/merge/merge.test.js | 18 + {test => test4}/minBy/minBy.js | 0 test4/minBy/minBy.test.js | 10 + {test => test4}/minN/minN.js | 0 test4/minN/minN.test.js | 10 + .../mostPerformant/mostPerformant.js | 0 test4/mostPerformant/mostPerformant.test.js | 8 + {test => test4}/negate/negate.js | 0 test4/negate/negate.test.js | 9 + {test => test4}/nest/nest.js | 0 test4/nest/nest.test.js | 8 + .../nodeListToArray/nodeListToArray.js | 0 test4/nodeListToArray/nodeListToArray.test.js | 8 + {test => test4}/none/none.js | 0 test4/none/none.test.js | 12 + {test => test4}/nthArg/nthArg.js | 0 test4/nthArg/nthArg.test.js | 13 + {test => test4}/nthElement/nthElement.js | 0 test4/nthElement/nthElement.test.js | 10 + .../objectFromPairs/objectFromPairs.js | 0 test4/objectFromPairs/objectFromPairs.test.js | 9 + .../objectToPairs/objectToPairs.js | 0 test4/objectToPairs/objectToPairs.test.js | 9 + .../observeMutations/observeMutations.js | 0 .../observeMutations/observeMutations.test.js | 8 + {test => test4}/off/off.js | 0 test4/off/off.test.js | 8 + {test => test4}/offset/offset.js | 0 test4/offset/offset.test.js | 14 + {test => test4}/omit/omit.js | 0 test4/omit/omit.test.js | 9 + {test => test5}/RGBToHex/RGBToHex.js | 0 test5/RGBToHex/RGBToHex.test.js | 9 + {test => test5}/omitBy/omitBy.js | 0 test5/omitBy/omitBy.test.js | 9 + {test => test5}/on/on.js | 0 test5/on/on.test.js | 8 + .../onUserInputChange/onUserInputChange.js | 0 .../onUserInputChange.test.js | 8 + {test => test5}/once/once.js | 0 test5/once/once.test.js | 8 + {test => test5}/orderBy/orderBy.js | 0 test5/orderBy/orderBy.test.js | 15 + {test => test5}/over/over.js | 0 test5/over/over.test.js | 10 + {test => test5}/overArgs/overArgs.js | 0 test5/overArgs/overArgs.test.js | 12 + {test => test5}/pad/pad.js | 0 test5/pad/pad.test.js | 12 + {test => test5}/palindrome/palindrome.js | 0 test5/palindrome/palindrome.test.js | 10 + {test => test5}/parseCookie/parseCookie.js | 0 test5/parseCookie/parseCookie.test.js | 9 + {test => test5}/partial/partial.js | 0 test5/partial/partial.test.js | 13 + {test => test5}/partialRight/partialRight.js | 0 test5/partialRight/partialRight.test.js | 13 + {test => test5}/partition/partition.js | 0 test5/partition/partition.test.js | 12 + {test => test5}/percentile/percentile.js | 0 test5/percentile/percentile.test.js | 9 + {test => test5}/permutations/permutations.js | 0 test5/permutations/permutations.test.js | 11 + {test => test5}/pick/pick.js | 0 test5/pick/pick.test.js | 9 + {test => test5}/pickBy/pickBy.js | 0 test5/pickBy/pickBy.test.js | 9 + .../pipeAsyncFunctions/pipeAsyncFunctions.js | 0 .../pipeAsyncFunctions.test.js | 19 + .../pipeFunctions/pipeFunctions.js | 0 test5/pipeFunctions/pipeFunctions.test.js | 12 + {test => test5}/pluralize/pluralize.js | 0 test5/pluralize/pluralize.test.js | 18 + {test => test5}/powerset/powerset.js | 0 test5/powerset/powerset.test.js | 9 + {test => test5}/prefix/prefix.js | 0 test5/prefix/prefix.test.js | 8 + {test => test5}/prettyBytes/prettyBytes.js | 0 test5/prettyBytes/prettyBytes.test.js | 11 + {test => test5}/primes/primes.js | 0 test5/primes/primes.test.js | 9 + {test => test5}/promisify/promisify.js | 0 test5/promisify/promisify.test.js | 12 + {test => test5}/pull/pull.js | 0 test5/pull/pull.test.js | 11 + {test => test5}/pullAtIndex/pullAtIndex.js | 0 test5/pullAtIndex/pullAtIndex.test.js | 12 + {test => test5}/pullAtValue/pullAtValue.js | 0 test5/pullAtValue/pullAtValue.test.js | 12 + {test => test5}/pullBy/pullBy.js | 0 test5/pullBy/pullBy.test.js | 11 + {test => test5}/quickSort/quickSort.js | 0 test5/quickSort/quickSort.test.js | 20 + .../radsToDegrees/radsToDegrees.js | 0 test5/radsToDegrees/radsToDegrees.test.js | 9 + .../randomHexColorCode/randomHexColorCode.js | 0 .../randomHexColorCode.test.js | 12 + .../randomIntArrayInRange.js | 0 .../randomIntArrayInRange.test.js | 14 + .../randomIntegerInRange.js | 0 .../randomIntegerInRange.test.js | 13 + .../randomNumberInRange.js | 0 .../randomNumberInRange.test.js | 13 + .../readFileLines/readFileLines.js | 0 test5/readFileLines/readFileLines.test.js | 8 + {test => test5}/rearg/rearg.js | 0 test5/rearg/rearg.test.js | 15 + .../recordAnimationFrames.js | 0 .../recordAnimationFrames.test.js | 8 + {test => test5}/redirect/redirect.js | 0 test5/redirect/redirect.test.js | 8 + .../reduceSuccessive/reduceSuccessive.js | 0 .../reduceSuccessive/reduceSuccessive.test.js | 9 + {test => test5}/reduceWhich/reduceWhich.js | 0 test5/reduceWhich/reduceWhich.test.js | 14 + .../reducedFilter/reducedFilter.js | 0 test5/reducedFilter/reducedFilter.test.js | 21 + {test => test5}/reject/reject.js | 0 {test => test5}/reject/reject.test.js | 12 +- {test => test5}/remove/remove.js | 0 test5/remove/remove.test.js | 9 + .../removeNonASCII/removeNonASCII.js | 0 test5/removeNonASCII/removeNonASCII.test.js | 9 + {test => test5}/removeVowels/removeVowels.js | 0 test5/removeVowels/removeVowels.test.js | 8 + {test => test5}/renameKeys/renameKeys.js | 0 {test => test5}/renameKeys/renameKeys.test.js | 10 +- .../reverseString/reverseString.js | 0 test5/reverseString/reverseString.test.js | 9 + {test => test5}/round/round.js | 0 test5/round/round.test.js | 22 + {test => test6}/URLJoin/URLJoin.js | 0 test6/URLJoin/URLJoin.test.js | 10 + .../UUIDGeneratorBrowser.js | 0 .../UUIDGeneratorBrowser.test.js | 8 + .../UUIDGeneratorNode/UUIDGeneratorNode.js | 0 .../UUIDGeneratorNode.test.js | 11 + {test => test6}/runAsync/runAsync.js | 0 test6/runAsync/runAsync.test.js | 8 + .../runPromisesInSeries.js | 0 .../runPromisesInSeries.test.js | 10 + {test => test6}/sample/sample.js | 0 test6/sample/sample.test.js | 12 + {test => test6}/sampleSize/sampleSize.js | 0 test6/sampleSize/sampleSize.test.js | 14 + {test => test6}/scrollToTop/scrollToTop.js | 0 test6/scrollToTop/scrollToTop.test.js | 8 + {test => test6}/sdbm/sdbm.js | 0 test6/sdbm/sdbm.test.js | 9 + .../serializeCookie/serializeCookie.js | 0 test6/serializeCookie/serializeCookie.test.js | 9 + {test => test6}/setStyle/setStyle.js | 0 test6/setStyle/setStyle.test.js | 8 + {test => test6}/shallowClone/shallowClone.js | 0 test6/shallowClone/shallowClone.test.js | 12 + {test => test6}/show/show.js | 0 test6/show/show.test.js | 8 + {test => test6}/shuffle/shuffle.js | 0 test6/shuffle/shuffle.test.js | 13 + {test => test6}/similarity/similarity.js | 0 test6/similarity/similarity.test.js | 9 + {test => test6}/size/size.js | 0 test6/size/size.test.js | 11 + {test => test6}/sleep/sleep.js | 0 test6/sleep/sleep.test.js | 11 + {test => test6}/smoothScroll/smoothScroll.js | 0 test6/smoothScroll/smoothScroll.test.js | 8 + {test => test6}/solveRPN/solveRPN.js | 0 test6/solveRPN/solveRPN.test.js | 8 + .../sortCharactersInString.js | 0 .../sortCharactersInString.test.js | 9 + {test => test6}/sortedIndex/sortedIndex.js | 0 test6/sortedIndex/sortedIndex.test.js | 10 + .../sortedIndexBy/sortedIndexBy.js | 0 test6/sortedIndexBy/sortedIndexBy.test.js | 9 + .../sortedLastIndex/sortedLastIndex.js | 0 test6/sortedLastIndex/sortedLastIndex.test.js | 9 + .../sortedLastIndexBy/sortedLastIndexBy.js | 0 .../sortedLastIndexBy.test.js | 9 + .../speechSynthesis/speechSynthesis.js | 0 test6/speechSynthesis/speechSynthesis.test.js | 8 + {test => test6}/splitLines/splitLines.js | 0 test6/splitLines/splitLines.test.js | 9 + {test => test6}/spreadOver/spreadOver.js | 0 test6/spreadOver/spreadOver.test.js | 10 + {test => test6}/stableSort/stableSort.js | 0 {test => test6}/stableSort/stableSort.test.js | 11 +- .../standardDeviation/standardDeviation.js | 0 .../standardDeviation.test.js | 10 + .../stringPermutations/stringPermutations.js | 0 .../stringPermutations.test.js | 11 + .../stripHTMLTags/stripHTMLTags.js | 0 test6/stripHTMLTags/stripHTMLTags.test.js | 9 + {test => test6}/sum/sum.js | 0 test6/sum/sum.test.js | 9 + {test => test6}/sumBy/sumBy.js | 0 test6/sumBy/sumBy.test.js | 8 + {test => test6}/sumPower/sumPower.js | 0 test6/sumPower/sumPower.test.js | 11 + .../symmetricDifference.js | 0 .../symmetricDifference.test.js | 9 + .../symmetricDifferenceBy.js | 0 .../symmetricDifferenceBy.test.js | 9 + .../symmetricDifferenceWith.js | 0 .../symmetricDifferenceWith.test.js | 13 + {test => test6}/tail/tail.js | 0 test6/tail/tail.test.js | 10 + {test => test6}/take/take.js | 0 test6/take/take.test.js | 10 + {test => test6}/takeRight/takeRight.js | 0 test6/takeRight/takeRight.test.js | 10 + .../takeRightWhile/takeRightWhile.js | 0 test6/takeRightWhile/takeRightWhile.test.js | 9 + {test => test6}/takeWhile/takeWhile.js | 0 test6/takeWhile/takeWhile.test.js | 9 + {test => test6}/throttle/throttle.js | 0 test6/throttle/throttle.test.js | 8 + {test => test6}/timeTaken/timeTaken.js | 0 test6/timeTaken/timeTaken.test.js | 8 + {test => test6}/times/times.js | 0 test6/times/times.test.js | 11 + {test => test6}/toCamelCase/toCamelCase.js | 0 test6/toCamelCase/toCamelCase.test.js | 21 + {test => test6}/toCurrency/toCurrency.js | 0 test6/toCurrency/toCurrency.test.js | 12 + .../toDecimalMark/toDecimalMark.js | 0 test6/toDecimalMark/toDecimalMark.test.js | 9 + {test => test6}/toHash/toHash.js | 0 test6/toHash/toHash.test.js | 8 + {test => test6}/toKebabCase/toKebabCase.js | 0 test6/toKebabCase/toKebabCase.test.js | 25 + .../toOrdinalSuffix/toOrdinalSuffix.js | 0 test6/toOrdinalSuffix/toOrdinalSuffix.test.js | 12 + .../toSafeInteger/toSafeInteger.js | 0 test6/toSafeInteger/toSafeInteger.test.js | 23 + {test => test6}/toSnakeCase/toSnakeCase.js | 0 test6/toSnakeCase/toSnakeCase.test.js | 25 + {test => test6}/toggleClass/toggleClass.js | 0 test6/toggleClass/toggleClass.test.js | 8 + {test => test6}/tomorrow/tomorrow.js | 0 test6/tomorrow/tomorrow.test.js | 13 + {test => test6}/transform/transform.js | 0 test6/transform/transform.test.js | 16 + .../truncateString/truncateString.js | 0 test6/truncateString/truncateString.test.js | 9 + .../truthCheckCollection.js | 0 .../truthCheckCollection.test.js | 11 + {test => test6}/unary/unary.js | 0 test6/unary/unary.test.js | 9 + {test => test6}/uncurry/uncurry.js | 0 test6/uncurry/uncurry.test.js | 15 + {test => test6}/unescapeHTML/unescapeHTML.js | 0 test6/unescapeHTML/unescapeHTML.test.js | 9 + .../unflattenObject/unflattenObject.js | 0 test6/unflattenObject/unflattenObject.test.js | 9 + {test => test6}/unfold/unfold.js | 0 test6/unfold/unfold.test.js | 10 + {test => test6}/union/union.js | 0 test6/union/union.test.js | 23 + {test => test6}/unionBy/unionBy.js | 0 test6/unionBy/unionBy.test.js | 9 + {test => test6}/unionWith/unionWith.js | 0 test6/unionWith/unionWith.test.js | 11 + .../uniqueElements/uniqueElements.js | 0 test6/uniqueElements/uniqueElements.test.js | 26 + {test => test6}/untildify/untildify.js | 0 test6/untildify/untildify.test.js | 11 + {test => test6}/unzip/unzip.js | 0 test6/unzip/unzip.test.js | 10 + {test => test6}/unzipWith/unzipWith.js | 0 test6/unzipWith/unzipWith.test.js | 11 + .../validateNumber/validateNumber.js | 0 test6/validateNumber/validateNumber.test.js | 20 + {test => test6}/when/when.js | 0 {test => test6}/when/when.test.js | 12 +- {test => test6}/without/without.js | 0 test6/without/without.test.js | 17 + {test => test6}/words/words.js | 0 test6/words/words.test.js | 17 + {test => test6}/xProd/xProd.js | 0 test6/xProd/xProd.test.js | 9 + {test => test6}/yesNo/yesNo.js | 0 test6/yesNo/yesNo.test.js | 20 + {test => test6}/zip/zip.js | 0 test6/zip/zip.test.js | 16 + {test => test6}/zipObject/zipObject.js | 0 test6/zipObject/zipObject.test.js | 17 + {test => test6}/zipWith/zipWith.js | 0 test6/zipWith/zipWith.test.js | 8 + 890 files changed, 6950 insertions(+), 6921 deletions(-) delete mode 100644 test/JSONToDate/JSONToDate.test.js delete mode 100644 test/JSONToFile/JSONToFile.test.js delete mode 100644 test/RGBToHex/RGBToHex.test.js delete mode 100644 test/URLJoin/URLJoin.test.js delete mode 100644 test/UUIDGeneratorBrowser/UUIDGeneratorBrowser.test.js delete mode 100644 test/UUIDGeneratorNode/UUIDGeneratorNode.test.js delete mode 100644 test/defaults/defaults.test.js delete mode 100644 test/defer/defer.test.js delete mode 100644 test/degreesToRads/degreesToRads.test.js delete mode 100644 test/delay/delay.test.js delete mode 100644 test/detectDeviceType/detectDeviceType.test.js delete mode 100644 test/difference/difference.test.js delete mode 100644 test/differenceBy/differenceBy.test.js delete mode 100644 test/differenceWith/differenceWith.test.js delete mode 100644 test/digitize/digitize.test.js delete mode 100644 test/distance/distance.test.js delete mode 100644 test/drop/drop.test.js delete mode 100644 test/dropRight/dropRight.test.js delete mode 100644 test/dropRightWhile/dropRightWhile.test.js delete mode 100644 test/dropWhile/dropWhile.test.js delete mode 100644 test/elementIsVisibleInViewport/elementIsVisibleInViewport.test.js delete mode 100644 test/elo/elo.test.js delete mode 100644 test/equals/equals.test.js delete mode 100644 test/escapeHTML/escapeHTML.test.js delete mode 100644 test/escapeRegExp/escapeRegExp.test.js delete mode 100644 test/everyNth/everyNth.test.js delete mode 100644 test/extendHex/extendHex.test.js delete mode 100644 test/factorial/factorial.test.js delete mode 100644 test/factors/factors.test.js delete mode 100644 test/fibonacci/fibonacci.test.js delete mode 100644 test/fibonacciCountUntilNum/fibonacciCountUntilNum.test.js delete mode 100644 test/fibonacciUntilNum/fibonacciUntilNum.test.js delete mode 100644 test/filterNonUnique/filterNonUnique.test.js delete mode 100644 test/findKey/findKey.test.js delete mode 100644 test/findLast/findLast.test.js delete mode 100644 test/findLastIndex/findLastIndex.test.js delete mode 100644 test/findLastKey/findLastKey.test.js delete mode 100644 test/flatten/flatten.test.js delete mode 100644 test/flattenObject/flattenObject.test.js delete mode 100644 test/flip/flip.test.js delete mode 100644 test/forEachRight/forEachRight.test.js delete mode 100644 test/forOwn/forOwn.test.js delete mode 100644 test/forOwnRight/forOwnRight.test.js delete mode 100644 test/formatDuration/formatDuration.test.js delete mode 100644 test/fromCamelCase/fromCamelCase.test.js delete mode 100644 test/functionName/functionName.test.js delete mode 100644 test/functions/functions.test.js delete mode 100644 test/gcd/gcd.test.js delete mode 100644 test/geometricProgression/geometricProgression.test.js delete mode 100644 test/get/get.test.js delete mode 100644 test/getColonTimeFromDate/getColonTimeFromDate.test.js delete mode 100644 test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js delete mode 100644 test/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.test.js delete mode 100644 test/getScrollPosition/getScrollPosition.test.js delete mode 100644 test/getStyle/getStyle.test.js delete mode 100644 test/getType/getType.test.js delete mode 100644 test/getURLParameters/getURLParameters.test.js delete mode 100644 test/groupBy/groupBy.test.js delete mode 100644 test/hammingDistance/hammingDistance.test.js delete mode 100644 test/hasClass/hasClass.test.js delete mode 100644 test/hasFlags/hasFlags.test.js delete mode 100644 test/hashBrowser/hashBrowser.test.js delete mode 100644 test/hashNode/hashNode.test.js delete mode 100644 test/head/head.test.js delete mode 100644 test/hexToRGB/hexToRGB.test.js delete mode 100644 test/hide/hide.test.js delete mode 100644 test/howManyTimes/howManyTimes.test.js delete mode 100644 test/httpDelete/httpDelete.test.js delete mode 100644 test/httpPut/httpPut.test.js delete mode 100644 test/httpsRedirect/httpsRedirect.test.js delete mode 100644 test/hz/hz.test.js delete mode 100644 test/inRange/inRange.test.js delete mode 100644 test/indexOfAll/indexOfAll.test.js delete mode 100644 test/initial/initial.test.js delete mode 100644 test/initialize2DArray/initialize2DArray.test.js delete mode 100644 test/initializeArrayWithRange/initializeArrayWithRange.test.js delete mode 100644 test/initializeArrayWithRangeRight/initializeArrayWithRangeRight.test.js delete mode 100644 test/initializeArrayWithValues/initializeArrayWithValues.test.js delete mode 100644 test/initializeNDArray/initializeNDArray.test.js delete mode 100644 test/intersection/intersection.test.js delete mode 100644 test/intersectionBy/intersectionBy.test.js delete mode 100644 test/intersectionWith/intersectionWith.test.js delete mode 100644 test/invertKeyValues/invertKeyValues.test.js delete mode 100644 test/is/is.test.js delete mode 100644 test/isAbsoluteURL/isAbsoluteURL.test.js delete mode 100644 test/isAnagram/isAnagram.test.js delete mode 100644 test/isArmstrongNumber/isArmstrongNumber.test.js delete mode 100644 test/isArray/isArray.test.js delete mode 100644 test/isArrayBuffer/isArrayBuffer.test.js delete mode 100644 test/isArrayLike/isArrayLike.test.js delete mode 100644 test/isBoolean/isBoolean.test.js delete mode 100644 test/isBrowser/isBrowser.test.js delete mode 100644 test/isBrowserTabFocused/isBrowserTabFocused.test.js delete mode 100644 test/isDivisible/isDivisible.test.js delete mode 100644 test/isEmpty/isEmpty.test.js delete mode 100644 test/isEven/isEven.test.js delete mode 100644 test/isFunction/isFunction.test.js delete mode 100644 test/isLowerCase/isLowerCase.test.js delete mode 100644 test/isMap/isMap.test.js delete mode 100644 test/isNil/isNil.test.js delete mode 100644 test/isNull/isNull.test.js delete mode 100644 test/isNumber/isNumber.test.js delete mode 100644 test/isObject/isObject.test.js delete mode 100644 test/isObjectLike/isObjectLike.test.js delete mode 100644 test/isPlainObject/isPlainObject.test.js delete mode 100644 test/isPrime/isPrime.test.js delete mode 100644 test/isPrimitive/isPrimitive.test.js delete mode 100644 test/isPromiseLike/isPromiseLike.test.js delete mode 100644 test/isRegExp/isRegExp.test.js delete mode 100644 test/isSet/isSet.test.js delete mode 100644 test/isSimilar/isSimilar.test.js delete mode 100644 test/isSorted/isSorted.test.js delete mode 100644 test/isString/isString.test.js delete mode 100644 test/isSymbol/isSymbol.test.js delete mode 100644 test/isTravisCI/isTravisCI.test.js delete mode 100644 test/isTypedArray/isTypedArray.test.js delete mode 100644 test/isUndefined/isUndefined.test.js delete mode 100644 test/isUpperCase/isUpperCase.test.js delete mode 100644 test/isValidJSON/isValidJSON.test.js delete mode 100644 test/isWeakMap/isWeakMap.test.js delete mode 100644 test/isWeakSet/isWeakSet.test.js delete mode 100644 test/join/join.test.js delete mode 100644 test/last/last.test.js delete mode 100644 test/lcm/lcm.test.js delete mode 100644 test/levenshteinDistance/levenshteinDistance.test.js delete mode 100644 test/longestItem/longestItem.test.js delete mode 100644 test/lowercaseKeys/lowercaseKeys.test.js delete mode 100644 test/luhnCheck/luhnCheck.test.js delete mode 100644 test/mapKeys/mapKeys.test.js delete mode 100644 test/mapObject/mapObject.test.js delete mode 100644 test/mapValues/mapValues.test.js delete mode 100644 test/mask/mask.test.js delete mode 100644 test/matches/matches.test.js delete mode 100644 test/matchesWith/matchesWith.test.js delete mode 100644 test/maxBy/maxBy.test.js delete mode 100644 test/maxN/maxN.test.js delete mode 100644 test/median/median.test.js delete mode 100644 test/memoize/memoize.test.js delete mode 100644 test/merge/merge.test.js delete mode 100644 test/minBy/minBy.test.js delete mode 100644 test/minN/minN.test.js delete mode 100644 test/mostPerformant/mostPerformant.test.js delete mode 100644 test/negate/negate.test.js delete mode 100644 test/nest/nest.test.js delete mode 100644 test/nodeListToArray/nodeListToArray.test.js delete mode 100644 test/none/none.test.js delete mode 100644 test/nthArg/nthArg.test.js delete mode 100644 test/nthElement/nthElement.test.js delete mode 100644 test/objectFromPairs/objectFromPairs.test.js delete mode 100644 test/objectToPairs/objectToPairs.test.js delete mode 100644 test/observeMutations/observeMutations.test.js delete mode 100644 test/off/off.test.js delete mode 100644 test/offset/offset.test.js delete mode 100644 test/omit/omit.test.js delete mode 100644 test/omitBy/omitBy.test.js delete mode 100644 test/on/on.test.js delete mode 100644 test/onUserInputChange/onUserInputChange.test.js delete mode 100644 test/once/once.test.js delete mode 100644 test/orderBy/orderBy.test.js delete mode 100644 test/over/over.test.js delete mode 100644 test/overArgs/overArgs.test.js delete mode 100644 test/pad/pad.test.js delete mode 100644 test/palindrome/palindrome.test.js delete mode 100644 test/parseCookie/parseCookie.test.js delete mode 100644 test/partial/partial.test.js delete mode 100644 test/partialRight/partialRight.test.js delete mode 100644 test/partition/partition.test.js delete mode 100644 test/percentile/percentile.test.js delete mode 100644 test/permutations/permutations.test.js delete mode 100644 test/pick/pick.test.js delete mode 100644 test/pickBy/pickBy.test.js delete mode 100644 test/pipeAsyncFunctions/pipeAsyncFunctions.test.js delete mode 100644 test/pipeFunctions/pipeFunctions.test.js delete mode 100644 test/pluralize/pluralize.test.js delete mode 100644 test/powerset/powerset.test.js delete mode 100644 test/prefix/prefix.test.js delete mode 100644 test/prettyBytes/prettyBytes.test.js delete mode 100644 test/primes/primes.test.js delete mode 100644 test/promisify/promisify.test.js delete mode 100644 test/pull/pull.test.js delete mode 100644 test/pullAtIndex/pullAtIndex.test.js delete mode 100644 test/pullAtValue/pullAtValue.test.js delete mode 100644 test/pullBy/pullBy.test.js delete mode 100644 test/quickSort/quickSort.test.js delete mode 100644 test/radsToDegrees/radsToDegrees.test.js delete mode 100644 test/randomHexColorCode/randomHexColorCode.test.js delete mode 100644 test/randomIntArrayInRange/randomIntArrayInRange.test.js delete mode 100644 test/randomIntegerInRange/randomIntegerInRange.test.js delete mode 100644 test/randomNumberInRange/randomNumberInRange.test.js delete mode 100644 test/readFileLines/readFileLines.test.js delete mode 100644 test/rearg/rearg.test.js delete mode 100644 test/recordAnimationFrames/recordAnimationFrames.test.js delete mode 100644 test/redirect/redirect.test.js delete mode 100644 test/reduceSuccessive/reduceSuccessive.test.js delete mode 100644 test/reduceWhich/reduceWhich.test.js delete mode 100644 test/reducedFilter/reducedFilter.test.js delete mode 100644 test/remove/remove.test.js delete mode 100644 test/removeNonASCII/removeNonASCII.test.js delete mode 100644 test/removeVowels/removeVowels.test.js delete mode 100644 test/reverseString/reverseString.test.js delete mode 100644 test/round/round.test.js delete mode 100644 test/runAsync/runAsync.test.js delete mode 100644 test/runPromisesInSeries/runPromisesInSeries.test.js delete mode 100644 test/sample/sample.test.js delete mode 100644 test/sampleSize/sampleSize.test.js delete mode 100644 test/scrollToTop/scrollToTop.test.js delete mode 100644 test/sdbm/sdbm.test.js delete mode 100644 test/serializeCookie/serializeCookie.test.js delete mode 100644 test/setStyle/setStyle.test.js delete mode 100644 test/shallowClone/shallowClone.test.js delete mode 100644 test/show/show.test.js delete mode 100644 test/shuffle/shuffle.test.js delete mode 100644 test/similarity/similarity.test.js delete mode 100644 test/size/size.test.js delete mode 100644 test/sleep/sleep.test.js delete mode 100644 test/smoothScroll/smoothScroll.test.js delete mode 100644 test/solveRPN/solveRPN.test.js delete mode 100644 test/sortCharactersInString/sortCharactersInString.test.js delete mode 100644 test/sortedIndex/sortedIndex.test.js delete mode 100644 test/sortedIndexBy/sortedIndexBy.test.js delete mode 100644 test/sortedLastIndex/sortedLastIndex.test.js delete mode 100644 test/sortedLastIndexBy/sortedLastIndexBy.test.js delete mode 100644 test/speechSynthesis/speechSynthesis.test.js delete mode 100644 test/splitLines/splitLines.test.js delete mode 100644 test/spreadOver/spreadOver.test.js delete mode 100644 test/standardDeviation/standardDeviation.test.js delete mode 100644 test/stringPermutations/stringPermutations.test.js delete mode 100644 test/stripHTMLTags/stripHTMLTags.test.js delete mode 100644 test/sum/sum.test.js delete mode 100644 test/sumBy/sumBy.test.js delete mode 100644 test/sumPower/sumPower.test.js delete mode 100644 test/symmetricDifference/symmetricDifference.test.js delete mode 100644 test/symmetricDifferenceBy/symmetricDifferenceBy.test.js delete mode 100644 test/symmetricDifferenceWith/symmetricDifferenceWith.test.js delete mode 100644 test/tail/tail.test.js delete mode 100644 test/take/take.test.js delete mode 100644 test/takeRight/takeRight.test.js delete mode 100644 test/takeRightWhile/takeRightWhile.test.js delete mode 100644 test/takeWhile/takeWhile.test.js delete mode 100644 test/testlog delete mode 100644 test/throttle/throttle.test.js delete mode 100644 test/timeTaken/timeTaken.test.js delete mode 100644 test/times/times.test.js delete mode 100644 test/toCamelCase/toCamelCase.test.js delete mode 100644 test/toCurrency/toCurrency.test.js delete mode 100644 test/toDecimalMark/toDecimalMark.test.js delete mode 100644 test/toHash/toHash.test.js delete mode 100644 test/toKebabCase/toKebabCase.test.js delete mode 100644 test/toOrdinalSuffix/toOrdinalSuffix.test.js delete mode 100644 test/toSafeInteger/toSafeInteger.test.js delete mode 100644 test/toSnakeCase/toSnakeCase.test.js delete mode 100644 test/toggleClass/toggleClass.test.js delete mode 100644 test/tomorrow/tomorrow.test.js delete mode 100644 test/transform/transform.test.js delete mode 100644 test/truncateString/truncateString.test.js delete mode 100644 test/truthCheckCollection/truthCheckCollection.test.js delete mode 100644 test/unary/unary.test.js delete mode 100644 test/uncurry/uncurry.test.js delete mode 100644 test/unescapeHTML/unescapeHTML.test.js delete mode 100644 test/unflattenObject/unflattenObject.test.js delete mode 100644 test/unfold/unfold.test.js delete mode 100644 test/union/union.test.js delete mode 100644 test/unionBy/unionBy.test.js delete mode 100644 test/unionWith/unionWith.test.js delete mode 100644 test/uniqueElements/uniqueElements.test.js delete mode 100644 test/untildify/untildify.test.js delete mode 100644 test/unzip/unzip.test.js delete mode 100644 test/unzipWith/unzipWith.test.js delete mode 100644 test/validateNumber/validateNumber.test.js delete mode 100644 test/without/without.test.js delete mode 100644 test/words/words.test.js delete mode 100644 test/xProd/xProd.test.js delete mode 100644 test/yesNo/yesNo.test.js delete mode 100644 test/zip/zip.test.js delete mode 100644 test/zipObject/zipObject.test.js delete mode 100644 test/zipWith/zipWith.test.js rename {test => test2}/defaults/defaults.js (100%) create mode 100644 test2/defaults/defaults.test.js rename {test => test2}/defer/defer.js (100%) create mode 100644 test2/defer/defer.test.js rename {test => test2}/degreesToRads/degreesToRads.js (100%) create mode 100644 test2/degreesToRads/degreesToRads.test.js rename {test => test2}/delay/delay.js (100%) create mode 100644 test2/delay/delay.test.js rename {test => test2}/detectDeviceType/detectDeviceType.js (100%) create mode 100644 test2/detectDeviceType/detectDeviceType.test.js rename {test => test2}/difference/difference.js (100%) create mode 100644 test2/difference/difference.test.js rename {test => test2}/differenceBy/differenceBy.js (100%) create mode 100644 test2/differenceBy/differenceBy.test.js rename {test => test2}/differenceWith/differenceWith.js (100%) create mode 100644 test2/differenceWith/differenceWith.test.js rename {test => test2}/digitize/digitize.js (100%) create mode 100644 test2/digitize/digitize.test.js rename {test => test2}/distance/distance.js (100%) create mode 100644 test2/distance/distance.test.js rename {test => test2}/drop/drop.js (100%) create mode 100644 test2/drop/drop.test.js rename {test => test2}/dropRight/dropRight.js (100%) create mode 100644 test2/dropRight/dropRight.test.js rename {test => test2}/dropRightWhile/dropRightWhile.js (100%) create mode 100644 test2/dropRightWhile/dropRightWhile.test.js rename {test => test2}/dropWhile/dropWhile.js (100%) create mode 100644 test2/dropWhile/dropWhile.test.js rename {test => test2}/elementIsVisibleInViewport/elementIsVisibleInViewport.js (100%) create mode 100644 test2/elementIsVisibleInViewport/elementIsVisibleInViewport.test.js rename {test => test2}/elo/elo.js (100%) create mode 100644 test2/elo/elo.test.js rename {test => test2}/equals/equals.js (100%) create mode 100644 test2/equals/equals.test.js rename {test => test2}/escapeHTML/escapeHTML.js (100%) create mode 100644 test2/escapeHTML/escapeHTML.test.js rename {test => test2}/escapeRegExp/escapeRegExp.js (100%) create mode 100644 test2/escapeRegExp/escapeRegExp.test.js rename {test => test2}/everyNth/everyNth.js (100%) create mode 100644 test2/everyNth/everyNth.test.js rename {test => test2}/extendHex/extendHex.js (100%) create mode 100644 test2/extendHex/extendHex.test.js rename {test => test2}/factorial/factorial.js (100%) create mode 100644 test2/factorial/factorial.test.js rename {test => test2}/factors/factors.js (100%) create mode 100644 test2/factors/factors.test.js rename {test => test2}/fibonacci/fibonacci.js (100%) create mode 100644 test2/fibonacci/fibonacci.test.js rename {test => test2}/fibonacciCountUntilNum/fibonacciCountUntilNum.js (100%) create mode 100644 test2/fibonacciCountUntilNum/fibonacciCountUntilNum.test.js rename {test => test2}/fibonacciUntilNum/fibonacciUntilNum.js (100%) create mode 100644 test2/fibonacciUntilNum/fibonacciUntilNum.test.js rename {test => test2}/filterNonUnique/filterNonUnique.js (100%) create mode 100644 test2/filterNonUnique/filterNonUnique.test.js rename {test => test2}/findKey/findKey.js (100%) create mode 100644 test2/findKey/findKey.test.js rename {test => test2}/findLast/findLast.js (100%) create mode 100644 test2/findLast/findLast.test.js rename {test => test2}/findLastIndex/findLastIndex.js (100%) create mode 100644 test2/findLastIndex/findLastIndex.test.js rename {test => test2}/findLastKey/findLastKey.js (100%) create mode 100644 test2/findLastKey/findLastKey.test.js rename {test => test2}/flatten/flatten.js (100%) create mode 100644 test2/flatten/flatten.test.js rename {test => test2}/flattenObject/flattenObject.js (100%) create mode 100644 test2/flattenObject/flattenObject.test.js rename {test => test2}/flip/flip.js (100%) create mode 100644 test2/flip/flip.test.js rename {test => test2}/forEachRight/forEachRight.js (100%) create mode 100644 test2/forEachRight/forEachRight.test.js rename {test => test2}/forOwn/forOwn.js (100%) create mode 100644 test2/forOwn/forOwn.test.js rename {test => test2}/forOwnRight/forOwnRight.js (100%) create mode 100644 test2/forOwnRight/forOwnRight.test.js rename {test => test2}/formatDuration/formatDuration.js (100%) create mode 100644 test2/formatDuration/formatDuration.test.js rename {test => test2}/fromCamelCase/fromCamelCase.js (100%) create mode 100644 test2/fromCamelCase/fromCamelCase.test.js rename {test => test2}/functionName/functionName.js (100%) create mode 100644 test2/functionName/functionName.test.js rename {test => test2}/functions/functions.js (100%) create mode 100644 test2/functions/functions.test.js rename {test => test2}/gcd/gcd.js (100%) create mode 100644 test2/gcd/gcd.test.js rename {test => test2}/geometricProgression/geometricProgression.js (100%) create mode 100644 test2/geometricProgression/geometricProgression.test.js rename {test => test2}/get/get.js (100%) create mode 100644 test2/get/get.test.js rename {test => test2}/getColonTimeFromDate/getColonTimeFromDate.js (100%) create mode 100644 test2/getColonTimeFromDate/getColonTimeFromDate.test.js rename {test => test2}/getDaysDiffBetweenDates/getDaysDiffBetweenDates.js (100%) create mode 100644 test2/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js rename {test => test2}/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.js (100%) create mode 100644 test2/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.test.js rename {test => test2}/getScrollPosition/getScrollPosition.js (100%) create mode 100644 test2/getScrollPosition/getScrollPosition.test.js rename {test => test2}/getStyle/getStyle.js (100%) create mode 100644 test2/getStyle/getStyle.test.js rename {test => test2}/getType/getType.js (100%) create mode 100644 test2/getType/getType.test.js rename {test => test2}/getURLParameters/getURLParameters.js (100%) create mode 100644 test2/getURLParameters/getURLParameters.test.js rename {test => test3}/groupBy/groupBy.js (100%) create mode 100644 test3/groupBy/groupBy.test.js rename {test => test3}/hammingDistance/hammingDistance.js (100%) create mode 100644 test3/hammingDistance/hammingDistance.test.js rename {test => test3}/hasClass/hasClass.js (100%) create mode 100644 test3/hasClass/hasClass.test.js rename {test => test3}/hasFlags/hasFlags.js (100%) create mode 100644 test3/hasFlags/hasFlags.test.js rename {test => test3}/hashBrowser/hashBrowser.js (100%) create mode 100644 test3/hashBrowser/hashBrowser.test.js rename {test => test3}/hashNode/hashNode.js (100%) create mode 100644 test3/hashNode/hashNode.test.js rename {test => test3}/head/head.js (100%) create mode 100644 test3/head/head.test.js rename {test => test3}/hexToRGB/hexToRGB.js (100%) create mode 100644 test3/hexToRGB/hexToRGB.test.js rename {test => test3}/hide/hide.js (100%) create mode 100644 test3/hide/hide.test.js rename {test => test3}/howManyTimes/howManyTimes.js (100%) create mode 100644 test3/howManyTimes/howManyTimes.test.js rename {test => test3}/httpDelete/httpDelete.js (100%) create mode 100644 test3/httpDelete/httpDelete.test.js rename {test => test3}/httpGet/httpGet.js (100%) rename {test => test3}/httpGet/httpGet.test.js (97%) rename {test => test3}/httpPost/httpPost.js (100%) rename {test => test3}/httpPost/httpPost.test.js (97%) rename {test => test3}/httpPut/httpPut.js (100%) create mode 100644 test3/httpPut/httpPut.test.js rename {test => test3}/httpsRedirect/httpsRedirect.js (100%) create mode 100644 test3/httpsRedirect/httpsRedirect.test.js rename {test => test3}/hz/hz.js (100%) create mode 100644 test3/hz/hz.test.js rename {test => test3}/inRange/inRange.js (100%) create mode 100644 test3/inRange/inRange.test.js rename {test => test3}/indexOfAll/indexOfAll.js (100%) create mode 100644 test3/indexOfAll/indexOfAll.test.js rename {test => test3}/initial/initial.js (100%) create mode 100644 test3/initial/initial.test.js rename {test => test3}/initialize2DArray/initialize2DArray.js (100%) create mode 100644 test3/initialize2DArray/initialize2DArray.test.js rename {test => test3}/initializeArrayWithRange/initializeArrayWithRange.js (100%) create mode 100644 test3/initializeArrayWithRange/initializeArrayWithRange.test.js rename {test => test3}/initializeArrayWithRangeRight/initializeArrayWithRangeRight.js (100%) create mode 100644 test3/initializeArrayWithRangeRight/initializeArrayWithRangeRight.test.js rename {test => test3}/initializeArrayWithValues/initializeArrayWithValues.js (100%) create mode 100644 test3/initializeArrayWithValues/initializeArrayWithValues.test.js rename {test => test3}/initializeNDArray/initializeNDArray.js (100%) create mode 100644 test3/initializeNDArray/initializeNDArray.test.js rename {test => test3}/intersection/intersection.js (100%) create mode 100644 test3/intersection/intersection.test.js rename {test => test3}/intersectionBy/intersectionBy.js (100%) create mode 100644 test3/intersectionBy/intersectionBy.test.js rename {test => test3}/intersectionWith/intersectionWith.js (100%) create mode 100644 test3/intersectionWith/intersectionWith.test.js rename {test => test3}/invertKeyValues/invertKeyValues.js (100%) create mode 100644 test3/invertKeyValues/invertKeyValues.test.js rename {test => test3}/is/is.js (100%) create mode 100644 test3/is/is.test.js rename {test => test3}/isAbsoluteURL/isAbsoluteURL.js (100%) create mode 100644 test3/isAbsoluteURL/isAbsoluteURL.test.js rename {test => test3}/isAnagram/isAnagram.js (100%) create mode 100644 test3/isAnagram/isAnagram.test.js rename {test => test3}/isArmstrongNumber/isArmstrongNumber.js (100%) create mode 100644 test3/isArmstrongNumber/isArmstrongNumber.test.js rename {test => test3}/isArray/isArray.js (100%) create mode 100644 test3/isArray/isArray.test.js rename {test => test3}/isArrayBuffer/isArrayBuffer.js (100%) create mode 100644 test3/isArrayBuffer/isArrayBuffer.test.js rename {test => test3}/isArrayLike/isArrayLike.js (100%) create mode 100644 test3/isArrayLike/isArrayLike.test.js rename {test => test3}/isBoolean/isBoolean.js (100%) create mode 100644 test3/isBoolean/isBoolean.test.js rename {test => test3}/isBrowser/isBrowser.js (100%) create mode 100644 test3/isBrowser/isBrowser.test.js rename {test => test3}/isBrowserTabFocused/isBrowserTabFocused.js (100%) create mode 100644 test3/isBrowserTabFocused/isBrowserTabFocused.test.js rename {test => test3}/isDivisible/isDivisible.js (100%) create mode 100644 test3/isDivisible/isDivisible.test.js rename {test => test3}/isEmpty/isEmpty.js (100%) create mode 100644 test3/isEmpty/isEmpty.test.js rename {test => test3}/isEven/isEven.js (100%) create mode 100644 test3/isEven/isEven.test.js rename {test => test3}/isFunction/isFunction.js (100%) create mode 100644 test3/isFunction/isFunction.test.js rename {test => test3}/isLowerCase/isLowerCase.js (100%) create mode 100644 test3/isLowerCase/isLowerCase.test.js rename {test => test3}/isMap/isMap.js (100%) create mode 100644 test3/isMap/isMap.test.js rename {test => test3}/isNil/isNil.js (100%) create mode 100644 test3/isNil/isNil.test.js rename {test => test3}/isNull/isNull.js (100%) create mode 100644 test3/isNull/isNull.test.js rename {test => test3}/isNumber/isNumber.js (100%) create mode 100644 test3/isNumber/isNumber.test.js rename {test => test3}/isObject/isObject.js (100%) create mode 100644 test3/isObject/isObject.test.js rename {test => test3}/isObjectLike/isObjectLike.js (100%) create mode 100644 test3/isObjectLike/isObjectLike.test.js rename {test => test3}/isPlainObject/isPlainObject.js (100%) create mode 100644 test3/isPlainObject/isPlainObject.test.js rename {test => test4}/JSONToDate/JSONToDate.js (100%) create mode 100644 test4/JSONToDate/JSONToDate.test.js rename {test => test4}/JSONToFile/JSONToFile.js (100%) create mode 100644 test4/JSONToFile/JSONToFile.test.js rename {test => test4}/isPrime/isPrime.js (100%) create mode 100644 test4/isPrime/isPrime.test.js rename {test => test4}/isPrimitive/isPrimitive.js (100%) create mode 100644 test4/isPrimitive/isPrimitive.test.js rename {test => test4}/isPromiseLike/isPromiseLike.js (100%) create mode 100644 test4/isPromiseLike/isPromiseLike.test.js rename {test => test4}/isRegExp/isRegExp.js (100%) create mode 100644 test4/isRegExp/isRegExp.test.js rename {test => test4}/isSet/isSet.js (100%) create mode 100644 test4/isSet/isSet.test.js rename {test => test4}/isSimilar/isSimilar.js (100%) create mode 100644 test4/isSimilar/isSimilar.test.js rename {test => test4}/isSorted/isSorted.js (100%) create mode 100644 test4/isSorted/isSorted.test.js rename {test => test4}/isString/isString.js (100%) create mode 100644 test4/isString/isString.test.js rename {test => test4}/isSymbol/isSymbol.js (100%) create mode 100644 test4/isSymbol/isSymbol.test.js rename {test => test4}/isTravisCI/isTravisCI.js (100%) create mode 100644 test4/isTravisCI/isTravisCI.test.js rename {test => test4}/isTypedArray/isTypedArray.js (100%) create mode 100644 test4/isTypedArray/isTypedArray.test.js rename {test => test4}/isUndefined/isUndefined.js (100%) create mode 100644 test4/isUndefined/isUndefined.test.js rename {test => test4}/isUpperCase/isUpperCase.js (100%) create mode 100644 test4/isUpperCase/isUpperCase.test.js rename {test => test4}/isValidJSON/isValidJSON.js (100%) create mode 100644 test4/isValidJSON/isValidJSON.test.js rename {test => test4}/isWeakMap/isWeakMap.js (100%) create mode 100644 test4/isWeakMap/isWeakMap.test.js rename {test => test4}/isWeakSet/isWeakSet.js (100%) create mode 100644 test4/isWeakSet/isWeakSet.test.js rename {test => test4}/join/join.js (100%) create mode 100644 test4/join/join.test.js rename {test => test4}/last/last.js (100%) create mode 100644 test4/last/last.test.js rename {test => test4}/lcm/lcm.js (100%) create mode 100644 test4/lcm/lcm.test.js rename {test => test4}/levenshteinDistance/levenshteinDistance.js (100%) create mode 100644 test4/levenshteinDistance/levenshteinDistance.test.js rename {test => test4}/longestItem/longestItem.js (100%) create mode 100644 test4/longestItem/longestItem.test.js rename {test => test4}/lowercaseKeys/lowercaseKeys.js (100%) create mode 100644 test4/lowercaseKeys/lowercaseKeys.test.js rename {test => test4}/luhnCheck/luhnCheck.js (100%) create mode 100644 test4/luhnCheck/luhnCheck.test.js rename {test => test4}/mapKeys/mapKeys.js (100%) create mode 100644 test4/mapKeys/mapKeys.test.js rename {test => test4}/mapObject/mapObject.js (100%) create mode 100644 test4/mapObject/mapObject.test.js rename {test => test4}/mapValues/mapValues.js (100%) create mode 100644 test4/mapValues/mapValues.test.js rename {test => test4}/mask/mask.js (100%) create mode 100644 test4/mask/mask.test.js rename {test => test4}/matches/matches.js (100%) create mode 100644 test4/matches/matches.test.js rename {test => test4}/matchesWith/matchesWith.js (100%) create mode 100644 test4/matchesWith/matchesWith.test.js rename {test => test4}/maxBy/maxBy.js (100%) create mode 100644 test4/maxBy/maxBy.test.js rename {test => test4}/maxN/maxN.js (100%) create mode 100644 test4/maxN/maxN.test.js rename {test => test4}/median/median.js (100%) create mode 100644 test4/median/median.test.js rename {test => test4}/memoize/memoize.js (100%) create mode 100644 test4/memoize/memoize.test.js rename {test => test4}/merge/merge.js (100%) create mode 100644 test4/merge/merge.test.js rename {test => test4}/minBy/minBy.js (100%) create mode 100644 test4/minBy/minBy.test.js rename {test => test4}/minN/minN.js (100%) create mode 100644 test4/minN/minN.test.js rename {test => test4}/mostPerformant/mostPerformant.js (100%) create mode 100644 test4/mostPerformant/mostPerformant.test.js rename {test => test4}/negate/negate.js (100%) create mode 100644 test4/negate/negate.test.js rename {test => test4}/nest/nest.js (100%) create mode 100644 test4/nest/nest.test.js rename {test => test4}/nodeListToArray/nodeListToArray.js (100%) create mode 100644 test4/nodeListToArray/nodeListToArray.test.js rename {test => test4}/none/none.js (100%) create mode 100644 test4/none/none.test.js rename {test => test4}/nthArg/nthArg.js (100%) create mode 100644 test4/nthArg/nthArg.test.js rename {test => test4}/nthElement/nthElement.js (100%) create mode 100644 test4/nthElement/nthElement.test.js rename {test => test4}/objectFromPairs/objectFromPairs.js (100%) create mode 100644 test4/objectFromPairs/objectFromPairs.test.js rename {test => test4}/objectToPairs/objectToPairs.js (100%) create mode 100644 test4/objectToPairs/objectToPairs.test.js rename {test => test4}/observeMutations/observeMutations.js (100%) create mode 100644 test4/observeMutations/observeMutations.test.js rename {test => test4}/off/off.js (100%) create mode 100644 test4/off/off.test.js rename {test => test4}/offset/offset.js (100%) create mode 100644 test4/offset/offset.test.js rename {test => test4}/omit/omit.js (100%) create mode 100644 test4/omit/omit.test.js rename {test => test5}/RGBToHex/RGBToHex.js (100%) create mode 100644 test5/RGBToHex/RGBToHex.test.js rename {test => test5}/omitBy/omitBy.js (100%) create mode 100644 test5/omitBy/omitBy.test.js rename {test => test5}/on/on.js (100%) create mode 100644 test5/on/on.test.js rename {test => test5}/onUserInputChange/onUserInputChange.js (100%) create mode 100644 test5/onUserInputChange/onUserInputChange.test.js rename {test => test5}/once/once.js (100%) create mode 100644 test5/once/once.test.js rename {test => test5}/orderBy/orderBy.js (100%) create mode 100644 test5/orderBy/orderBy.test.js rename {test => test5}/over/over.js (100%) create mode 100644 test5/over/over.test.js rename {test => test5}/overArgs/overArgs.js (100%) create mode 100644 test5/overArgs/overArgs.test.js rename {test => test5}/pad/pad.js (100%) create mode 100644 test5/pad/pad.test.js rename {test => test5}/palindrome/palindrome.js (100%) create mode 100644 test5/palindrome/palindrome.test.js rename {test => test5}/parseCookie/parseCookie.js (100%) create mode 100644 test5/parseCookie/parseCookie.test.js rename {test => test5}/partial/partial.js (100%) create mode 100644 test5/partial/partial.test.js rename {test => test5}/partialRight/partialRight.js (100%) create mode 100644 test5/partialRight/partialRight.test.js rename {test => test5}/partition/partition.js (100%) create mode 100644 test5/partition/partition.test.js rename {test => test5}/percentile/percentile.js (100%) create mode 100644 test5/percentile/percentile.test.js rename {test => test5}/permutations/permutations.js (100%) create mode 100644 test5/permutations/permutations.test.js rename {test => test5}/pick/pick.js (100%) create mode 100644 test5/pick/pick.test.js rename {test => test5}/pickBy/pickBy.js (100%) create mode 100644 test5/pickBy/pickBy.test.js rename {test => test5}/pipeAsyncFunctions/pipeAsyncFunctions.js (100%) create mode 100644 test5/pipeAsyncFunctions/pipeAsyncFunctions.test.js rename {test => test5}/pipeFunctions/pipeFunctions.js (100%) create mode 100644 test5/pipeFunctions/pipeFunctions.test.js rename {test => test5}/pluralize/pluralize.js (100%) create mode 100644 test5/pluralize/pluralize.test.js rename {test => test5}/powerset/powerset.js (100%) create mode 100644 test5/powerset/powerset.test.js rename {test => test5}/prefix/prefix.js (100%) create mode 100644 test5/prefix/prefix.test.js rename {test => test5}/prettyBytes/prettyBytes.js (100%) create mode 100644 test5/prettyBytes/prettyBytes.test.js rename {test => test5}/primes/primes.js (100%) create mode 100644 test5/primes/primes.test.js rename {test => test5}/promisify/promisify.js (100%) create mode 100644 test5/promisify/promisify.test.js rename {test => test5}/pull/pull.js (100%) create mode 100644 test5/pull/pull.test.js rename {test => test5}/pullAtIndex/pullAtIndex.js (100%) create mode 100644 test5/pullAtIndex/pullAtIndex.test.js rename {test => test5}/pullAtValue/pullAtValue.js (100%) create mode 100644 test5/pullAtValue/pullAtValue.test.js rename {test => test5}/pullBy/pullBy.js (100%) create mode 100644 test5/pullBy/pullBy.test.js rename {test => test5}/quickSort/quickSort.js (100%) create mode 100644 test5/quickSort/quickSort.test.js rename {test => test5}/radsToDegrees/radsToDegrees.js (100%) create mode 100644 test5/radsToDegrees/radsToDegrees.test.js rename {test => test5}/randomHexColorCode/randomHexColorCode.js (100%) create mode 100644 test5/randomHexColorCode/randomHexColorCode.test.js rename {test => test5}/randomIntArrayInRange/randomIntArrayInRange.js (100%) create mode 100644 test5/randomIntArrayInRange/randomIntArrayInRange.test.js rename {test => test5}/randomIntegerInRange/randomIntegerInRange.js (100%) create mode 100644 test5/randomIntegerInRange/randomIntegerInRange.test.js rename {test => test5}/randomNumberInRange/randomNumberInRange.js (100%) create mode 100644 test5/randomNumberInRange/randomNumberInRange.test.js rename {test => test5}/readFileLines/readFileLines.js (100%) create mode 100644 test5/readFileLines/readFileLines.test.js rename {test => test5}/rearg/rearg.js (100%) create mode 100644 test5/rearg/rearg.test.js rename {test => test5}/recordAnimationFrames/recordAnimationFrames.js (100%) create mode 100644 test5/recordAnimationFrames/recordAnimationFrames.test.js rename {test => test5}/redirect/redirect.js (100%) create mode 100644 test5/redirect/redirect.test.js rename {test => test5}/reduceSuccessive/reduceSuccessive.js (100%) create mode 100644 test5/reduceSuccessive/reduceSuccessive.test.js rename {test => test5}/reduceWhich/reduceWhich.js (100%) create mode 100644 test5/reduceWhich/reduceWhich.test.js rename {test => test5}/reducedFilter/reducedFilter.js (100%) create mode 100644 test5/reducedFilter/reducedFilter.test.js rename {test => test5}/reject/reject.js (100%) rename {test => test5}/reject/reject.test.js (60%) rename {test => test5}/remove/remove.js (100%) create mode 100644 test5/remove/remove.test.js rename {test => test5}/removeNonASCII/removeNonASCII.js (100%) create mode 100644 test5/removeNonASCII/removeNonASCII.test.js rename {test => test5}/removeVowels/removeVowels.js (100%) create mode 100644 test5/removeVowels/removeVowels.test.js rename {test => test5}/renameKeys/renameKeys.js (100%) rename {test => test5}/renameKeys/renameKeys.test.js (56%) rename {test => test5}/reverseString/reverseString.js (100%) create mode 100644 test5/reverseString/reverseString.test.js rename {test => test5}/round/round.js (100%) create mode 100644 test5/round/round.test.js rename {test => test6}/URLJoin/URLJoin.js (100%) create mode 100644 test6/URLJoin/URLJoin.test.js rename {test => test6}/UUIDGeneratorBrowser/UUIDGeneratorBrowser.js (100%) create mode 100644 test6/UUIDGeneratorBrowser/UUIDGeneratorBrowser.test.js rename {test => test6}/UUIDGeneratorNode/UUIDGeneratorNode.js (100%) create mode 100644 test6/UUIDGeneratorNode/UUIDGeneratorNode.test.js rename {test => test6}/runAsync/runAsync.js (100%) create mode 100644 test6/runAsync/runAsync.test.js rename {test => test6}/runPromisesInSeries/runPromisesInSeries.js (100%) create mode 100644 test6/runPromisesInSeries/runPromisesInSeries.test.js rename {test => test6}/sample/sample.js (100%) create mode 100644 test6/sample/sample.test.js rename {test => test6}/sampleSize/sampleSize.js (100%) create mode 100644 test6/sampleSize/sampleSize.test.js rename {test => test6}/scrollToTop/scrollToTop.js (100%) create mode 100644 test6/scrollToTop/scrollToTop.test.js rename {test => test6}/sdbm/sdbm.js (100%) create mode 100644 test6/sdbm/sdbm.test.js rename {test => test6}/serializeCookie/serializeCookie.js (100%) create mode 100644 test6/serializeCookie/serializeCookie.test.js rename {test => test6}/setStyle/setStyle.js (100%) create mode 100644 test6/setStyle/setStyle.test.js rename {test => test6}/shallowClone/shallowClone.js (100%) create mode 100644 test6/shallowClone/shallowClone.test.js rename {test => test6}/show/show.js (100%) create mode 100644 test6/show/show.test.js rename {test => test6}/shuffle/shuffle.js (100%) create mode 100644 test6/shuffle/shuffle.test.js rename {test => test6}/similarity/similarity.js (100%) create mode 100644 test6/similarity/similarity.test.js rename {test => test6}/size/size.js (100%) create mode 100644 test6/size/size.test.js rename {test => test6}/sleep/sleep.js (100%) create mode 100644 test6/sleep/sleep.test.js rename {test => test6}/smoothScroll/smoothScroll.js (100%) create mode 100644 test6/smoothScroll/smoothScroll.test.js rename {test => test6}/solveRPN/solveRPN.js (100%) create mode 100644 test6/solveRPN/solveRPN.test.js rename {test => test6}/sortCharactersInString/sortCharactersInString.js (100%) create mode 100644 test6/sortCharactersInString/sortCharactersInString.test.js rename {test => test6}/sortedIndex/sortedIndex.js (100%) create mode 100644 test6/sortedIndex/sortedIndex.test.js rename {test => test6}/sortedIndexBy/sortedIndexBy.js (100%) create mode 100644 test6/sortedIndexBy/sortedIndexBy.test.js rename {test => test6}/sortedLastIndex/sortedLastIndex.js (100%) create mode 100644 test6/sortedLastIndex/sortedLastIndex.test.js rename {test => test6}/sortedLastIndexBy/sortedLastIndexBy.js (100%) create mode 100644 test6/sortedLastIndexBy/sortedLastIndexBy.test.js rename {test => test6}/speechSynthesis/speechSynthesis.js (100%) create mode 100644 test6/speechSynthesis/speechSynthesis.test.js rename {test => test6}/splitLines/splitLines.js (100%) create mode 100644 test6/splitLines/splitLines.test.js rename {test => test6}/spreadOver/spreadOver.js (100%) create mode 100644 test6/spreadOver/spreadOver.test.js rename {test => test6}/stableSort/stableSort.js (100%) rename {test => test6}/stableSort/stableSort.test.js (65%) rename {test => test6}/standardDeviation/standardDeviation.js (100%) create mode 100644 test6/standardDeviation/standardDeviation.test.js rename {test => test6}/stringPermutations/stringPermutations.js (100%) create mode 100644 test6/stringPermutations/stringPermutations.test.js rename {test => test6}/stripHTMLTags/stripHTMLTags.js (100%) create mode 100644 test6/stripHTMLTags/stripHTMLTags.test.js rename {test => test6}/sum/sum.js (100%) create mode 100644 test6/sum/sum.test.js rename {test => test6}/sumBy/sumBy.js (100%) create mode 100644 test6/sumBy/sumBy.test.js rename {test => test6}/sumPower/sumPower.js (100%) create mode 100644 test6/sumPower/sumPower.test.js rename {test => test6}/symmetricDifference/symmetricDifference.js (100%) create mode 100644 test6/symmetricDifference/symmetricDifference.test.js rename {test => test6}/symmetricDifferenceBy/symmetricDifferenceBy.js (100%) create mode 100644 test6/symmetricDifferenceBy/symmetricDifferenceBy.test.js rename {test => test6}/symmetricDifferenceWith/symmetricDifferenceWith.js (100%) create mode 100644 test6/symmetricDifferenceWith/symmetricDifferenceWith.test.js rename {test => test6}/tail/tail.js (100%) create mode 100644 test6/tail/tail.test.js rename {test => test6}/take/take.js (100%) create mode 100644 test6/take/take.test.js rename {test => test6}/takeRight/takeRight.js (100%) create mode 100644 test6/takeRight/takeRight.test.js rename {test => test6}/takeRightWhile/takeRightWhile.js (100%) create mode 100644 test6/takeRightWhile/takeRightWhile.test.js rename {test => test6}/takeWhile/takeWhile.js (100%) create mode 100644 test6/takeWhile/takeWhile.test.js rename {test => test6}/throttle/throttle.js (100%) create mode 100644 test6/throttle/throttle.test.js rename {test => test6}/timeTaken/timeTaken.js (100%) create mode 100644 test6/timeTaken/timeTaken.test.js rename {test => test6}/times/times.js (100%) create mode 100644 test6/times/times.test.js rename {test => test6}/toCamelCase/toCamelCase.js (100%) create mode 100644 test6/toCamelCase/toCamelCase.test.js rename {test => test6}/toCurrency/toCurrency.js (100%) create mode 100644 test6/toCurrency/toCurrency.test.js rename {test => test6}/toDecimalMark/toDecimalMark.js (100%) create mode 100644 test6/toDecimalMark/toDecimalMark.test.js rename {test => test6}/toHash/toHash.js (100%) create mode 100644 test6/toHash/toHash.test.js rename {test => test6}/toKebabCase/toKebabCase.js (100%) create mode 100644 test6/toKebabCase/toKebabCase.test.js rename {test => test6}/toOrdinalSuffix/toOrdinalSuffix.js (100%) create mode 100644 test6/toOrdinalSuffix/toOrdinalSuffix.test.js rename {test => test6}/toSafeInteger/toSafeInteger.js (100%) create mode 100644 test6/toSafeInteger/toSafeInteger.test.js rename {test => test6}/toSnakeCase/toSnakeCase.js (100%) create mode 100644 test6/toSnakeCase/toSnakeCase.test.js rename {test => test6}/toggleClass/toggleClass.js (100%) create mode 100644 test6/toggleClass/toggleClass.test.js rename {test => test6}/tomorrow/tomorrow.js (100%) create mode 100644 test6/tomorrow/tomorrow.test.js rename {test => test6}/transform/transform.js (100%) create mode 100644 test6/transform/transform.test.js rename {test => test6}/truncateString/truncateString.js (100%) create mode 100644 test6/truncateString/truncateString.test.js rename {test => test6}/truthCheckCollection/truthCheckCollection.js (100%) create mode 100644 test6/truthCheckCollection/truthCheckCollection.test.js rename {test => test6}/unary/unary.js (100%) create mode 100644 test6/unary/unary.test.js rename {test => test6}/uncurry/uncurry.js (100%) create mode 100644 test6/uncurry/uncurry.test.js rename {test => test6}/unescapeHTML/unescapeHTML.js (100%) create mode 100644 test6/unescapeHTML/unescapeHTML.test.js rename {test => test6}/unflattenObject/unflattenObject.js (100%) create mode 100644 test6/unflattenObject/unflattenObject.test.js rename {test => test6}/unfold/unfold.js (100%) create mode 100644 test6/unfold/unfold.test.js rename {test => test6}/union/union.js (100%) create mode 100644 test6/union/union.test.js rename {test => test6}/unionBy/unionBy.js (100%) create mode 100644 test6/unionBy/unionBy.test.js rename {test => test6}/unionWith/unionWith.js (100%) create mode 100644 test6/unionWith/unionWith.test.js rename {test => test6}/uniqueElements/uniqueElements.js (100%) create mode 100644 test6/uniqueElements/uniqueElements.test.js rename {test => test6}/untildify/untildify.js (100%) create mode 100644 test6/untildify/untildify.test.js rename {test => test6}/unzip/unzip.js (100%) create mode 100644 test6/unzip/unzip.test.js rename {test => test6}/unzipWith/unzipWith.js (100%) create mode 100644 test6/unzipWith/unzipWith.test.js rename {test => test6}/validateNumber/validateNumber.js (100%) create mode 100644 test6/validateNumber/validateNumber.test.js rename {test => test6}/when/when.js (100%) rename {test => test6}/when/when.test.js (52%) rename {test => test6}/without/without.js (100%) create mode 100644 test6/without/without.test.js rename {test => test6}/words/words.js (100%) create mode 100644 test6/words/words.test.js rename {test => test6}/xProd/xProd.js (100%) create mode 100644 test6/xProd/xProd.test.js rename {test => test6}/yesNo/yesNo.js (100%) create mode 100644 test6/yesNo/yesNo.test.js rename {test => test6}/zip/zip.js (100%) create mode 100644 test6/zip/zip.test.js rename {test => test6}/zipObject/zipObject.js (100%) create mode 100644 test6/zipObject/zipObject.test.js rename {test => test6}/zipWith/zipWith.js (100%) create mode 100644 test6/zipWith/zipWith.test.js diff --git a/package-lock.json b/package-lock.json index 1f859f49d..710f23ce3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,26 @@ "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" + } + }, "abab": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/abab/-/abab-1.0.4.tgz", @@ -31,12 +51,29 @@ "acorn": "5.5.3" } }, + "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 +86,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 +159,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 +189,18 @@ "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", "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 + }, "asn1": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", @@ -98,6 +213,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 +260,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 +340,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", @@ -317,6 +521,26 @@ "babel-types": "6.26.0" } }, + "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 +559,35 @@ "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-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 +600,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", @@ -666,6 +925,31 @@ "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-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 +1031,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 +1130,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 +1192,50 @@ "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" + } + }, + "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 +1268,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 +1325,35 @@ } } }, + "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 + }, + "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", @@ -942,6 +1420,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,6 +1460,18 @@ "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", @@ -984,6 +1484,18 @@ "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", "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,12 +1582,27 @@ "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" + } + }, "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, + "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-equal": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", @@ -1088,6 +1615,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,6 +1634,53 @@ "object-keys": "1.0.11" } }, + "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 + } + } + }, "defined": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", @@ -1123,6 +1706,27 @@ "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "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 + }, "domexception": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", @@ -1236,6 +1840,12 @@ } } }, + "esprima": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "dev": true + }, "estraverse": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", @@ -1254,12 +1864,258 @@ "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" + } + } + } + }, + "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,6 +2140,15 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, + "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": { + "bser": "2.0.0" + } + }, "figures": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", @@ -1294,6 +2159,45 @@ "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-up": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", @@ -1313,6 +2217,21 @@ "is-function": "1.0.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": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", @@ -1336,12 +2255,550 @@ "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.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", @@ -1428,6 +2885,18 @@ "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=", "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,6 +2920,25 @@ "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", @@ -1484,6 +2972,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 +3127,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 +3183,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 +3240,22 @@ "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==", "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", @@ -1661,12 +3302,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 +3338,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 +3417,33 @@ "number-is-nan": "1.0.1" } }, + "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-function": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.1.tgz", "integrity": "sha1-Es+5i2W1fdPRk6MSH19uL0N2ArU=", "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 +3463,53 @@ "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-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-property": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", @@ -1737,6 +3525,12 @@ "has": "1.0.1" } }, + "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 +3549,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 +3567,682 @@ "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 + }, "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-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 +4255,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 +4306,12 @@ "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-schema": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", @@ -1844,6 +4330,12 @@ "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 + }, "jsonpointer": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", @@ -1862,6 +4354,22 @@ "verror": "1.10.0" } }, + "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 +4385,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 +4410,24 @@ "uc.micro": "1.0.5" } }, + "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", @@ -1926,6 +4458,12 @@ "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 +4499,36 @@ "yallist": "2.1.2" } }, + "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 +4542,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 +4581,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 +4678,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 +4705,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 +4743,52 @@ } } }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "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", @@ -2101,6 +4827,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 +5051,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,6 +5105,28 @@ "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "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-inspect": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.5.0.tgz", @@ -2355,6 +5139,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 +5195,30 @@ "wrappy": "1.0.2" } }, + "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 +5264,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 +5303,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", @@ -2448,6 +5336,12 @@ "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 +5357,12 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "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,6 +5407,26 @@ "pinkie": "2.0.4" } }, + "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" + } + } + } + }, "plur": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/plur/-/plur-1.0.0.tgz", @@ -2519,18 +5439,57 @@ "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-format": { + "version": "23.0.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-23.0.1.tgz", + "integrity": "sha1-1h0GUmjkx1kIO8y8onoBrXx2AfQ=", + "dev": true, + "requires": { + "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" + } + } + } + }, "pretty-ms": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-2.1.0.tgz", @@ -2581,6 +5540,31 @@ "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==", "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 + } + } + }, "re-emitter": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/re-emitter/-/re-emitter-1.1.3.tgz", @@ -2647,6 +5631,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 +5673,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 +5732,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", @@ -2806,6 +5830,27 @@ "path-parse": "1.0.5" } }, + "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": { + "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 + }, "resumer": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", @@ -2815,6 +5860,22 @@ "through": "2.3.8" } }, + "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": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", @@ -2843,12 +5904,73 @@ "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 + }, "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", @@ -2907,12 +6029,173 @@ "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" + } + } + } + }, + "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 + }, + "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 +6211,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", @@ -2969,6 +6280,15 @@ "through": "2.3.8" } }, + "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": { + "extend-shallow": "3.0.2" + } + }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -2991,6 +6311,33 @@ "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 + }, + "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,6 +6353,60 @@ "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", "dev": true }, + "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.trim": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz", @@ -3041,6 +6442,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", @@ -3151,6 +6564,54 @@ "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" + } + } + } + }, + "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", @@ -3174,12 +6635,49 @@ "dev": true, "optional": true }, + "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", @@ -3218,6 +6716,12 @@ "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", @@ -3291,18 +6795,133 @@ } } }, + "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" + } + } + } + }, + "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 + } + } + }, "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", @@ -3339,6 +6958,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", @@ -3417,6 +7055,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 +7106,17 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, + "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..b2a1e4c0f 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "chalk": "^2.4.1", "fs-extra": "^6.0.0", "html-minifier": "^3.5.15", + "jest": "^23.1.0", "jsdom": "^11.10.0", "markdown-it": "^8.4.1", "mini.css": "^2.3.7", @@ -32,7 +33,8 @@ "extractor": "node ./scripts/extract.js", "packager": "node ./scripts/module.js", "localizer": "node ./scripts/localize.js", - "test": "tape test/**/*.test.js | tap-spec" + "test": "tape test/**/*.test.js | tap-spec", + "test2": "jest ./jesttest/**/*.test.js" }, "repository": { "type": "git", diff --git a/test/JSONToDate/JSONToDate.test.js b/test/JSONToDate/JSONToDate.test.js deleted file mode 100644 index 1e2a7a57b..000000000 --- a/test/JSONToDate/JSONToDate.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/JSONToFile/JSONToFile.test.js b/test/JSONToFile/JSONToFile.test.js deleted file mode 100644 index 7c352d079..000000000 --- a/test/JSONToFile/JSONToFile.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/RGBToHex/RGBToHex.test.js b/test/RGBToHex/RGBToHex.test.js deleted file mode 100644 index 277d6575c..000000000 --- a/test/RGBToHex/RGBToHex.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/URLJoin/URLJoin.test.js b/test/URLJoin/URLJoin.test.js deleted file mode 100644 index 70d0d09a6..000000000 --- a/test/URLJoin/URLJoin.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/UUIDGeneratorBrowser/UUIDGeneratorBrowser.test.js b/test/UUIDGeneratorBrowser/UUIDGeneratorBrowser.test.js deleted file mode 100644 index 255054290..000000000 --- a/test/UUIDGeneratorBrowser/UUIDGeneratorBrowser.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/UUIDGeneratorNode/UUIDGeneratorNode.test.js b/test/UUIDGeneratorNode/UUIDGeneratorNode.test.js deleted file mode 100644 index 1857e1727..000000000 --- a/test/UUIDGeneratorNode/UUIDGeneratorNode.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/all/all.test.js b/test/all/all.test.js index 60ac82f4a..b3b238577 100644 --- a/test/all/all.test.js +++ b/test/all/all.test.js @@ -1,21 +1,16 @@ -const test = require('tape'); +const expect = require('expect'); const all = require('./all.js'); -test('Testing all', (t) => { +test('Testing all', () => { //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(); + expect(typeof all === 'function').toBeTruthy(); + expect(all([4,1,2,3])).toBeTruthy(); + expect(all([0,1])).toBeFalsy(); + expect(all([NaN,1])).toBeFalsy(); + expect(all([undefined,1])).toBeFalsy(); + expect(all([null,1])).toBeFalsy(); + expect(all(['',1])).toBeFalsy(); + expect(all([4,1,2,3], x => x >= 1)).toBeTruthy(); + expect(all([0,1], x => x >= 1)).toBeFalsy(); }); diff --git a/test/any/any.test.js b/test/any/any.test.js index 63399b385..a5ae70981 100644 --- a/test/any/any.test.js +++ b/test/any/any.test.js @@ -1,18 +1,13 @@ -const test = require('tape'); +const expect = require('expect'); const any = require('./any.js'); -test('Testing any', (t) => { +test('Testing any', () => { //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(); + expect(typeof any === 'function').toBeTruthy(); + expect(any([0,1,2,3])).toBeTruthy(); + expect(any([0,0])).toBeFalsy(); + expect(any([NaN,0,undefined,null,''])).toBeFalsy(); + expect(any([4,1,0,3], x => x >= 1)).toBeTruthy(); + expect(any([0,1], x => x < 0)).toBeFalsy(); }); diff --git a/test/approximatelyEqual/approximatelyEqual.test.js b/test/approximatelyEqual/approximatelyEqual.test.js index 44221aeb8..5e223172e 100644 --- a/test/approximatelyEqual/approximatelyEqual.test.js +++ b/test/approximatelyEqual/approximatelyEqual.test.js @@ -1,17 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const approximatelyEqual = require('./approximatelyEqual.js'); -test('Testing approximatelyEqual', (t) => { +test('Testing approximatelyEqual', () => { //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(); + expect(typeof approximatelyEqual === 'function').toBeTruthy(); + expect(approximatelyEqual(Math.PI / 2.0 , 1.5708)).toBeTruthy(); + expect(approximatelyEqual(0.1 + 0.2, 0.3)).toBeTruthy(); + expect(approximatelyEqual(0.5, 0.5)).toBeTruthy(); + 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..005e1a472 100644 --- a/test/arrayToHtmlList/arrayToHtmlList.test.js +++ b/test/arrayToHtmlList/arrayToHtmlList.test.js @@ -1,14 +1,8 @@ -const test = require('tape'); +const expect = require('expect'); const arrayToHtmlList = require('./arrayToHtmlList.js'); -test('Testing arrayToHtmlList', (t) => { +test('Testing arrayToHtmlList', () => { //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(); + expect(typeof arrayToHtmlList === 'function').toBeTruthy(); }); diff --git a/test/ary/ary.test.js b/test/ary/ary.test.js index f73c1c40f..66ca2da84 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) => { +test('Testing ary', () => { //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'); + expect(typeof ary === 'function').toBeTruthy(); 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(); + 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..1ea997aed 100644 --- a/test/atob/atob.test.js +++ b/test/atob/atob.test.js @@ -1,15 +1,10 @@ -const test = require('tape'); +const expect = require('expect'); const atob = require('./atob.js'); -test('Testing atob', (t) => { +test('Testing atob', () => { //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(); + expect(typeof atob === 'function').toBeTruthy(); + expect(atob('Zm9vYmFy')).toBe('foobar'); + expect(atob('Z')).toBe(''); }); diff --git a/test/attempt/attempt.test.js b/test/attempt/attempt.test.js index 557d7af3b..0e6b0d5b0 100644 --- a/test/attempt/attempt.test.js +++ b/test/attempt/attempt.test.js @@ -1,15 +1,10 @@ -const test = require('tape'); +const expect = require('expect'); const attempt = require('./attempt.js'); -test('Testing attempt', (t) => { +test('Testing attempt', () => { //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(); + expect(typeof attempt === 'function').toBeTruthy(); + expect(attempt(() => 0)).toBe(0); + expect(attempt(() => {throw new Error();}) instanceof Error).toBeTruthy(); }); diff --git a/test/average/average.test.js b/test/average/average.test.js index 16a9471c7..b07cc6380 100644 --- a/test/average/average.test.js +++ b/test/average/average.test.js @@ -1,24 +1,23 @@ -const test = require('tape'); +const expect = require('expect'); const average = require('./average.js'); -test('Testing average', (t) => { +test('Testing average', () => { //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'); + expect(typeof average === 'function').toBeTruthy(); + expect(average(true) === 1).toBeTruthy(); + expect(average(false) === 0).toBeTruthy(); + expect(average(9, 1)).toBe(5); + expect(average(153, 44, 55, 64, 71, 1122, 322774, 2232, 23423, 234, 3631)).toBe(32163.909090909092); + expect(average(1, 2, 3)).toBe(2); + expect(average(null)).toBe(0); + expect(isNaN(average(undefined))).toBeTruthy(); + expect(isNaN(average('String'))).toBeTruthy(); + expect(isNaN(average({ a: 123}))).toBeTruthy(); + 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(); + let end = new Date().getTime(); + expect((end - start) < 2000).toBeTruthy(); }); \ No newline at end of file diff --git a/test/averageBy/averageBy.test.js b/test/averageBy/averageBy.test.js index 7c3fabe16..d1a1839c3 100644 --- a/test/averageBy/averageBy.test.js +++ b/test/averageBy/averageBy.test.js @@ -1,15 +1,10 @@ -const test = require('tape'); +const expect = require('expect'); const averageBy = require('./averageBy.js'); -test('Testing averageBy', (t) => { +test('Testing averageBy', () => { //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(); + expect(typeof averageBy === 'function').toBeTruthy(); + expect(averageBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], o => o.n)).toBe(5); + 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..b8bbda4bf 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) => { +test('Testing bifurcate', () => { //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(); + expect(typeof bifurcate === 'function').toBeTruthy(); + 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..2eebcb6e6 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) => { +test('Testing bifurcateBy', () => { //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(); + expect(typeof bifurcateBy === 'function').toBeTruthy(); + 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..34620e797 100644 --- a/test/binarySearch/binarySearch.test.js +++ b/test/binarySearch/binarySearch.test.js @@ -1,16 +1,13 @@ -const test = require('tape'); +const expect = require('expect'); const binarySearch = require('./binarySearch.js'); -test('Testing binarySearch', (t) => { +test('Testing binarySearch', () => { //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'); + expect(typeof binarySearch === 'function').toBeTruthy(); //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(); + expect(binarySearch([1, 4, 6, 7, 12, 13, 15, 18, 19, 20, 22, 24], 6)).toBe(2); + expect(binarySearch([1, 4, 6, 7, 12, 13, 15, 18, 19, 20, 22, 24], 21)).toBe(-1); + expect(binarySearch([], 21)).toBe(-1); + expect(binarySearch([1], 1)).toBe(0); }); \ No newline at end of file diff --git a/test/bind/bind.test.js b/test/bind/bind.test.js index e3ba1054c..552c40249 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) => { +test('Testing bind', () => { //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'); + expect(typeof bind === 'function').toBeTruthy(); 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(); + expect(freddyBound('hi', '!')).toBe('hi fred!'); }); diff --git a/test/bindAll/bindAll.test.js b/test/bindAll/bindAll.test.js index 3876982f4..2d6a07c8d 100644 --- a/test/bindAll/bindAll.test.js +++ b/test/bindAll/bindAll.test.js @@ -1,10 +1,10 @@ -const test = require('tape'); +const expect = require('expect'); const bindAll = require('./bindAll.js'); -test('Testing bindAll', (t) => { +test('Testing bindAll', () => { //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'); + expect(typeof bindAll === 'function').toBeTruthy(); var view = { label: 'docs', 'click': function() { @@ -12,10 +12,5 @@ test('Testing bindAll', (t) => { } }; 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(); + expect(view.click()).toBe('clicked docs'); }); diff --git a/test/bindKey/bindKey.test.js b/test/bindKey/bindKey.test.js index 2aed1fb1e..b34d80dd3 100644 --- a/test/bindKey/bindKey.test.js +++ b/test/bindKey/bindKey.test.js @@ -1,10 +1,10 @@ -const test = require('tape'); +const expect = require('expect'); const bindKey = require('./bindKey.js'); -test('Testing bindKey', (t) => { +test('Testing bindKey', () => { //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'); + expect(typeof bindKey === 'function').toBeTruthy(); const freddy = { user: 'fred', greet: function(greeting, punctuation) { @@ -12,10 +12,5 @@ test('Testing bindKey', (t) => { } }; 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(); + expect(freddyBound('hi', '!')).toBe('hi fred!'); }); diff --git a/test/binomialCoefficient/binomialCoefficient.test.js b/test/binomialCoefficient/binomialCoefficient.test.js index 2f0e8ab20..2549bb0e8 100644 --- a/test/binomialCoefficient/binomialCoefficient.test.js +++ b/test/binomialCoefficient/binomialCoefficient.test.js @@ -1,18 +1,13 @@ -const test = require('tape'); +const expect = require('expect'); const binomialCoefficient = require('./binomialCoefficient.js'); -test('Testing binomialCoefficient', (t) => { +test('Testing binomialCoefficient', () => { //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(); + expect(typeof binomialCoefficient === 'function').toBeTruthy(); + expect(binomialCoefficient(8, 2)).toBe(28); + expect(binomialCoefficient(0, 0)).toBe(1); + expect(binomialCoefficient(5, 3)).toBe(10); + expect(Number.isNaN(binomialCoefficient(NaN, 3))).toBeTruthy(); + expect(Number.isNaN(binomialCoefficient(5, NaN))).toBeTruthy(); }); diff --git a/test/bottomVisible/bottomVisible.test.js b/test/bottomVisible/bottomVisible.test.js index b9be1fc89..ba92fa3de 100644 --- a/test/bottomVisible/bottomVisible.test.js +++ b/test/bottomVisible/bottomVisible.test.js @@ -1,14 +1,8 @@ -const test = require('tape'); +const expect = require('expect'); const bottomVisible = require('./bottomVisible.js'); -test('Testing bottomVisible', (t) => { +test('Testing bottomVisible', () => { //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(); + expect(typeof bottomVisible === 'function').toBeTruthy(); }); diff --git a/test/btoa/btoa.test.js b/test/btoa/btoa.test.js index 85690e99b..6720da7bc 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) => { +test('Testing btoa', () => { //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(); + expect(typeof btoa === 'function').toBeTruthy(); + expect(btoa('foobar')).toBe('Zm9vYmFy'); }); diff --git a/test/byteSize/byteSize.test.js b/test/byteSize/byteSize.test.js index 423c63ce4..f0cafd212 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. +import expect from 'expect'; const Blob = class{ constructor(s) { return { @@ -10,21 +9,11 @@ const Blob = class{ // const byteSize = require('./byteSize.js'); // Override const byteSize = str => new Blob([str]).size; -test('Testing byteSize', (t) => { +test('Testing byteSize', () => { //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(); + expect(typeof byteSize === 'function').toBeTruthy(); + expect(byteSize('a')).toBe(1); + expect(byteSize('Hello World')).toBe(11); + expect(byteSize('😀')).toBe(4); }); diff --git a/test/call/call.test.js b/test/call/call.test.js index bf1ed5e56..831054502 100644 --- a/test/call/call.test.js +++ b/test/call/call.test.js @@ -1,13 +1,10 @@ -const test = require('tape'); +const expect = require('expect'); const call = require('./call.js'); -test('Testing call', (t) => { +test('Testing call', () => { //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'); + expect(typeof call === 'function').toBeTruthy(); //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 diff --git a/test/capitalize/capitalize.test.js b/test/capitalize/capitalize.test.js index 9a19686af..677d1198b 100644 --- a/test/capitalize/capitalize.test.js +++ b/test/capitalize/capitalize.test.js @@ -1,17 +1,12 @@ -const test = require('tape'); +const expect = require('expect'); const capitalize = require('./capitalize.js'); -test('Testing capitalize', (t) => { +test('Testing capitalize', () => { //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(); + expect(typeof capitalize === 'function').toBeTruthy(); + expect(capitalize('fooBar')).toBe('FooBar'); + expect(capitalize('fooBar', true)).toBe('Foobar'); + expect(capitalize('#!#', true)).toBe('#!#'); + expect(capitalize('a', true)).toBe('A'); }); \ No newline at end of file diff --git a/test/capitalizeEveryWord/capitalizeEveryWord.test.js b/test/capitalizeEveryWord/capitalizeEveryWord.test.js index 5ea7eb4d7..2f3482a35 100644 --- a/test/capitalizeEveryWord/capitalizeEveryWord.test.js +++ b/test/capitalizeEveryWord/capitalizeEveryWord.test.js @@ -1,16 +1,11 @@ -const test = require('tape'); +const expect = require('expect'); const capitalizeEveryWord = require('./capitalizeEveryWord.js'); -test('Testing capitalizeEveryWord', (t) => { +test('Testing capitalizeEveryWord', () => { //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(); + expect(typeof capitalizeEveryWord === 'function').toBeTruthy(); + expect(capitalizeEveryWord('hello world!')).toBe('Hello World!'); + expect(capitalizeEveryWord('$# @!')).toBe('$# @!'); + expect(capitalizeEveryWord('a')).toBe('A'); }); \ No newline at end of file diff --git a/test/castArray/castArray.test.js b/test/castArray/castArray.test.js index a0961a491..b66526e2f 100644 --- a/test/castArray/castArray.test.js +++ b/test/castArray/castArray.test.js @@ -1,18 +1,13 @@ -const test = require('tape'); +const expect = require('expect'); const castArray = require('./castArray.js'); -test('Testing castArray', (t) => { +test('Testing castArray', () => { //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(); + expect(typeof castArray === 'function').toBeTruthy(); + expect(castArray(1)).toEqual([1]); + expect(castArray([1])).toEqual([1]); + expect(castArray([1,2,3])).toEqual([1,2,3]); + expect(castArray('test')).toEqual(['test']); + expect(castArray({})).toEqual([{}]); }); diff --git a/test/chainAsync/chainAsync.test.js b/test/chainAsync/chainAsync.test.js index a1e6edd06..1fa7bf1eb 100644 --- a/test/chainAsync/chainAsync.test.js +++ b/test/chainAsync/chainAsync.test.js @@ -1,10 +1,10 @@ -const test = require('tape'); +const expect = require('expect'); const chainAsync = require('./chainAsync.js'); -test('Testing chainAsync', (t) => { +test('Testing chainAsync', () => { //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'); + expect(typeof chainAsync === 'function').toBeTruthy(); chainAsync([ next => { next(); @@ -14,14 +14,6 @@ test('Testing chainAsync', (t) => { next(); })(); }, - next => { - t.pass("Calls all functions in an array"); - } + next => {} ]); - // // 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..18b6bf623 100644 --- a/test/chunk/chunk.test.js +++ b/test/chunk/chunk.test.js @@ -1,22 +1,21 @@ -const test = require('tape'); +const expect = require('expect'); const chunk = require('./chunk.js'); -test('Testing chunk', (t) => { +test('Testing chunk', () => { //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'); + expect(typeof chunk === 'function').toBeTruthy(); + expect(chunk([1, 2, 3, 4, 5], 2)).toEqual([[1,2],[3,4],[5]]); + expect(chunk([])).toEqual([]); + expect(chunk(123)).toEqual([]); + expect(chunk({ a: 123})).toEqual([]); + expect(chunk('string', 2)).toEqual([ 'st', 'ri', 'ng' ]); + expect(() => chunk()).toThrow(); + expect(() => chunk(undefined)).toThrow(); + expect(() => chunk(null)).toThrow(); 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(); + expect((end - start) < 2000).toBeTruthy(); }); diff --git a/test/clampNumber/clampNumber.test.js b/test/clampNumber/clampNumber.test.js index 0e62c5b8f..2ee01ebc7 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) => { +test('Testing clampNumber', () => { //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(); + expect(typeof clampNumber === 'function').toBeTruthy(); + expect(clampNumber(2, 3, 5)).toBe(3); }); \ No newline at end of file diff --git a/test/cleanObj/cleanObj.test.js b/test/cleanObj/cleanObj.test.js index db490ed45..15ea30712 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) => { +test('Testing cleanObj', () => { //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'); + expect(typeof cleanObj === 'function').toBeTruthy(); 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(); + expect(cleanObj(testObj, ['a'], 'children')).toEqual({ a: 1, children : { a: 1}}); }); \ No newline at end of file diff --git a/test/cloneRegExp/cloneRegExp.test.js b/test/cloneRegExp/cloneRegExp.test.js index 17b2ce8c0..3a323061b 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) => { +test('Testing cloneRegExp', () => { //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'); + expect(typeof cloneRegExp === 'function').toBeTruthy(); 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(); + expect(cloneRegExp(rgTest)).not.toBe(rgTest); }); diff --git a/test/coalesce/coalesce.test.js b/test/coalesce/coalesce.test.js index e32afaf95..fb0876734 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) => { +test('Testing coalesce', () => { //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(); + expect(typeof coalesce === 'function').toBeTruthy(); + expect(coalesce(null, undefined, '', NaN, 'Waldo')).toEqual(''); }); \ No newline at end of file diff --git a/test/coalesceFactory/coalesceFactory.test.js b/test/coalesceFactory/coalesceFactory.test.js index e0651ace2..74cd3b817 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) => { +test('Testing coalesceFactory', () => { //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'); + expect(typeof coalesceFactory === 'function').toBeTruthy(); 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(); + expect(customCoalesce(undefined, null, NaN, '', 'Waldo')).toEqual('Waldo'); }); \ No newline at end of file diff --git a/test/collatz/collatz.test.js b/test/collatz/collatz.test.js index 5b177db8d..3163ac75c 100644 --- a/test/collatz/collatz.test.js +++ b/test/collatz/collatz.test.js @@ -1,24 +1,19 @@ -const test = require('tape'); +const expect = require('expect'); const collatz = require('./collatz.js'); -test('Testing collatz', (t) => { +test('Testing collatz', () => { //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'); + expect(typeof collatz === 'function').toBeTruthy(); //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'); + expect(collatz(8)).toBe(4); + expect(collatz(9)).toBe(28); let n = 9; while(true){ if (n === 1){ - t.pass('Eventually reaches 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..ecfc30293 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) => { +test('Testing collectInto', () => { //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'); + expect(typeof collectInto === 'function').toBeTruthy(); 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(); + Pall(p1, p2, p3).then(function(val){ expect(val).toEqual([1,2,3]);}, function(reason){}); }); diff --git a/test/colorize/colorize.test.js b/test/colorize/colorize.test.js index 77666f0ae..85def3607 100644 --- a/test/colorize/colorize.test.js +++ b/test/colorize/colorize.test.js @@ -1,14 +1,8 @@ -const test = require('tape'); +const expect = require('expect'); const colorize = require('./colorize.js'); -test('Testing colorize', (t) => { +test('Testing colorize', () => { //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(); + expect(typeof colorize === 'function').toBeTruthy(); }); diff --git a/test/compact/compact.test.js b/test/compact/compact.test.js index 74de02b1b..f3a4af122 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) => { +test('Testing compact', () => { //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(); + expect(typeof compact === 'function').toBeTruthy(); + expect(compact([0, 1, false, 2, '', 3, 'a', 'e' * 23, NaN, 's', 34])).toEqual([ 1, 2, 3, 'a', 's', 34 ]); }); \ No newline at end of file diff --git a/test/compose/compose.test.js b/test/compose/compose.test.js index 87c2ea8bd..b8788829b 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) => { +test('Testing compose', () => { //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'); + expect(typeof compose === 'function').toBeTruthy(); 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(); + expect(multiplyAndAdd5(5, 2)).toBe(15); }); \ No newline at end of file diff --git a/test/composeRight/composeRight.test.js b/test/composeRight/composeRight.test.js index c07f7e8a5..bf6ff5ed9 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) => { +test('Testing composeRight', () => { //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'); + expect(typeof composeRight === 'function').toBeTruthy(); 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(); + expect(addAndSquare(1, 2)).toBe(9); }); diff --git a/test/converge/converge.test.js b/test/converge/converge.test.js index 73cafbf11..d066c0937 100644 --- a/test/converge/converge.test.js +++ b/test/converge/converge.test.js @@ -1,23 +1,18 @@ -const test = require('tape'); +const expect = require('expect'); const converge = require('./converge.js'); -test('Testing converge', (t) => { +test('Testing converge', () => { //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'); + expect(typeof converge === 'function').toBeTruthy(); 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'); + expect(average([1, 2, 3, 4, 5, 6, 7])).toBe(4); 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(); + expect(strangeConcat('Yodel')).toBe("YODELyodel"); }); diff --git a/test/copyToClipboard/copyToClipboard.test.js b/test/copyToClipboard/copyToClipboard.test.js index 24118be8f..3dbcdf2db 100644 --- a/test/copyToClipboard/copyToClipboard.test.js +++ b/test/copyToClipboard/copyToClipboard.test.js @@ -1,14 +1,8 @@ -const test = require('tape'); +const expect = require('expect'); const copyToClipboard = require('./copyToClipboard.js'); -test('Testing copyToClipboard', (t) => { +test('Testing copyToClipboard', () => { //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(); + expect(typeof copyToClipboard === 'function').toBeTruthy(); }); diff --git a/test/countBy/countBy.test.js b/test/countBy/countBy.test.js index 94296d017..87b969afa 100644 --- a/test/countBy/countBy.test.js +++ b/test/countBy/countBy.test.js @@ -1,15 +1,10 @@ -const test = require('tape'); +const expect = require('expect'); const countBy = require('./countBy.js'); -test('Testing countBy', (t) => { +test('Testing countBy', () => { //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(); + expect(typeof countBy === 'function').toBeTruthy(); + expect(countBy([6.1, 4.2, 6.3], Math.floor)).toEqual({4: 1, 6: 2}); + 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..518b29888 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) => { +test('Testing countOccurrences', () => { //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(); + expect(typeof countOccurrences === 'function').toBeTruthy(); + expect(countOccurrences([1, 1, 2, 1, 2, 3], 1)).toEqual(3); }); \ No newline at end of file diff --git a/test/countVowels/countVowels.test.js b/test/countVowels/countVowels.test.js index 98a67a2b1..f631109ec 100644 --- a/test/countVowels/countVowels.test.js +++ b/test/countVowels/countVowels.test.js @@ -1,13 +1,8 @@ -const test = require('tape'); +const expect = require('expect'); const countVowels = require('./countVowels.js'); -test('Testing countVowels', (t) => { +test('Testing countVowels', () => { //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(); + expect(typeof countVowels === 'function').toBeTruthy(); }); \ No newline at end of file diff --git a/test/counter/counter.test.js b/test/counter/counter.test.js index f22689a34..93c889ed4 100644 --- a/test/counter/counter.test.js +++ b/test/counter/counter.test.js @@ -1,13 +1,8 @@ -const test = require('tape'); +const expect = require('expect'); const counter = require('./counter.js'); -test('Testing counter', (t) => { +test('Testing counter', () => { //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(); + expect(typeof counter === 'function').toBeTruthy(); }); \ No newline at end of file diff --git a/test/createElement/createElement.test.js b/test/createElement/createElement.test.js index 6923ec245..f8dadcc16 100644 --- a/test/createElement/createElement.test.js +++ b/test/createElement/createElement.test.js @@ -1,14 +1,8 @@ -const test = require('tape'); +const expect = require('expect'); const createElement = require('./createElement.js'); -test('Testing createElement', (t) => { +test('Testing createElement', () => { //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(); + expect(typeof createElement === 'function').toBeTruthy(); }); diff --git a/test/createEventHub/createEventHub.test.js b/test/createEventHub/createEventHub.test.js index 101d07aef..4991ebaca 100644 --- a/test/createEventHub/createEventHub.test.js +++ b/test/createEventHub/createEventHub.test.js @@ -1,14 +1,8 @@ -const test = require('tape'); +const expect = require('expect'); const createEventHub = require('./createEventHub.js'); -test('Testing createEventHub', (t) => { +test('Testing createEventHub', () => { //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(); + expect(typeof createEventHub === 'function').toBeTruthy(); }); diff --git a/test/currentURL/currentURL.test.js b/test/currentURL/currentURL.test.js index e190ad429..52aeb37b3 100644 --- a/test/currentURL/currentURL.test.js +++ b/test/currentURL/currentURL.test.js @@ -1,14 +1,8 @@ -const test = require('tape'); +const expect = require('expect'); const currentURL = require('./currentURL.js'); -test('Testing currentURL', (t) => { +test('Testing currentURL', () => { //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(); + expect(typeof currentURL === 'function').toBeTruthy(); }); diff --git a/test/curry/curry.test.js b/test/curry/curry.test.js index 341b11811..b2f8cae8a 100644 --- a/test/curry/curry.test.js +++ b/test/curry/curry.test.js @@ -1,15 +1,10 @@ -const test = require('tape'); +const expect = require('expect'); const curry = require('./curry.js'); -test('Testing curry', (t) => { +test('Testing curry', () => { //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(); + expect(typeof curry === 'function').toBeTruthy(); + expect(curry(Math.pow)(2)(10)).toBe(1024); + expect(curry(Math.min, 3)(10)(50)(2)).toBe(2); }); \ No newline at end of file diff --git a/test/debounce/debounce.test.js b/test/debounce/debounce.test.js index 867aac93a..88d9c3b75 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) => { +test('Testing debounce', () => { //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(); + expect(typeof debounce === 'function').toBeTruthy(); + debounce(() => {}, 250); }); diff --git a/test/decapitalize/decapitalize.test.js b/test/decapitalize/decapitalize.test.js index 83bf6b32a..b600ace89 100644 --- a/test/decapitalize/decapitalize.test.js +++ b/test/decapitalize/decapitalize.test.js @@ -1,15 +1,10 @@ -const test = require('tape'); +const expect = require('expect'); const decapitalize = require('./decapitalize.js'); -test('Testing decapitalize', (t) => { +test('Testing decapitalize', () => { //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(); + expect(typeof decapitalize === 'function').toBeTruthy(); + expect(decapitalize('FooBar')).toBe('fooBar'); + expect(decapitalize('FooBar', true)).toBe('fOOBAR'); }); diff --git a/test/deepClone/deepClone.test.js b/test/deepClone/deepClone.test.js index c2276f6ae..dca7e3a64 100644 --- a/test/deepClone/deepClone.test.js +++ b/test/deepClone/deepClone.test.js @@ -1,21 +1,16 @@ -const test = require('tape'); +const expect = require('expect'); const deepClone = require('./deepClone.js'); -test('Testing deepClone', (t) => { +test('Testing deepClone', () => { //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'); + expect(typeof deepClone === 'function').toBeTruthy(); 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(); + expect(a).not.toBe(b); + expect(a.obj).not.toBe(b.obj); + expect(c).not.toBe(d); + expect(c[0]).not.toBe(d[0]); }); diff --git a/test/deepFlatten/deepFlatten.test.js b/test/deepFlatten/deepFlatten.test.js index d6225da28..2d57901e4 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) => { +test('Testing deepFlatten', () => { //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(); + expect(typeof deepFlatten === 'function').toBeTruthy(); + expect(deepFlatten([1, [2], [[3], 4], 5])).toEqual([1, 2, 3, 4, 5]); }); \ No newline at end of file diff --git a/test/defaults/defaults.test.js b/test/defaults/defaults.test.js deleted file mode 100644 index b3c519f9d..000000000 --- a/test/defaults/defaults.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/defer/defer.test.js b/test/defer/defer.test.js deleted file mode 100644 index 23e125b90..000000000 --- a/test/defer/defer.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/degreesToRads/degreesToRads.test.js b/test/degreesToRads/degreesToRads.test.js deleted file mode 100644 index 8ec980a10..000000000 --- a/test/degreesToRads/degreesToRads.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/delay/delay.test.js b/test/delay/delay.test.js deleted file mode 100644 index 8404b3bcb..000000000 --- a/test/delay/delay.test.js +++ /dev/null @@ -1,20 +0,0 @@ -const test = require('tape'); -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'); - delay( - function(text) { - t.equals(text, 'test', 'Works as expecting, passing arguments properly'); - }, - 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 deleted file mode 100644 index 9a369fe00..000000000 --- a/test/detectDeviceType/detectDeviceType.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/difference/difference.test.js b/test/difference/difference.test.js deleted file mode 100644 index 17a5b7ba2..000000000 --- a/test/difference/difference.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/differenceBy/differenceBy.test.js b/test/differenceBy/differenceBy.test.js deleted file mode 100644 index 36c220cac..000000000 --- a/test/differenceBy/differenceBy.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/differenceWith/differenceWith.test.js b/test/differenceWith/differenceWith.test.js deleted file mode 100644 index b3dd65cd5..000000000 --- a/test/differenceWith/differenceWith.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/digitize/digitize.test.js b/test/digitize/digitize.test.js deleted file mode 100644 index 2fb81a471..000000000 --- a/test/digitize/digitize.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/distance/distance.test.js b/test/distance/distance.test.js deleted file mode 100644 index 7939c3048..000000000 --- a/test/distance/distance.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/drop/drop.test.js b/test/drop/drop.test.js deleted file mode 100644 index 3b20fd1cd..000000000 --- a/test/drop/drop.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/dropRight/dropRight.test.js b/test/dropRight/dropRight.test.js deleted file mode 100644 index b224b0a47..000000000 --- a/test/dropRight/dropRight.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/dropRightWhile/dropRightWhile.test.js b/test/dropRightWhile/dropRightWhile.test.js deleted file mode 100644 index 50bba45c3..000000000 --- a/test/dropRightWhile/dropRightWhile.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/dropWhile/dropWhile.test.js b/test/dropWhile/dropWhile.test.js deleted file mode 100644 index 0bbc55024..000000000 --- a/test/dropWhile/dropWhile.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/elementIsVisibleInViewport/elementIsVisibleInViewport.test.js b/test/elementIsVisibleInViewport/elementIsVisibleInViewport.test.js deleted file mode 100644 index a2b4b7a59..000000000 --- a/test/elementIsVisibleInViewport/elementIsVisibleInViewport.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/elo/elo.test.js b/test/elo/elo.test.js deleted file mode 100644 index c7f757a8e..000000000 --- a/test/elo/elo.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/equals/equals.test.js b/test/equals/equals.test.js deleted file mode 100644 index fd7f0e8f4..000000000 --- a/test/equals/equals.test.js +++ /dev/null @@ -1,18 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/escapeHTML/escapeHTML.test.js b/test/escapeHTML/escapeHTML.test.js deleted file mode 100644 index 642cbfd5b..000000000 --- a/test/escapeHTML/escapeHTML.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/escapeRegExp/escapeRegExp.test.js b/test/escapeRegExp/escapeRegExp.test.js deleted file mode 100644 index 9ecb9497a..000000000 --- a/test/escapeRegExp/escapeRegExp.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/everyNth/everyNth.test.js b/test/everyNth/everyNth.test.js deleted file mode 100644 index 53c3851ef..000000000 --- a/test/everyNth/everyNth.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/extendHex/extendHex.test.js b/test/extendHex/extendHex.test.js deleted file mode 100644 index c9fd57973..000000000 --- a/test/extendHex/extendHex.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/factorial/factorial.test.js b/test/factorial/factorial.test.js deleted file mode 100644 index d8694b446..000000000 --- a/test/factorial/factorial.test.js +++ /dev/null @@ -1,18 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/factors/factors.test.js b/test/factors/factors.test.js deleted file mode 100644 index cd9d3a0c9..000000000 --- a/test/factors/factors.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/fibonacci/fibonacci.test.js b/test/fibonacci/fibonacci.test.js deleted file mode 100644 index 75951a4de..000000000 --- a/test/fibonacci/fibonacci.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/fibonacciCountUntilNum/fibonacciCountUntilNum.test.js b/test/fibonacciCountUntilNum/fibonacciCountUntilNum.test.js deleted file mode 100644 index 6d14331d3..000000000 --- a/test/fibonacciCountUntilNum/fibonacciCountUntilNum.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/fibonacciUntilNum/fibonacciUntilNum.test.js b/test/fibonacciUntilNum/fibonacciUntilNum.test.js deleted file mode 100644 index a023c376c..000000000 --- a/test/fibonacciUntilNum/fibonacciUntilNum.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/filterNonUnique/filterNonUnique.test.js b/test/filterNonUnique/filterNonUnique.test.js deleted file mode 100644 index 9fd18bf41..000000000 --- a/test/filterNonUnique/filterNonUnique.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/findKey/findKey.test.js b/test/findKey/findKey.test.js deleted file mode 100644 index 7c505e561..000000000 --- a/test/findKey/findKey.test.js +++ /dev/null @@ -1,21 +0,0 @@ -const test = require('tape'); -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( - { - 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(); -}); diff --git a/test/findLast/findLast.test.js b/test/findLast/findLast.test.js deleted file mode 100644 index a2d74405c..000000000 --- a/test/findLast/findLast.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/findLastIndex/findLastIndex.test.js b/test/findLastIndex/findLastIndex.test.js deleted file mode 100644 index 2105f977a..000000000 --- a/test/findLastIndex/findLastIndex.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/findLastKey/findLastKey.test.js b/test/findLastKey/findLastKey.test.js deleted file mode 100644 index 41bcf3624..000000000 --- a/test/findLastKey/findLastKey.test.js +++ /dev/null @@ -1,21 +0,0 @@ -const test = require('tape'); -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( - { - 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(); -}); diff --git a/test/flatten/flatten.test.js b/test/flatten/flatten.test.js deleted file mode 100644 index eb54b6c19..000000000 --- a/test/flatten/flatten.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/flattenObject/flattenObject.test.js b/test/flattenObject/flattenObject.test.js deleted file mode 100644 index 6fea9f795..000000000 --- a/test/flattenObject/flattenObject.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/flip/flip.test.js b/test/flip/flip.test.js deleted file mode 100644 index e5cbedefc..000000000 --- a/test/flip/flip.test.js +++ /dev/null @@ -1,18 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/forEachRight/forEachRight.test.js b/test/forEachRight/forEachRight.test.js deleted file mode 100644 index 2b6b8a956..000000000 --- a/test/forEachRight/forEachRight.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/forOwn/forOwn.test.js b/test/forOwn/forOwn.test.js deleted file mode 100644 index b6910eb1f..000000000 --- a/test/forOwn/forOwn.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/forOwnRight/forOwnRight.test.js b/test/forOwnRight/forOwnRight.test.js deleted file mode 100644 index 66c783785..000000000 --- a/test/forOwnRight/forOwnRight.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/formatDuration/formatDuration.test.js b/test/formatDuration/formatDuration.test.js deleted file mode 100644 index 6c5cc23c3..000000000 --- a/test/formatDuration/formatDuration.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/fromCamelCase/fromCamelCase.test.js b/test/fromCamelCase/fromCamelCase.test.js deleted file mode 100644 index 58ecffed9..000000000 --- a/test/fromCamelCase/fromCamelCase.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/functionName/functionName.test.js b/test/functionName/functionName.test.js deleted file mode 100644 index 4231f45c5..000000000 --- a/test/functionName/functionName.test.js +++ /dev/null @@ -1,26 +0,0 @@ -const test = require('tape'); -//const functionName = require('./functionName.js'); -// Custom override for console.debug to check output. -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(); -}); diff --git a/test/functions/functions.test.js b/test/functions/functions.test.js deleted file mode 100644 index 0177fa60a..000000000 --- a/test/functions/functions.test.js +++ /dev/null @@ -1,20 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/gcd/gcd.test.js b/test/gcd/gcd.test.js deleted file mode 100644 index a222fe04b..000000000 --- a/test/gcd/gcd.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/geometricProgression/geometricProgression.test.js b/test/geometricProgression/geometricProgression.test.js deleted file mode 100644 index 059e83682..000000000 --- a/test/geometricProgression/geometricProgression.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/get/get.test.js b/test/get/get.test.js deleted file mode 100644 index d8448a171..000000000 --- a/test/get/get.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/getColonTimeFromDate/getColonTimeFromDate.test.js b/test/getColonTimeFromDate/getColonTimeFromDate.test.js deleted file mode 100644 index d1f0f3789..000000000 --- a/test/getColonTimeFromDate/getColonTimeFromDate.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js b/test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js deleted file mode 100644 index 56bf82f8c..000000000 --- a/test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.test.js b/test/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.test.js deleted file mode 100644 index 7df3d24df..000000000 --- a/test/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/getScrollPosition/getScrollPosition.test.js b/test/getScrollPosition/getScrollPosition.test.js deleted file mode 100644 index 9f7fd14d7..000000000 --- a/test/getScrollPosition/getScrollPosition.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/getStyle/getStyle.test.js b/test/getStyle/getStyle.test.js deleted file mode 100644 index 23bac0147..000000000 --- a/test/getStyle/getStyle.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/getType/getType.test.js b/test/getType/getType.test.js deleted file mode 100644 index 359e9ea07..000000000 --- a/test/getType/getType.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/getURLParameters/getURLParameters.test.js b/test/getURLParameters/getURLParameters.test.js deleted file mode 100644 index a030f86ee..000000000 --- a/test/getURLParameters/getURLParameters.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/groupBy/groupBy.test.js b/test/groupBy/groupBy.test.js deleted file mode 100644 index e3e8528bb..000000000 --- a/test/groupBy/groupBy.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/hammingDistance/hammingDistance.test.js b/test/hammingDistance/hammingDistance.test.js deleted file mode 100644 index 6ada1733c..000000000 --- a/test/hammingDistance/hammingDistance.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/hasClass/hasClass.test.js b/test/hasClass/hasClass.test.js deleted file mode 100644 index 43932ea01..000000000 --- a/test/hasClass/hasClass.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/hasFlags/hasFlags.test.js b/test/hasFlags/hasFlags.test.js deleted file mode 100644 index be0d4c301..000000000 --- a/test/hasFlags/hasFlags.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/hashBrowser/hashBrowser.test.js b/test/hashBrowser/hashBrowser.test.js deleted file mode 100644 index 5464dd95d..000000000 --- a/test/hashBrowser/hashBrowser.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/hashNode/hashNode.test.js b/test/hashNode/hashNode.test.js deleted file mode 100644 index 51345a607..000000000 --- a/test/hashNode/hashNode.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/head/head.test.js b/test/head/head.test.js deleted file mode 100644 index b6fa2d188..000000000 --- a/test/head/head.test.js +++ /dev/null @@ -1,21 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/hexToRGB/hexToRGB.test.js b/test/hexToRGB/hexToRGB.test.js deleted file mode 100644 index 4b3d0fdd8..000000000 --- a/test/hexToRGB/hexToRGB.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/hide/hide.test.js b/test/hide/hide.test.js deleted file mode 100644 index af1971858..000000000 --- a/test/hide/hide.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/howManyTimes/howManyTimes.test.js b/test/howManyTimes/howManyTimes.test.js deleted file mode 100644 index 250b542ce..000000000 --- a/test/howManyTimes/howManyTimes.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/httpDelete/httpDelete.test.js b/test/httpDelete/httpDelete.test.js deleted file mode 100644 index d4edd42a9..000000000 --- a/test/httpDelete/httpDelete.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/httpPut/httpPut.test.js b/test/httpPut/httpPut.test.js deleted file mode 100644 index d7c3f1e86..000000000 --- a/test/httpPut/httpPut.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/httpsRedirect/httpsRedirect.test.js b/test/httpsRedirect/httpsRedirect.test.js deleted file mode 100644 index f86baf715..000000000 --- a/test/httpsRedirect/httpsRedirect.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/hz/hz.test.js b/test/hz/hz.test.js deleted file mode 100644 index afd054442..000000000 --- a/test/hz/hz.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/inRange/inRange.test.js b/test/inRange/inRange.test.js deleted file mode 100644 index 10b2a2bec..000000000 --- a/test/inRange/inRange.test.js +++ /dev/null @@ -1,17 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/indexOfAll/indexOfAll.test.js b/test/indexOfAll/indexOfAll.test.js deleted file mode 100644 index d9c681a65..000000000 --- a/test/indexOfAll/indexOfAll.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/initial/initial.test.js b/test/initial/initial.test.js deleted file mode 100644 index d4b0b76d6..000000000 --- a/test/initial/initial.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/initialize2DArray/initialize2DArray.test.js b/test/initialize2DArray/initialize2DArray.test.js deleted file mode 100644 index d2436a46a..000000000 --- a/test/initialize2DArray/initialize2DArray.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/initializeArrayWithRange/initializeArrayWithRange.test.js b/test/initializeArrayWithRange/initializeArrayWithRange.test.js deleted file mode 100644 index c35b1f557..000000000 --- a/test/initializeArrayWithRange/initializeArrayWithRange.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/initializeArrayWithRangeRight/initializeArrayWithRangeRight.test.js b/test/initializeArrayWithRangeRight/initializeArrayWithRangeRight.test.js deleted file mode 100644 index f630da0c4..000000000 --- a/test/initializeArrayWithRangeRight/initializeArrayWithRangeRight.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/initializeArrayWithValues/initializeArrayWithValues.test.js b/test/initializeArrayWithValues/initializeArrayWithValues.test.js deleted file mode 100644 index e4590fcaa..000000000 --- a/test/initializeArrayWithValues/initializeArrayWithValues.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/initializeNDArray/initializeNDArray.test.js b/test/initializeNDArray/initializeNDArray.test.js deleted file mode 100644 index 82b015be3..000000000 --- a/test/initializeNDArray/initializeNDArray.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/intersection/intersection.test.js b/test/intersection/intersection.test.js deleted file mode 100644 index 065d86356..000000000 --- a/test/intersection/intersection.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/intersectionBy/intersectionBy.test.js b/test/intersectionBy/intersectionBy.test.js deleted file mode 100644 index 499153b91..000000000 --- a/test/intersectionBy/intersectionBy.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/intersectionWith/intersectionWith.test.js b/test/intersectionWith/intersectionWith.test.js deleted file mode 100644 index 1fac234c2..000000000 --- a/test/intersectionWith/intersectionWith.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/invertKeyValues/invertKeyValues.test.js b/test/invertKeyValues/invertKeyValues.test.js deleted file mode 100644 index 948a80889..000000000 --- a/test/invertKeyValues/invertKeyValues.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/is/is.test.js b/test/is/is.test.js deleted file mode 100644 index 9671e766d..000000000 --- a/test/is/is.test.js +++ /dev/null @@ -1,29 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/isAbsoluteURL/isAbsoluteURL.test.js b/test/isAbsoluteURL/isAbsoluteURL.test.js deleted file mode 100644 index 965d48cdc..000000000 --- a/test/isAbsoluteURL/isAbsoluteURL.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/isAnagram/isAnagram.test.js b/test/isAnagram/isAnagram.test.js deleted file mode 100644 index 915d14aba..000000000 --- a/test/isAnagram/isAnagram.test.js +++ /dev/null @@ -1,17 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/isArmstrongNumber/isArmstrongNumber.test.js b/test/isArmstrongNumber/isArmstrongNumber.test.js deleted file mode 100644 index dbebfbfd0..000000000 --- a/test/isArmstrongNumber/isArmstrongNumber.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/isArray/isArray.test.js b/test/isArray/isArray.test.js deleted file mode 100644 index 7d56d1112..000000000 --- a/test/isArray/isArray.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/isArrayBuffer/isArrayBuffer.test.js b/test/isArrayBuffer/isArrayBuffer.test.js deleted file mode 100644 index 1d9cffa97..000000000 --- a/test/isArrayBuffer/isArrayBuffer.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/isArrayLike/isArrayLike.test.js b/test/isArrayLike/isArrayLike.test.js deleted file mode 100644 index 97b41b827..000000000 --- a/test/isArrayLike/isArrayLike.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/isBoolean/isBoolean.test.js b/test/isBoolean/isBoolean.test.js deleted file mode 100644 index 68334e925..000000000 --- a/test/isBoolean/isBoolean.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/isBrowser/isBrowser.test.js b/test/isBrowser/isBrowser.test.js deleted file mode 100644 index 3f0c1adf9..000000000 --- a/test/isBrowser/isBrowser.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/isBrowserTabFocused/isBrowserTabFocused.test.js b/test/isBrowserTabFocused/isBrowserTabFocused.test.js deleted file mode 100644 index d3a5b5133..000000000 --- a/test/isBrowserTabFocused/isBrowserTabFocused.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/isDivisible/isDivisible.test.js b/test/isDivisible/isDivisible.test.js deleted file mode 100644 index bdfa8a5c2..000000000 --- a/test/isDivisible/isDivisible.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/isEmpty/isEmpty.test.js b/test/isEmpty/isEmpty.test.js deleted file mode 100644 index 76fc0aef8..000000000 --- a/test/isEmpty/isEmpty.test.js +++ /dev/null @@ -1,23 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/isEven/isEven.test.js b/test/isEven/isEven.test.js deleted file mode 100644 index 8c9e29455..000000000 --- a/test/isEven/isEven.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/isFunction/isFunction.test.js b/test/isFunction/isFunction.test.js deleted file mode 100644 index 7311b25d4..000000000 --- a/test/isFunction/isFunction.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/isLowerCase/isLowerCase.test.js b/test/isLowerCase/isLowerCase.test.js deleted file mode 100644 index 0e596dff9..000000000 --- a/test/isLowerCase/isLowerCase.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/isMap/isMap.test.js b/test/isMap/isMap.test.js deleted file mode 100644 index bc9fe3187..000000000 --- a/test/isMap/isMap.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/isNil/isNil.test.js b/test/isNil/isNil.test.js deleted file mode 100644 index c5e11d1f4..000000000 --- a/test/isNil/isNil.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/isNull/isNull.test.js b/test/isNull/isNull.test.js deleted file mode 100644 index dbc7d20c8..000000000 --- a/test/isNull/isNull.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/isNumber/isNumber.test.js b/test/isNumber/isNumber.test.js deleted file mode 100644 index 90af5bb5b..000000000 --- a/test/isNumber/isNumber.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/isObject/isObject.test.js b/test/isObject/isObject.test.js deleted file mode 100644 index 8ed7620c8..000000000 --- a/test/isObject/isObject.test.js +++ /dev/null @@ -1,19 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/isObjectLike/isObjectLike.test.js b/test/isObjectLike/isObjectLike.test.js deleted file mode 100644 index fe414423b..000000000 --- a/test/isObjectLike/isObjectLike.test.js +++ /dev/null @@ -1,17 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/isPlainObject/isPlainObject.test.js b/test/isPlainObject/isPlainObject.test.js deleted file mode 100644 index 515b61b2d..000000000 --- a/test/isPlainObject/isPlainObject.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/isPrime/isPrime.test.js b/test/isPrime/isPrime.test.js deleted file mode 100644 index 8d7ce3b8b..000000000 --- a/test/isPrime/isPrime.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/isPrimitive/isPrimitive.test.js b/test/isPrimitive/isPrimitive.test.js deleted file mode 100644 index 3e0a21076..000000000 --- a/test/isPrimitive/isPrimitive.test.js +++ /dev/null @@ -1,24 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/isPromiseLike/isPromiseLike.test.js b/test/isPromiseLike/isPromiseLike.test.js deleted file mode 100644 index 5ce5d856b..000000000 --- a/test/isPromiseLike/isPromiseLike.test.js +++ /dev/null @@ -1,20 +0,0 @@ -const test = require('tape'); -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({ - 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(); -}); diff --git a/test/isRegExp/isRegExp.test.js b/test/isRegExp/isRegExp.test.js deleted file mode 100644 index 2580a138d..000000000 --- a/test/isRegExp/isRegExp.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/isSet/isSet.test.js b/test/isSet/isSet.test.js deleted file mode 100644 index 81fae132b..000000000 --- a/test/isSet/isSet.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/isSimilar/isSimilar.test.js b/test/isSimilar/isSimilar.test.js deleted file mode 100644 index bcc980a18..000000000 --- a/test/isSimilar/isSimilar.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/isSorted/isSorted.test.js b/test/isSorted/isSorted.test.js deleted file mode 100644 index a55dfe962..000000000 --- a/test/isSorted/isSorted.test.js +++ /dev/null @@ -1,23 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/isString/isString.test.js b/test/isString/isString.test.js deleted file mode 100644 index f48d8cfe0..000000000 --- a/test/isString/isString.test.js +++ /dev/null @@ -1,19 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/isSymbol/isSymbol.test.js b/test/isSymbol/isSymbol.test.js deleted file mode 100644 index 24a4defdf..000000000 --- a/test/isSymbol/isSymbol.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/isTravisCI/isTravisCI.test.js b/test/isTravisCI/isTravisCI.test.js deleted file mode 100644 index c807bcd67..000000000 --- a/test/isTravisCI/isTravisCI.test.js +++ /dev/null @@ -1,17 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/isTypedArray/isTypedArray.test.js b/test/isTypedArray/isTypedArray.test.js deleted file mode 100644 index 75253822d..000000000 --- a/test/isTypedArray/isTypedArray.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/isUndefined/isUndefined.test.js b/test/isUndefined/isUndefined.test.js deleted file mode 100644 index 43029fcf8..000000000 --- a/test/isUndefined/isUndefined.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/isUpperCase/isUpperCase.test.js b/test/isUpperCase/isUpperCase.test.js deleted file mode 100644 index a0b8e8a89..000000000 --- a/test/isUpperCase/isUpperCase.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/isValidJSON/isValidJSON.test.js b/test/isValidJSON/isValidJSON.test.js deleted file mode 100644 index b0ad1dac5..000000000 --- a/test/isValidJSON/isValidJSON.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/isWeakMap/isWeakMap.test.js b/test/isWeakMap/isWeakMap.test.js deleted file mode 100644 index 72bb4544a..000000000 --- a/test/isWeakMap/isWeakMap.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/isWeakSet/isWeakSet.test.js b/test/isWeakSet/isWeakSet.test.js deleted file mode 100644 index 3bb390cde..000000000 --- a/test/isWeakSet/isWeakSet.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/join/join.test.js b/test/join/join.test.js deleted file mode 100644 index 385ef56b8..000000000 --- a/test/join/join.test.js +++ /dev/null @@ -1,17 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/last/last.test.js b/test/last/last.test.js deleted file mode 100644 index fc0ba799c..000000000 --- a/test/last/last.test.js +++ /dev/null @@ -1,21 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/lcm/lcm.test.js b/test/lcm/lcm.test.js deleted file mode 100644 index cba81345c..000000000 --- a/test/lcm/lcm.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/levenshteinDistance/levenshteinDistance.test.js b/test/levenshteinDistance/levenshteinDistance.test.js deleted file mode 100644 index 3c3c74404..000000000 --- a/test/levenshteinDistance/levenshteinDistance.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/longestItem/longestItem.test.js b/test/longestItem/longestItem.test.js deleted file mode 100644 index ae4b53739..000000000 --- a/test/longestItem/longestItem.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/lowercaseKeys/lowercaseKeys.test.js b/test/lowercaseKeys/lowercaseKeys.test.js deleted file mode 100644 index 6b7937773..000000000 --- a/test/lowercaseKeys/lowercaseKeys.test.js +++ /dev/null @@ -1,17 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/luhnCheck/luhnCheck.test.js b/test/luhnCheck/luhnCheck.test.js deleted file mode 100644 index e044cbd85..000000000 --- a/test/luhnCheck/luhnCheck.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/mapKeys/mapKeys.test.js b/test/mapKeys/mapKeys.test.js deleted file mode 100644 index 1ce44e71f..000000000 --- a/test/mapKeys/mapKeys.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/mapObject/mapObject.test.js b/test/mapObject/mapObject.test.js deleted file mode 100644 index 294bdcd00..000000000 --- a/test/mapObject/mapObject.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/mapValues/mapValues.test.js b/test/mapValues/mapValues.test.js deleted file mode 100644 index 273ada753..000000000 --- a/test/mapValues/mapValues.test.js +++ /dev/null @@ -1,18 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/mask/mask.test.js b/test/mask/mask.test.js deleted file mode 100644 index dc57ed888..000000000 --- a/test/mask/mask.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/matches/matches.test.js b/test/matches/matches.test.js deleted file mode 100644 index e28065fa5..000000000 --- a/test/matches/matches.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/matchesWith/matchesWith.test.js b/test/matchesWith/matchesWith.test.js deleted file mode 100644 index 9ce717785..000000000 --- a/test/matchesWith/matchesWith.test.js +++ /dev/null @@ -1,19 +0,0 @@ -const test = require('tape'); -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( - { 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(); -}); diff --git a/test/maxBy/maxBy.test.js b/test/maxBy/maxBy.test.js deleted file mode 100644 index 3c0d156b3..000000000 --- a/test/maxBy/maxBy.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/maxN/maxN.test.js b/test/maxN/maxN.test.js deleted file mode 100644 index 89e14ab98..000000000 --- a/test/maxN/maxN.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/median/median.test.js b/test/median/median.test.js deleted file mode 100644 index 9fa44be9c..000000000 --- a/test/median/median.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/memoize/memoize.test.js b/test/memoize/memoize.test.js deleted file mode 100644 index e90eb2b05..000000000 --- a/test/memoize/memoize.test.js +++ /dev/null @@ -1,18 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/merge/merge.test.js b/test/merge/merge.test.js deleted file mode 100644 index 2ed73d89a..000000000 --- a/test/merge/merge.test.js +++ /dev/null @@ -1,23 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/minBy/minBy.test.js b/test/minBy/minBy.test.js deleted file mode 100644 index f2a0ca5ff..000000000 --- a/test/minBy/minBy.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/minN/minN.test.js b/test/minN/minN.test.js deleted file mode 100644 index edfd36631..000000000 --- a/test/minN/minN.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/mostPerformant/mostPerformant.test.js b/test/mostPerformant/mostPerformant.test.js deleted file mode 100644 index 95a560f91..000000000 --- a/test/mostPerformant/mostPerformant.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/negate/negate.test.js b/test/negate/negate.test.js deleted file mode 100644 index a356b8a2d..000000000 --- a/test/negate/negate.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/nest/nest.test.js b/test/nest/nest.test.js deleted file mode 100644 index f3b177255..000000000 --- a/test/nest/nest.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/nodeListToArray/nodeListToArray.test.js b/test/nodeListToArray/nodeListToArray.test.js deleted file mode 100644 index 12d99435c..000000000 --- a/test/nodeListToArray/nodeListToArray.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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(); -}); \ No newline at end of file diff --git a/test/none/none.test.js b/test/none/none.test.js deleted file mode 100644 index af6209d91..000000000 --- a/test/none/none.test.js +++ /dev/null @@ -1,17 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/nthArg/nthArg.test.js b/test/nthArg/nthArg.test.js deleted file mode 100644 index b8cc4b62c..000000000 --- a/test/nthArg/nthArg.test.js +++ /dev/null @@ -1,18 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/nthElement/nthElement.test.js b/test/nthElement/nthElement.test.js deleted file mode 100644 index 6db6ddd4a..000000000 --- a/test/nthElement/nthElement.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/objectFromPairs/objectFromPairs.test.js b/test/objectFromPairs/objectFromPairs.test.js deleted file mode 100644 index af270b7cf..000000000 --- a/test/objectFromPairs/objectFromPairs.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/objectToPairs/objectToPairs.test.js b/test/objectToPairs/objectToPairs.test.js deleted file mode 100644 index e3477d39b..000000000 --- a/test/objectToPairs/objectToPairs.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/observeMutations/observeMutations.test.js b/test/observeMutations/observeMutations.test.js deleted file mode 100644 index fe42861a2..000000000 --- a/test/observeMutations/observeMutations.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/off/off.test.js b/test/off/off.test.js deleted file mode 100644 index 8a3eca663..000000000 --- a/test/off/off.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/offset/offset.test.js b/test/offset/offset.test.js deleted file mode 100644 index b122f8dbb..000000000 --- a/test/offset/offset.test.js +++ /dev/null @@ -1,19 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/omit/omit.test.js b/test/omit/omit.test.js deleted file mode 100644 index 296505687..000000000 --- a/test/omit/omit.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/omitBy/omitBy.test.js b/test/omitBy/omitBy.test.js deleted file mode 100644 index cf01f902b..000000000 --- a/test/omitBy/omitBy.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/on/on.test.js b/test/on/on.test.js deleted file mode 100644 index f14e85ad0..000000000 --- a/test/on/on.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/onUserInputChange/onUserInputChange.test.js b/test/onUserInputChange/onUserInputChange.test.js deleted file mode 100644 index bbc726d63..000000000 --- a/test/onUserInputChange/onUserInputChange.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/once/once.test.js b/test/once/once.test.js deleted file mode 100644 index 89aba3872..000000000 --- a/test/once/once.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/orderBy/orderBy.test.js b/test/orderBy/orderBy.test.js deleted file mode 100644 index 2a721f61e..000000000 --- a/test/orderBy/orderBy.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/over/over.test.js b/test/over/over.test.js deleted file mode 100644 index c349f6049..000000000 --- a/test/over/over.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/overArgs/overArgs.test.js b/test/overArgs/overArgs.test.js deleted file mode 100644 index 523cf3ff2..000000000 --- a/test/overArgs/overArgs.test.js +++ /dev/null @@ -1,17 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/pad/pad.test.js b/test/pad/pad.test.js deleted file mode 100644 index 035ebf91b..000000000 --- a/test/pad/pad.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/palindrome/palindrome.test.js b/test/palindrome/palindrome.test.js deleted file mode 100644 index 2c65f5995..000000000 --- a/test/palindrome/palindrome.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/parseCookie/parseCookie.test.js b/test/parseCookie/parseCookie.test.js deleted file mode 100644 index 2c6712d21..000000000 --- a/test/parseCookie/parseCookie.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/partial/partial.test.js b/test/partial/partial.test.js deleted file mode 100644 index 4c7b32d1d..000000000 --- a/test/partial/partial.test.js +++ /dev/null @@ -1,18 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/partialRight/partialRight.test.js b/test/partialRight/partialRight.test.js deleted file mode 100644 index 75b3113b5..000000000 --- a/test/partialRight/partialRight.test.js +++ /dev/null @@ -1,18 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/partition/partition.test.js b/test/partition/partition.test.js deleted file mode 100644 index 429fae050..000000000 --- a/test/partition/partition.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/percentile/percentile.test.js b/test/percentile/percentile.test.js deleted file mode 100644 index 63cf07868..000000000 --- a/test/percentile/percentile.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/permutations/permutations.test.js b/test/permutations/permutations.test.js deleted file mode 100644 index fe9b08e46..000000000 --- a/test/permutations/permutations.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/pick/pick.test.js b/test/pick/pick.test.js deleted file mode 100644 index 61565a0a2..000000000 --- a/test/pick/pick.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/pickBy/pickBy.test.js b/test/pickBy/pickBy.test.js deleted file mode 100644 index 523ed0bdd..000000000 --- a/test/pickBy/pickBy.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/pipeAsyncFunctions/pipeAsyncFunctions.test.js b/test/pipeAsyncFunctions/pipeAsyncFunctions.test.js deleted file mode 100644 index 7a4ae346e..000000000 --- a/test/pipeAsyncFunctions/pipeAsyncFunctions.test.js +++ /dev/null @@ -1,24 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/pipeFunctions/pipeFunctions.test.js b/test/pipeFunctions/pipeFunctions.test.js deleted file mode 100644 index a9703858f..000000000 --- a/test/pipeFunctions/pipeFunctions.test.js +++ /dev/null @@ -1,17 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/pluralize/pluralize.test.js b/test/pluralize/pluralize.test.js deleted file mode 100644 index 674244ca7..000000000 --- a/test/pluralize/pluralize.test.js +++ /dev/null @@ -1,23 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/powerset/powerset.test.js b/test/powerset/powerset.test.js deleted file mode 100644 index a9bf7ba6a..000000000 --- a/test/powerset/powerset.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/prefix/prefix.test.js b/test/prefix/prefix.test.js deleted file mode 100644 index 846d951c1..000000000 --- a/test/prefix/prefix.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/prettyBytes/prettyBytes.test.js b/test/prettyBytes/prettyBytes.test.js deleted file mode 100644 index 7553e5304..000000000 --- a/test/prettyBytes/prettyBytes.test.js +++ /dev/null @@ -1,17 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/primes/primes.test.js b/test/primes/primes.test.js deleted file mode 100644 index d64602713..000000000 --- a/test/primes/primes.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/promisify/promisify.test.js b/test/promisify/promisify.test.js deleted file mode 100644 index cd313631e..000000000 --- a/test/promisify/promisify.test.js +++ /dev/null @@ -1,17 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/pull/pull.test.js b/test/pull/pull.test.js deleted file mode 100644 index 81299a3f8..000000000 --- a/test/pull/pull.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/pullAtIndex/pullAtIndex.test.js b/test/pullAtIndex/pullAtIndex.test.js deleted file mode 100644 index 7ee05dc01..000000000 --- a/test/pullAtIndex/pullAtIndex.test.js +++ /dev/null @@ -1,17 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/pullAtValue/pullAtValue.test.js b/test/pullAtValue/pullAtValue.test.js deleted file mode 100644 index 00e22c122..000000000 --- a/test/pullAtValue/pullAtValue.test.js +++ /dev/null @@ -1,17 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/pullBy/pullBy.test.js b/test/pullBy/pullBy.test.js deleted file mode 100644 index 29082d3e0..000000000 --- a/test/pullBy/pullBy.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/quickSort/quickSort.test.js b/test/quickSort/quickSort.test.js deleted file mode 100644 index 86ef548a4..000000000 --- a/test/quickSort/quickSort.test.js +++ /dev/null @@ -1,22 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/radsToDegrees/radsToDegrees.test.js b/test/radsToDegrees/radsToDegrees.test.js deleted file mode 100644 index 446485d76..000000000 --- a/test/radsToDegrees/radsToDegrees.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/randomHexColorCode/randomHexColorCode.test.js b/test/randomHexColorCode/randomHexColorCode.test.js deleted file mode 100644 index 7d9946955..000000000 --- a/test/randomHexColorCode/randomHexColorCode.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/randomIntArrayInRange/randomIntArrayInRange.test.js b/test/randomIntArrayInRange/randomIntArrayInRange.test.js deleted file mode 100644 index 093fdba64..000000000 --- a/test/randomIntArrayInRange/randomIntArrayInRange.test.js +++ /dev/null @@ -1,19 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/randomIntegerInRange/randomIntegerInRange.test.js b/test/randomIntegerInRange/randomIntegerInRange.test.js deleted file mode 100644 index 41309c7e5..000000000 --- a/test/randomIntegerInRange/randomIntegerInRange.test.js +++ /dev/null @@ -1,18 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/randomNumberInRange/randomNumberInRange.test.js b/test/randomNumberInRange/randomNumberInRange.test.js deleted file mode 100644 index 15359481d..000000000 --- a/test/randomNumberInRange/randomNumberInRange.test.js +++ /dev/null @@ -1,18 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/readFileLines/readFileLines.test.js b/test/readFileLines/readFileLines.test.js deleted file mode 100644 index db0658908..000000000 --- a/test/readFileLines/readFileLines.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/rearg/rearg.test.js b/test/rearg/rearg.test.js deleted file mode 100644 index 781b5c5a0..000000000 --- a/test/rearg/rearg.test.js +++ /dev/null @@ -1,20 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/recordAnimationFrames/recordAnimationFrames.test.js b/test/recordAnimationFrames/recordAnimationFrames.test.js deleted file mode 100644 index 2d366d62a..000000000 --- a/test/recordAnimationFrames/recordAnimationFrames.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/redirect/redirect.test.js b/test/redirect/redirect.test.js deleted file mode 100644 index d6dbce35d..000000000 --- a/test/redirect/redirect.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/reduceSuccessive/reduceSuccessive.test.js b/test/reduceSuccessive/reduceSuccessive.test.js deleted file mode 100644 index 411438820..000000000 --- a/test/reduceSuccessive/reduceSuccessive.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/reduceWhich/reduceWhich.test.js b/test/reduceWhich/reduceWhich.test.js deleted file mode 100644 index 7e38f36d0..000000000 --- a/test/reduceWhich/reduceWhich.test.js +++ /dev/null @@ -1,19 +0,0 @@ -const test = require('tape'); -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( - [{ 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(); -}); diff --git a/test/reducedFilter/reducedFilter.test.js b/test/reducedFilter/reducedFilter.test.js deleted file mode 100644 index db6dcdc9e..000000000 --- a/test/reducedFilter/reducedFilter.test.js +++ /dev/null @@ -1,26 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/remove/remove.test.js b/test/remove/remove.test.js deleted file mode 100644 index 64c00696c..000000000 --- a/test/remove/remove.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/removeNonASCII/removeNonASCII.test.js b/test/removeNonASCII/removeNonASCII.test.js deleted file mode 100644 index 03aedfed1..000000000 --- a/test/removeNonASCII/removeNonASCII.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/removeVowels/removeVowels.test.js b/test/removeVowels/removeVowels.test.js deleted file mode 100644 index 67a187869..000000000 --- a/test/removeVowels/removeVowels.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/reverseString/reverseString.test.js b/test/reverseString/reverseString.test.js deleted file mode 100644 index 7aeca53df..000000000 --- a/test/reverseString/reverseString.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/round/round.test.js b/test/round/round.test.js deleted file mode 100644 index 2aa705899..000000000 --- a/test/round/round.test.js +++ /dev/null @@ -1,23 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/runAsync/runAsync.test.js b/test/runAsync/runAsync.test.js deleted file mode 100644 index cbe70590b..000000000 --- a/test/runAsync/runAsync.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/runPromisesInSeries/runPromisesInSeries.test.js b/test/runPromisesInSeries/runPromisesInSeries.test.js deleted file mode 100644 index 288878bf2..000000000 --- a/test/runPromisesInSeries/runPromisesInSeries.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/sample/sample.test.js b/test/sample/sample.test.js deleted file mode 100644 index 258d58e6f..000000000 --- a/test/sample/sample.test.js +++ /dev/null @@ -1,17 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/sampleSize/sampleSize.test.js b/test/sampleSize/sampleSize.test.js deleted file mode 100644 index 6c610fa2d..000000000 --- a/test/sampleSize/sampleSize.test.js +++ /dev/null @@ -1,19 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/scrollToTop/scrollToTop.test.js b/test/scrollToTop/scrollToTop.test.js deleted file mode 100644 index 1772b8fe9..000000000 --- a/test/scrollToTop/scrollToTop.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/sdbm/sdbm.test.js b/test/sdbm/sdbm.test.js deleted file mode 100644 index 8152041bb..000000000 --- a/test/sdbm/sdbm.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/serializeCookie/serializeCookie.test.js b/test/serializeCookie/serializeCookie.test.js deleted file mode 100644 index 45db4324f..000000000 --- a/test/serializeCookie/serializeCookie.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/setStyle/setStyle.test.js b/test/setStyle/setStyle.test.js deleted file mode 100644 index 3c8e4aa94..000000000 --- a/test/setStyle/setStyle.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/shallowClone/shallowClone.test.js b/test/shallowClone/shallowClone.test.js deleted file mode 100644 index 71223569b..000000000 --- a/test/shallowClone/shallowClone.test.js +++ /dev/null @@ -1,17 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/show/show.test.js b/test/show/show.test.js deleted file mode 100644 index 859735338..000000000 --- a/test/show/show.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/shuffle/shuffle.test.js b/test/shuffle/shuffle.test.js deleted file mode 100644 index aed55ad03..000000000 --- a/test/shuffle/shuffle.test.js +++ /dev/null @@ -1,18 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/similarity/similarity.test.js b/test/similarity/similarity.test.js deleted file mode 100644 index b82022707..000000000 --- a/test/similarity/similarity.test.js +++ /dev/null @@ -1,12 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/size/size.test.js b/test/size/size.test.js deleted file mode 100644 index 5c8410b23..000000000 --- a/test/size/size.test.js +++ /dev/null @@ -1,17 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/sleep/sleep.test.js b/test/sleep/sleep.test.js deleted file mode 100644 index 57beb16e2..000000000 --- a/test/sleep/sleep.test.js +++ /dev/null @@ -1,17 +0,0 @@ -const test = require('tape'); -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'); - async function sleepyWork() { - await sleep(1000); - t.pass('Works as expected'); - } - //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 deleted file mode 100644 index e74581e2c..000000000 --- a/test/smoothScroll/smoothScroll.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/solveRPN/solveRPN.test.js b/test/solveRPN/solveRPN.test.js deleted file mode 100644 index 78cea6cdf..000000000 --- a/test/solveRPN/solveRPN.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/sortCharactersInString/sortCharactersInString.test.js b/test/sortCharactersInString/sortCharactersInString.test.js deleted file mode 100644 index 25fc97bd8..000000000 --- a/test/sortCharactersInString/sortCharactersInString.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/sortedIndex/sortedIndex.test.js b/test/sortedIndex/sortedIndex.test.js deleted file mode 100644 index c60ba058f..000000000 --- a/test/sortedIndex/sortedIndex.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/sortedIndexBy/sortedIndexBy.test.js b/test/sortedIndexBy/sortedIndexBy.test.js deleted file mode 100644 index 6f173a5b6..000000000 --- a/test/sortedIndexBy/sortedIndexBy.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/sortedLastIndex/sortedLastIndex.test.js b/test/sortedLastIndex/sortedLastIndex.test.js deleted file mode 100644 index a80ef11dc..000000000 --- a/test/sortedLastIndex/sortedLastIndex.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/sortedLastIndexBy/sortedLastIndexBy.test.js b/test/sortedLastIndexBy/sortedLastIndexBy.test.js deleted file mode 100644 index e7f19f6e9..000000000 --- a/test/sortedLastIndexBy/sortedLastIndexBy.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/speechSynthesis/speechSynthesis.test.js b/test/speechSynthesis/speechSynthesis.test.js deleted file mode 100644 index 16d2f891f..000000000 --- a/test/speechSynthesis/speechSynthesis.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/splitLines/splitLines.test.js b/test/splitLines/splitLines.test.js deleted file mode 100644 index 7d03fd581..000000000 --- a/test/splitLines/splitLines.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/spreadOver/spreadOver.test.js b/test/spreadOver/spreadOver.test.js deleted file mode 100644 index d294b4f52..000000000 --- a/test/spreadOver/spreadOver.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/standardDeviation/standardDeviation.test.js b/test/standardDeviation/standardDeviation.test.js deleted file mode 100644 index ad43efb90..000000000 --- a/test/standardDeviation/standardDeviation.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -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 diff --git a/test/stringPermutations/stringPermutations.test.js b/test/stringPermutations/stringPermutations.test.js deleted file mode 100644 index 6b5bb11ad..000000000 --- a/test/stringPermutations/stringPermutations.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const test = require('tape'); -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(); -}); diff --git a/test/stripHTMLTags/stripHTMLTags.test.js b/test/stripHTMLTags/stripHTMLTags.test.js deleted file mode 100644 index 7aad3d6fe..000000000 --- a/test/stripHTMLTags/stripHTMLTags.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -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', 'Removes HTML tags'); - //t.deepEqual(stripHTMLTags(args..), 'Expected'); - //t.equal(stripHTMLTags(args..), 'Expected'); - //t.false(stripHTMLTags(args..), 'Expected'); - //t.throws(stripHTMLTags(args..), 'Expected'); - t.end(); -}); diff --git a/test/sum/sum.test.js b/test/sum/sum.test.js deleted file mode 100644 index 7abf88f6f..000000000 --- a/test/sum/sum.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -const sum = require('./sum.js'); - -test('Testing sum', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof sum === 'function', 'sum is a Function'); - t.equal(sum(...[1, 2, 3, 4]), 10, "Returns the sum of two or more numbers/arrays."); - //t.deepEqual(sum(args..), 'Expected'); - //t.equal(sum(args..), 'Expected'); - //t.false(sum(args..), 'Expected'); - //t.throws(sum(args..), 'Expected'); - t.end(); -}); \ No newline at end of file diff --git a/test/sumBy/sumBy.test.js b/test/sumBy/sumBy.test.js deleted file mode 100644 index 7d2660dec..000000000 --- a/test/sumBy/sumBy.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -const sumBy = require('./sumBy.js'); - -test('Testing sumBy', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof sumBy === 'function', 'sumBy is a Function'); - //t.deepEqual(sumBy(args..), 'Expected'); - //t.equal(sumBy(args..), 'Expected'); - //t.false(sumBy(args..), 'Expected'); - //t.throws(sumBy(args..), 'Expected'); - t.end(); -}); \ No newline at end of file diff --git a/test/sumPower/sumPower.test.js b/test/sumPower/sumPower.test.js deleted file mode 100644 index 44cb6d64f..000000000 --- a/test/sumPower/sumPower.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const test = require('tape'); -const sumPower = require('./sumPower.js'); - -test('Testing sumPower', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof sumPower === 'function', 'sumPower is a Function'); - t.equal(sumPower(10), 385, "Returns the sum of the powers of all the numbers from start to end"); - t.equal(sumPower(10, 3), 3025, "Returns the sum of the powers of all the numbers from start to end"); - t.equal(sumPower(10, 3, 5), 2925, "Returns the sum of the powers of all the numbers from start to end"); - //t.deepEqual(sumPower(args..), 'Expected'); - //t.equal(sumPower(args..), 'Expected'); - //t.false(sumPower(args..), 'Expected'); - //t.throws(sumPower(args..), 'Expected'); - t.end(); -}); \ No newline at end of file diff --git a/test/symmetricDifference/symmetricDifference.test.js b/test/symmetricDifference/symmetricDifference.test.js deleted file mode 100644 index 1ceeba195..000000000 --- a/test/symmetricDifference/symmetricDifference.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -const symmetricDifference = require('./symmetricDifference.js'); - -test('Testing symmetricDifference', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof symmetricDifference === 'function', 'symmetricDifference is a Function'); - t.deepEqual(symmetricDifference([1, 2, 3], [1, 2, 4]), [3, 4], "Returns the symmetric difference between two arrays."); - //t.deepEqual(symmetricDifference(args..), 'Expected'); - //t.equal(symmetricDifference(args..), 'Expected'); - //t.false(symmetricDifference(args..), 'Expected'); - //t.throws(symmetricDifference(args..), 'Expected'); - t.end(); -}); \ No newline at end of file diff --git a/test/symmetricDifferenceBy/symmetricDifferenceBy.test.js b/test/symmetricDifferenceBy/symmetricDifferenceBy.test.js deleted file mode 100644 index 4b1fd4e3a..000000000 --- a/test/symmetricDifferenceBy/symmetricDifferenceBy.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -const symmetricDifferenceBy = require('./symmetricDifferenceBy.js'); - -test('Testing symmetricDifferenceBy', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof symmetricDifferenceBy === 'function', 'symmetricDifferenceBy is a Function'); - t.deepEqual(symmetricDifferenceBy([2.1, 1.2], [2.3, 3.4], Math.floor), [ 1.2, 3.4 ], 'Returns the symmetric difference between two arrays, after applying the provided function to each array element of both'); - //t.deepEqual(symmetricDifferenceBy(args..), 'Expected'); - //t.equal(symmetricDifferenceBy(args..), 'Expected'); - //t.false(symmetricDifferenceBy(args..), 'Expected'); - //t.throws(symmetricDifferenceBy(args..), 'Expected'); - t.end(); -}); diff --git a/test/symmetricDifferenceWith/symmetricDifferenceWith.test.js b/test/symmetricDifferenceWith/symmetricDifferenceWith.test.js deleted file mode 100644 index 12267272d..000000000 --- a/test/symmetricDifferenceWith/symmetricDifferenceWith.test.js +++ /dev/null @@ -1,18 +0,0 @@ -const test = require('tape'); -const symmetricDifferenceWith = require('./symmetricDifferenceWith.js'); - -test('Testing symmetricDifferenceWith', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof symmetricDifferenceWith === 'function', 'symmetricDifferenceWith is a Function'); - t.deepEqual(symmetricDifferenceWith( - [1, 1.2, 1.5, 3, 0], - [1.9, 3, 0, 3.9], - (a, b) => Math.round(a) === Math.round(b) -), [1, 1.2, 3.9], 'Returns the symmetric difference between two arrays, using a provided function as a comparator'); - //t.deepEqual(symmetricDifferenceWith(args..), 'Expected'); - //t.equal(symmetricDifferenceWith(args..), 'Expected'); - //t.false(symmetricDifferenceWith(args..), 'Expected'); - //t.throws(symmetricDifferenceWith(args..), 'Expected'); - t.end(); -}); diff --git a/test/tail/tail.test.js b/test/tail/tail.test.js deleted file mode 100644 index 6eb499139..000000000 --- a/test/tail/tail.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -const tail = require('./tail.js'); - -test('Testing tail', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof tail === 'function', 'tail is a Function'); - t.deepEqual(tail([1, 2, 3]), [2, 3], "Returns tail"); - t.deepEqual(tail([1]), [1], "Returns tail"); - //t.deepEqual(tail(args..), 'Expected'); - //t.equal(tail(args..), 'Expected'); - //t.false(tail(args..), 'Expected'); - //t.throws(tail(args..), 'Expected'); - t.end(); -}); \ No newline at end of file diff --git a/test/take/take.test.js b/test/take/take.test.js deleted file mode 100644 index 030024725..000000000 --- a/test/take/take.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -const take = require('./take.js'); - -test('Testing take', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof take === 'function', 'take is a Function'); - t.deepEqual(take([1, 2, 3], 5), [1, 2, 3], "Returns an array with n elements removed from the beginning."); - t.deepEqual(take([1, 2, 3], 0), [], "Returns an array with n elements removed from the beginning."); - //t.deepEqual(take(args..), 'Expected'); - //t.equal(take(args..), 'Expected'); - //t.false(take(args..), 'Expected'); - //t.throws(take(args..), 'Expected'); - t.end(); -}); diff --git a/test/takeRight/takeRight.test.js b/test/takeRight/takeRight.test.js deleted file mode 100644 index a7625862b..000000000 --- a/test/takeRight/takeRight.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -const takeRight = require('./takeRight.js'); - -test('Testing takeRight', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof takeRight === 'function', 'takeRight is a Function'); - t.deepEqual(takeRight([1, 2, 3], 2), [2, 3], "Returns an array with n elements removed from the end"); - t.deepEqual(takeRight([1, 2, 3]), [3], "Returns an array with n elements removed from the end"); - //t.deepEqual(takeRight(args..), 'Expected'); - //t.equal(takeRight(args..), 'Expected'); - //t.false(takeRight(args..), 'Expected'); - //t.throws(takeRight(args..), 'Expected'); - t.end(); -}); \ No newline at end of file diff --git a/test/takeRightWhile/takeRightWhile.test.js b/test/takeRightWhile/takeRightWhile.test.js deleted file mode 100644 index c841d410d..000000000 --- a/test/takeRightWhile/takeRightWhile.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -const takeRightWhile = require('./takeRightWhile.js'); - -test('Testing takeRightWhile', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof takeRightWhile === 'function', 'takeRightWhile is a Function'); - t.deepEqual(takeRightWhile([1, 2, 3, 4], n => n < 3), [3, 4], 'Removes elements until the function returns true'); - //t.deepEqual(takeRightWhile(args..), 'Expected'); - //t.equal(takeRightWhile(args..), 'Expected'); - //t.false(takeRightWhile(args..), 'Expected'); - //t.throws(takeRightWhile(args..), 'Expected'); - t.end(); -}); diff --git a/test/takeWhile/takeWhile.test.js b/test/takeWhile/takeWhile.test.js deleted file mode 100644 index 09f5d5cb7..000000000 --- a/test/takeWhile/takeWhile.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -const takeWhile = require('./takeWhile.js'); - -test('Testing takeWhile', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof takeWhile === 'function', 'takeWhile is a Function'); - t.deepEqual(takeWhile([1, 2, 3, 4], n => n >= 3), [1, 2], 'Removes elements until the function returns true'); - //t.deepEqual(takeWhile(args..), 'Expected'); - //t.equal(takeWhile(args..), 'Expected'); - //t.false(takeWhile(args..), 'Expected'); - //t.throws(takeWhile(args..), 'Expected'); - t.end(); -}); diff --git a/test/testlog b/test/testlog deleted file mode 100644 index 790dd2119..000000000 --- a/test/testlog +++ /dev/null @@ -1,2054 +0,0 @@ -Test log for: Sun Jun 17 2018 21:26:15 GMT+0000 (Coordinated Universal Time) - -> 30-seconds-of-code@0.0.3 test /home/travis/build/Chalarangelo/30-seconds-of-code -> tape test/**/*.test.js | tap-spec - - - Testing JSONToDate - - ✔ JSONToDate is a Function - - Testing JSONToFile - - ✔ JSONToFile is a Function - ✔ Tested on 09/02/2018 by @chalarangelo - - Testing RGBToHex - - ✔ RGBToHex is a Function - ✔ Converts the values of RGB components to a color code. - - Testing URLJoin - - ✔ URLJoin is a Function - ✔ Returns proper URL - ✔ Returns proper URL - - Testing UUIDGeneratorBrowser - - ✔ UUIDGeneratorBrowser is a Function - ✔ Tested 09/02/2018 by @chalarangelo - - Testing UUIDGeneratorNode - - ✔ UUIDGeneratorNode is a Function - ✔ Contains dashes in the proper places - ✔ Only contains hexadecimal digits - - Testing all - - ✔ all is a Function - ✔ Returns true for arrays with no falsey values - ✔ Returns false for arrays with 0 - ✔ Returns false for arrays with NaN - ✔ Returns false for arrays with undefined - ✔ Returns false for arrays with null - ✔ Returns false for arrays with empty strings - ✔ Returns true with predicate function - ✔ Returns false with a predicate function - - Testing any - - ✔ any is a Function - ✔ Returns true for arrays with at least one truthy value - ✔ Returns false for arrays with no truthy values - ✔ Returns false for arrays with no truthy values - ✔ Returns true with predicate function - ✔ Returns false with a predicate function - - Testing approximatelyEqual - - ✔ approximatelyEqual is a Function - ✔ Works for PI / 2 - ✔ Works for 0.1 + 0.2 === 0.3 - ✔ Works for exactly equal values - ✔ Works for a custom epsilon - - Testing arrayToHtmlList - - ✔ arrayToHtmlList is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing ary - - ✔ ary is a Function - ✔ Discards arguments with index >=n - - Testing atob - - ✔ atob is a Function - ✔ atob("Zm9vYmFy") equals "foobar" - ✔ atob("Z") returns "" - - Testing attempt - - ✔ attempt is a Function - ✔ Returns a value - ✔ Returns an error - - Testing average - - ✔ average is a Function - ✔ average(true) returns 0 - ✔ average(false) returns 1 - ✔ average(9, 1) returns 5 - ✔ average(153, 44, 55, 64, 71, 1122, 322774, 2232, 23423, 234, 3631) returns 32163.909090909092 - ✔ average(1, 2, 3) returns 2 - ✔ average(null) returns 0 - ✔ average(1, 2, 3) returns NaN - ✔ average(String) returns NaN - ✔ average({ a: 123}) returns NaN - ✔ average([undefined, 0, string]) returns NaN - ✔ average([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run - - Testing averageBy - - ✔ averageBy is a Function - ✔ Produces the right result with a function - ✔ Produces the right result with a property name - - Testing bifurcate - - ✔ bifurcate is a Function - ✔ Splits the collection into two groups - - Testing bifurcateBy - - ✔ bifurcateBy is a Function - ✔ Splits the collection into two groups - - Testing binarySearch - - ✔ binarySearch is a Function - ✔ Finds item in array - ✔ Returns -1 when not found - ✔ Works with empty arrays - ✔ Works for one element arrays - - Testing bind - - ✔ bind is a Function - ✔ Binds to an object context - - Testing bindAll - - ✔ bindAll is a Function - ✔ Binds to an object context - - Testing bindKey - - ✔ bindKey is a Function - ✔ Binds function to an object context - - Testing binomialCoefficient - - ✔ binomialCoefficient is a Function - ✔ Returns the appropriate value - ✔ Returns the appropriate value - ✔ Returns the appropriate value - ✔ Returns NaN - ✔ Returns NaN - - Testing bottomVisible - - ✔ bottomVisible is a Function - ✔ Tested on 09/02/2018 by @chalarangelo - - Testing btoa - - ✔ btoa is a Function - ✔ btoa("foobar") equals "Zm9vYmFy" - - Testing byteSize - - ✔ byteSize is a Function - ✔ Works for a single letter - ✔ Works for a common string - ✔ Works for emoji - - Testing call - - ✔ call is a Function - ✔ Calls function on given object - - Testing capitalize - - ✔ capitalize is a Function - ✔ Capitalizes the first letter of a string - ✔ Capitalizes the first letter of a string - ✔ Works with characters - ✔ Works with single character words - - Testing capitalizeEveryWord - - ✔ capitalizeEveryWord is a Function - ✔ Capitalizes the first letter of every word in a string - ✔ Works with characters - ✔ Works with one word string - - Testing castArray - - ✔ castArray is a Function - ✔ Works for single values - ✔ Works for arrays with one value - ✔ Works for arrays with multiple value - ✔ Works for strings - ✔ Works for objects - - Testing chainAsync - - ✔ chainAsync is a Function - ✔ Calls all functions in an array - - Testing chunk - - ✔ chunk is a Function - ✔ chunk([1, 2, 3, 4, 5], 2) returns [[1,2],[3,4],[5]] - ✔ chunk([]) returns [] - ✔ chunk(123) returns [] - ✔ chunk({ a: 123}) returns [] - ✔ chunk(string, 2) returns [ st, ri, ng ] - ✔ chunk() throws an error - ✔ chunk(undefined) throws an error - ✔ chunk(null) throws an error - ✔ chunk(This is a string, 2) takes less than 2s to run - - Testing clampNumber - - ✔ clampNumber is a Function - ✔ Clamps num within the inclusive range specified by the boundary values a and b - - Testing cleanObj - - ✔ cleanObj is a Function - ✔ Removes any properties except the ones specified from a JSON object - - Testing cloneRegExp - - ✔ cloneRegExp is a Function - ✔ Clones regular expressions properly - - Testing coalesce - - ✔ coalesce is a Function - ✔ Returns the first non-null/undefined argument - - Testing coalesceFactory - - ✔ coalesceFactory is a Function - ✔ Returns a customized coalesce function - - Testing collatz - - ✔ collatz is a Function - ✔ When n is even, divide by 2 - ✔ When n is odd, times by 3 and add 1 - ✔ Eventually reaches 1 - - Testing collectInto - - ✔ collectInto is a Function - - Testing colorize - - ✔ colorize is a Function - ✔ Tested on 09/02/2018 by @chalarangelo - - Testing compact - - ✔ compact is a Function - ✔ Removes falsey values from an array - - Testing compose - - ✔ compose is a Function - ✔ Performs right-to-left function composition - - Testing composeRight - - ✔ composeRight is a Function - ✔ Performs left-to-right function composition - - Testing converge - - ✔ converge is a Function - ✔ Produces the average of the array - ✔ Produces the strange concatenation - - Testing copyToClipboard - - ✔ copyToClipboard is a Function - ✔ Tested on 09/02/2018 by @chalarangelo - - Testing countBy - - ✔ countBy is a Function - ✔ Works for functions - ✔ Works for property names - - Testing countOccurrences - - ✔ countOccurrences is a Function - ✔ Counts the occurrences of a value in an array - - Testing countVowels - - ✔ countVowels is a Function - - Testing counter - - ✔ counter is a Function - - Testing createElement - - ✔ createElement is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing createEventHub - - ✔ createEventHub is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing currentURL - - ✔ currentURL is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing curry - - ✔ curry is a Function - ✔ curries a Math.pow - ✔ curries a Math.min - - Testing debounce - - ✔ debounce is a Function - - Testing decapitalize - - ✔ decapitalize is a Function - ✔ Works with default parameter - ✔ Works with second parameter set to true - - Testing deepClone - - ✔ deepClone is a Function - ✔ Shallow cloning works - ✔ Deep cloning works - ✔ Array shallow cloning works - ✔ Array deep cloning works - - Testing deepFlatten - - ✔ deepFlatten is a Function - ✔ Deep flattens an array - - Testing defaults - - ✔ defaults is a Function - ✔ Assigns default values for undefined properties - - Testing defer - - ✔ defer is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing degreesToRads - - ✔ degreesToRads is a Function - ✔ Returns the appropriate value - - Testing delay - - ✔ delay is a Function - - Testing detectDeviceType - - ✔ detectDeviceType is a Function - ✔ Tested on 09/02/2018 by @chalarangelo - - Testing difference - - ✔ difference is a Function - ✔ Returns the difference between two arrays - - Testing differenceBy - - ✔ differenceBy is a Function - ✔ Works using a native function and numbers - ✔ Works with arrow function and objects - - Testing differenceWith - - ✔ differenceWith is a Function - ✔ Filters out all values from an array - - Testing digitize - - ✔ digitize is a Function - ✔ Converts a number to an array of digits - - Testing distance - - ✔ distance is a Function - ✔ Calculates the distance between two points - - Testing drop - - ✔ drop is a Function - ✔ Works without the last argument - ✔ Removes appropriate element count as specified - ✔ Empties array given a count greater than length - - Testing dropRight - - ✔ dropRight is a Function - ✔ Returns a new array with n elements removed from the right - ✔ Returns a new array with n elements removed from the right - ✔ Returns a new array with n elements removed from the right - - Testing dropRightWhile - - ✔ dropRightWhile is a Function - ✔ Removes elements from the end of an array until the passed function returns true. - - Testing dropWhile - - ✔ dropWhile is a Function - ✔ Removes elements in an array until the passed function returns true. - - Testing elementIsVisibleInViewport - - ✔ elementIsVisibleInViewport is a Function - ✔ Tested on 09/02/2018 by @chalarangelo - - Testing elo - - ✔ elo is a Function - ✔ Standard 1v1s - ✔ should be equivalent - ✔ 4 player FFA, all same rank - - Testing equals - - ✔ equals is a Function - ✔ { a: [2, {e: 3}], b: [4], c: 'foo' } is equal to { a: [2, {e: 3}], b: [4], c: 'foo' } - ✔ [1,2,3] is equal to [1,2,3] - ✔ { a: [2, 3], b: [4] } is not equal to { a: [2, 3], b: [6] } - ✔ [1,2,3] is not equal to [1,2,4] - ✔ [1, 2, 3] should be equal to { 0: 1, 1: 2, 2: 3 }) - type is different, but their enumerable properties match. - - Testing escapeHTML - - ✔ escapeHTML is a Function - ✔ Escapes a string for use in HTML - - Testing escapeRegExp - - ✔ escapeRegExp is a Function - ✔ Escapes a string to use in a regular expression - - Testing everyNth - - ✔ everyNth is a Function - ✔ Returns every nth element in an array - - Testing extendHex - - ✔ extendHex is a Function - ✔ Extends a 3-digit color code to a 6-digit color code - ✔ Extends a 3-digit color code to a 6-digit color code - - Testing factorial - - ✔ factorial is a Function - ✔ Calculates the factorial of 720 - ✔ Calculates the factorial of 0 - ✔ Calculates the factorial of 1 - ✔ Calculates the factorial of 4 - ✔ Calculates the factorial of 10 - - Testing factors - - ✔ factors is a Function - - Testing fibonacci - - ✔ fibonacci is a Function - ✔ Generates an array, containing the Fibonacci sequence - - Testing fibonacciCountUntilNum - - ✔ fibonacciCountUntilNum is a Function - - Testing fibonacciUntilNum - - ✔ fibonacciUntilNum is a Function - - Testing filterNonUnique - - ✔ filterNonUnique is a Function - ✔ Filters out the non-unique values in an array - - Testing findKey - - ✔ findKey is a Function - ✔ Returns the appropriate key - - Testing findLast - - ✔ findLast is a Function - ✔ Finds last element for which the given function returns true - - Testing findLastIndex - - ✔ findLastIndex is a Function - ✔ Finds last index for which the given function returns true - - Testing findLastKey - - ✔ findLastKey is a Function - ✔ Returns the appropriate key - - Testing flatten - - ✔ flatten is a Function - ✔ Flattens an array - ✔ Flattens an array - - Testing flattenObject - - ✔ flattenObject is a Function - ✔ Flattens an object with the paths for keys - ✔ Works with arrays - - Testing flip - - ✔ flip is a Function - ✔ Flips argument order - - Testing forEachRight - - ✔ forEachRight is a Function - ✔ Iterates over the array in reverse - - Testing forOwn - - ✔ forOwn is a Function - ✔ Iterates over an element's key-value pairs - - Testing forOwnRight - - ✔ forOwnRight is a Function - ✔ Iterates over an element's key-value pairs in reverse - - Testing formatDuration - - ✔ formatDuration is a Function - ✔ Returns the human readable format of the given number of milliseconds - ✔ Returns the human readable format of the given number of milliseconds - - Testing fromCamelCase - - ✔ fromCamelCase is a Function - ✔ Converts a string from camelcase - ✔ Converts a string from camelcase - ✔ Converts a string from camelcase - - Testing functionName - - ✔ functionName is a Function - ✔ Works for native functions - ✔ Works for functions - ✔ Works for arrow functions - - Testing functions - - ✔ functions is a Function - ✔ Returns own methods - ✔ Returns own and inherited methods - - Testing gcd - - ✔ gcd is a Function - ✔ Calculates the greatest common divisor between two or more numbers/arrays - ✔ Calculates the greatest common divisor between two or more numbers/arrays - - Testing geometricProgression - - ✔ geometricProgression is a Function - ✔ Initializes an array containing the numbers in the specified range - ✔ Initializes an array containing the numbers in the specified range - ✔ Initializes an array containing the numbers in the specified range - - Testing get - - ✔ get is a Function - ✔ Retrieve a property indicated by the selector from an object. - - Testing getColonTimeFromDate - - ✔ getColonTimeFromDate is a Function - - Testing getDaysDiffBetweenDates - - ✔ getDaysDiffBetweenDates is a Function - ✔ Returns the difference in days between two dates - - Testing getMeridiemSuffixOfInteger - - ✔ getMeridiemSuffixOfInteger is a Function - - Testing getScrollPosition - - ✔ getScrollPosition is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing getStyle - - ✔ getStyle is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing getType - - ✔ getType is a Function - ✔ Returns the native type of a value - - Testing getURLParameters - - ✔ getURLParameters is a Function - ✔ Returns an object containing the parameters of the current URL - - Testing groupBy - - ✔ groupBy is a Function - ✔ Groups the elements of an array based on the given function - ✔ Groups the elements of an array based on the given function - - Testing hammingDistance - - ✔ hammingDistance is a Function - ✔ retuns hamming disance between 2 values - - Testing hasClass - - ✔ hasClass is a Function - - Testing hasFlags - - ✔ hasFlags is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing hashBrowser - - ✔ hashBrowser is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing hashNode - - ✔ hashNode is a Function - - Testing head - - ✔ head is a Function - ✔ head({ a: 1234}) returns undefined - ✔ head([1, 2, 3]) returns 1 - ✔ head({ 0: false}) returns false - ✔ head(String) returns S - ✔ head(null) throws an Error - ✔ head(undefined) throws an Error - ✔ head() throws an Error - ✔ head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run - - Testing hexToRGB - - ✔ hexToRGB is a Function - ✔ Converts a color code to a rgb() or rgba() string - ✔ Converts a color code to a rgb() or rgba() string - ✔ Converts a color code to a rgb() or rgba() string - - Testing hide - - ✔ hide is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing howManyTimes - - ✔ howManyTimes is a Function - - Testing httpDelete - - ✔ httpDelete is a Function - - Testing httpGet - - ✔ httpGet is a Function - - Testing httpPost - - ✔ httpPost is a Function - - Testing httpPut - - ✔ httpPut is a Function - - Testing httpsRedirect - - ✔ httpsRedirect is a Function - ✔ Tested on 09/02/2018 by @chalarangelo - - Testing hz - - ✔ hz is a Function - - Testing inRange - - ✔ inRange is a Function - ✔ The given number falls within the given range - ✔ The given number falls within the given range - ✔ The given number does not falls within the given range - ✔ The given number does not falls within the given range - - Testing indexOfAll - - ✔ indexOfAll is a Function - ✔ Returns all indices of val in an array - ✔ Returns all indices of val in an array - - Testing initial - - ✔ initial is a Function - ✔ Returns all the elements of an array except the last one - - Testing initialize2DArray - - ✔ initialize2DArray is a Function - ✔ Initializes a 2D array of given width and height and value - - Testing initializeArrayWithRange - - ✔ initializeArrayWithRange is a Function - ✔ Initializes an array containing the numbers in the specified range - - Testing initializeArrayWithRangeRight - - ✔ initializeArrayWithRangeRight is a Function - - Testing initializeArrayWithValues - - ✔ initializeArrayWithValues is a Function - ✔ Initializes and fills an array with the specified values - - Testing initializeNDArray - - ✔ initializeNDArray is a Function - - Testing intersection - - ✔ intersection is a Function - ✔ Returns a list of elements that exist in both arrays - - Testing intersectionBy - - ✔ intersectionBy is a Function - ✔ Returns a list of elements that exist in both arrays, after applying the provided function to each array element of both - - Testing intersectionWith - - ✔ intersectionWith is a Function - ✔ Returns a list of elements that exist in both arrays, using a provided comparator function - - Testing invertKeyValues - - ✔ invertKeyValues is a Function - ✔ invertKeyValues({ a: 1, b: 2, c: 1 }) returns { 1: [ 'a', 'c' ], 2: [ 'b' ] } - ✔ invertKeyValues({ a: 1, b: 2, c: 1 }, value => 'group' + value) returns { group1: [ 'a', 'c' ], group2: [ 'b' ] } - - Testing is - - ✔ is is a Function - ✔ Works for arrays with data - ✔ Works for empty arrays - ✔ Works for arrays, not objects - ✔ Works for objects - ✔ Works for maps - ✔ Works for regular expressions - ✔ Works for sets - ✔ Works for weak maps - ✔ Works for weak sets - ✔ Works for strings - returns true for primitive - ✔ Works for strings - returns true when using constructor - ✔ Works for numbers - returns true for primitive - ✔ Works for numbers - returns true when using constructor - ✔ Works for booleans - returns true for primitive - ✔ Works for booleans - returns true when using constructor - ✔ Works for functions - - Testing isAbsoluteURL - - ✔ isAbsoluteURL is a Function - ✔ Given string is an absolute URL - ✔ Given string is an absolute URL - ✔ Given string is not an absolute URL - - Testing isAnagram - - ✔ isAnagram is a Function - ✔ Checks valid anagram - ✔ Works with spaces - ✔ Ignores case - ✔ Ignores special characters - - Testing isArmstrongNumber - - ✔ isArmstrongNumber is a Function - - Testing isArray - - ✔ isArray is a Function - ✔ passed value is an array - ✔ passed value is not an array - - Testing isArrayBuffer - - ✔ isArrayBuffer is a Function - - Testing isArrayLike - - ✔ isArrayLike is a Function - ✔ Returns true for a string - ✔ Returns true for an array - ✔ Returns false for null - - Testing isBoolean - - ✔ isBoolean is a Function - ✔ passed value is not a boolean - ✔ passed value is not a boolean - - Testing isBrowser - - ✔ isBrowser is a Function - - Testing isBrowserTabFocused - - ✔ isBrowserTabFocused is a Function - - Testing isDivisible - - ✔ isDivisible is a Function - ✔ The number 6 is divisible by 3 - - Testing isEmpty - - ✔ isEmpty is a Function - ✔ Returns true for empty Map - ✔ Returns true for empty Set - ✔ Returns true for empty array - ✔ Returns true for empty object - ✔ Returns true for empty string - ✔ Returns false for non-empty array - ✔ Returns false for non-empty object - ✔ Returns false for non-empty string - ✔ Returns true - type is not considered a collection - ✔ Returns true - type is not considered a collection - - Testing isEven - - ✔ isEven is a Function - ✔ 4 is even number - ✔ undefined - - Testing isFunction - - ✔ isFunction is a Function - ✔ passed value is a function - ✔ passed value is not a function - - Testing isLowerCase - - ✔ isLowerCase is a Function - ✔ passed string is a lowercase - ✔ passed string is a lowercase - ✔ passed value is not a lowercase - - Testing isMap - - ✔ isMap is a Function - - Testing isNil - - ✔ isNil is a Function - ✔ Returns true for null - ✔ Returns true for undefined - ✔ Returns false for an empty string - - Testing isNull - - ✔ isNull is a Function - ✔ passed argument is a null - ✔ passed argument is a null - - Testing isNumber - - ✔ isNumber is a Function - ✔ passed argument is a number - ✔ passed argument is not a number - - Testing isObject - - ✔ isObject is a Function - ✔ isObject([1, 2, 3, 4]) is a object - ✔ isObject([]) is a object - ✔ isObject({ a:1 }) is a object - ✔ isObject(true) is not a object - - Testing isObjectLike - - ✔ isObjectLike is a Function - ✔ Returns true for an object - ✔ Returns true for an array - ✔ Returns false for a function - ✔ Returns false for null - - Testing isPlainObject - - ✔ isPlainObject is a Function - ✔ Returns true for a plain object - ✔ Returns false for a Map (example of non-plain object) - - Testing isPrime - - ✔ isPrime is a Function - ✔ passed number is a prime - - Testing isPrimitive - - ✔ isPrimitive is a Function - ✔ isPrimitive(null) is primitive - ✔ isPrimitive(undefined) is primitive - ✔ isPrimitive(string) is primitive - ✔ isPrimitive(true) is primitive - ✔ isPrimitive(50) is primitive - ✔ isPrimitive('Hello') is primitive - ✔ isPrimitive(false) is primitive - ✔ isPrimitive(Symbol()) is primitive - ✔ isPrimitive([1, 2, 3]) is not primitive - ✔ isPrimitive({ a: 123 }) is not primitive - ✔ isPrimitive({ a: 123 }) takes less than 2s to run - - Testing isPromiseLike - - ✔ isPromiseLike is a Function - ✔ Returns true for a promise-like object - ✔ Returns false for null - ✔ Returns false for an empty object - - Testing isRegExp - - ✔ isRegExp is a Function - - Testing isSet - - ✔ isSet is a Function - - Testing isSimilar - - ✔ isSimilar is a Function - - Testing isSorted - - ✔ isSorted is a Function - ✔ Array is sorted in ascending order - ✔ Array is sorted in ascending order - ✔ Array is sorted in ascending order - ✔ Array is sorted in ascending order - ✔ Array is sorted in descending order - ✔ Array is sorted in descending order - ✔ Array is sorted in descending order - ✔ Array is sorted in descending order - ✔ Array is empty - ✔ Array is not sorted, direction changed in array - ✔ Array is not sorted, direction changed in array - - Testing isString - - ✔ isString is a Function - ✔ foo is a string - ✔ "10" is a string - ✔ Empty string is a string - ✔ 10 is not a string - ✔ true is not string - - Testing isSymbol - - ✔ isSymbol is a Function - ✔ Checks if the given argument is a symbol - - Testing isTravisCI - - ✔ isTravisCI is a Function - ✔ Running on Travis, correctly evaluates - - Testing isTypedArray - - ✔ isTypedArray is a Function - - Testing isUndefined - - ✔ isUndefined is a Function - ✔ Returns true for undefined - - Testing isUpperCase - - ✔ isUpperCase is a Function - ✔ ABC is all upper case - ✔ abc is not all upper case - ✔ A3@$ is all uppercase - - Testing isValidJSON - - ✔ isValidJSON is a Function - ✔ {"name":"Adam","age":20} is a valid JSON - ✔ {"name":"Adam",age:"20"} is not a valid JSON - ✔ null is a valid JSON - - Testing isWeakMap - - ✔ isWeakMap is a Function - - Testing isWeakSet - - ✔ isWeakSet is a Function - - Testing join - - ✔ join is a Function - ✔ Joins all elements of an array into a string and returns this string - ✔ Joins all elements of an array into a string and returns this string - ✔ Joins all elements of an array into a string and returns this string - - Testing last - - ✔ last is a Function - ✔ last({ a: 1234}) returns undefined - ✔ last([1, 2, 3]) returns 3 - ✔ last({ 0: false}) returns undefined - ✔ last(String) returns g - ✔ last(null) throws an Error - ✔ last(undefined) throws an Error - ✔ last() throws an Error - ✔ last([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run - - Testing lcm - - ✔ lcm is a Function - ✔ Returns the least common multiple of two or more numbers. - ✔ Returns the least common multiple of two or more numbers. - - Testing levenshteinDistance - - ✔ levenshteinDistance is a Function - - Testing longestItem - - ✔ longestItem is a Function - ✔ Returns the longest object - - Testing lowercaseKeys - - ✔ lowercaseKeys is a Function - ✔ Lowercases object keys - ✔ Does not mutate original object - - Testing luhnCheck - - ✔ luhnCheck is a Function - ✔ validates identification number - ✔ validates identification number - ✔ validates identification number - - Testing mapKeys - - ✔ mapKeys is a Function - ✔ Maps keys - - Testing mapObject - - ✔ mapObject is a Function - ✔ mapObject([1, 2, 3], a => a * a) returns { 1: 1, 2: 4, 3: 9 } - ✔ mapObject([1, 2, 3, 4], (a, b) => b - a) returns { 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 } - - Testing mapValues - - ✔ mapValues is a Function - ✔ Maps values - - Testing mask - - ✔ mask is a Function - ✔ Replaces all but the last num of characters with the specified mask character - ✔ Replaces all but the last num of characters with the specified mask character - ✔ Replaces all but the last num of characters with the specified mask character - - Testing matches - - ✔ matches is a Function - ✔ Matches returns true for two similar objects - ✔ Matches returns false for two non-similar objects - - Testing matchesWith - - ✔ matchesWith is a Function - ✔ Returns true for two objects with similar values, based on the provided function - - Testing maxBy - - ✔ maxBy is a Function - ✔ Produces the right result with a function - ✔ Produces the right result with a property name - - Testing maxN - - ✔ maxN is a Function - ✔ Returns the n maximum elements from the provided array - ✔ Returns the n maximum elements from the provided array - - Testing median - - ✔ median is a Function - ✔ Returns the median of an array of numbers - ✔ Returns the median of an array of numbers - - Testing memoize - - ✔ memoize is a Function - ✔ Function works properly - ✔ Function works properly - ✔ Cache stores values - - Testing merge - - ✔ merge is a Function - ✔ Merges two objects - - Testing minBy - - ✔ minBy is a Function - ✔ Produces the right result with a function - ✔ Produces the right result with a property name - - Testing minN - - ✔ minN is a Function - ✔ Returns the n minimum elements from the provided array - ✔ Returns the n minimum elements from the provided array - - Testing mostPerformant - - ✔ mostPerformant is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing negate - - ✔ negate is a Function - ✔ Negates a predicate function - - Testing nest - - ✔ nest is a Function - - Testing nodeListToArray - - ✔ nodeListToArray is a Function - - Testing none - - ✔ none is a Function - ✔ Returns true for arrays with no truthy values - ✔ Returns false for arrays with at least one truthy value - ✔ Returns true with a predicate function - ✔ Returns false with predicate function - - Testing nthArg - - ✔ nthArg is a Function - ✔ Returns the nth argument - ✔ Returns undefined if arguments too few - ✔ Works for negative values - - Testing nthElement - - ✔ nthElement is a Function - ✔ Returns the nth element of an array. - ✔ Returns the nth element of an array. - - Testing objectFromPairs - - ✔ objectFromPairs is a Function - ✔ Creates an object from the given key-value pairs. - - Testing objectToPairs - - ✔ objectToPairs is a Function - ✔ Creates an array of key-value pair arrays from an object. - - Testing observeMutations - - ✔ observeMutations is a Function - ✔ Tested on 09/02/2018 by @chalarangelo - - Testing off - - ✔ off is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing offset - - ✔ offset is a Function - ✔ Offset of 0 returns the same array. - ✔ Offset > 0 returns the offsetted array. - ✔ Offset < 0 returns the reverse offsetted array. - ✔ Offset greater than the length of the array returns the same array. - ✔ Offset less than the negative length of the array returns the same array. - ✔ Offsetting empty array returns an empty array. - - Testing omit - - ✔ omit is a Function - ✔ Omits the key-value pairs corresponding to the given keys from an object - - Testing omitBy - - ✔ omitBy is a Function - ✔ Creates an object composed of the properties the given function returns falsey for - - Testing on - - ✔ on is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing onUserInputChange - - ✔ onUserInputChange is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing once - - ✔ once is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing orderBy - - ✔ orderBy is a Function - ✔ Returns a sorted array of objects ordered by properties and orders. - ✔ Returns a sorted array of objects ordered by properties and orders. - - Testing over - - ✔ over is a Function - ✔ Applies given functions over multiple arguments - - Testing overArgs - - ✔ overArgs is a Function - ✔ Invokes the provided function with its arguments transformed - - Testing pad - - ✔ pad is a Function - ✔ cat is padded on both sides - ✔ length of string is 8 - ✔ pads 42 with "0" - ✔ does not truncates if string exceeds length - - Testing palindrome - - ✔ palindrome is a Function - ✔ Given string is a palindrome - ✔ Given string is not a palindrome - - Testing parseCookie - - ✔ parseCookie is a Function - ✔ Parses the cookie - - Testing partial - - ✔ partial is a Function - ✔ Prepends arguments - - Testing partialRight - - ✔ partialRight is a Function - ✔ Appends arguments - - Testing partition - - ✔ partition is a Function - ✔ Groups the elements into two arrays, depending on the provided function's truthiness for each element. - - Testing percentile - - ✔ percentile is a Function - ✔ Uses the percentile formula to calculate how many numbers in the given array are less or equal to the given value. - - Testing permutations - - ✔ permutations is a Function - ✔ Generates all permutations of an array - - Testing pick - - ✔ pick is a Function - ✔ Picks the key-value pairs corresponding to the given keys from an object. - - Testing pickBy - - ✔ pickBy is a Function - ✔ Creates an object composed of the properties the given function returns truthy for. - - Testing pipeAsyncFunctions - - ✔ pipeAsyncFunctions is a Function - ✔ Produces the appropriate hash - ✔ pipeAsyncFunctions result should be 15 - - Testing pipeFunctions - - ✔ pipeFunctions is a Function - ✔ Performs left-to-right function composition - - Testing pluralize - - ✔ pluralize is a Function - ✔ Produces the plural of the word - ✔ Produces the singular of the word - ✔ Produces the plural of the word - ✔ Prodices the defined plural of the word - ✔ Works with a dictionary - - Testing powerset - - ✔ powerset is a Function - ✔ Returns the powerset of a given array of numbers. - - Testing prefix - - ✔ prefix is a Function - - Testing prettyBytes - - ✔ prettyBytes is a Function - ✔ Converts a number in bytes to a human-readable string. - ✔ Converts a number in bytes to a human-readable string. - ✔ Converts a number in bytes to a human-readable string. - - Testing primes - - ✔ primes is a Function - ✔ Generates primes up to a given number, using the Sieve of Eratosthenes. - - Testing promisify - - ✔ promisify is a Function - ✔ Returns a promise - - Testing pull - - ✔ pull is a Function - ✔ Pulls the specified values - - Testing pullAtIndex - - ✔ pullAtIndex is a Function - ✔ Pulls the given values - ✔ Pulls the given values - - Testing pullAtValue - - ✔ pullAtValue is a Function - ✔ Pulls the specified values - ✔ Pulls the specified values - - Testing pullBy - - ✔ pullBy is a Function - ✔ Pulls the specified values - - Testing quickSort - - ✔ quickSort is a Function - ✔ quickSort([5, 6, 4, 3, 1, 2]) returns [1, 2, 3, 4, 5, 6] - ✔ quickSort([-1, 0, -2]) returns [-2, -1, 0] - ✔ quickSort() throws an error - ✔ quickSort(123) throws an error - ✔ quickSort({ 234: string}) throws an error - ✔ quickSort(null) throws an error - ✔ quickSort(undefined) throws an error - ✔ quickSort([11, 1, 324, 23232, -1, 53, 2, 524, 32, 13, 156, 133, 62, 12, 4]) takes less than 2s to run - - Testing radsToDegrees - - ✔ radsToDegrees is a Function - ✔ Returns the appropriate value - - Testing randomHexColorCode - - ✔ randomHexColorCode is a Function - ✔ should be equal - ✔ The color code starts with "#" - ✔ The color code contains only valid hex-digits - - Testing randomIntArrayInRange - - ✔ randomIntArrayInRange is a Function - ✔ The returned array contains only integers - ✔ The returned array has the proper length - ✔ The returned array's values lie between provided lowerLimit and upperLimit (both inclusive). - - Testing randomIntegerInRange - - ✔ randomIntegerInRange is a Function - ✔ The returned value is an integer - ✔ The returned value lies between provided lowerLimit and upperLimit (both inclusive). - - Testing randomNumberInRange - - ✔ randomNumberInRange is a Function - ✔ The returned value is a number - ✔ The returned value lies between provided lowerLimit and upperLimit (both inclusive). - - Testing readFileLines - - ✔ readFileLines is a Function - ✔ Tested on 09/02/2018 by @chalarangelo - - Testing rearg - - ✔ rearg is a Function - ✔ Reorders arguments in invoked function - - Testing recordAnimationFrames - - ✔ recordAnimationFrames is a Function - - Testing redirect - - ✔ redirect is a Function - ✔ Tested on 09/02/2018 by @chalarangelo - - Testing reduceSuccessive - - ✔ reduceSuccessive is a Function - ✔ Returns the array of successively reduced values - - Testing reduceWhich - - ✔ reduceWhich is a Function - ✔ Returns the minimum of an array - ✔ Returns the maximum of an array - ✔ Returns the object with the minimum specified value in an array - - Testing reducedFilter - - ✔ reducedFilter is a Function - ✔ Filter an array of objects based on a condition while also filtering out unspecified keys. - - Testing reject - - ✔ reject is a Function - ✔ should be equivalent - ✔ should be equivalent - - Testing remove - - ✔ remove is a Function - ✔ Removes elements from an array for which the given function returns false - - Testing removeNonASCII - - ✔ removeNonASCII is a Function - ✔ Removes non-ASCII characters - - Testing removeVowels - - ✔ removeVowels is a Function - - Testing renameKeys - - ✔ renameKeys is a Function - ✔ should be equivalent - - Testing reverseString - - ✔ reverseString is a Function - ✔ Reverses a string. - - Testing round - - ✔ round is a Function - ✔ round(1.005, 2) returns 1.01 - ✔ round(123.3423345345345345344, 11) returns 123.34233453453 - ✔ round(3.342, 11) returns 3.342 - ✔ round(1.005) returns 1 - ✔ round([1.005, 2]) returns NaN - ✔ round(string) returns NaN - ✔ round() returns NaN - ✔ round(132, 413, 4134) returns NaN - ✔ round({a: 132}, 413) returns NaN - ✔ round(123.3423345345345345344, 11) takes less than 2s to run - - Testing runAsync - - ✔ runAsync is a Function - ✔ Tested on 09/02/2018 by @chalarangelo - - Testing runPromisesInSeries - - ✔ runPromisesInSeries is a Function - - Testing sample - - ✔ sample is a Function - ✔ Returns a random element from the array - ✔ Works for single-element arrays - ✔ Returns undefined for empty array - - Testing sampleSize - - ✔ sampleSize is a Function - ✔ Returns a single element without n specified - ✔ Returns a random sample of specified size from an array - ✔ Returns all elements in an array if n >= length - ✔ Returns an empty array if original array is empty - ✔ Returns an empty array if n = 0 - - Testing scrollToTop - - ✔ scrollToTop is a Function - ✔ Tested on 09/02/2018 by @chalarangelo - - Testing sdbm - - ✔ sdbm is a Function - ✔ Hashes the input string into a whole number. - - Testing serializeCookie - - ✔ serializeCookie is a Function - ✔ Serializes the cookie - - Testing setStyle - - ✔ setStyle is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing shallowClone - - ✔ shallowClone is a Function - ✔ Shallow cloning works - ✔ Does not clone deeply - - Testing show - - ✔ show is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing shuffle - - ✔ shuffle is a Function - ✔ Shuffles the array - ✔ New array contains all original elements - ✔ Works for empty arrays - ✔ Works for single-element arrays - - Testing similarity - - ✔ similarity is a Function - ✔ Returns an array of elements that appear in both arrays. - - Testing size - - ✔ size is a Function - ✔ Get size of arrays, objects or strings. - ✔ Get size of arrays, objects or strings. - - Testing sleep - - ✔ sleep is a Function - - Testing smoothScroll - - ✔ smoothScroll is a Function - - Testing solveRPN - - ✔ solveRPN is a Function - - Testing sortCharactersInString - - ✔ sortCharactersInString is a Function - ✔ Alphabetically sorts the characters in a string. - - Testing sortedIndex - - ✔ sortedIndex is a Function - ✔ Returns the lowest index at which value should be inserted into array in order to maintain its sort order. - ✔ Returns the lowest index at which value should be inserted into array in order to maintain its sort order. - - Testing sortedIndexBy - - ✔ sortedIndexBy is a Function - ✔ Returns the lowest index to insert the element without messing up the list order - - Testing sortedLastIndex - - ✔ sortedLastIndex is a Function - ✔ Returns the highest index to insert the element without messing up the list order - - Testing sortedLastIndexBy - - ✔ sortedLastIndexBy is a Function - ✔ Returns the highest index to insert the element without messing up the list order - - Testing speechSynthesis - - ✔ speechSynthesis is a Function - - Testing splitLines - - ✔ splitLines is a Function - ✔ Splits a multiline string into an array of lines. - - Testing spreadOver - - ✔ spreadOver is a Function - ✔ Takes a variadic function and returns a closure that accepts an array of arguments to map to the inputs of the function. - - Testing stableSort - - ✔ stableSort is a Function - ✔ Array is properly sorted - - Testing standardDeviation - - ✔ standardDeviation is a Function - ✔ Returns the standard deviation of an array of numbers - ✔ Returns the standard deviation of an array of numbers - - Testing stringPermutations - - ✔ stringPermutations is a Function - ✔ Generates all stringPermutations of a string - ✔ Works for single-letter strings - ✔ Works for empty strings - - Testing stripHTMLTags - - ✔ stripHTMLTags is a Function - ✔ Removes HTML tags - - Testing sum - - ✔ sum is a Function - ✔ Returns the sum of two or more numbers/arrays. - - Testing sumBy - - ✔ sumBy is a Function - - Testing sumPower - - ✔ sumPower is a Function - ✔ Returns the sum of the powers of all the numbers from start to end - ✔ Returns the sum of the powers of all the numbers from start to end - ✔ Returns the sum of the powers of all the numbers from start to end - - Testing symmetricDifference - - ✔ symmetricDifference is a Function - ✔ Returns the symmetric difference between two arrays. - - Testing symmetricDifferenceBy - - ✔ symmetricDifferenceBy is a Function - ✔ Returns the symmetric difference between two arrays, after applying the provided function to each array element of both - - Testing symmetricDifferenceWith - - ✔ symmetricDifferenceWith is a Function - ✔ Returns the symmetric difference between two arrays, using a provided function as a comparator - - Testing tail - - ✔ tail is a Function - ✔ Returns tail - ✔ Returns tail - - Testing take - - ✔ take is a Function - ✔ Returns an array with n elements removed from the beginning. - ✔ Returns an array with n elements removed from the beginning. - - Testing takeRight - - ✔ takeRight is a Function - ✔ Returns an array with n elements removed from the end - ✔ Returns an array with n elements removed from the end - - Testing takeRightWhile - - ✔ takeRightWhile is a Function - ✔ Removes elements until the function returns true - - Testing takeWhile - - ✔ takeWhile is a Function - ✔ Removes elements until the function returns true - - Testing throttle - - ✔ throttle is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing timeTaken - - ✔ timeTaken is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing times - - ✔ times is a Function - ✔ Runs a function the specified amount of times - - Testing toCamelCase - - ✔ toCamelCase is a Function - ✔ toCamelCase('some_database_field_name') returns someDatabaseFieldName - ✔ toCamelCase('Some label that needs to be camelized') returns someLabelThatNeedsToBeCamelized - ✔ toCamelCase('some-javascript-property') return someJavascriptProperty - ✔ toCamelCase('some-mixed_string with spaces_underscores-and-hyphens') returns someMixedStringWithSpacesUnderscoresAndHyphens - ✔ toCamelCase() throws a error - ✔ toCamelCase([]) throws a error - ✔ toCamelCase({}) throws a error - ✔ toCamelCase(123) throws a error - ✔ toCamelCase(some-mixed_string with spaces_underscores-and-hyphens) takes less than 2s to run - - Testing toCurrency - - ✔ toCurrency is a Function - - ✖ currency: Euro | currencyLangFormat: Local - --------------------------------------------- - operator: equal - expected: '€ 123,456.79' - actual: '€123,456.79' - at: Test.test (/home/travis/build/Chalarangelo/30-seconds-of-code/test/toCurrency/toCurrency.test.js:8:5) - stack: |- - - ✔ currency: US Dollar | currencyLangFormat: English (United States) - - ✖ currency: Japanese Yen | currencyLangFormat: Local - ----------------------------------------------------- - operator: equal - expected: 'JP¥ 322,342,436,423' - actual: '¥322,342,436,423' - at: Test.test (/home/travis/build/Chalarangelo/30-seconds-of-code/test/toCurrency/toCurrency.test.js:11:5) - stack: |- - - - Testing toDecimalMark - - ✔ toDecimalMark is a Function - ✔ convert a float-point arithmetic to the Decimal mark form - - Testing toHash - - ✔ toHash is a Function - - Testing toKebabCase - - ✔ toKebabCase is a Function - ✔ toKebabCase('camelCase') returns camel-case - ✔ toKebabCase('some text') returns some-text - ✔ toKebabCase('some-mixed-string With spaces-underscores-and-hyphens') returns some-mixed-string-with-spaces-underscores-and-hyphens - ✔ toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html - ✔ toKebabCase() return undefined - ✔ toKebabCase([]) throws an error - ✔ toKebabCase({}) throws an error - ✔ toKebabCase(123) throws an error - ✔ toKebabCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run - - Testing toOrdinalSuffix - - ✔ toOrdinalSuffix is a Function - ✔ Adds an ordinal suffix to a number - ✔ Adds an ordinal suffix to a number - ✔ Adds an ordinal suffix to a number - ✔ Adds an ordinal suffix to a number - - Testing toSafeInteger - - ✔ toSafeInteger is a Function - ✔ Number(toSafeInteger(3.2)) is a number - ✔ Converts a value to a safe integer - ✔ toSafeInteger('4.2') returns 4 - ✔ toSafeInteger(4.6) returns 5 - ✔ toSafeInteger([]) returns 0 - ✔ isNaN(toSafeInteger([1.5, 3124])) is true - ✔ isNaN(toSafeInteger('string')) is true - ✔ isNaN(toSafeInteger({})) is true - ✔ isNaN(toSafeInteger()) is true - ✔ toSafeInteger(Infinity) returns 9007199254740991 - ✔ toSafeInteger(3.2) takes less than 2s to run - - Testing toSnakeCase - - ✔ toSnakeCase is a Function - ✔ toSnakeCase('camelCase') returns camel_case - ✔ toSnakeCase('some text') returns some_text - ✔ toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens') returns some_mixed_string_with_spaces_underscores_and_hyphens - ✔ toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html - ✔ toSnakeCase() returns undefined - ✔ toSnakeCase([]) throws an error - ✔ toSnakeCase({}) throws an error - ✔ toSnakeCase(123) throws an error - ✔ toSnakeCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run - - Testing toggleClass - - ✔ toggleClass is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing tomorrow - - ✔ tomorrow is a Function - ✔ Returns the correct year - ✔ Returns the correct month - ✔ Returns the correct date - - Testing transform - - ✔ transform is a Function - ✔ Transforms an object - - Testing truncateString - - ✔ truncateString is a Function - ✔ Truncates a "boomerang" up to a specified length. - - Testing truthCheckCollection - - ✔ truthCheckCollection is a Function - ✔ second argument is truthy on all elements of a collection - - Testing unary - - ✔ unary is a Function - ✔ Discards arguments after the first one - - Testing uncurry - - ✔ uncurry is a Function - ✔ Works without a provided value for n - ✔ Works without n = 2 - ✔ Works withoutn = 3 - - Testing unescapeHTML - - ✔ unescapeHTML is a Function - ✔ Unescapes escaped HTML characters. - - Testing unflattenObject - - ✔ unflattenObject is a Function - ✔ Unflattens an object with the paths for keys - - Testing unfold - - ✔ unfold is a Function - ✔ Works with a given function, producing an array - - Testing union - - ✔ union is a Function - ✔ union([1, 2, 3], [4, 3, 2]) returns [1, 2, 3, 4] - ✔ union('str', 'asd') returns [ 's', 't', 'r', 'a', 'd' ] - ✔ union([[], {}], [1, 2, 3]) returns [[], {}, 1, 2, 3] - ✔ union([], []) returns [] - ✔ union() throws an error - ✔ union(true, str) throws an error - ✔ union(false, true) throws an error - ✔ union(123, {}) throws an error - ✔ union([], {}) throws an error - ✔ union(undefined, null) throws an error - ✔ union([1, 2, 3], [4, 3, 2]) takes less than 2s to run - - Testing unionBy - - ✔ unionBy is a Function - ✔ Produces the appropriate results - - Testing unionWith - - ✔ unionWith is a Function - ✔ Produces the appropriate results - - Testing uniqueElements - - ✔ uniqueElements is a Function - ✔ uniqueElements([1, 2, 2, 3, 4, 4, 5]) returns [1,2,3,4,5] - ✔ uniqueElements([1, 23, 53]) returns [1, 23, 53] - ✔ uniqueElements([true, 0, 1, false, false, undefined, null, '']) returns [true, 0, 1, false, false, undefined, null, ''] - ✔ uniqueElements() returns [] - ✔ uniqueElements(null) returns [] - ✔ uniqueElements(undefined) returns [] - ✔ uniqueElements('strt') returns ['s', 't', 'r'] - ✔ uniqueElements(1, 1, 2543, 534, 5) throws an error - ✔ uniqueElements({}) throws an error - ✔ uniqueElements(true) throws an error - ✔ uniqueElements(false) throws an error - ✔ uniqueElements([true, 0, 1, false, false, undefined, null]) takes less than 2s to run - - Testing untildify - - ✔ untildify is a Function - ✔ Contains no tildes - ✔ Does not alter the rest of the path - ✔ Does not alter paths without tildes - - Testing unzip - - ✔ unzip is a Function - ✔ unzip([['a', 1, true], ['b', 2, false]]) equals [['a', 'b'], [1, 2], [true, false]] - ✔ unzip([['a', 1, true], ['b', 2]]) equals [['a', 'b'], [1, 2], [true]] - - Testing unzipWith - - ✔ unzipWith is a Function - ✔ unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)) equals [3, 30, 300] - - Testing validateNumber - - ✔ validateNumber is a Function - ✔ validateNumber(9) returns true - ✔ validateNumber(234asd.slice(0, 2)) returns true - ✔ validateNumber(1232) returns true - ✔ validateNumber(1232 + 13423) returns true - ✔ validateNumber(1232 * 2342 * 123) returns true - ✔ validateNumber(1232.23423536) returns true - ✔ validateNumber(234asd) returns false - ✔ validateNumber(e234d) returns false - ✔ validateNumber(false) returns false - ✔ validateNumber(true) returns false - ✔ validateNumber(null) returns false - ✔ validateNumber(123 * asd) returns false - - Testing when - - ✔ when is a Function - ✔ should be truthy - ✔ should be truthy - - Testing without - - ✔ without is a Function - ✔ without([2, 1, 2, 3], 1, 2) returns [3] - ✔ without([]) returns [] - ✔ without([3, 1, true, '3', true], '3', true) returns [3, 1] - ✔ without('string'.split(''), 's', 't', 'g') returns ['r', 'i', 'n'] - ✔ without() throws an error - ✔ without(null) throws an error - ✔ without(undefined) throws an error - ✔ without() throws an error - ✔ without({}) throws an error - - Testing words - - ✔ words is a Function - ✔ words('I love javaScript!!') returns [I, love, javaScript] - ✔ words('python, javaScript & coffee') returns [python, javaScript, coffee] - ✔ words(I love javaScript!!) returns an array - ✔ words() throws a error - ✔ words(null) throws a error - ✔ words(undefined) throws a error - ✔ words({}) throws a error - ✔ words([]) throws a error - ✔ words(1234) throws a error - - Testing xProd - - ✔ xProd is a Function - ✔ xProd([1, 2], ['a', 'b']) returns [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']] - - Testing yesNo - - ✔ yesNo is a Function - ✔ yesNo(Y) returns true - ✔ yesNo(yes) returns true - ✔ yesNo(foo, true) returns true - ✔ yesNo(No) returns false - ✔ yesNo() returns false - ✔ yesNo(null) returns false - ✔ yesNo(undefined) returns false - ✔ yesNo([123, null]) returns false - ✔ yesNo([Yes, No]) returns false - ✔ yesNo({ 2: Yes }) returns false - ✔ yesNo([Yes, No], true) returns true - ✔ yesNo({ 2: Yes }, true) returns true - - Testing zip - - ✔ zip is a Function - ✔ zip([a, b], [1, 2], [true, false]) returns [[a, 1, true], [b, 2, false]] - ✔ zip([a], [1, 2], [true, false]) returns [[a, 1, true], [undefined, 2, false]] - ✔ zip([]) returns [] - ✔ zip(123) returns [] - ✔ zip([a, b], [1, 2], [true, false]) returns an Array - ✔ zip([a], [1, 2], [true, false]) returns an Array - ✔ zip(null) throws an error - ✔ zip(undefined) throws an error - - Testing zipObject - - ✔ zipObject is a Function - ✔ zipObject([a, b, c], [1, 2]) returns {a: 1, b: 2, c: undefined} - ✔ zipObject([a, b], [1, 2, 3]) returns {a: 1, b: 2} - ✔ zipObject([a, b, c], string) returns { a: s, b: t, c: r } - ✔ zipObject([a], string) returns { a: s } - ✔ zipObject() throws an error - ✔ zipObject([string], null) throws an error - ✔ zipObject(null, [1]) throws an error - ✔ zipObject(string) throws an error - ✔ zipObject(test, string) throws an error - - Testing zipWith - - ✔ zipWith is a Function - ✔ Sends a GET request - ✔ Sends a POST request - ✔ Runs the function provided - ✔ Runs promises in series - ✔ Works as expecting, passing arguments properly - ✔ Works with multiple promises - - - - Failed Tests: There were 2 failures - - Testing toCurrency - - ✖ currency: Euro | currencyLangFormat: Local - ✖ currency: Japanese Yen | currencyLangFormat: Local - - - total: 1022 - passing: 1020 - failing: 2 - duration: 2.4s - - -undefined \ No newline at end of file diff --git a/test/throttle/throttle.test.js b/test/throttle/throttle.test.js deleted file mode 100644 index fcd88a603..000000000 --- a/test/throttle/throttle.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -const throttle = require('./throttle.js'); - -test('Testing throttle', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof throttle === 'function', 'throttle is a Function'); - t.pass('Tested by @chalarangelo on 16/02/2018'); - //t.deepEqual(throttle(args..), 'Expected'); - //t.equal(throttle(args..), 'Expected'); - //t.false(throttle(args..), 'Expected'); - //t.throws(throttle(args..), 'Expected'); - t.end(); -}); diff --git a/test/timeTaken/timeTaken.test.js b/test/timeTaken/timeTaken.test.js deleted file mode 100644 index fd72e9d13..000000000 --- a/test/timeTaken/timeTaken.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -const timeTaken = require('./timeTaken.js'); - -test('Testing timeTaken', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof timeTaken === 'function', 'timeTaken is a Function'); - t.pass('Tested by @chalarangelo on 16/02/2018'); - //t.deepEqual(timeTaken(args..), 'Expected'); - //t.equal(timeTaken(args..), 'Expected'); - //t.false(timeTaken(args..), 'Expected'); - //t.throws(timeTaken(args..), 'Expected'); - t.end(); -}); diff --git a/test/times/times.test.js b/test/times/times.test.js deleted file mode 100644 index dcf2d7e28..000000000 --- a/test/times/times.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const test = require('tape'); -const times = require('./times.js'); - -test('Testing times', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof times === 'function', 'times is a Function'); - var output = ''; - times(5, i => (output += i)); - t.equals(output, '01234', 'Runs a function the specified amount of times'); - //t.deepEqual(times(args..), 'Expected'); - //t.equal(times(args..), 'Expected'); - //t.false(times(args..), 'Expected'); - //t.throws(times(args..), 'Expected'); - t.end(); -}); diff --git a/test/toCamelCase/toCamelCase.test.js b/test/toCamelCase/toCamelCase.test.js deleted file mode 100644 index 0f3efc557..000000000 --- a/test/toCamelCase/toCamelCase.test.js +++ /dev/null @@ -1,22 +0,0 @@ -const test = require('tape'); -const toCamelCase = require('./toCamelCase.js'); - -test('Testing toCamelCase', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof toCamelCase === 'function', 'toCamelCase is a Function'); - t.equal(toCamelCase('some_database_field_name'), 'someDatabaseFieldName', "toCamelCase('some_database_field_name') returns someDatabaseFieldName"); - t.equal(toCamelCase('Some label that needs to be camelized'), 'someLabelThatNeedsToBeCamelized', "toCamelCase('Some label that needs to be camelized') returns someLabelThatNeedsToBeCamelized"); - t.equal(toCamelCase('some-javascript-property'), 'someJavascriptProperty', "toCamelCase('some-javascript-property') return someJavascriptProperty"); - t.equal(toCamelCase('some-mixed_string with spaces_underscores-and-hyphens'), 'someMixedStringWithSpacesUnderscoresAndHyphens', "toCamelCase('some-mixed_string with spaces_underscores-and-hyphens') returns someMixedStringWithSpacesUnderscoresAndHyphens"); - t.throws(() => toCamelCase(), 'toCamelCase() throws a error'); - t.throws(() => toCamelCase([]), 'toCamelCase([]) throws a error'); - t.throws(() => toCamelCase({}), 'toCamelCase({}) throws a error'); - t.throws(() => toCamelCase(123), 'toCamelCase(123) throws a error'); - - let start = new Date().getTime(); - toCamelCase('some-mixed_string with spaces_underscores-and-hyphens'); - let end = new Date().getTime(); - t.true((end - start) < 2000, 'toCamelCase(some-mixed_string with spaces_underscores-and-hyphens) takes less than 2s to run'); - t.end(); -}); diff --git a/test/toCurrency/toCurrency.test.js b/test/toCurrency/toCurrency.test.js deleted file mode 100644 index 16423c0c1..000000000 --- a/test/toCurrency/toCurrency.test.js +++ /dev/null @@ -1,18 +0,0 @@ -const test = require('tape'); -const toCurrency = require('./toCurrency.js'); - -test('Testing toCurrency', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof toCurrency === 'function', 'toCurrency is a Function'); - t.equal(toCurrency(123456.789, 'EUR'), '€ 123,456.79', 'currency: Euro | currencyLangFormat: Local'); - t.equal(toCurrency(123456.789, 'USD', 'en-us'), '$123,456.79', ' currency: US Dollar | currencyLangFormat: English (United States)'); - //t.equal(toCurrency(123456.789, 'USD', 'fa'), '۱۲۳٬۴۵۶٫۷۹ ؜$', 'currency: US Dollar | currencyLangFormat: Farsi'); - These break in node - t.equal(toCurrency(322342436423.2435, 'JPY'), 'JP¥ 322,342,436,423', 'currency: Japanese Yen | currencyLangFormat: Local'); - //t.equal(toCurrency(322342436423.2435, 'JPY', 'fi'), '322 342 436 423 ¥', 'currency: Japanese Yen | currencyLangFormat: Finnish'); - These break in node - //t.deepEqual(toCurrency(args..), 'Expected'); - //t.equal(toCurrency(args..), 'Expected'); - //t.false(toCurrency(args..), 'Expected'); - //t.throws(toCurrency(args..), 'Expected'); - t.end(); -}); diff --git a/test/toDecimalMark/toDecimalMark.test.js b/test/toDecimalMark/toDecimalMark.test.js deleted file mode 100644 index 0da36d864..000000000 --- a/test/toDecimalMark/toDecimalMark.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -const toDecimalMark = require('./toDecimalMark.js'); - -test('Testing toDecimalMark', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof toDecimalMark === 'function', 'toDecimalMark is a Function'); - t.equal(toDecimalMark(12305030388.9087), "12,305,030,388.909", "convert a float-point arithmetic to the Decimal mark form"); - //t.deepEqual(toDecimalMark(args..), 'Expected'); - //t.equal(toDecimalMark(args..), 'Expected'); - //t.false(toDecimalMark(args..), 'Expected'); - //t.throws(toDecimalMark(args..), 'Expected'); - t.end(); -}); \ No newline at end of file diff --git a/test/toHash/toHash.test.js b/test/toHash/toHash.test.js deleted file mode 100644 index a7c2e931f..000000000 --- a/test/toHash/toHash.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -const toHash = require('./toHash.js'); - -test('Testing toHash', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof toHash === 'function', 'toHash is a Function'); - //t.deepEqual(toHash(args..), 'Expected'); - //t.equal(toHash(args..), 'Expected'); - //t.false(toHash(args..), 'Expected'); - //t.throws(toHash(args..), 'Expected'); - t.end(); -}); \ No newline at end of file diff --git a/test/toKebabCase/toKebabCase.test.js b/test/toKebabCase/toKebabCase.test.js deleted file mode 100644 index ab360940d..000000000 --- a/test/toKebabCase/toKebabCase.test.js +++ /dev/null @@ -1,22 +0,0 @@ -const test = require('tape'); -const toKebabCase = require('./toKebabCase.js'); - -test('Testing toKebabCase', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof toKebabCase === 'function', 'toKebabCase is a Function'); - t.equal(toKebabCase('camelCase'), 'camel-case', "toKebabCase('camelCase') returns camel-case"); - t.equal(toKebabCase('some text'), 'some-text', "toKebabCase('some text') returns some-text"); - t.equal(toKebabCase('some-mixed-string With spaces-underscores-and-hyphens'), 'some-mixed-string-with-spaces-underscores-and-hyphens', "toKebabCase('some-mixed-string With spaces-underscores-and-hyphens') returns some-mixed-string-with-spaces-underscores-and-hyphens"); - t.equal(toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML'), 'i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html', "toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html"); - t.equal(toKebabCase(), undefined, 'toKebabCase() return undefined'); - t.throws(() => toKebabCase([]), 'toKebabCase([]) throws an error'); - t.throws(() => toKebabCase({}), 'toKebabCase({}) throws an error'); - t.throws(() => toKebabCase(123), 'toKebabCase(123) throws an error'); - - let start = new Date().getTime(); - toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML'); - let end = new Date().getTime(); - t.true((end - start) < 2000, 'toKebabCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run'); - t.end(); -}); diff --git a/test/toOrdinalSuffix/toOrdinalSuffix.test.js b/test/toOrdinalSuffix/toOrdinalSuffix.test.js deleted file mode 100644 index a58c7cf64..000000000 --- a/test/toOrdinalSuffix/toOrdinalSuffix.test.js +++ /dev/null @@ -1,18 +0,0 @@ -const test = require('tape'); -const toOrdinalSuffix = require('./toOrdinalSuffix.js'); - -test('Testing toOrdinalSuffix', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof toOrdinalSuffix === 'function', 'toOrdinalSuffix is a Function'); - t.equal(toOrdinalSuffix('123'), '123rd', 'Adds an ordinal suffix to a number'); - t.equal(toOrdinalSuffix(5), '5th', 'Adds an ordinal suffix to a number'); - t.equal(toOrdinalSuffix(1), '1st', 'Adds an ordinal suffix to a number'); - t.equal(toOrdinalSuffix(0), '0th', 'Adds an ordinal suffix to a number'); - // t.equal(toOrdinalSuffix(), ,); - //t.deepEqual(toOrdinalSuffix(args..), 'Expected'); - //t.equal(toOrdinalSuffix(args..), 'Expected'); - //t.false(toOrdinalSuffix(args..), 'Expected'); - //t.throws(toOrdinalSuffix(args..), 'Expected'); - t.end(); -}); \ No newline at end of file diff --git a/test/toSafeInteger/toSafeInteger.test.js b/test/toSafeInteger/toSafeInteger.test.js deleted file mode 100644 index 885f6e324..000000000 --- a/test/toSafeInteger/toSafeInteger.test.js +++ /dev/null @@ -1,24 +0,0 @@ -const test = require('tape'); -const toSafeInteger = require('./toSafeInteger.js'); - -test('Testing toSafeInteger', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof toSafeInteger === 'function', 'toSafeInteger is a Function'); - t.true(Number(toSafeInteger(3.2)), 'Number(toSafeInteger(3.2)) is a number'); - t.equal(toSafeInteger(3.2), 3, "Converts a value to a safe integer"); - t.equal(toSafeInteger('4.2'), 4, "toSafeInteger('4.2') returns 4"); - t.equal(toSafeInteger(4.6), 5, "toSafeInteger(4.6) returns 5"); - t.equal(toSafeInteger([]), 0, "toSafeInteger([]) returns 0"); - t.true(isNaN(toSafeInteger([1.5, 3124])), "isNaN(toSafeInteger([1.5, 3124])) is true"); - t.true(isNaN(toSafeInteger('string')), "isNaN(toSafeInteger('string')) is true"); - t.true(isNaN(toSafeInteger({})), "isNaN(toSafeInteger({})) is true"); - t.true(isNaN(toSafeInteger()), "isNaN(toSafeInteger()) is true"); - t.equal(toSafeInteger(Infinity), 9007199254740991, "toSafeInteger(Infinity) returns 9007199254740991"); - - let start = new Date().getTime(); - toSafeInteger(3.2); - let end = new Date().getTime(); - t.true((end - start) < 2000, 'toSafeInteger(3.2) takes less than 2s to run'); - t.end(); -}); diff --git a/test/toSnakeCase/toSnakeCase.test.js b/test/toSnakeCase/toSnakeCase.test.js deleted file mode 100644 index 72190fda2..000000000 --- a/test/toSnakeCase/toSnakeCase.test.js +++ /dev/null @@ -1,22 +0,0 @@ -const test = require('tape'); -const toSnakeCase = require('./toSnakeCase.js'); - -test('Testing toSnakeCase', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof toSnakeCase === 'function', 'toSnakeCase is a Function'); - t.equal(toSnakeCase('camelCase'), 'camel_case', "toSnakeCase('camelCase') returns camel_case"); - t.equal(toSnakeCase('some text'), 'some_text', "toSnakeCase('some text') returns some_text"); - t.equal(toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens'), 'some_mixed_string_with_spaces_underscores_and_hyphens', "toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens') returns some_mixed_string_with_spaces_underscores_and_hyphens"); - t.equal(toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML'), 'i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html', "toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html"); - t.equal(toSnakeCase(), undefined, 'toSnakeCase() returns undefined'); - t.throws(() => toSnakeCase([]), 'toSnakeCase([]) throws an error'); - t.throws(() => toSnakeCase({}), 'toSnakeCase({}) throws an error'); - t.throws(() => toSnakeCase(123), 'toSnakeCase(123) throws an error'); - - let start = new Date().getTime(); - toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML'); - let end = new Date().getTime(); - t.true((end - start) < 2000, 'toSnakeCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run'); - t.end(); -}); diff --git a/test/toggleClass/toggleClass.test.js b/test/toggleClass/toggleClass.test.js deleted file mode 100644 index f0bbe14d6..000000000 --- a/test/toggleClass/toggleClass.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -const toggleClass = require('./toggleClass.js'); - -test('Testing toggleClass', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof toggleClass === 'function', 'toggleClass is a Function'); - t.pass('Tested by @chalarangelo on 16/02/2018'); - //t.deepEqual(toggleClass(args..), 'Expected'); - //t.equal(toggleClass(args..), 'Expected'); - //t.false(toggleClass(args..), 'Expected'); - //t.throws(toggleClass(args..), 'Expected'); - t.end(); -}); diff --git a/test/tomorrow/tomorrow.test.js b/test/tomorrow/tomorrow.test.js deleted file mode 100644 index a9f77a544..000000000 --- a/test/tomorrow/tomorrow.test.js +++ /dev/null @@ -1,18 +0,0 @@ -const test = require('tape'); -const tomorrow = require('./tomorrow.js'); - -test('Testing tomorrow', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof tomorrow === 'function', 'tomorrow is a Function'); - const t1 = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate() + 1); - const t2 = new Date(tomorrow()); - t.equal(t1.getFullYear(), t2.getFullYear(), 'Returns the correct year'); - t.equal(t1.getMonth(), t2.getMonth(), 'Returns the correct month'); - t.equal(t1.getDate(), t2.getDate(), 'Returns the correct date'); - //t.deepEqual(tomorrow(args..), 'Expected'); - //t.equal(tomorrow(args..), 'Expected'); - //t.false(tomorrow(args..), 'Expected'); - //t.throws(tomorrow(args..), 'Expected'); - t.end(); -}); diff --git a/test/transform/transform.test.js b/test/transform/transform.test.js deleted file mode 100644 index 4e3529509..000000000 --- a/test/transform/transform.test.js +++ /dev/null @@ -1,21 +0,0 @@ -const test = require('tape'); -const transform = require('./transform.js'); - -test('Testing transform', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof transform === 'function', 'transform is a Function'); - t.deepEqual(transform( - { a: 1, b: 2, c: 1 }, - (r, v, k) => { - (r[v] || (r[v] = [])).push(k); - return r; - }, - {} -), { '1': ['a', 'c'], '2': ['b'] }, 'Transforms an object'); - //t.deepEqual(transform(args..), 'Expected'); - //t.equal(transform(args..), 'Expected'); - //t.false(transform(args..), 'Expected'); - //t.throws(transform(args..), 'Expected'); - t.end(); -}); diff --git a/test/truncateString/truncateString.test.js b/test/truncateString/truncateString.test.js deleted file mode 100644 index 8022f5a6c..000000000 --- a/test/truncateString/truncateString.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -const truncateString = require('./truncateString.js'); - -test('Testing truncateString', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof truncateString === 'function', 'truncateString is a Function'); - t.equal(truncateString('boomerang', 7), 'boom...', 'Truncates a "boomerang" up to a specified length.'); - //t.equal(truncateString(args..), 'Expected'); - //t.false(truncateString(args..), 'Expected'); - //t.throws(truncateString(args..), 'Expected'); - t.end(); -}); \ No newline at end of file diff --git a/test/truthCheckCollection/truthCheckCollection.test.js b/test/truthCheckCollection/truthCheckCollection.test.js deleted file mode 100644 index a844c925b..000000000 --- a/test/truthCheckCollection/truthCheckCollection.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -const truthCheckCollection = require('./truthCheckCollection.js'); - -test('Testing truthCheckCollection', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof truthCheckCollection === 'function', 'truthCheckCollection is a Function'); - t.equal(truthCheckCollection([{ user: 'Tinky-Winky', sex: 'male' }, { user: 'Dipsy', sex: 'male' }], 'sex'), true, "second argument is truthy on all elements of a collection"); - //t.deepEqual(truthCheckCollection(args..), 'Expected'); - //t.equal(truthCheckCollection(args..), 'Expected'); - //t.false(truthCheckCollection(args..), 'Expected'); - //t.throws(truthCheckCollection(args..), 'Expected'); - t.end(); -}); \ No newline at end of file diff --git a/test/unary/unary.test.js b/test/unary/unary.test.js deleted file mode 100644 index 4ea62e7a1..000000000 --- a/test/unary/unary.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -const unary = require('./unary.js'); - -test('Testing unary', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof unary === 'function', 'unary is a Function'); - t.deepEqual(['6', '8', '10'].map(unary(parseInt)), [6, 8, 10], 'Discards arguments after the first one'); - //t.deepEqual(unary(args..), 'Expected'); - //t.equal(unary(args..), 'Expected'); - //t.false(unary(args..), 'Expected'); - //t.throws(unary(args..), 'Expected'); - t.end(); -}); diff --git a/test/uncurry/uncurry.test.js b/test/uncurry/uncurry.test.js deleted file mode 100644 index 76ef507fa..000000000 --- a/test/uncurry/uncurry.test.js +++ /dev/null @@ -1,20 +0,0 @@ -const test = require('tape'); -const uncurry = require('./uncurry.js'); - -test('Testing uncurry', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof uncurry === 'function', 'uncurry is a Function'); - const add = x => y => z => x + y + z; - const add1 = uncurry(add); - const add2 = uncurry(add, 2); - const add3 = uncurry(add, 3); - t.equal(add1(1)(2)(3), 6, 'Works without a provided value for n'); - t.equal(add2(1,2)(3), 6, 'Works without n = 2'); - t.equal(add3(1,2,3), 6, 'Works withoutn = 3'); - //t.deepEqual(uncurry(args..), 'Expected'); - //t.equal(uncurry(args..), 'Expected'); - //t.false(uncurry(args..), 'Expected'); - //t.throws(uncurry(args..), 'Expected'); - t.end(); -}); diff --git a/test/unescapeHTML/unescapeHTML.test.js b/test/unescapeHTML/unescapeHTML.test.js deleted file mode 100644 index 460a20106..000000000 --- a/test/unescapeHTML/unescapeHTML.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -const unescapeHTML = require('./unescapeHTML.js'); - -test('Testing unescapeHTML', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof unescapeHTML === 'function', 'unescapeHTML is a Function'); - t.equal(unescapeHTML('<a href="#">Me & you</a>'), 'Me & you', 'Unescapes escaped HTML characters.'); - //t.deepEqual(unescapeHTML(args..), 'Expected'); - //t.equal(unescapeHTML(args..), 'Expected'); - //t.false(unescapeHTML(args..), 'Expected'); - //t.throws(unescapeHTML(args..), 'Expected'); - t.end(); -}); \ No newline at end of file diff --git a/test/unflattenObject/unflattenObject.test.js b/test/unflattenObject/unflattenObject.test.js deleted file mode 100644 index 05ac15d70..000000000 --- a/test/unflattenObject/unflattenObject.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -const unflattenObject = require('./unflattenObject.js'); - -test('Testing unflattenObject', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof unflattenObject === 'function', 'unflattenObject is a Function'); - t.deepEqual(unflattenObject({ 'a.b.c': 1, d: 1 }), { a: { b: { c: 1 } }, d: 1 }, 'Unflattens an object with the paths for keys'); - //t.deepEqual(unflattenObject(args..), 'Expected'); - //t.equal(unflattenObject(args..), 'Expected'); - //t.false(unflattenObject(args..), 'Expected'); - //t.throws(unflattenObject(args..), 'Expected'); - t.end(); -}); diff --git a/test/unfold/unfold.test.js b/test/unfold/unfold.test.js deleted file mode 100644 index bf14e7290..000000000 --- a/test/unfold/unfold.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -const unfold = require('./unfold.js'); - -test('Testing unfold', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof unfold === 'function', 'unfold is a Function'); - var f = n => (n > 50 ? false : [-n, n + 10]); - t.deepEqual(unfold(f, 10), [-10, -20, -30, -40, -50], 'Works with a given function, producing an array'); - //t.deepEqual(unfold(args..), 'Expected'); - //t.equal(unfold(args..), 'Expected'); - //t.false(unfold(args..), 'Expected'); - //t.throws(unfold(args..), 'Expected'); - t.end(); -}); diff --git a/test/union/union.test.js b/test/union/union.test.js deleted file mode 100644 index fd6157918..000000000 --- a/test/union/union.test.js +++ /dev/null @@ -1,24 +0,0 @@ -const test = require('tape'); -const union = require('./union.js'); - -test('Testing union', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof union === 'function', 'union is a Function'); - t.deepEqual(union([1, 2, 3], [4, 3, 2]), [1, 2, 3, 4], "union([1, 2, 3], [4, 3, 2]) returns [1, 2, 3, 4]"); - t.deepEqual(union('str', 'asd'), [ 's', 't', 'r', 'a', 'd' ], "union('str', 'asd') returns [ 's', 't', 'r', 'a', 'd' ]"); - t.deepEqual(union([[], {}], [1, 2, 3]), [[], {}, 1, 2, 3], "union([[], {}], [1, 2, 3]) returns [[], {}, 1, 2, 3]"); - t.deepEqual(union([], []), [], "union([], []) returns []"); - t.throws(() => union(), 'union() throws an error'); - t.throws(() => union(true, 'str'), 'union(true, str) throws an error'); - t.throws(() => union('false', true), 'union(false, true) throws an error'); - t.throws(() => union(123, {}), 'union(123, {}) throws an error'); - t.throws(() => union([], {}), 'union([], {}) throws an error'); - t.throws(() => union(undefined, null), 'union(undefined, null) throws an error'); - - let start = new Date().getTime(); - union([1, 2, 3], [4, 3, 2]); - let end = new Date().getTime(); - t.true((end - start) < 2000, 'union([1, 2, 3], [4, 3, 2]) takes less than 2s to run'); - t.end(); -}); diff --git a/test/unionBy/unionBy.test.js b/test/unionBy/unionBy.test.js deleted file mode 100644 index c412368ce..000000000 --- a/test/unionBy/unionBy.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -const unionBy = require('./unionBy.js'); - -test('Testing unionBy', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof unionBy === 'function', 'unionBy is a Function'); - t.deepEqual(unionBy([2.1], [1.2, 2.3], Math.floor), [2.1, 1.2], 'Produces the appropriate results'); - //t.deepEqual(unionBy(args..), 'Expected'); - //t.equal(unionBy(args..), 'Expected'); - //t.false(unionBy(args..), 'Expected'); - //t.throws(unionBy(args..), 'Expected'); - t.end(); -}); diff --git a/test/unionWith/unionWith.test.js b/test/unionWith/unionWith.test.js deleted file mode 100644 index 852226eb9..000000000 --- a/test/unionWith/unionWith.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -const unionWith = require('./unionWith.js'); - -test('Testing unionWith', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof unionWith === 'function', 'unionWith is a Function'); - t.deepEqual(unionWith([1, 1.2, 1.5, 3, 0], [1.9, 3, 0, 3.9], (a, b) => Math.round(a) === Math.round(b)), [1, 1.2, 1.5, 3, 0, 3.9], 'Produces the appropriate results'); - //t.deepEqual(unionWith(args..), 'Expected'); - //t.equal(unionWith(args..), 'Expected'); - //t.false(unionWith(args..), 'Expected'); - //t.throws(unionWith(args..), 'Expected'); - t.end(); -}); diff --git a/test/uniqueElements/uniqueElements.test.js b/test/uniqueElements/uniqueElements.test.js deleted file mode 100644 index 2dd158e08..000000000 --- a/test/uniqueElements/uniqueElements.test.js +++ /dev/null @@ -1,28 +0,0 @@ -const test = require('tape'); -const uniqueElements = require('./uniqueElements.js'); - -test('Testing uniqueElements', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof uniqueElements === 'function', 'uniqueElements is a Function'); - t.deepEqual(uniqueElements([1, 2, 2, 3, 4, 4, 5]), [1,2,3,4,5], "uniqueElements([1, 2, 2, 3, 4, 4, 5]) returns [1,2,3,4,5]"); - t.deepEqual(uniqueElements([1, 23, 53]), [1, 23, 53], "uniqueElements([1, 23, 53]) returns [1, 23, 53]"); - t.deepEqual(uniqueElements([true, 0, 1, false, false, undefined, null, '']), [true, 0, 1, false, undefined, null, ''], "uniqueElements([true, 0, 1, false, false, undefined, null, '']) returns [true, 0, 1, false, false, undefined, null, '']"); - t.deepEqual(uniqueElements(), [], "uniqueElements() returns []"); - t.deepEqual(uniqueElements(null), [], "uniqueElements(null) returns []"); - t.deepEqual(uniqueElements(undefined), [], "uniqueElements(undefined) returns []"); - t.deepEqual(uniqueElements('strt'), ['s', 't', 'r'], "uniqueElements('strt') returns ['s', 't', 'r']"); - t.throws(() => uniqueElements(1, 1, 2543, 534, 5), 'uniqueElements(1, 1, 2543, 534, 5) throws an error'); - t.throws(() => uniqueElements({}), 'uniqueElements({}) throws an error'); - t.throws(() => uniqueElements(true), 'uniqueElements(true) throws an error'); - t.throws(() => uniqueElements(false), 'uniqueElements(false) throws an error'); - - let start = new Date().getTime(); - uniqueElements([true, 0, 1, false, false, undefined, null, '']); - let end = new Date().getTime(); - t.true((end - start) < 2000, 'uniqueElements([true, 0, 1, false, false, undefined, null]) takes less than 2s to run'); - - t.end(); -}); - -uniqueElements([1, 2, 2, '1', 4, 4, 4, 5, true]); // [1,2,3,4,5] diff --git a/test/untildify/untildify.test.js b/test/untildify/untildify.test.js deleted file mode 100644 index 1e00ff510..000000000 --- a/test/untildify/untildify.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const test = require('tape'); -const untildify = require('./untildify.js'); - -test('Testing untildify', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof untildify === 'function', 'untildify is a Function'); - t.true(untildify('~/test/dir/file.f').indexOf('~') === -1, 'Contains no tildes'); - t.equal(untildify('~/test/dir/file.f').slice(-16), '/test/dir/file.f', 'Does not alter the rest of the path'); - t.equal(untildify('test/dir/file.f'), 'test/dir/file.f', 'Does not alter paths without tildes'); - //t.deepEqual(untildify(args..), 'Expected'); - //t.equal(untildify(args..), 'Expected'); - //t.false(untildify(args..), 'Expected'); - //t.throws(untildify(args..), 'Expected'); - t.end(); -}); diff --git a/test/unzip/unzip.test.js b/test/unzip/unzip.test.js deleted file mode 100644 index acfddc110..000000000 --- a/test/unzip/unzip.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const test = require('tape'); -const unzip = require('./unzip.js'); - -test('Testing unzip', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof unzip === 'function', 'unzip is a Function'); - t.deepEqual(unzip([['a', 1, true], ['b', 2, false]]), [['a', 'b'], [1, 2], [true, false]], `unzip([['a', 1, true], ['b', 2, false]]) equals [['a', 'b'], [1, 2], [true, false]]`); - t.deepEqual(unzip([['a', 1, true], ['b', 2]]), [['a', 'b'], [1, 2], [true]], `unzip([['a', 1, true], ['b', 2]]) equals [['a', 'b'], [1, 2], [true]]`); - //t.deepEqual(unzip(args..), 'Expected'); - //t.equal(unzip(args..), 'Expected'); - //t.false(unzip(args..), 'Expected'); - //t.throws(unzip(args..), 'Expected'); - t.end(); -}); diff --git a/test/unzipWith/unzipWith.test.js b/test/unzipWith/unzipWith.test.js deleted file mode 100644 index a9416e7c2..000000000 --- a/test/unzipWith/unzipWith.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -const unzipWith = require('./unzipWith.js'); - -test('Testing unzipWith', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof unzipWith === 'function', 'unzipWith is a Function'); - t.deepEqual(unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)), [3, 30, 300], `unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)) equals [3, 30, 300]`); - //t.equal(unzipWith(args..), 'Expected'); - //t.false(unzipWith(args..), 'Expected'); - //t.throws(unzipWith(args..), 'Expected'); - t.end(); -}); diff --git a/test/validateNumber/validateNumber.test.js b/test/validateNumber/validateNumber.test.js deleted file mode 100644 index e8037cc65..000000000 --- a/test/validateNumber/validateNumber.test.js +++ /dev/null @@ -1,22 +0,0 @@ -const test = require('tape'); -const validateNumber = require('./validateNumber.js'); - -test('Testing validateNumber', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof validateNumber === 'function', 'validateNumber is a Function'); - t.true(validateNumber(9), 'validateNumber(9) returns true'); - t.true(validateNumber('234asd'.slice(0, 2)), 'validateNumber(234asd.slice(0, 2)) returns true'); - t.true(validateNumber(1232), 'validateNumber(1232) returns true'); - t.true(validateNumber(1232 + 13423), 'validateNumber(1232 + 13423) returns true'); - t.true(validateNumber(1232 * 2342 * 123), 'validateNumber(1232 * 2342 * 123) returns true'); - t.true(validateNumber(1232.23423536), 'validateNumber(1232.23423536) returns true'); - t.false(validateNumber('234asd'), 'validateNumber(234asd) returns false'); - t.false(validateNumber('e234d'), 'validateNumber(e234d) returns false'); - t.false(validateNumber(false), 'validateNumber(false) returns false'); - t.false(validateNumber(true), 'validateNumber(true) returns false'); - t.false(validateNumber(null), 'validateNumber(null) returns false'); - t.false(validateNumber(123 * 'asd'), 'validateNumber(123 * asd) returns false'); - - t.end(); -}); diff --git a/test/without/without.test.js b/test/without/without.test.js deleted file mode 100644 index 7d9fa7e70..000000000 --- a/test/without/without.test.js +++ /dev/null @@ -1,19 +0,0 @@ -const test = require('tape'); -const without = require('./without.js'); - -test('Testing without', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof without === 'function', 'without is a Function'); - t.deepEqual(without([2, 1, 2, 3], 1, 2), [3], "without([2, 1, 2, 3], 1, 2) returns [3]"); - t.deepEqual(without([]), [], "without([]) returns []"); - t.deepEqual(without([3, 1, true, '3', true], '3', true), [3, 1], "without([3, 1, true, '3', true], '3', true) returns [3, 1]"); - t.deepEqual(without('string'.split(''), 's', 't', 'g'), ['r', 'i', 'n'], "without('string'.split(''), 's', 't', 'g') returns ['r', 'i', 'n']"); - t.throws(() => without(), 'without() throws an error'); - t.throws(() => without(null), 'without(null) throws an error'); - t.throws(() => without(undefined), 'without(undefined) throws an error'); - t.throws(() => without(123), 'without() throws an error'); - t.throws(() => without({}), 'without({}) throws an error'); - - t.end(); -}); diff --git a/test/words/words.test.js b/test/words/words.test.js deleted file mode 100644 index 1c8a7fda7..000000000 --- a/test/words/words.test.js +++ /dev/null @@ -1,19 +0,0 @@ -const test = require('tape'); -const words = require('./words.js'); - -test('Testing words', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof words === 'function', 'words is a Function'); - t.deepEqual(words('I love javaScript!!'), ["I", "love", "javaScript"], "words('I love javaScript!!') returns [I, love, javaScript]"); - t.deepEqual(words('python, javaScript & coffee'), ["python", "javaScript", "coffee"], "words('python, javaScript & coffee') returns [python, javaScript, coffee]"); - t.true(Array.isArray(words('I love javaScript!!')), 'words(I love javaScript!!) returns an array'); - t.throws(() => words(), 'words() throws a error'); - t.throws(() => words(null), 'words(null) throws a error'); - t.throws(() => words(undefined), 'words(undefined) throws a error'); - t.throws(() => words({}), 'words({}) throws a error'); - t.throws(() => words([]), 'words([]) throws a error'); - t.throws(() => words(1234), 'words(1234) throws a error'); - - t.end(); -}); diff --git a/test/xProd/xProd.test.js b/test/xProd/xProd.test.js deleted file mode 100644 index 9bc6571de..000000000 --- a/test/xProd/xProd.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const test = require('tape'); -const xProd = require('./xProd.js'); - -test('Testing xProd', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof xProd === 'function', 'xProd is a Function'); - t.deepEqual(xProd([1, 2], ['a', 'b']), [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']], `xProd([1, 2], ['a', 'b']) returns [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]`); - //t.deepEqual(xProd(args..), 'Expected'); - //t.equal(xProd(args..), 'Expected'); - //t.false(xProd(args..), 'Expected'); - //t.throws(xProd(args..), 'Expected'); - t.end(); -}); diff --git a/test/yesNo/yesNo.test.js b/test/yesNo/yesNo.test.js deleted file mode 100644 index 6b7c66d1c..000000000 --- a/test/yesNo/yesNo.test.js +++ /dev/null @@ -1,22 +0,0 @@ -const test = require('tape'); -const yesNo = require('./yesNo.js'); - -test('Testing yesNo', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof yesNo === 'function', 'yesNo is a Function'); - t.true(yesNo('Y'), 'yesNo(Y) returns true'); - t.true(yesNo('yes'), 'yesNo(yes) returns true'); - t.true(yesNo('foo', true), 'yesNo(foo, true) returns true'); - t.false(yesNo('No'), 'yesNo(No) returns false'); - t.false(yesNo(), 'yesNo() returns false'); - t.false(yesNo(null), 'yesNo(null) returns false'); - t.false(yesNo(undefined), 'yesNo(undefined) returns false'); - t.false(yesNo([123, null]), 'yesNo([123, null]) returns false'); - t.false(yesNo(['Yes', 'No']), 'yesNo([Yes, No]) returns false'); - t.false(yesNo({ 2: 'Yes' }), 'yesNo({ 2: Yes }) returns false'); - t.true(yesNo(['Yes', 'No'], true), 'yesNo([Yes, No], true) returns true'); - t.true(yesNo({ 2: 'Yes' }, true), 'yesNo({ 2: Yes }, true) returns true'); - - t.end(); -}); diff --git a/test/zip/zip.test.js b/test/zip/zip.test.js deleted file mode 100644 index 8e6ce6747..000000000 --- a/test/zip/zip.test.js +++ /dev/null @@ -1,18 +0,0 @@ -const test = require('tape'); -const zip = require('./zip.js'); - -test('Testing zip', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof zip === 'function', 'zip is a Function'); - t.deepEqual(zip(['a', 'b'], [1, 2], [true, false]), [['a', 1, true], ['b', 2, false]], 'zip([a, b], [1, 2], [true, false]) returns [[a, 1, true], [b, 2, false]]'); - t.deepEqual(zip(['a'], [1, 2], [true, false]), [['a', 1, true], [undefined, 2, false]], 'zip([a], [1, 2], [true, false]) returns [[a, 1, true], [undefined, 2, false]]'); - t.deepEqual(zip(), [], 'zip([]) returns []'); - t.deepEqual(zip(123), [], 'zip(123) returns []'); - t.true(Array.isArray(zip(['a', 'b'], [1, 2], [true, false])), 'zip([a, b], [1, 2], [true, false]) returns an Array'); - t.true(Array.isArray(zip(['a'], [1, 2], [true, false])), 'zip([a], [1, 2], [true, false]) returns an Array'); - t.throws(() => zip(null), 'zip(null) throws an error'); - t.throws(() => zip(undefined), 'zip(undefined) throws an error'); - - t.end(); -}); diff --git a/test/zipObject/zipObject.test.js b/test/zipObject/zipObject.test.js deleted file mode 100644 index 83ba782a0..000000000 --- a/test/zipObject/zipObject.test.js +++ /dev/null @@ -1,19 +0,0 @@ -const test = require('tape'); -const zipObject = require('./zipObject.js'); - -test('Testing zipObject', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof zipObject === 'function', 'zipObject is a Function'); - t.deepEqual(zipObject(['a', 'b', 'c'], [1, 2]), {a: 1, b: 2, c: undefined}, 'zipObject([a, b, c], [1, 2]) returns {a: 1, b: 2, c: undefined}'); - t.deepEqual(zipObject(['a', 'b'], [1, 2, 3]), {a: 1, b: 2}, 'zipObject([a, b], [1, 2, 3]) returns {a: 1, b: 2}'); - t.deepEqual(zipObject(['a', 'b', 'c'], 'string'), { a: 's', b: 't', c: 'r' }, 'zipObject([a, b, c], string) returns { a: s, b: t, c: r }'); - t.deepEqual(zipObject(['a'], 'string'), { a: 's' }, 'zipObject([a], string) returns { a: s }'); - t.throws(() => zipObject(), 'zipObject() throws an error'); - t.throws(() => zipObject(['string'], null), 'zipObject([string], null) throws an error'); - t.throws(() => zipObject(null, [1]), 'zipObject(null, [1]) throws an error'); - t.throws(() => zipObject('string'), 'zipObject(string) throws an error'); - t.throws(() => zipObject('test', 'string'), 'zipObject(test, string) throws an error'); - - t.end(); -}); diff --git a/test/zipWith/zipWith.test.js b/test/zipWith/zipWith.test.js deleted file mode 100644 index 2cf409e24..000000000 --- a/test/zipWith/zipWith.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const test = require('tape'); -const zipWith = require('./zipWith.js'); - -test('Testing zipWith', (t) => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - t.true(typeof zipWith === 'function', 'zipWith is a Function'); - //t.deepEqual(zipWith(args..), 'Expected'); - //t.equal(zipWith(args..), 'Expected'); - //t.false(zipWith(args..), 'Expected'); - //t.throws(zipWith(args..), 'Expected'); - t.end(); -}); \ No newline at end of file diff --git a/test/defaults/defaults.js b/test2/defaults/defaults.js similarity index 100% rename from test/defaults/defaults.js rename to test2/defaults/defaults.js diff --git a/test2/defaults/defaults.test.js b/test2/defaults/defaults.test.js new file mode 100644 index 000000000..79c5a5472 --- /dev/null +++ b/test2/defaults/defaults.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const defaults = require('./defaults.js'); + +test('Testing defaults', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof defaults === 'function').toBeTruthy(); + expect(defaults({ a: 1 }, { b: 2 }, { b: 6 }, { a: 3 })).toEqual({ a: 1, b: 2 }); +}); diff --git a/test/defer/defer.js b/test2/defer/defer.js similarity index 100% rename from test/defer/defer.js rename to test2/defer/defer.js diff --git a/test2/defer/defer.test.js b/test2/defer/defer.test.js new file mode 100644 index 000000000..c5db044d2 --- /dev/null +++ b/test2/defer/defer.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const defer = require('./defer.js'); + +test('Testing defer', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof defer === 'function').toBeTruthy(); +}); diff --git a/test/degreesToRads/degreesToRads.js b/test2/degreesToRads/degreesToRads.js similarity index 100% rename from test/degreesToRads/degreesToRads.js rename to test2/degreesToRads/degreesToRads.js diff --git a/test2/degreesToRads/degreesToRads.test.js b/test2/degreesToRads/degreesToRads.test.js new file mode 100644 index 000000000..742faaad3 --- /dev/null +++ b/test2/degreesToRads/degreesToRads.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const degreesToRads = require('./degreesToRads.js'); + +test('Testing degreesToRads', () => { + //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 + expect(typeof degreesToRads === 'function').toBeTruthy(); + expect(approxeq(degreesToRads(90.0), Math.PI / 2)).toBeTruthy(); +}); diff --git a/test/delay/delay.js b/test2/delay/delay.js similarity index 100% rename from test/delay/delay.js rename to test2/delay/delay.js diff --git a/test2/delay/delay.test.js b/test2/delay/delay.test.js new file mode 100644 index 000000000..68fc4dd89 --- /dev/null +++ b/test2/delay/delay.test.js @@ -0,0 +1,15 @@ +const expect = require('expect'); +const delay = require('./delay.js'); + +test('Testing delay', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof delay === 'function').toBeTruthy(); + delay( + function(text) { + expect(text).toBe('test'); + }, + 1000, + 'test' + ); +}); diff --git a/test/detectDeviceType/detectDeviceType.js b/test2/detectDeviceType/detectDeviceType.js similarity index 100% rename from test/detectDeviceType/detectDeviceType.js rename to test2/detectDeviceType/detectDeviceType.js diff --git a/test2/detectDeviceType/detectDeviceType.test.js b/test2/detectDeviceType/detectDeviceType.test.js new file mode 100644 index 000000000..708f7ebe6 --- /dev/null +++ b/test2/detectDeviceType/detectDeviceType.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const detectDeviceType = require('./detectDeviceType.js'); + +test('Testing detectDeviceType', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof detectDeviceType === 'function').toBeTruthy(); +}); diff --git a/test/difference/difference.js b/test2/difference/difference.js similarity index 100% rename from test/difference/difference.js rename to test2/difference/difference.js diff --git a/test2/difference/difference.test.js b/test2/difference/difference.test.js new file mode 100644 index 000000000..21e4fac21 --- /dev/null +++ b/test2/difference/difference.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const difference = require('./difference.js'); + +test('Testing difference', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof difference === 'function').toBeTruthy(); + expect(difference([1, 2, 3], [1, 2, 4])).toEqual([3]); +}); \ No newline at end of file diff --git a/test/differenceBy/differenceBy.js b/test2/differenceBy/differenceBy.js similarity index 100% rename from test/differenceBy/differenceBy.js rename to test2/differenceBy/differenceBy.js diff --git a/test2/differenceBy/differenceBy.test.js b/test2/differenceBy/differenceBy.test.js new file mode 100644 index 000000000..4d7dfe471 --- /dev/null +++ b/test2/differenceBy/differenceBy.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const differenceBy = require('./differenceBy.js'); + +test('Testing differenceBy', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof differenceBy === 'function').toBeTruthy(); + expect(differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor)).toEqual([1.2]); + expect(differenceBy([{ x: 2 }, { x: 1 }], [{ x: 1 }], v => v.x)).toEqual([ { x: 2 } ]); +}); diff --git a/test/differenceWith/differenceWith.js b/test2/differenceWith/differenceWith.js similarity index 100% rename from test/differenceWith/differenceWith.js rename to test2/differenceWith/differenceWith.js diff --git a/test2/differenceWith/differenceWith.test.js b/test2/differenceWith/differenceWith.test.js new file mode 100644 index 000000000..0e27a4501 --- /dev/null +++ b/test2/differenceWith/differenceWith.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const differenceWith = require('./differenceWith.js'); + +test('Testing differenceWith', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof differenceWith === 'function').toBeTruthy(); + 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]); +}); \ No newline at end of file diff --git a/test/digitize/digitize.js b/test2/digitize/digitize.js similarity index 100% rename from test/digitize/digitize.js rename to test2/digitize/digitize.js diff --git a/test2/digitize/digitize.test.js b/test2/digitize/digitize.test.js new file mode 100644 index 000000000..75b554e53 --- /dev/null +++ b/test2/digitize/digitize.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const digitize = require('./digitize.js'); + +test('Testing digitize', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof digitize === 'function').toBeTruthy(); + expect(digitize(123)).toEqual([1, 2, 3]); +}); \ No newline at end of file diff --git a/test/distance/distance.js b/test2/distance/distance.js similarity index 100% rename from test/distance/distance.js rename to test2/distance/distance.js diff --git a/test2/distance/distance.test.js b/test2/distance/distance.test.js new file mode 100644 index 000000000..495cf60c0 --- /dev/null +++ b/test2/distance/distance.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const distance = require('./distance.js'); + +test('Testing distance', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof distance === 'function').toBeTruthy(); + expect(distance(1, 1, 2, 3)).toBe(2.23606797749979); +}); diff --git a/test/drop/drop.js b/test2/drop/drop.js similarity index 100% rename from test/drop/drop.js rename to test2/drop/drop.js diff --git a/test2/drop/drop.test.js b/test2/drop/drop.test.js new file mode 100644 index 000000000..ea9715842 --- /dev/null +++ b/test2/drop/drop.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const drop = require('./drop.js'); + +test('Testing drop', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof drop === 'function').toBeTruthy(); + expect(drop([1, 2, 3])).toEqual([2,3]); + expect(drop([1, 2, 3], 2)).toEqual([3]); + expect(drop([1, 2, 3], 42)).toEqual([]); +}); diff --git a/test/dropRight/dropRight.js b/test2/dropRight/dropRight.js similarity index 100% rename from test/dropRight/dropRight.js rename to test2/dropRight/dropRight.js diff --git a/test2/dropRight/dropRight.test.js b/test2/dropRight/dropRight.test.js new file mode 100644 index 000000000..ffd46e6d3 --- /dev/null +++ b/test2/dropRight/dropRight.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const dropRight = require('./dropRight.js'); + +test('Testing dropRight', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof dropRight === 'function').toBeTruthy(); + expect(dropRight([1, 2, 3])).toEqual([1,2]); + expect(dropRight([1, 2, 3], 2)).toEqual([1]); + expect(dropRight([1, 2, 3], 42)).toEqual([]); +}); \ No newline at end of file diff --git a/test/dropRightWhile/dropRightWhile.js b/test2/dropRightWhile/dropRightWhile.js similarity index 100% rename from test/dropRightWhile/dropRightWhile.js rename to test2/dropRightWhile/dropRightWhile.js diff --git a/test2/dropRightWhile/dropRightWhile.test.js b/test2/dropRightWhile/dropRightWhile.test.js new file mode 100644 index 000000000..1df6588a5 --- /dev/null +++ b/test2/dropRightWhile/dropRightWhile.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const dropRightWhile = require('./dropRightWhile.js'); + +test('Testing dropRightWhile', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof dropRightWhile === 'function').toBeTruthy(); + expect(dropRightWhile([1, 2, 3, 4], n => n < 3)).toEqual([1, 2]); +}); diff --git a/test/dropWhile/dropWhile.js b/test2/dropWhile/dropWhile.js similarity index 100% rename from test/dropWhile/dropWhile.js rename to test2/dropWhile/dropWhile.js diff --git a/test2/dropWhile/dropWhile.test.js b/test2/dropWhile/dropWhile.test.js new file mode 100644 index 000000000..8a2be7a17 --- /dev/null +++ b/test2/dropWhile/dropWhile.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const dropWhile = require('./dropWhile.js'); + +test('Testing dropWhile', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof dropWhile === 'function').toBeTruthy(); + expect(dropWhile([1, 2, 3, 4], n => n >= 3)).toEqual([3,4]); +}); diff --git a/test/elementIsVisibleInViewport/elementIsVisibleInViewport.js b/test2/elementIsVisibleInViewport/elementIsVisibleInViewport.js similarity index 100% rename from test/elementIsVisibleInViewport/elementIsVisibleInViewport.js rename to test2/elementIsVisibleInViewport/elementIsVisibleInViewport.js diff --git a/test2/elementIsVisibleInViewport/elementIsVisibleInViewport.test.js b/test2/elementIsVisibleInViewport/elementIsVisibleInViewport.test.js new file mode 100644 index 000000000..2707cbc4e --- /dev/null +++ b/test2/elementIsVisibleInViewport/elementIsVisibleInViewport.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const elementIsVisibleInViewport = require('./elementIsVisibleInViewport.js'); + +test('Testing elementIsVisibleInViewport', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof elementIsVisibleInViewport === 'function').toBeTruthy(); +}); diff --git a/test/elo/elo.js b/test2/elo/elo.js similarity index 100% rename from test/elo/elo.js rename to test2/elo/elo.js diff --git a/test2/elo/elo.test.js b/test2/elo/elo.test.js new file mode 100644 index 000000000..a0c483696 --- /dev/null +++ b/test2/elo/elo.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const elo = require('./elo.js'); + +test('Testing elo', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof elo === 'function').toBeTruthy(); + expect(elo([1200, 1200])).toEqual([1216, 1184]); + expect(elo([1200, 1200], 64)).toEqual([1232, 1168]), "Standard 1v1s"; + expect(elo([1200, 1200, 1200, 1200]).map(Math.round)).toEqual([1246, 1215, 1185, 1154]); +}); \ No newline at end of file diff --git a/test/equals/equals.js b/test2/equals/equals.js similarity index 100% rename from test/equals/equals.js rename to test2/equals/equals.js diff --git a/test2/equals/equals.test.js b/test2/equals/equals.test.js new file mode 100644 index 000000000..f84987498 --- /dev/null +++ b/test2/equals/equals.test.js @@ -0,0 +1,15 @@ +const expect = require('expect'); +const equals = require('./equals.js'); + +test('Testing equals', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof equals === 'function').toBeTruthy(); + expect( + equals({ a: [2, {e: 3}], b: [4], c: 'foo' }, { a: [2, {e: 3}], b: [4], c: 'foo' }) + ).toBeTruthy(); + expect(equals([1, 2, 3], [1, 2, 3])).toBeTruthy(); + expect(equals({ a: [2, 3], b: [4] }, { a: [2, 3], b: [6] })).toBeFalsy(); + expect(equals([1, 2, 3], [1, 2, 4])).toBeFalsy(); + expect(equals([1, 2, 3], { 0: 1, 1: 2, 2: 3 })).toBeTruthy(); +}); diff --git a/test/escapeHTML/escapeHTML.js b/test2/escapeHTML/escapeHTML.js similarity index 100% rename from test/escapeHTML/escapeHTML.js rename to test2/escapeHTML/escapeHTML.js diff --git a/test2/escapeHTML/escapeHTML.test.js b/test2/escapeHTML/escapeHTML.test.js new file mode 100644 index 000000000..a040ed437 --- /dev/null +++ b/test2/escapeHTML/escapeHTML.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const escapeHTML = require('./escapeHTML.js'); + +test('Testing escapeHTML', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof escapeHTML === 'function').toBeTruthy(); + expect(escapeHTML('Me & you')).toBe('<a href="#">Me & you</a>'); +}); \ No newline at end of file diff --git a/test/escapeRegExp/escapeRegExp.js b/test2/escapeRegExp/escapeRegExp.js similarity index 100% rename from test/escapeRegExp/escapeRegExp.js rename to test2/escapeRegExp/escapeRegExp.js diff --git a/test2/escapeRegExp/escapeRegExp.test.js b/test2/escapeRegExp/escapeRegExp.test.js new file mode 100644 index 000000000..1890779fb --- /dev/null +++ b/test2/escapeRegExp/escapeRegExp.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const escapeRegExp = require('./escapeRegExp.js'); + +test('Testing escapeRegExp', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof escapeRegExp === 'function').toBeTruthy(); + expect(escapeRegExp('(test)')).toBe('\\(test\\)'); +}); \ No newline at end of file diff --git a/test/everyNth/everyNth.js b/test2/everyNth/everyNth.js similarity index 100% rename from test/everyNth/everyNth.js rename to test2/everyNth/everyNth.js diff --git a/test2/everyNth/everyNth.test.js b/test2/everyNth/everyNth.test.js new file mode 100644 index 000000000..7301eeeed --- /dev/null +++ b/test2/everyNth/everyNth.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const everyNth = require('./everyNth.js'); + +test('Testing everyNth', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof everyNth === 'function').toBeTruthy(); + expect(everyNth([1, 2, 3, 4, 5, 6], 2)).toEqual([ 2, 4, 6 ]); +}); \ No newline at end of file diff --git a/test/extendHex/extendHex.js b/test2/extendHex/extendHex.js similarity index 100% rename from test/extendHex/extendHex.js rename to test2/extendHex/extendHex.js diff --git a/test2/extendHex/extendHex.test.js b/test2/extendHex/extendHex.test.js new file mode 100644 index 000000000..172c9259e --- /dev/null +++ b/test2/extendHex/extendHex.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const extendHex = require('./extendHex.js'); + +test('Testing extendHex', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof extendHex === 'function').toBeTruthy(); + expect(extendHex('#03f')).toBe('#0033ff'); + expect(extendHex('05a')).toBe('#0055aa'); +}); \ No newline at end of file diff --git a/test/factorial/factorial.js b/test2/factorial/factorial.js similarity index 100% rename from test/factorial/factorial.js rename to test2/factorial/factorial.js diff --git a/test2/factorial/factorial.test.js b/test2/factorial/factorial.test.js new file mode 100644 index 000000000..ea04c6b50 --- /dev/null +++ b/test2/factorial/factorial.test.js @@ -0,0 +1,13 @@ +const expect = require('expect'); +const factorial = require('./factorial.js'); + +test('Testing factorial', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof factorial === 'function').toBeTruthy(); + expect(factorial(6)).toBe(720); + expect(factorial(0)).toBe(1); + expect(factorial(1)).toBe(1); + expect(factorial(4)).toBe(24); + expect(factorial(10)).toBe(3628800); +}); \ No newline at end of file diff --git a/test/factors/factors.js b/test2/factors/factors.js similarity index 100% rename from test/factors/factors.js rename to test2/factors/factors.js diff --git a/test2/factors/factors.test.js b/test2/factors/factors.test.js new file mode 100644 index 000000000..458b48f5c --- /dev/null +++ b/test2/factors/factors.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const factors = require('./factors.js'); + +test('Testing factors', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof factors === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/fibonacci/fibonacci.js b/test2/fibonacci/fibonacci.js similarity index 100% rename from test/fibonacci/fibonacci.js rename to test2/fibonacci/fibonacci.js diff --git a/test2/fibonacci/fibonacci.test.js b/test2/fibonacci/fibonacci.test.js new file mode 100644 index 000000000..cd3be86df --- /dev/null +++ b/test2/fibonacci/fibonacci.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const fibonacci = require('./fibonacci.js'); + +test('Testing fibonacci', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof fibonacci === 'function').toBeTruthy(); + expect(fibonacci(6)).toEqual([0, 1, 1, 2, 3, 5]); +}); \ No newline at end of file diff --git a/test/fibonacciCountUntilNum/fibonacciCountUntilNum.js b/test2/fibonacciCountUntilNum/fibonacciCountUntilNum.js similarity index 100% rename from test/fibonacciCountUntilNum/fibonacciCountUntilNum.js rename to test2/fibonacciCountUntilNum/fibonacciCountUntilNum.js diff --git a/test2/fibonacciCountUntilNum/fibonacciCountUntilNum.test.js b/test2/fibonacciCountUntilNum/fibonacciCountUntilNum.test.js new file mode 100644 index 000000000..b54b33bf5 --- /dev/null +++ b/test2/fibonacciCountUntilNum/fibonacciCountUntilNum.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const fibonacciCountUntilNum = require('./fibonacciCountUntilNum.js'); + +test('Testing fibonacciCountUntilNum', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof fibonacciCountUntilNum === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/fibonacciUntilNum/fibonacciUntilNum.js b/test2/fibonacciUntilNum/fibonacciUntilNum.js similarity index 100% rename from test/fibonacciUntilNum/fibonacciUntilNum.js rename to test2/fibonacciUntilNum/fibonacciUntilNum.js diff --git a/test2/fibonacciUntilNum/fibonacciUntilNum.test.js b/test2/fibonacciUntilNum/fibonacciUntilNum.test.js new file mode 100644 index 000000000..77d6970ae --- /dev/null +++ b/test2/fibonacciUntilNum/fibonacciUntilNum.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const fibonacciUntilNum = require('./fibonacciUntilNum.js'); + +test('Testing fibonacciUntilNum', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof fibonacciUntilNum === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/filterNonUnique/filterNonUnique.js b/test2/filterNonUnique/filterNonUnique.js similarity index 100% rename from test/filterNonUnique/filterNonUnique.js rename to test2/filterNonUnique/filterNonUnique.js diff --git a/test2/filterNonUnique/filterNonUnique.test.js b/test2/filterNonUnique/filterNonUnique.test.js new file mode 100644 index 000000000..05009e044 --- /dev/null +++ b/test2/filterNonUnique/filterNonUnique.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const filterNonUnique = require('./filterNonUnique.js'); + +test('Testing filterNonUnique', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof filterNonUnique === 'function').toBeTruthy(); + expect(filterNonUnique([1, 2, 2, 3, 4, 4, 5])).toEqual([1,3,5]); +}); \ No newline at end of file diff --git a/test/findKey/findKey.js b/test2/findKey/findKey.js similarity index 100% rename from test/findKey/findKey.js rename to test2/findKey/findKey.js diff --git a/test2/findKey/findKey.test.js b/test2/findKey/findKey.test.js new file mode 100644 index 000000000..9c3e354a4 --- /dev/null +++ b/test2/findKey/findKey.test.js @@ -0,0 +1,16 @@ +const expect = require('expect'); +const findKey = require('./findKey.js'); + +test('Testing findKey', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof findKey === 'function').toBeTruthy(); + expect(findKey( + { + barney: { age: 36, active: true }, + fred: { age: 40, active: false }, + pebbles: { age: 1, active: true } + }, + o => o['active'] +)).toEqual('barney'); +}); diff --git a/test/findLast/findLast.js b/test2/findLast/findLast.js similarity index 100% rename from test/findLast/findLast.js rename to test2/findLast/findLast.js diff --git a/test2/findLast/findLast.test.js b/test2/findLast/findLast.test.js new file mode 100644 index 000000000..69e768dee --- /dev/null +++ b/test2/findLast/findLast.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const findLast = require('./findLast.js'); + +test('Testing findLast', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof findLast === 'function').toBeTruthy(); + expect(findLast([1, 2, 3, 4], n => n % 2 === 1)).toBe(3); +}); diff --git a/test/findLastIndex/findLastIndex.js b/test2/findLastIndex/findLastIndex.js similarity index 100% rename from test/findLastIndex/findLastIndex.js rename to test2/findLastIndex/findLastIndex.js diff --git a/test2/findLastIndex/findLastIndex.test.js b/test2/findLastIndex/findLastIndex.test.js new file mode 100644 index 000000000..2e1c57351 --- /dev/null +++ b/test2/findLastIndex/findLastIndex.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const findLastIndex = require('./findLastIndex.js'); + +test('Testing findLastIndex', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof findLastIndex === 'function').toBeTruthy(); + expect(findLastIndex([1, 2, 3, 4], n => n % 2 === 1)).toBe(2); +}); diff --git a/test/findLastKey/findLastKey.js b/test2/findLastKey/findLastKey.js similarity index 100% rename from test/findLastKey/findLastKey.js rename to test2/findLastKey/findLastKey.js diff --git a/test2/findLastKey/findLastKey.test.js b/test2/findLastKey/findLastKey.test.js new file mode 100644 index 000000000..bbaa493d5 --- /dev/null +++ b/test2/findLastKey/findLastKey.test.js @@ -0,0 +1,16 @@ +const expect = require('expect'); +const findLastKey = require('./findLastKey.js'); + +test('Testing findLastKey', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof findLastKey === 'function').toBeTruthy(); + expect(findLastKey( + { + barney: { age: 36, active: true }, + fred: { age: 40, active: false }, + pebbles: { age: 1, active: true } + }, + o => o['active'] +)).toBe('pebbles'); +}); diff --git a/test/flatten/flatten.js b/test2/flatten/flatten.js similarity index 100% rename from test/flatten/flatten.js rename to test2/flatten/flatten.js diff --git a/test2/flatten/flatten.test.js b/test2/flatten/flatten.test.js new file mode 100644 index 000000000..24da6650b --- /dev/null +++ b/test2/flatten/flatten.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const flatten = require('./flatten.js'); + +test('Testing flatten', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof flatten === 'function').toBeTruthy(); + expect(flatten([1, [2], 3, 4])).toEqual([1, 2, 3, 4]); + expect(flatten([1, [2, [3, [4, 5], 6], 7], 8], 2)).toEqual([1, 2, 3, [4, 5], 6, 7, 8]); +}); \ No newline at end of file diff --git a/test/flattenObject/flattenObject.js b/test2/flattenObject/flattenObject.js similarity index 100% rename from test/flattenObject/flattenObject.js rename to test2/flattenObject/flattenObject.js diff --git a/test2/flattenObject/flattenObject.test.js b/test2/flattenObject/flattenObject.test.js new file mode 100644 index 000000000..cc864ba37 --- /dev/null +++ b/test2/flattenObject/flattenObject.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const flattenObject = require('./flattenObject.js'); + +test('Testing flattenObject', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof flattenObject === 'function').toBeTruthy(); + expect(flattenObject({ a: { b: { c: 1 } }, d: 1 })).toEqual({ 'a.b.c': 1, d: 1 }); + 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.js b/test2/flip/flip.js similarity index 100% rename from test/flip/flip.js rename to test2/flip/flip.js diff --git a/test2/flip/flip.test.js b/test2/flip/flip.test.js new file mode 100644 index 000000000..6227b2f44 --- /dev/null +++ b/test2/flip/flip.test.js @@ -0,0 +1,13 @@ +const expect = require('expect'); +const flip = require('./flip.js'); + +test('Testing flip', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof flip === 'function').toBeTruthy(); + let a = { name: 'John Smith' }; + let b = {}; + const mergeFrom = flip(Object.assign); + let mergePerson = mergeFrom.bind(null, a); + expect(mergePerson(b)).toEqual(a); +}); diff --git a/test/forEachRight/forEachRight.js b/test2/forEachRight/forEachRight.js similarity index 100% rename from test/forEachRight/forEachRight.js rename to test2/forEachRight/forEachRight.js diff --git a/test2/forEachRight/forEachRight.test.js b/test2/forEachRight/forEachRight.test.js new file mode 100644 index 000000000..b64188386 --- /dev/null +++ b/test2/forEachRight/forEachRight.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const forEachRight = require('./forEachRight.js'); + +test('Testing forEachRight', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof forEachRight === 'function').toBeTruthy(); + let output = ''; + forEachRight([1, 2, 3, 4], val => output+=val); + expect(output).toBe('4321'); +}); diff --git a/test/forOwn/forOwn.js b/test2/forOwn/forOwn.js similarity index 100% rename from test/forOwn/forOwn.js rename to test2/forOwn/forOwn.js diff --git a/test2/forOwn/forOwn.test.js b/test2/forOwn/forOwn.test.js new file mode 100644 index 000000000..85553ad3f --- /dev/null +++ b/test2/forOwn/forOwn.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const forOwn = require('./forOwn.js'); + +test('Testing forOwn', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof forOwn === 'function').toBeTruthy(); + let output = []; + forOwn({ foo: 'bar', a: 1 }, v => output.push(v)); // 'bar', 1 + expect(output).toEqual(['bar', 1]); +}); diff --git a/test/forOwnRight/forOwnRight.js b/test2/forOwnRight/forOwnRight.js similarity index 100% rename from test/forOwnRight/forOwnRight.js rename to test2/forOwnRight/forOwnRight.js diff --git a/test2/forOwnRight/forOwnRight.test.js b/test2/forOwnRight/forOwnRight.test.js new file mode 100644 index 000000000..db6008220 --- /dev/null +++ b/test2/forOwnRight/forOwnRight.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const forOwnRight = require('./forOwnRight.js'); + +test('Testing forOwnRight', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof forOwnRight === 'function').toBeTruthy(); + let output = []; + forOwnRight({ foo: 'bar', a: 1 }, v => output.push(v)); // 'bar', 1 + expect(output).toEqual([1, 'bar']); +}); diff --git a/test/formatDuration/formatDuration.js b/test2/formatDuration/formatDuration.js similarity index 100% rename from test/formatDuration/formatDuration.js rename to test2/formatDuration/formatDuration.js diff --git a/test2/formatDuration/formatDuration.test.js b/test2/formatDuration/formatDuration.test.js new file mode 100644 index 000000000..ebe26a0bd --- /dev/null +++ b/test2/formatDuration/formatDuration.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const formatDuration = require('./formatDuration.js'); + +test('Testing formatDuration', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof formatDuration === 'function').toBeTruthy(); + expect(formatDuration(1001)).toBe('1 second, 1 millisecond'); + expect(formatDuration(34325055574)).toBe('397 days, 6 hours, 44 minutes, 15 seconds, 574 milliseconds'); +}); \ No newline at end of file diff --git a/test/fromCamelCase/fromCamelCase.js b/test2/fromCamelCase/fromCamelCase.js similarity index 100% rename from test/fromCamelCase/fromCamelCase.js rename to test2/fromCamelCase/fromCamelCase.js diff --git a/test2/fromCamelCase/fromCamelCase.test.js b/test2/fromCamelCase/fromCamelCase.test.js new file mode 100644 index 000000000..5ab939e12 --- /dev/null +++ b/test2/fromCamelCase/fromCamelCase.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const fromCamelCase = require('./fromCamelCase.js'); + +test('Testing fromCamelCase', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof fromCamelCase === 'function').toBeTruthy(); + expect(fromCamelCase('someDatabaseFieldName', ' ')).toBe('some database field name'); + expect(fromCamelCase('someLabelThatNeedsToBeCamelized', '-')).toBe('some-label-that-needs-to-be-camelized'); + expect(fromCamelCase('someJavascriptProperty', '_')).toBe('some_javascript_property'); +}); \ No newline at end of file diff --git a/test/functionName/functionName.js b/test2/functionName/functionName.js similarity index 100% rename from test/functionName/functionName.js rename to test2/functionName/functionName.js diff --git a/test2/functionName/functionName.test.js b/test2/functionName/functionName.test.js new file mode 100644 index 000000000..8d00a5278 --- /dev/null +++ b/test2/functionName/functionName.test.js @@ -0,0 +1,19 @@ +import expect from 'expect'; +let output = ''; +const console = {}; +console.debug = (x) => output = x; +// Override for testing +const functionName = fn => (console.debug(fn.name), fn); +test('Testing functionName', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof functionName === 'function').toBeTruthy(); + functionName(Math.max); + expect(output).toBe('max'); + function fun(x) {return x;} + functionName(fun); + expect(output).toBe('fun'); + const fn = x => x; + functionName(fn); + expect(output).toBe('fn'); +}); diff --git a/test/functions/functions.js b/test2/functions/functions.js similarity index 100% rename from test/functions/functions.js rename to test2/functions/functions.js diff --git a/test2/functions/functions.test.js b/test2/functions/functions.test.js new file mode 100644 index 000000000..c6f94fc8c --- /dev/null +++ b/test2/functions/functions.test.js @@ -0,0 +1,15 @@ +const expect = require('expect'); +const functions = require('./functions.js'); + +test('Testing functions', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof functions === 'function').toBeTruthy(); + function Foo() { + this.a = () => 1; + this.b = () => 2; + } + Foo.prototype.c = () => 3; + expect(functions(new Foo())).toEqual(['a', 'b']); + expect(functions(new Foo(), true)).toEqual(['a', 'b', 'c']); +}); diff --git a/test/gcd/gcd.js b/test2/gcd/gcd.js similarity index 100% rename from test/gcd/gcd.js rename to test2/gcd/gcd.js diff --git a/test2/gcd/gcd.test.js b/test2/gcd/gcd.test.js new file mode 100644 index 000000000..a96a20050 --- /dev/null +++ b/test2/gcd/gcd.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const gcd = require('./gcd.js'); + +test('Testing gcd', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof gcd === 'function').toBeTruthy(); + expect(gcd(8, 36)).toBe(4); + expect(gcd(...[12, 8, 32])).toEqual(4); +}); \ No newline at end of file diff --git a/test/geometricProgression/geometricProgression.js b/test2/geometricProgression/geometricProgression.js similarity index 100% rename from test/geometricProgression/geometricProgression.js rename to test2/geometricProgression/geometricProgression.js diff --git a/test2/geometricProgression/geometricProgression.test.js b/test2/geometricProgression/geometricProgression.test.js new file mode 100644 index 000000000..d1cd39d4c --- /dev/null +++ b/test2/geometricProgression/geometricProgression.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const geometricProgression = require('./geometricProgression.js'); + +test('Testing geometricProgression', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof geometricProgression === 'function').toBeTruthy(); + expect(geometricProgression(256)).toEqual([1, 2, 4, 8, 16, 32, 64, 128, 256]); + expect(geometricProgression(256, 3)).toEqual([3, 6, 12, 24, 48, 96, 192]); + expect(geometricProgression(256, 1, 4)).toEqual([1, 4, 16, 64, 256]); +}); \ No newline at end of file diff --git a/test/get/get.js b/test2/get/get.js similarity index 100% rename from test/get/get.js rename to test2/get/get.js diff --git a/test2/get/get.test.js b/test2/get/get.test.js new file mode 100644 index 000000000..358f50b85 --- /dev/null +++ b/test2/get/get.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const get = require('./get.js'); + +test('Testing get', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof get === 'function').toBeTruthy(); + const obj = { selector: { to: { val: 'val to get' } } }; + expect(get(obj, 'selector.to.val')).toEqual(['val to get']); +}); diff --git a/test/getColonTimeFromDate/getColonTimeFromDate.js b/test2/getColonTimeFromDate/getColonTimeFromDate.js similarity index 100% rename from test/getColonTimeFromDate/getColonTimeFromDate.js rename to test2/getColonTimeFromDate/getColonTimeFromDate.js diff --git a/test2/getColonTimeFromDate/getColonTimeFromDate.test.js b/test2/getColonTimeFromDate/getColonTimeFromDate.test.js new file mode 100644 index 000000000..6336f0a1e --- /dev/null +++ b/test2/getColonTimeFromDate/getColonTimeFromDate.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const getColonTimeFromDate = require('./getColonTimeFromDate.js'); + +test('Testing getColonTimeFromDate', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof getColonTimeFromDate === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.js b/test2/getDaysDiffBetweenDates/getDaysDiffBetweenDates.js similarity index 100% rename from test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.js rename to test2/getDaysDiffBetweenDates/getDaysDiffBetweenDates.js diff --git a/test2/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js b/test2/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js new file mode 100644 index 000000000..c3c9ab2e0 --- /dev/null +++ b/test2/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const getDaysDiffBetweenDates = require('./getDaysDiffBetweenDates.js'); + +test('Testing getDaysDiffBetweenDates', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof getDaysDiffBetweenDates === 'function').toBeTruthy(); + expect(getDaysDiffBetweenDates(new Date('2017-12-13'), new Date('2017-12-22'))).toBe(9); +}); \ No newline at end of file diff --git a/test/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.js b/test2/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.js similarity index 100% rename from test/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.js rename to test2/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.js diff --git a/test2/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.test.js b/test2/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.test.js new file mode 100644 index 000000000..c265282ef --- /dev/null +++ b/test2/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const getMeridiemSuffixOfInteger = require('./getMeridiemSuffixOfInteger.js'); + +test('Testing getMeridiemSuffixOfInteger', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof getMeridiemSuffixOfInteger === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/getScrollPosition/getScrollPosition.js b/test2/getScrollPosition/getScrollPosition.js similarity index 100% rename from test/getScrollPosition/getScrollPosition.js rename to test2/getScrollPosition/getScrollPosition.js diff --git a/test2/getScrollPosition/getScrollPosition.test.js b/test2/getScrollPosition/getScrollPosition.test.js new file mode 100644 index 000000000..ca75aec52 --- /dev/null +++ b/test2/getScrollPosition/getScrollPosition.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const getScrollPosition = require('./getScrollPosition.js'); + +test('Testing getScrollPosition', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof getScrollPosition === 'function').toBeTruthy(); +}); diff --git a/test/getStyle/getStyle.js b/test2/getStyle/getStyle.js similarity index 100% rename from test/getStyle/getStyle.js rename to test2/getStyle/getStyle.js diff --git a/test2/getStyle/getStyle.test.js b/test2/getStyle/getStyle.test.js new file mode 100644 index 000000000..1d1fc4e47 --- /dev/null +++ b/test2/getStyle/getStyle.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const getStyle = require('./getStyle.js'); + +test('Testing getStyle', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof getStyle === 'function').toBeTruthy(); +}); diff --git a/test/getType/getType.js b/test2/getType/getType.js similarity index 100% rename from test/getType/getType.js rename to test2/getType/getType.js diff --git a/test2/getType/getType.test.js b/test2/getType/getType.test.js new file mode 100644 index 000000000..4e7b38e4b --- /dev/null +++ b/test2/getType/getType.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const getType = require('./getType.js'); + +test('Testing getType', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof getType === 'function').toBeTruthy(); + expect(getType(new Set([1, 2, 3]))).toBe('set'); +}); \ No newline at end of file diff --git a/test/getURLParameters/getURLParameters.js b/test2/getURLParameters/getURLParameters.js similarity index 100% rename from test/getURLParameters/getURLParameters.js rename to test2/getURLParameters/getURLParameters.js diff --git a/test2/getURLParameters/getURLParameters.test.js b/test2/getURLParameters/getURLParameters.test.js new file mode 100644 index 000000000..4b93ceca6 --- /dev/null +++ b/test2/getURLParameters/getURLParameters.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const getURLParameters = require('./getURLParameters.js'); + +test('Testing getURLParameters', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof getURLParameters === 'function').toBeTruthy(); + expect(getURLParameters('http://url.com/page?name=Adam&surname=Smith')).toEqual({name: 'Adam', surname: 'Smith'}); +}); \ No newline at end of file diff --git a/test/groupBy/groupBy.js b/test3/groupBy/groupBy.js similarity index 100% rename from test/groupBy/groupBy.js rename to test3/groupBy/groupBy.js diff --git a/test3/groupBy/groupBy.test.js b/test3/groupBy/groupBy.test.js new file mode 100644 index 000000000..a639ba073 --- /dev/null +++ b/test3/groupBy/groupBy.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const groupBy = require('./groupBy.js'); + +test('Testing groupBy', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof groupBy === 'function').toBeTruthy(); + expect(groupBy([6.1, 4.2, 6.3], Math.floor)).toEqual({4: [4.2], 6: [6.1, 6.3]}); + expect(groupBy(['one', 'two', 'three'], 'length')).toEqual({3: ['one', 'two'], 5: ['three']}); +}); \ No newline at end of file diff --git a/test/hammingDistance/hammingDistance.js b/test3/hammingDistance/hammingDistance.js similarity index 100% rename from test/hammingDistance/hammingDistance.js rename to test3/hammingDistance/hammingDistance.js diff --git a/test3/hammingDistance/hammingDistance.test.js b/test3/hammingDistance/hammingDistance.test.js new file mode 100644 index 000000000..8ec3fef99 --- /dev/null +++ b/test3/hammingDistance/hammingDistance.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const hammingDistance = require('./hammingDistance.js'); + +test('Testing hammingDistance', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof hammingDistance === 'function').toBeTruthy(); + expect(hammingDistance(2, 3)).toBe(1); +}); \ No newline at end of file diff --git a/test/hasClass/hasClass.js b/test3/hasClass/hasClass.js similarity index 100% rename from test/hasClass/hasClass.js rename to test3/hasClass/hasClass.js diff --git a/test3/hasClass/hasClass.test.js b/test3/hasClass/hasClass.test.js new file mode 100644 index 000000000..5b04c1444 --- /dev/null +++ b/test3/hasClass/hasClass.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const hasClass = require('./hasClass.js'); + +test('Testing hasClass', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof hasClass === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/hasFlags/hasFlags.js b/test3/hasFlags/hasFlags.js similarity index 100% rename from test/hasFlags/hasFlags.js rename to test3/hasFlags/hasFlags.js diff --git a/test3/hasFlags/hasFlags.test.js b/test3/hasFlags/hasFlags.test.js new file mode 100644 index 000000000..50a922aae --- /dev/null +++ b/test3/hasFlags/hasFlags.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const hasFlags = require('./hasFlags.js'); + +test('Testing hasFlags', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof hasFlags === 'function').toBeTruthy(); +}); diff --git a/test/hashBrowser/hashBrowser.js b/test3/hashBrowser/hashBrowser.js similarity index 100% rename from test/hashBrowser/hashBrowser.js rename to test3/hashBrowser/hashBrowser.js diff --git a/test3/hashBrowser/hashBrowser.test.js b/test3/hashBrowser/hashBrowser.test.js new file mode 100644 index 000000000..103e968b1 --- /dev/null +++ b/test3/hashBrowser/hashBrowser.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const hashBrowser = require('./hashBrowser.js'); + +test('Testing hashBrowser', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof hashBrowser === 'function').toBeTruthy(); +}); diff --git a/test/hashNode/hashNode.js b/test3/hashNode/hashNode.js similarity index 100% rename from test/hashNode/hashNode.js rename to test3/hashNode/hashNode.js diff --git a/test3/hashNode/hashNode.test.js b/test3/hashNode/hashNode.test.js new file mode 100644 index 000000000..b594baf55 --- /dev/null +++ b/test3/hashNode/hashNode.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const hashNode = require('./hashNode.js'); + +test('Testing hashNode', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof hashNode === 'function').toBeTruthy(); + 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.js b/test3/head/head.js similarity index 100% rename from test/head/head.js rename to test3/head/head.js diff --git a/test3/head/head.test.js b/test3/head/head.test.js new file mode 100644 index 000000000..cb300bfcf --- /dev/null +++ b/test3/head/head.test.js @@ -0,0 +1,20 @@ +const expect = require('expect'); +const head = require('./head.js'); + +test('Testing head', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof head === 'function').toBeTruthy(); + expect(head({ a: 1234}) === undefined).toBeTruthy(); + expect(head([1, 2, 3])).toBe(1); + expect(head({ 0: false})).toBe(false); + expect(head('String')).toBe('S'); + expect(() => head(null)).toThrow(); + expect(() => head(undefined)).toThrow(); + 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(); + expect((end - start) < 2000).toBeTruthy(); +}); \ No newline at end of file diff --git a/test/hexToRGB/hexToRGB.js b/test3/hexToRGB/hexToRGB.js similarity index 100% rename from test/hexToRGB/hexToRGB.js rename to test3/hexToRGB/hexToRGB.js diff --git a/test3/hexToRGB/hexToRGB.test.js b/test3/hexToRGB/hexToRGB.test.js new file mode 100644 index 000000000..20e0bdf32 --- /dev/null +++ b/test3/hexToRGB/hexToRGB.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const hexToRGB = require('./hexToRGB.js'); + +test('Testing hexToRGB', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof hexToRGB === 'function').toBeTruthy(); + expect(hexToRGB('#27ae60ff')).toBe('rgba(39, 174, 96, 255)'); + expect(hexToRGB('27ae60')).toBe('rgb(39, 174, 96)'); + expect(hexToRGB('#fff')).toBe('rgb(255, 255, 255)'); +}); \ No newline at end of file diff --git a/test/hide/hide.js b/test3/hide/hide.js similarity index 100% rename from test/hide/hide.js rename to test3/hide/hide.js diff --git a/test3/hide/hide.test.js b/test3/hide/hide.test.js new file mode 100644 index 000000000..f011daf95 --- /dev/null +++ b/test3/hide/hide.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const hide = require('./hide.js'); + +test('Testing hide', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof hide === 'function').toBeTruthy(); +}); diff --git a/test/howManyTimes/howManyTimes.js b/test3/howManyTimes/howManyTimes.js similarity index 100% rename from test/howManyTimes/howManyTimes.js rename to test3/howManyTimes/howManyTimes.js diff --git a/test3/howManyTimes/howManyTimes.test.js b/test3/howManyTimes/howManyTimes.test.js new file mode 100644 index 000000000..daacb5c6d --- /dev/null +++ b/test3/howManyTimes/howManyTimes.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const howManyTimes = require('./howManyTimes.js'); + +test('Testing howManyTimes', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof howManyTimes === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/httpDelete/httpDelete.js b/test3/httpDelete/httpDelete.js similarity index 100% rename from test/httpDelete/httpDelete.js rename to test3/httpDelete/httpDelete.js diff --git a/test3/httpDelete/httpDelete.test.js b/test3/httpDelete/httpDelete.test.js new file mode 100644 index 000000000..afc68db92 --- /dev/null +++ b/test3/httpDelete/httpDelete.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const httpDelete = require('./httpDelete.js'); + +test('Testing httpDelete', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof httpDelete === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/httpGet/httpGet.js b/test3/httpGet/httpGet.js similarity index 100% rename from test/httpGet/httpGet.js rename to test3/httpGet/httpGet.js diff --git a/test/httpGet/httpGet.test.js b/test3/httpGet/httpGet.test.js similarity index 97% rename from test/httpGet/httpGet.test.js rename to test3/httpGet/httpGet.test.js index a23ff2131..813289a70 100644 --- a/test/httpGet/httpGet.test.js +++ b/test3/httpGet/httpGet.test.js @@ -1,6 +1,4 @@ -const test = require('tape'); -//const httpGet = require('./httpGet.js'); -// Override +const expect = require("expect"); const httpGet = (url, callback, err = console.error) => { const request = new XMLHttpRequest(); request.open('GET', url, true); @@ -9,26 +7,20 @@ const httpGet = (url, callback, err = console.error) => { request.send(); }; -test('Testing httpGet', (t) => { +test('Testing httpGet', () => { //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'); + expect(typeof httpGet === 'function').toBeTruthy(); httpGet('https://jsonplaceholder.typicode.com/posts/1', response => { - t.deepEqual(JSON.parse(response), { + expect(JSON.parse(response)).toEqual({ 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(); }); // Custom implementation of XMLHttpRequest for the requirements of this snippet. // Based on https://github.com/driverdan/node-XMLHttpRequest diff --git a/test/httpPost/httpPost.js b/test3/httpPost/httpPost.js similarity index 100% rename from test/httpPost/httpPost.js rename to test3/httpPost/httpPost.js diff --git a/test/httpPost/httpPost.test.js b/test3/httpPost/httpPost.test.js similarity index 97% rename from test/httpPost/httpPost.test.js rename to test3/httpPost/httpPost.test.js index 05fc7f421..e3367ba47 100644 --- a/test/httpPost/httpPost.test.js +++ b/test3/httpPost/httpPost.test.js @@ -1,5 +1,4 @@ -const test = require('tape'); -//const httpPost = require('./httpPost.js'); +const expect = require("expect"); const httpPost = (url, data, callback, err = console.error) => { const request = new XMLHttpRequest(); request.open('POST', url, true); @@ -8,23 +7,18 @@ const httpPost = (url, data, callback, err = console.error) => { request.onerror = () => err(request); request.send(data); }; -test('Testing httpPost', (t) => { +test('Testing httpPost', () => { //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'); + expect(typeof httpPost === 'function').toBeTruthy(); 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'); + expect(JSON.parse(response).id).toEqual(101); }); - //t.deepEqual(httpPost(args..), 'Expected'); - //t.equal(httpPost(args..), 'Expected'); - //t.false(httpPost(args..), 'Expected'); - //t.throws(httpPost(args..), 'Expected'); - t.end(); }); // Custom implementation of XMLHttpRequest for the requirements of this snippet. diff --git a/test/httpPut/httpPut.js b/test3/httpPut/httpPut.js similarity index 100% rename from test/httpPut/httpPut.js rename to test3/httpPut/httpPut.js diff --git a/test3/httpPut/httpPut.test.js b/test3/httpPut/httpPut.test.js new file mode 100644 index 000000000..57cc17100 --- /dev/null +++ b/test3/httpPut/httpPut.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const httpPut = require('./httpPut.js'); + +test('Testing httpPut', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof httpPut === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/httpsRedirect/httpsRedirect.js b/test3/httpsRedirect/httpsRedirect.js similarity index 100% rename from test/httpsRedirect/httpsRedirect.js rename to test3/httpsRedirect/httpsRedirect.js diff --git a/test3/httpsRedirect/httpsRedirect.test.js b/test3/httpsRedirect/httpsRedirect.test.js new file mode 100644 index 000000000..dcea1d1e6 --- /dev/null +++ b/test3/httpsRedirect/httpsRedirect.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const httpsRedirect = require('./httpsRedirect.js'); + +test('Testing httpsRedirect', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof httpsRedirect === 'function').toBeTruthy(); +}); diff --git a/test/hz/hz.js b/test3/hz/hz.js similarity index 100% rename from test/hz/hz.js rename to test3/hz/hz.js diff --git a/test3/hz/hz.test.js b/test3/hz/hz.test.js new file mode 100644 index 000000000..0181386c2 --- /dev/null +++ b/test3/hz/hz.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const hz = require('./hz.js'); + +test('Testing hz', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof hz === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/inRange/inRange.js b/test3/inRange/inRange.js similarity index 100% rename from test/inRange/inRange.js rename to test3/inRange/inRange.js diff --git a/test3/inRange/inRange.test.js b/test3/inRange/inRange.test.js new file mode 100644 index 000000000..dbaa8e096 --- /dev/null +++ b/test3/inRange/inRange.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const inRange = require('./inRange.js'); + +test('Testing inRange', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof inRange === 'function').toBeTruthy(); + expect(inRange(3, 2, 5)).toBe(true); + expect(inRange(3, 4)).toBe(true); + expect(inRange(2, 3, 5)).toBe(false); + expect(inRange(3, 2)).toBe(false); +}); \ No newline at end of file diff --git a/test/indexOfAll/indexOfAll.js b/test3/indexOfAll/indexOfAll.js similarity index 100% rename from test/indexOfAll/indexOfAll.js rename to test3/indexOfAll/indexOfAll.js diff --git a/test3/indexOfAll/indexOfAll.test.js b/test3/indexOfAll/indexOfAll.test.js new file mode 100644 index 000000000..792cd1f16 --- /dev/null +++ b/test3/indexOfAll/indexOfAll.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const indexOfAll = require('./indexOfAll.js'); + +test('Testing indexOfAll', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof indexOfAll === 'function').toBeTruthy(); + expect(indexOfAll([1, 2, 3, 1, 2, 3], 1)).toEqual([0,3]); + expect(indexOfAll([1, 2, 3], 4)).toEqual([]); +}); \ No newline at end of file diff --git a/test/initial/initial.js b/test3/initial/initial.js similarity index 100% rename from test/initial/initial.js rename to test3/initial/initial.js diff --git a/test3/initial/initial.test.js b/test3/initial/initial.test.js new file mode 100644 index 000000000..c4febca6a --- /dev/null +++ b/test3/initial/initial.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const initial = require('./initial.js'); + +test('Testing initial', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof initial === 'function').toBeTruthy(); + expect(initial([1, 2, 3])).toEqual([1, 2]); +}); \ No newline at end of file diff --git a/test/initialize2DArray/initialize2DArray.js b/test3/initialize2DArray/initialize2DArray.js similarity index 100% rename from test/initialize2DArray/initialize2DArray.js rename to test3/initialize2DArray/initialize2DArray.js diff --git a/test3/initialize2DArray/initialize2DArray.test.js b/test3/initialize2DArray/initialize2DArray.test.js new file mode 100644 index 000000000..c8bbb69cb --- /dev/null +++ b/test3/initialize2DArray/initialize2DArray.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const initialize2DArray = require('./initialize2DArray.js'); + +test('Testing initialize2DArray', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof initialize2DArray === 'function').toBeTruthy(); + expect(initialize2DArray(2, 2, 0)).toEqual([[0,0], [0,0]]); +}); \ No newline at end of file diff --git a/test/initializeArrayWithRange/initializeArrayWithRange.js b/test3/initializeArrayWithRange/initializeArrayWithRange.js similarity index 100% rename from test/initializeArrayWithRange/initializeArrayWithRange.js rename to test3/initializeArrayWithRange/initializeArrayWithRange.js diff --git a/test3/initializeArrayWithRange/initializeArrayWithRange.test.js b/test3/initializeArrayWithRange/initializeArrayWithRange.test.js new file mode 100644 index 000000000..e232928c2 --- /dev/null +++ b/test3/initializeArrayWithRange/initializeArrayWithRange.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const initializeArrayWithRange = require('./initializeArrayWithRange.js'); + +test('Testing initializeArrayWithRange', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof initializeArrayWithRange === 'function').toBeTruthy(); + expect(initializeArrayWithRange(5)).toEqual([0, 1, 2, 3, 4, 5]); +}); \ No newline at end of file diff --git a/test/initializeArrayWithRangeRight/initializeArrayWithRangeRight.js b/test3/initializeArrayWithRangeRight/initializeArrayWithRangeRight.js similarity index 100% rename from test/initializeArrayWithRangeRight/initializeArrayWithRangeRight.js rename to test3/initializeArrayWithRangeRight/initializeArrayWithRangeRight.js diff --git a/test3/initializeArrayWithRangeRight/initializeArrayWithRangeRight.test.js b/test3/initializeArrayWithRangeRight/initializeArrayWithRangeRight.test.js new file mode 100644 index 000000000..462cf1c8b --- /dev/null +++ b/test3/initializeArrayWithRangeRight/initializeArrayWithRangeRight.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const initializeArrayWithRangeRight = require('./initializeArrayWithRangeRight.js'); + +test('Testing initializeArrayWithRangeRight', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof initializeArrayWithRangeRight === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/initializeArrayWithValues/initializeArrayWithValues.js b/test3/initializeArrayWithValues/initializeArrayWithValues.js similarity index 100% rename from test/initializeArrayWithValues/initializeArrayWithValues.js rename to test3/initializeArrayWithValues/initializeArrayWithValues.js diff --git a/test3/initializeArrayWithValues/initializeArrayWithValues.test.js b/test3/initializeArrayWithValues/initializeArrayWithValues.test.js new file mode 100644 index 000000000..c7b4bbd2f --- /dev/null +++ b/test3/initializeArrayWithValues/initializeArrayWithValues.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const initializeArrayWithValues = require('./initializeArrayWithValues.js'); + +test('Testing initializeArrayWithValues', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof initializeArrayWithValues === 'function').toBeTruthy(); + expect(initializeArrayWithValues(5, 2)).toEqual([2, 2, 2, 2, 2]); +}); \ No newline at end of file diff --git a/test/initializeNDArray/initializeNDArray.js b/test3/initializeNDArray/initializeNDArray.js similarity index 100% rename from test/initializeNDArray/initializeNDArray.js rename to test3/initializeNDArray/initializeNDArray.js diff --git a/test3/initializeNDArray/initializeNDArray.test.js b/test3/initializeNDArray/initializeNDArray.test.js new file mode 100644 index 000000000..c2557c2ce --- /dev/null +++ b/test3/initializeNDArray/initializeNDArray.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const initializeNDArray = require('./initializeNDArray.js'); + +test('Testing initializeNDArray', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof initializeNDArray === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/intersection/intersection.js b/test3/intersection/intersection.js similarity index 100% rename from test/intersection/intersection.js rename to test3/intersection/intersection.js diff --git a/test3/intersection/intersection.test.js b/test3/intersection/intersection.test.js new file mode 100644 index 000000000..10377e033 --- /dev/null +++ b/test3/intersection/intersection.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const intersection = require('./intersection.js'); + +test('Testing intersection', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof intersection === 'function').toBeTruthy(); + expect(intersection([1, 2, 3], [4, 3, 2])).toEqual([2, 3]); +}); \ No newline at end of file diff --git a/test/intersectionBy/intersectionBy.js b/test3/intersectionBy/intersectionBy.js similarity index 100% rename from test/intersectionBy/intersectionBy.js rename to test3/intersectionBy/intersectionBy.js diff --git a/test3/intersectionBy/intersectionBy.test.js b/test3/intersectionBy/intersectionBy.test.js new file mode 100644 index 000000000..903e522ed --- /dev/null +++ b/test3/intersectionBy/intersectionBy.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const intersectionBy = require('./intersectionBy.js'); + +test('Testing intersectionBy', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof intersectionBy === 'function').toBeTruthy(); + expect(intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor)).toEqual([2.1]); +}); diff --git a/test/intersectionWith/intersectionWith.js b/test3/intersectionWith/intersectionWith.js similarity index 100% rename from test/intersectionWith/intersectionWith.js rename to test3/intersectionWith/intersectionWith.js diff --git a/test3/intersectionWith/intersectionWith.test.js b/test3/intersectionWith/intersectionWith.test.js new file mode 100644 index 000000000..bf2c4a091 --- /dev/null +++ b/test3/intersectionWith/intersectionWith.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const intersectionWith = require('./intersectionWith.js'); + +test('Testing intersectionWith', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof intersectionWith === 'function').toBeTruthy(); + 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.js b/test3/invertKeyValues/invertKeyValues.js similarity index 100% rename from test/invertKeyValues/invertKeyValues.js rename to test3/invertKeyValues/invertKeyValues.js diff --git a/test3/invertKeyValues/invertKeyValues.test.js b/test3/invertKeyValues/invertKeyValues.test.js new file mode 100644 index 000000000..02a21f85e --- /dev/null +++ b/test3/invertKeyValues/invertKeyValues.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const invertKeyValues = require('./invertKeyValues.js'); + +test('Testing invertKeyValues', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof invertKeyValues === 'function').toBeTruthy(); + expect(invertKeyValues({ a: 1, b: 2, c: 1 })).toEqual({ 1: [ 'a', 'c' ], 2: [ 'b' ] }); + expect(invertKeyValues({ a: 1, b: 2, c: 1 }, value => 'group' + value)).toEqual({ group1: [ 'a', 'c' ], group2: [ 'b' ] }); +}); \ No newline at end of file diff --git a/test/is/is.js b/test3/is/is.js similarity index 100% rename from test/is/is.js rename to test3/is/is.js diff --git a/test3/is/is.test.js b/test3/is/is.test.js new file mode 100644 index 000000000..b39b90d11 --- /dev/null +++ b/test3/is/is.test.js @@ -0,0 +1,24 @@ +const expect = require('expect'); +const is = require('./is.js'); + +test('Testing is', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof is === 'function').toBeTruthy(); + expect(is(Array, [1])).toBeTruthy(); + expect(is(Array, [])).toBeTruthy(); + expect(is(Array, {})).toBeFalsy(); + expect(is(Object, {})).toBeTruthy(); + expect(is(Map, new Map())).toBeTruthy(); + expect(is(RegExp, /./g)).toBeTruthy(); + expect(is(Set, new Set())).toBeTruthy(); + expect(is(WeakMap, new WeakMap())).toBeTruthy(); + expect(is(WeakSet, new WeakSet())).toBeTruthy(); + expect(is(String, '')).toBeTruthy(); + expect(is(String, new String(''))).toBeTruthy(); + expect(is(Number, 1)).toBeTruthy(); + expect(is(Number, new Number('10'))).toBeTruthy(); + expect(is(Boolean, false)).toBeTruthy(); + expect(is(Boolean, new Boolean(false))).toBeTruthy(); + expect(is(Function, () => null)).toBeTruthy(); +}); diff --git a/test/isAbsoluteURL/isAbsoluteURL.js b/test3/isAbsoluteURL/isAbsoluteURL.js similarity index 100% rename from test/isAbsoluteURL/isAbsoluteURL.js rename to test3/isAbsoluteURL/isAbsoluteURL.js diff --git a/test3/isAbsoluteURL/isAbsoluteURL.test.js b/test3/isAbsoluteURL/isAbsoluteURL.test.js new file mode 100644 index 000000000..085b7cf3c --- /dev/null +++ b/test3/isAbsoluteURL/isAbsoluteURL.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const isAbsoluteURL = require('./isAbsoluteURL.js'); + +test('Testing isAbsoluteURL', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isAbsoluteURL === 'function').toBeTruthy(); + expect(isAbsoluteURL('https://google.com')).toBe(true); + expect(isAbsoluteURL('ftp://www.myserver.net')).toBe(true); + expect(isAbsoluteURL('/foo/bar')).toBe(false); +}); \ No newline at end of file diff --git a/test/isAnagram/isAnagram.js b/test3/isAnagram/isAnagram.js similarity index 100% rename from test/isAnagram/isAnagram.js rename to test3/isAnagram/isAnagram.js diff --git a/test3/isAnagram/isAnagram.test.js b/test3/isAnagram/isAnagram.test.js new file mode 100644 index 000000000..0508183a8 --- /dev/null +++ b/test3/isAnagram/isAnagram.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const isAnagram = require('./isAnagram.js'); + +test('Testing isAnagram', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isAnagram === 'function').toBeTruthy(); + expect(isAnagram('iceman', 'cinema')).toBeTruthy(); + expect(isAnagram('rail safety', 'fairy tales')).toBeTruthy(); + expect(isAnagram('roast beef', 'eat for BSE')).toBeTruthy(); + expect(isAnagram('Regera Dowdy', 'E. G. Deadworry')).toBeTruthy(); +}); diff --git a/test/isArmstrongNumber/isArmstrongNumber.js b/test3/isArmstrongNumber/isArmstrongNumber.js similarity index 100% rename from test/isArmstrongNumber/isArmstrongNumber.js rename to test3/isArmstrongNumber/isArmstrongNumber.js diff --git a/test3/isArmstrongNumber/isArmstrongNumber.test.js b/test3/isArmstrongNumber/isArmstrongNumber.test.js new file mode 100644 index 000000000..07c78dd06 --- /dev/null +++ b/test3/isArmstrongNumber/isArmstrongNumber.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const isArmstrongNumber = require('./isArmstrongNumber.js'); + +test('Testing isArmstrongNumber', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isArmstrongNumber === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/isArray/isArray.js b/test3/isArray/isArray.js similarity index 100% rename from test/isArray/isArray.js rename to test3/isArray/isArray.js diff --git a/test3/isArray/isArray.test.js b/test3/isArray/isArray.test.js new file mode 100644 index 000000000..21416f848 --- /dev/null +++ b/test3/isArray/isArray.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const isArray = require('./isArray.js'); + +test('Testing isArray', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isArray === 'function').toBeTruthy(); + expect(isArray([1])).toBe(true); + expect(isArray('array')).toBe(false); +}); \ No newline at end of file diff --git a/test/isArrayBuffer/isArrayBuffer.js b/test3/isArrayBuffer/isArrayBuffer.js similarity index 100% rename from test/isArrayBuffer/isArrayBuffer.js rename to test3/isArrayBuffer/isArrayBuffer.js diff --git a/test3/isArrayBuffer/isArrayBuffer.test.js b/test3/isArrayBuffer/isArrayBuffer.test.js new file mode 100644 index 000000000..3e9264b89 --- /dev/null +++ b/test3/isArrayBuffer/isArrayBuffer.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const isArrayBuffer = require('./isArrayBuffer.js'); + +test('Testing isArrayBuffer', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isArrayBuffer === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/isArrayLike/isArrayLike.js b/test3/isArrayLike/isArrayLike.js similarity index 100% rename from test/isArrayLike/isArrayLike.js rename to test3/isArrayLike/isArrayLike.js diff --git a/test3/isArrayLike/isArrayLike.test.js b/test3/isArrayLike/isArrayLike.test.js new file mode 100644 index 000000000..a11a11186 --- /dev/null +++ b/test3/isArrayLike/isArrayLike.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const isArrayLike = require('./isArrayLike.js'); + +test('Testing isArrayLike', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isArrayLike === 'function').toBeTruthy(); + expect(isArrayLike('abc')).toBe(true); + expect(isArrayLike([1,2,3])).toBe(true); + expect(isArrayLike(null)).toBe(false); +}); diff --git a/test/isBoolean/isBoolean.js b/test3/isBoolean/isBoolean.js similarity index 100% rename from test/isBoolean/isBoolean.js rename to test3/isBoolean/isBoolean.js diff --git a/test3/isBoolean/isBoolean.test.js b/test3/isBoolean/isBoolean.test.js new file mode 100644 index 000000000..f5b7ebefd --- /dev/null +++ b/test3/isBoolean/isBoolean.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const isBoolean = require('./isBoolean.js'); + +test('Testing isBoolean', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isBoolean === 'function').toBeTruthy(); + expect(isBoolean(null)).toBe(false); + expect(isBoolean(false)).toBe(true); +}); \ No newline at end of file diff --git a/test/isBrowser/isBrowser.js b/test3/isBrowser/isBrowser.js similarity index 100% rename from test/isBrowser/isBrowser.js rename to test3/isBrowser/isBrowser.js diff --git a/test3/isBrowser/isBrowser.test.js b/test3/isBrowser/isBrowser.test.js new file mode 100644 index 000000000..bb0a421d5 --- /dev/null +++ b/test3/isBrowser/isBrowser.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const isBrowser = require('./isBrowser.js'); + +test('Testing isBrowser', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isBrowser === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/isBrowserTabFocused/isBrowserTabFocused.js b/test3/isBrowserTabFocused/isBrowserTabFocused.js similarity index 100% rename from test/isBrowserTabFocused/isBrowserTabFocused.js rename to test3/isBrowserTabFocused/isBrowserTabFocused.js diff --git a/test3/isBrowserTabFocused/isBrowserTabFocused.test.js b/test3/isBrowserTabFocused/isBrowserTabFocused.test.js new file mode 100644 index 000000000..54989d858 --- /dev/null +++ b/test3/isBrowserTabFocused/isBrowserTabFocused.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const isBrowserTabFocused = require('./isBrowserTabFocused.js'); + +test('Testing isBrowserTabFocused', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isBrowserTabFocused === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/isDivisible/isDivisible.js b/test3/isDivisible/isDivisible.js similarity index 100% rename from test/isDivisible/isDivisible.js rename to test3/isDivisible/isDivisible.js diff --git a/test3/isDivisible/isDivisible.test.js b/test3/isDivisible/isDivisible.test.js new file mode 100644 index 000000000..637d6b4d5 --- /dev/null +++ b/test3/isDivisible/isDivisible.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const isDivisible = require('./isDivisible.js'); + +test('Testing isDivisible', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isDivisible === 'function').toBeTruthy(); + expect(isDivisible(6, 3)).toBe(true); +}); \ No newline at end of file diff --git a/test/isEmpty/isEmpty.js b/test3/isEmpty/isEmpty.js similarity index 100% rename from test/isEmpty/isEmpty.js rename to test3/isEmpty/isEmpty.js diff --git a/test3/isEmpty/isEmpty.test.js b/test3/isEmpty/isEmpty.test.js new file mode 100644 index 000000000..70806b461 --- /dev/null +++ b/test3/isEmpty/isEmpty.test.js @@ -0,0 +1,18 @@ +const expect = require('expect'); +const isEmpty = require('./isEmpty.js'); + +test('Testing isEmpty', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isEmpty === 'function').toBeTruthy(); + expect(isEmpty(new Map())).toBe(true); + expect(isEmpty(new Set())).toBe(true); + expect(isEmpty([])).toBe(true); + expect(isEmpty({})).toBe(true); + expect(isEmpty('')).toBe(true); + expect(isEmpty([1, 2])).toBe(false); + expect(isEmpty({ a: 1, b: 2 })).toBe(false); + expect(isEmpty('text')).toBe(false); + expect(isEmpty(123)).toBe(true); + expect(isEmpty(true)).toBe(true); +}); diff --git a/test/isEven/isEven.js b/test3/isEven/isEven.js similarity index 100% rename from test/isEven/isEven.js rename to test3/isEven/isEven.js diff --git a/test3/isEven/isEven.test.js b/test3/isEven/isEven.test.js new file mode 100644 index 000000000..1babab815 --- /dev/null +++ b/test3/isEven/isEven.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const isEven = require('./isEven.js'); + +test('Testing isEven', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isEven === 'function').toBeTruthy(); + expect(isEven(4)).toBe(true); + expect(isEven(5)).toBeFalsy(); +}); \ No newline at end of file diff --git a/test/isFunction/isFunction.js b/test3/isFunction/isFunction.js similarity index 100% rename from test/isFunction/isFunction.js rename to test3/isFunction/isFunction.js diff --git a/test3/isFunction/isFunction.test.js b/test3/isFunction/isFunction.test.js new file mode 100644 index 000000000..97c8b64f5 --- /dev/null +++ b/test3/isFunction/isFunction.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const isFunction = require('./isFunction.js'); + +test('Testing isFunction', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isFunction === 'function').toBeTruthy(); + expect(isFunction(x => x)).toBe(true); + expect(isFunction('x')).toBe(false); +}); \ No newline at end of file diff --git a/test/isLowerCase/isLowerCase.js b/test3/isLowerCase/isLowerCase.js similarity index 100% rename from test/isLowerCase/isLowerCase.js rename to test3/isLowerCase/isLowerCase.js diff --git a/test3/isLowerCase/isLowerCase.test.js b/test3/isLowerCase/isLowerCase.test.js new file mode 100644 index 000000000..624400811 --- /dev/null +++ b/test3/isLowerCase/isLowerCase.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const isLowerCase = require('./isLowerCase.js'); + +test('Testing isLowerCase', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isLowerCase === 'function').toBeTruthy(); + expect(isLowerCase('abc')).toBe(true); + expect(isLowerCase('a3@$')).toBe(true); + expect(isLowerCase('A3@$')).toBe(false); +}); \ No newline at end of file diff --git a/test/isMap/isMap.js b/test3/isMap/isMap.js similarity index 100% rename from test/isMap/isMap.js rename to test3/isMap/isMap.js diff --git a/test3/isMap/isMap.test.js b/test3/isMap/isMap.test.js new file mode 100644 index 000000000..27a16b4a6 --- /dev/null +++ b/test3/isMap/isMap.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const isMap = require('./isMap.js'); + +test('Testing isMap', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isMap === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/isNil/isNil.js b/test3/isNil/isNil.js similarity index 100% rename from test/isNil/isNil.js rename to test3/isNil/isNil.js diff --git a/test3/isNil/isNil.test.js b/test3/isNil/isNil.test.js new file mode 100644 index 000000000..d3412b0fb --- /dev/null +++ b/test3/isNil/isNil.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const isNil = require('./isNil.js'); + +test('Testing isNil', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isNil === 'function').toBeTruthy(); + expect(isNil(null)).toBe(true); + expect(isNil(undefined)).toBe(true); + expect(isNil('')).toBe(false); +}); diff --git a/test/isNull/isNull.js b/test3/isNull/isNull.js similarity index 100% rename from test/isNull/isNull.js rename to test3/isNull/isNull.js diff --git a/test3/isNull/isNull.test.js b/test3/isNull/isNull.test.js new file mode 100644 index 000000000..d9d6935c0 --- /dev/null +++ b/test3/isNull/isNull.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const isNull = require('./isNull.js'); + +test('Testing isNull', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isNull === 'function').toBeTruthy(); + expect(isNull(null)).toBe(true); + expect(isNull(NaN)).toBe(false); +}); \ No newline at end of file diff --git a/test/isNumber/isNumber.js b/test3/isNumber/isNumber.js similarity index 100% rename from test/isNumber/isNumber.js rename to test3/isNumber/isNumber.js diff --git a/test3/isNumber/isNumber.test.js b/test3/isNumber/isNumber.test.js new file mode 100644 index 000000000..c0effd774 --- /dev/null +++ b/test3/isNumber/isNumber.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const isNumber = require('./isNumber.js'); + +test('Testing isNumber', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isNumber === 'function').toBeTruthy(); + expect(isNumber(1)).toBe(true); + expect(isNumber('1')).toBe(false); +}); \ No newline at end of file diff --git a/test/isObject/isObject.js b/test3/isObject/isObject.js similarity index 100% rename from test/isObject/isObject.js rename to test3/isObject/isObject.js diff --git a/test3/isObject/isObject.test.js b/test3/isObject/isObject.test.js new file mode 100644 index 000000000..8531462f5 --- /dev/null +++ b/test3/isObject/isObject.test.js @@ -0,0 +1,13 @@ +const expect = require('expect'); +const isObject = require('./isObject.js'); + +test('Testing isObject', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isObject === 'function').toBeTruthy(); + + expect(isObject([1, 2, 3, 4])).toBeTruthy(); + expect(isObject([])).toBeTruthy(); + expect(isObject({ a:1 })).toBeTruthy(); + expect(isObject(true)).toBeFalsy(); +}); diff --git a/test/isObjectLike/isObjectLike.js b/test3/isObjectLike/isObjectLike.js similarity index 100% rename from test/isObjectLike/isObjectLike.js rename to test3/isObjectLike/isObjectLike.js diff --git a/test3/isObjectLike/isObjectLike.test.js b/test3/isObjectLike/isObjectLike.test.js new file mode 100644 index 000000000..5058fe8b1 --- /dev/null +++ b/test3/isObjectLike/isObjectLike.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const isObjectLike = require('./isObjectLike.js'); + +test('Testing isObjectLike', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isObjectLike === 'function').toBeTruthy(); + expect(isObjectLike({})).toBe(true); + expect(isObjectLike([1, 2, 3])).toBe(true); + expect(isObjectLike(x => x)).toBe(false); + expect(isObjectLike(null)).toBe(false); +}); diff --git a/test/isPlainObject/isPlainObject.js b/test3/isPlainObject/isPlainObject.js similarity index 100% rename from test/isPlainObject/isPlainObject.js rename to test3/isPlainObject/isPlainObject.js diff --git a/test3/isPlainObject/isPlainObject.test.js b/test3/isPlainObject/isPlainObject.test.js new file mode 100644 index 000000000..ce6feaa5b --- /dev/null +++ b/test3/isPlainObject/isPlainObject.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const isPlainObject = require('./isPlainObject.js'); + +test('Testing isPlainObject', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isPlainObject === 'function').toBeTruthy(); + expect(isPlainObject({ a: 1 })).toBe(true); + expect(isPlainObject(new Map())).toBe(false); +}); diff --git a/test/JSONToDate/JSONToDate.js b/test4/JSONToDate/JSONToDate.js similarity index 100% rename from test/JSONToDate/JSONToDate.js rename to test4/JSONToDate/JSONToDate.js diff --git a/test4/JSONToDate/JSONToDate.test.js b/test4/JSONToDate/JSONToDate.test.js new file mode 100644 index 000000000..bf3f186c8 --- /dev/null +++ b/test4/JSONToDate/JSONToDate.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const JSONToDate = require('./JSONToDate.js'); + +test('Testing JSONToDate', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof JSONToDate === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/JSONToFile/JSONToFile.js b/test4/JSONToFile/JSONToFile.js similarity index 100% rename from test/JSONToFile/JSONToFile.js rename to test4/JSONToFile/JSONToFile.js diff --git a/test4/JSONToFile/JSONToFile.test.js b/test4/JSONToFile/JSONToFile.test.js new file mode 100644 index 000000000..6a17cb86d --- /dev/null +++ b/test4/JSONToFile/JSONToFile.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const JSONToFile = require('./JSONToFile.js'); + +test('Testing JSONToFile', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof JSONToFile === 'function').toBeTruthy(); +}); diff --git a/test/isPrime/isPrime.js b/test4/isPrime/isPrime.js similarity index 100% rename from test/isPrime/isPrime.js rename to test4/isPrime/isPrime.js diff --git a/test4/isPrime/isPrime.test.js b/test4/isPrime/isPrime.test.js new file mode 100644 index 000000000..5d17948ef --- /dev/null +++ b/test4/isPrime/isPrime.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const isPrime = require('./isPrime.js'); + +test('Testing isPrime', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isPrime === 'function').toBeTruthy(); + expect(isPrime(11)).toBe(true); +}); \ No newline at end of file diff --git a/test/isPrimitive/isPrimitive.js b/test4/isPrimitive/isPrimitive.js similarity index 100% rename from test/isPrimitive/isPrimitive.js rename to test4/isPrimitive/isPrimitive.js diff --git a/test4/isPrimitive/isPrimitive.test.js b/test4/isPrimitive/isPrimitive.test.js new file mode 100644 index 000000000..0ce6c26b0 --- /dev/null +++ b/test4/isPrimitive/isPrimitive.test.js @@ -0,0 +1,23 @@ +const expect = require('expect'); +const isPrimitive = require('./isPrimitive.js'); + +test('Testing isPrimitive', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isPrimitive === 'function').toBeTruthy(); + expect(isPrimitive(null)).toBeTruthy(); + expect(isPrimitive(undefined)).toBeTruthy(); + expect(isPrimitive('string')).toBeTruthy(); + expect(isPrimitive(true)).toBeTruthy(); + expect(isPrimitive(50)).toBeTruthy(); + expect(isPrimitive('Hello')).toBeTruthy(); + expect(isPrimitive(false)).toBeTruthy(); + expect(isPrimitive(Symbol())).toBeTruthy(); + expect(isPrimitive([1, 2, 3])).toBeFalsy(); + expect(isPrimitive({ a: 123 })).toBeFalsy(); + + let start = new Date().getTime(); + isPrimitive({ a: 123 }); + let end = new Date().getTime(); + expect((end - start) < 2000).toBeTruthy(); +}); \ No newline at end of file diff --git a/test/isPromiseLike/isPromiseLike.js b/test4/isPromiseLike/isPromiseLike.js similarity index 100% rename from test/isPromiseLike/isPromiseLike.js rename to test4/isPromiseLike/isPromiseLike.js diff --git a/test4/isPromiseLike/isPromiseLike.test.js b/test4/isPromiseLike/isPromiseLike.test.js new file mode 100644 index 000000000..a971c86f0 --- /dev/null +++ b/test4/isPromiseLike/isPromiseLike.test.js @@ -0,0 +1,15 @@ +const expect = require('expect'); +const isPromiseLike = require('./isPromiseLike.js'); + +test('Testing isPromiseLike', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isPromiseLike === 'function').toBeTruthy(); + expect(isPromiseLike({ + then: function() { + return ''; + } + })).toBe(true); + expect(isPromiseLike(null)).toBe(false); + expect(isPromiseLike({})).toBe(false); +}); diff --git a/test/isRegExp/isRegExp.js b/test4/isRegExp/isRegExp.js similarity index 100% rename from test/isRegExp/isRegExp.js rename to test4/isRegExp/isRegExp.js diff --git a/test4/isRegExp/isRegExp.test.js b/test4/isRegExp/isRegExp.test.js new file mode 100644 index 000000000..c72df0593 --- /dev/null +++ b/test4/isRegExp/isRegExp.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const isRegExp = require('./isRegExp.js'); + +test('Testing isRegExp', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isRegExp === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/isSet/isSet.js b/test4/isSet/isSet.js similarity index 100% rename from test/isSet/isSet.js rename to test4/isSet/isSet.js diff --git a/test4/isSet/isSet.test.js b/test4/isSet/isSet.test.js new file mode 100644 index 000000000..0cc4d8995 --- /dev/null +++ b/test4/isSet/isSet.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const isSet = require('./isSet.js'); + +test('Testing isSet', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isSet === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/isSimilar/isSimilar.js b/test4/isSimilar/isSimilar.js similarity index 100% rename from test/isSimilar/isSimilar.js rename to test4/isSimilar/isSimilar.js diff --git a/test4/isSimilar/isSimilar.test.js b/test4/isSimilar/isSimilar.test.js new file mode 100644 index 000000000..24d4e6abf --- /dev/null +++ b/test4/isSimilar/isSimilar.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const isSimilar = require('./isSimilar.js'); + +test('Testing isSimilar', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isSimilar === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/isSorted/isSorted.js b/test4/isSorted/isSorted.js similarity index 100% rename from test/isSorted/isSorted.js rename to test4/isSorted/isSorted.js diff --git a/test4/isSorted/isSorted.test.js b/test4/isSorted/isSorted.test.js new file mode 100644 index 000000000..c9f3432d6 --- /dev/null +++ b/test4/isSorted/isSorted.test.js @@ -0,0 +1,20 @@ +const expect = require('expect'); +const isSorted = require('./isSorted.js'); + +test('Testing isSorted', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isSorted === 'function').toBeTruthy(); + //t.deepEqual(isSorted(args..), 'Expected'); + expect(isSorted([0, 1, 2])).toBe(1); + expect(isSorted([0, 1, 2, 2])).toBe(1); + expect(isSorted([-4, -3, -2])).toBe(1); + expect(isSorted([0, 0, 1, 2])).toBe(1); + expect(isSorted([2, 1, 0])).toBe(-1); + expect(isSorted([2, 2, 1, 0])).toBe(-1); + expect(isSorted([-2, -3, -4])).toBe(-1); + expect(isSorted([2, 1, 0, 0])).toBe(-1); + expect(isSorted([])).toBe(undefined); + expect(isSorted([1])).toBe(0); + expect(isSorted([1, 2, 1])).toBe(0); +}); diff --git a/test/isString/isString.js b/test4/isString/isString.js similarity index 100% rename from test/isString/isString.js rename to test4/isString/isString.js diff --git a/test4/isString/isString.test.js b/test4/isString/isString.test.js new file mode 100644 index 000000000..be8d629a2 --- /dev/null +++ b/test4/isString/isString.test.js @@ -0,0 +1,13 @@ +const expect = require('expect'); +const isString = require('./isString.js'); + +test('Testing isString', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isString === 'function').toBeTruthy(); + expect(isString('foo')).toBe(true); + expect(isString('10')).toBe(true); + expect(isString('')).toBe(true); + expect(isString(10)).toBe(false); + expect(isString(true)).toBe(false); +}); \ No newline at end of file diff --git a/test/isSymbol/isSymbol.js b/test4/isSymbol/isSymbol.js similarity index 100% rename from test/isSymbol/isSymbol.js rename to test4/isSymbol/isSymbol.js diff --git a/test4/isSymbol/isSymbol.test.js b/test4/isSymbol/isSymbol.test.js new file mode 100644 index 000000000..6eebd3e54 --- /dev/null +++ b/test4/isSymbol/isSymbol.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const isSymbol = require('./isSymbol.js'); + +test('Testing isSymbol', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isSymbol === 'function').toBeTruthy(); + expect(isSymbol(Symbol('x'))).toBe(true); +}); \ No newline at end of file diff --git a/test/isTravisCI/isTravisCI.js b/test4/isTravisCI/isTravisCI.js similarity index 100% rename from test/isTravisCI/isTravisCI.js rename to test4/isTravisCI/isTravisCI.js diff --git a/test4/isTravisCI/isTravisCI.test.js b/test4/isTravisCI/isTravisCI.test.js new file mode 100644 index 000000000..58a776d2d --- /dev/null +++ b/test4/isTravisCI/isTravisCI.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const isTravisCI = require('./isTravisCI.js'); + +test('Testing isTravisCI', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isTravisCI === 'function').toBeTruthy(); + if(isTravisCI()) + expect(isTravisCI()).toBeTruthy(); + else + expect(isTravisCI()).toBeFalsy(); +}); diff --git a/test/isTypedArray/isTypedArray.js b/test4/isTypedArray/isTypedArray.js similarity index 100% rename from test/isTypedArray/isTypedArray.js rename to test4/isTypedArray/isTypedArray.js diff --git a/test4/isTypedArray/isTypedArray.test.js b/test4/isTypedArray/isTypedArray.test.js new file mode 100644 index 000000000..deec79621 --- /dev/null +++ b/test4/isTypedArray/isTypedArray.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const isTypedArray = require('./isTypedArray.js'); + +test('Testing isTypedArray', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isTypedArray === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/isUndefined/isUndefined.js b/test4/isUndefined/isUndefined.js similarity index 100% rename from test/isUndefined/isUndefined.js rename to test4/isUndefined/isUndefined.js diff --git a/test4/isUndefined/isUndefined.test.js b/test4/isUndefined/isUndefined.test.js new file mode 100644 index 000000000..d345a2f69 --- /dev/null +++ b/test4/isUndefined/isUndefined.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const isUndefined = require('./isUndefined.js'); + +test('Testing isUndefined', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isUndefined === 'function').toBeTruthy(); + expect(isUndefined(undefined)).toBeTruthy(); +}); diff --git a/test/isUpperCase/isUpperCase.js b/test4/isUpperCase/isUpperCase.js similarity index 100% rename from test/isUpperCase/isUpperCase.js rename to test4/isUpperCase/isUpperCase.js diff --git a/test4/isUpperCase/isUpperCase.test.js b/test4/isUpperCase/isUpperCase.test.js new file mode 100644 index 000000000..660ad5547 --- /dev/null +++ b/test4/isUpperCase/isUpperCase.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const isUpperCase = require('./isUpperCase.js'); + +test('Testing isUpperCase', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isUpperCase === 'function').toBeTruthy(); + //t.deepEqual(isUpperCase(args..), 'Expected'); + expect(isUpperCase('ABC')).toBe(true); + expect(isUpperCase('abc')).toBe(false); + expect(isUpperCase('A3@$')).toBe(true); +}); \ No newline at end of file diff --git a/test/isValidJSON/isValidJSON.js b/test4/isValidJSON/isValidJSON.js similarity index 100% rename from test/isValidJSON/isValidJSON.js rename to test4/isValidJSON/isValidJSON.js diff --git a/test4/isValidJSON/isValidJSON.test.js b/test4/isValidJSON/isValidJSON.test.js new file mode 100644 index 000000000..3d3d9a152 --- /dev/null +++ b/test4/isValidJSON/isValidJSON.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const isValidJSON = require('./isValidJSON.js'); + +test('Testing isValidJSON', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isValidJSON === 'function').toBeTruthy(); + expect(isValidJSON('{"name":"Adam","age":20}')).toBe(true); + expect(isValidJSON('{"name":"Adam",age:"20"}')).toBe(false); + expect(isValidJSON(null)).toBe(true); +}); \ No newline at end of file diff --git a/test/isWeakMap/isWeakMap.js b/test4/isWeakMap/isWeakMap.js similarity index 100% rename from test/isWeakMap/isWeakMap.js rename to test4/isWeakMap/isWeakMap.js diff --git a/test4/isWeakMap/isWeakMap.test.js b/test4/isWeakMap/isWeakMap.test.js new file mode 100644 index 000000000..e79e1410a --- /dev/null +++ b/test4/isWeakMap/isWeakMap.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const isWeakMap = require('./isWeakMap.js'); + +test('Testing isWeakMap', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isWeakMap === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/isWeakSet/isWeakSet.js b/test4/isWeakSet/isWeakSet.js similarity index 100% rename from test/isWeakSet/isWeakSet.js rename to test4/isWeakSet/isWeakSet.js diff --git a/test4/isWeakSet/isWeakSet.test.js b/test4/isWeakSet/isWeakSet.test.js new file mode 100644 index 000000000..7da0fec69 --- /dev/null +++ b/test4/isWeakSet/isWeakSet.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const isWeakSet = require('./isWeakSet.js'); + +test('Testing isWeakSet', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof isWeakSet === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/join/join.js b/test4/join/join.js similarity index 100% rename from test/join/join.js rename to test4/join/join.js diff --git a/test4/join/join.test.js b/test4/join/join.test.js new file mode 100644 index 000000000..6e173d9fa --- /dev/null +++ b/test4/join/join.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const join = require('./join.js'); + +test('Testing join', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof join === 'function').toBeTruthy(); + expect(join(['pen', 'pineapple', 'apple', 'pen'], ',', '&')).toEqual("pen,pineapple,apple&pen"); + expect(join(['pen', 'pineapple', 'apple', 'pen'], ',')).toEqual("pen,pineapple,apple,pen"); + expect(join(['pen', 'pineapple', 'apple', 'pen'])).toEqual("pen,pineapple,apple,pen"); +}); \ No newline at end of file diff --git a/test/last/last.js b/test4/last/last.js similarity index 100% rename from test/last/last.js rename to test4/last/last.js diff --git a/test4/last/last.test.js b/test4/last/last.test.js new file mode 100644 index 000000000..df9817754 --- /dev/null +++ b/test4/last/last.test.js @@ -0,0 +1,20 @@ +const expect = require('expect'); +const last = require('./last.js'); + +test('Testing last', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof last === 'function').toBeTruthy(); + expect(last({ a: 1234}) === undefined).toBeTruthy(); + expect(last([1, 2, 3])).toBe(3); + expect(last({ 0: false})).toBe(undefined); + expect(last('String')).toBe('g'); + expect(() => last(null)).toThrow(); + expect(() => last(undefined)).toThrow(); + 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(); + expect((end - start) < 2000).toBeTruthy(); +}); \ No newline at end of file diff --git a/test/lcm/lcm.js b/test4/lcm/lcm.js similarity index 100% rename from test/lcm/lcm.js rename to test4/lcm/lcm.js diff --git a/test4/lcm/lcm.test.js b/test4/lcm/lcm.test.js new file mode 100644 index 000000000..76e1cf03d --- /dev/null +++ b/test4/lcm/lcm.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const lcm = require('./lcm.js'); + +test('Testing lcm', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof lcm === 'function').toBeTruthy(); + expect(lcm(12, 7)).toBe(84); + expect(lcm(...[1, 3, 4, 5])).toBe(60); +}); \ No newline at end of file diff --git a/test/levenshteinDistance/levenshteinDistance.js b/test4/levenshteinDistance/levenshteinDistance.js similarity index 100% rename from test/levenshteinDistance/levenshteinDistance.js rename to test4/levenshteinDistance/levenshteinDistance.js diff --git a/test4/levenshteinDistance/levenshteinDistance.test.js b/test4/levenshteinDistance/levenshteinDistance.test.js new file mode 100644 index 000000000..01afeb869 --- /dev/null +++ b/test4/levenshteinDistance/levenshteinDistance.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const levenshteinDistance = require('./levenshteinDistance.js'); + +test('Testing levenshteinDistance', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof levenshteinDistance === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/longestItem/longestItem.js b/test4/longestItem/longestItem.js similarity index 100% rename from test/longestItem/longestItem.js rename to test4/longestItem/longestItem.js diff --git a/test4/longestItem/longestItem.test.js b/test4/longestItem/longestItem.test.js new file mode 100644 index 000000000..d4961f009 --- /dev/null +++ b/test4/longestItem/longestItem.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const longestItem = require('./longestItem.js'); + +test('Testing longestItem', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof longestItem === 'function').toBeTruthy(); + expect(longestItem('this', 'is', 'a', 'testcase')).toEqual('testcase'); +}); \ No newline at end of file diff --git a/test/lowercaseKeys/lowercaseKeys.js b/test4/lowercaseKeys/lowercaseKeys.js similarity index 100% rename from test/lowercaseKeys/lowercaseKeys.js rename to test4/lowercaseKeys/lowercaseKeys.js diff --git a/test4/lowercaseKeys/lowercaseKeys.test.js b/test4/lowercaseKeys/lowercaseKeys.test.js new file mode 100644 index 000000000..537b699a7 --- /dev/null +++ b/test4/lowercaseKeys/lowercaseKeys.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const lowercaseKeys = require('./lowercaseKeys.js'); + +test('Testing lowercaseKeys', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof lowercaseKeys === 'function').toBeTruthy(); + const myObj = { Name: 'Adam', sUrnAME: 'Smith' }; + const myObjLower = lowercaseKeys(myObj); + expect(myObjLower).toEqual({name: 'Adam', surname: 'Smith'}); + expect(myObj).toEqual({ Name: 'Adam', sUrnAME: 'Smith' }); +}); diff --git a/test/luhnCheck/luhnCheck.js b/test4/luhnCheck/luhnCheck.js similarity index 100% rename from test/luhnCheck/luhnCheck.js rename to test4/luhnCheck/luhnCheck.js diff --git a/test4/luhnCheck/luhnCheck.test.js b/test4/luhnCheck/luhnCheck.test.js new file mode 100644 index 000000000..dec48f653 --- /dev/null +++ b/test4/luhnCheck/luhnCheck.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const luhnCheck = require('./luhnCheck.js'); + +test('Testing luhnCheck', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof luhnCheck === 'function').toBeTruthy(); + expect(luhnCheck(6011329933655299)).toBe(false); + expect(luhnCheck('4485275742308327')).toBe(true); + expect(luhnCheck(123456789)).toBe(false); +}); \ No newline at end of file diff --git a/test/mapKeys/mapKeys.js b/test4/mapKeys/mapKeys.js similarity index 100% rename from test/mapKeys/mapKeys.js rename to test4/mapKeys/mapKeys.js diff --git a/test4/mapKeys/mapKeys.test.js b/test4/mapKeys/mapKeys.test.js new file mode 100644 index 000000000..0aa00bf36 --- /dev/null +++ b/test4/mapKeys/mapKeys.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const mapKeys = require('./mapKeys.js'); + +test('Testing mapKeys', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof mapKeys === 'function').toBeTruthy(); + expect(mapKeys({ a: 1, b: 2 }, (val, key) => key + val)).toEqual({ a1: 1, b2: 2 }); +}); diff --git a/test/mapObject/mapObject.js b/test4/mapObject/mapObject.js similarity index 100% rename from test/mapObject/mapObject.js rename to test4/mapObject/mapObject.js diff --git a/test4/mapObject/mapObject.test.js b/test4/mapObject/mapObject.test.js new file mode 100644 index 000000000..80c2295a8 --- /dev/null +++ b/test4/mapObject/mapObject.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const mapObject = require('./mapObject.js'); + +test('Testing mapObject', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof mapObject === 'function').toBeTruthy(); + expect(mapObject([1, 2, 3], a => a * a)).toEqual({ 1: 1, 2: 4, 3: 9 }); + expect(mapObject([1, 2, 3, 4], (a, b) => b - a)).toEqual({ 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.js b/test4/mapValues/mapValues.js similarity index 100% rename from test/mapValues/mapValues.js rename to test4/mapValues/mapValues.js diff --git a/test4/mapValues/mapValues.test.js b/test4/mapValues/mapValues.test.js new file mode 100644 index 000000000..862909d71 --- /dev/null +++ b/test4/mapValues/mapValues.test.js @@ -0,0 +1,13 @@ +const expect = require('expect'); +const mapValues = require('./mapValues.js'); + +test('Testing mapValues', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof mapValues === 'function').toBeTruthy(); + const users = { + fred: { user: 'fred', age: 40 }, + pebbles: { user: 'pebbles', age: 1 } + }; + expect(mapValues(users, u => u.age)).toEqual({ fred: 40, pebbles: 1 }); +}); diff --git a/test/mask/mask.js b/test4/mask/mask.js similarity index 100% rename from test/mask/mask.js rename to test4/mask/mask.js diff --git a/test4/mask/mask.test.js b/test4/mask/mask.test.js new file mode 100644 index 000000000..a313029c0 --- /dev/null +++ b/test4/mask/mask.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const mask = require('./mask.js'); + +test('Testing mask', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof mask === 'function').toBeTruthy(); + expect(mask(1234567890)).toBe('******7890'); + expect(mask(1234567890, 3)).toBe('*******890'); + expect(mask(1234567890, -4, '$')).toBe('$$$$567890'); +}); \ No newline at end of file diff --git a/test/matches/matches.js b/test4/matches/matches.js similarity index 100% rename from test/matches/matches.js rename to test4/matches/matches.js diff --git a/test4/matches/matches.test.js b/test4/matches/matches.test.js new file mode 100644 index 000000000..b8c61f7fb --- /dev/null +++ b/test4/matches/matches.test.js @@ -0,0 +1,14 @@ +const expect = require('expect'); +const matches = require('./matches.js'); + +test('Testing matches', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof matches === 'function').toBeTruthy(); + expect( + matches({ age: 25, hair: 'long', beard: true }, { hair: 'long', beard: true }) + ).toBeTruthy(); + expect( + matches({ hair: 'long', beard: true }, { age: 25, hair: 'long', beard: true }) + ).toBeFalsy(); +}); diff --git a/test/matchesWith/matchesWith.js b/test4/matchesWith/matchesWith.js similarity index 100% rename from test/matchesWith/matchesWith.js rename to test4/matchesWith/matchesWith.js diff --git a/test4/matchesWith/matchesWith.test.js b/test4/matchesWith/matchesWith.test.js new file mode 100644 index 000000000..aef31c802 --- /dev/null +++ b/test4/matchesWith/matchesWith.test.js @@ -0,0 +1,14 @@ +const expect = require('expect'); +const matchesWith = require('./matchesWith.js'); + +test('Testing matchesWith', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof matchesWith === 'function').toBeTruthy(); + const isGreeting = val => /^h(?:i|ello)$/.test(val); + expect(matchesWith( + { greeting: 'hello' }, + { greeting: 'hi' }, + (oV, sV) => isGreeting(oV) && isGreeting(sV) + )).toBeTruthy(); +}); diff --git a/test/maxBy/maxBy.js b/test4/maxBy/maxBy.js similarity index 100% rename from test/maxBy/maxBy.js rename to test4/maxBy/maxBy.js diff --git a/test4/maxBy/maxBy.test.js b/test4/maxBy/maxBy.test.js new file mode 100644 index 000000000..041e16d5f --- /dev/null +++ b/test4/maxBy/maxBy.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const maxBy = require('./maxBy.js'); + +test('Testing maxBy', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof maxBy === 'function').toBeTruthy(); + expect(maxBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], o => o.n)).toBe(8); + expect(maxBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], 'n')).toBe(8); +}); diff --git a/test/maxN/maxN.js b/test4/maxN/maxN.js similarity index 100% rename from test/maxN/maxN.js rename to test4/maxN/maxN.js diff --git a/test4/maxN/maxN.test.js b/test4/maxN/maxN.test.js new file mode 100644 index 000000000..e714acd04 --- /dev/null +++ b/test4/maxN/maxN.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const maxN = require('./maxN.js'); + +test('Testing maxN', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof maxN === 'function').toBeTruthy(); + expect(maxN([1, 2, 3])).toEqual([3]); + expect(maxN([1, 2, 3], 2)).toEqual([3, 2]); +}); \ No newline at end of file diff --git a/test/median/median.js b/test4/median/median.js similarity index 100% rename from test/median/median.js rename to test4/median/median.js diff --git a/test4/median/median.test.js b/test4/median/median.test.js new file mode 100644 index 000000000..d7e14899e --- /dev/null +++ b/test4/median/median.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const median = require('./median.js'); + +test('Testing median', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof median === 'function').toBeTruthy(); + expect(median([5, 6, 50, 1, -5])).toBe(5); + expect(median([1, 2, 3])).toBe(2); +}); \ No newline at end of file diff --git a/test/memoize/memoize.js b/test4/memoize/memoize.js similarity index 100% rename from test/memoize/memoize.js rename to test4/memoize/memoize.js diff --git a/test4/memoize/memoize.test.js b/test4/memoize/memoize.test.js new file mode 100644 index 000000000..29ef30ccb --- /dev/null +++ b/test4/memoize/memoize.test.js @@ -0,0 +1,13 @@ +const expect = require('expect'); +const memoize = require('./memoize.js'); + +test('Testing memoize', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof memoize === 'function').toBeTruthy(); + const f = x => x * x; + const square = memoize(f); + expect(square(2)).toBe(4); + expect(square(3)).toBe(9); + expect(Array.from(square.cache)).toEqual([[2,4],[3,9]]); +}); diff --git a/test/merge/merge.js b/test4/merge/merge.js similarity index 100% rename from test/merge/merge.js rename to test4/merge/merge.js diff --git a/test4/merge/merge.test.js b/test4/merge/merge.test.js new file mode 100644 index 000000000..c3369f320 --- /dev/null +++ b/test4/merge/merge.test.js @@ -0,0 +1,18 @@ +const expect = require('expect'); +const merge = require('./merge.js'); + +test('Testing merge', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof merge === 'function').toBeTruthy(); + const object = { + a: [{ x: 2 }, { y: 4 }], + b: 1 + }; + const other = { + a: { z: 3 }, + b: [2, 3], + c: 'foo' + }; + expect(merge(object, other)).toEqual({ a: [ { x: 2 }, { y: 4 }, { z: 3 } ], b: [ 1, 2, 3 ], c: 'foo' }); +}); diff --git a/test/minBy/minBy.js b/test4/minBy/minBy.js similarity index 100% rename from test/minBy/minBy.js rename to test4/minBy/minBy.js diff --git a/test4/minBy/minBy.test.js b/test4/minBy/minBy.test.js new file mode 100644 index 000000000..58efee38f --- /dev/null +++ b/test4/minBy/minBy.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const minBy = require('./minBy.js'); + +test('Testing minBy', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof minBy === 'function').toBeTruthy(); + expect(minBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], o => o.n)).toBe(2); + expect(minBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], 'n')).toBe(2); +}); diff --git a/test/minN/minN.js b/test4/minN/minN.js similarity index 100% rename from test/minN/minN.js rename to test4/minN/minN.js diff --git a/test4/minN/minN.test.js b/test4/minN/minN.test.js new file mode 100644 index 000000000..c10fd200f --- /dev/null +++ b/test4/minN/minN.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const minN = require('./minN.js'); + +test('Testing minN', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof minN === 'function').toBeTruthy(); + expect(minN([1, 2, 3])).toEqual([1]); + expect(minN([1, 2, 3], 2)).toEqual([1, 2]); +}); \ No newline at end of file diff --git a/test/mostPerformant/mostPerformant.js b/test4/mostPerformant/mostPerformant.js similarity index 100% rename from test/mostPerformant/mostPerformant.js rename to test4/mostPerformant/mostPerformant.js diff --git a/test4/mostPerformant/mostPerformant.test.js b/test4/mostPerformant/mostPerformant.test.js new file mode 100644 index 000000000..b83d3ff0f --- /dev/null +++ b/test4/mostPerformant/mostPerformant.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const mostPerformant = require('./mostPerformant.js'); + +test('Testing mostPerformant', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof mostPerformant === 'function').toBeTruthy(); +}); diff --git a/test/negate/negate.js b/test4/negate/negate.js similarity index 100% rename from test/negate/negate.js rename to test4/negate/negate.js diff --git a/test4/negate/negate.test.js b/test4/negate/negate.test.js new file mode 100644 index 000000000..3a3799bb8 --- /dev/null +++ b/test4/negate/negate.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const negate = require('./negate.js'); + +test('Testing negate', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof negate === 'function').toBeTruthy(); + expect([1, 2, 3, 4, 5, 6].filter(negate(n => n % 2 === 0))).toEqual([1, 3, 5]); +}); diff --git a/test/nest/nest.js b/test4/nest/nest.js similarity index 100% rename from test/nest/nest.js rename to test4/nest/nest.js diff --git a/test4/nest/nest.test.js b/test4/nest/nest.test.js new file mode 100644 index 000000000..2866537ad --- /dev/null +++ b/test4/nest/nest.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const nest = require('./nest.js'); + +test('Testing nest', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof nest === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/nodeListToArray/nodeListToArray.js b/test4/nodeListToArray/nodeListToArray.js similarity index 100% rename from test/nodeListToArray/nodeListToArray.js rename to test4/nodeListToArray/nodeListToArray.js diff --git a/test4/nodeListToArray/nodeListToArray.test.js b/test4/nodeListToArray/nodeListToArray.test.js new file mode 100644 index 000000000..cc16b355d --- /dev/null +++ b/test4/nodeListToArray/nodeListToArray.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const nodeListToArray = require('./nodeListToArray.js'); + +test('Testing nodeListToArray', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof nodeListToArray === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/none/none.js b/test4/none/none.js similarity index 100% rename from test/none/none.js rename to test4/none/none.js diff --git a/test4/none/none.test.js b/test4/none/none.test.js new file mode 100644 index 000000000..fdf7c6bbc --- /dev/null +++ b/test4/none/none.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const none = require('./none.js'); + +test('Testing none', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof none === 'function').toBeTruthy(); + expect(none([0,undefined,NaN,null,''])).toBeTruthy(); + expect(none([0,1])).toBeFalsy(); + expect(none([4,1,0,3], x => x < 0)).toBeTruthy(); + expect(none([0,1,2], x => x === 1)).toBeFalsy(); +}); diff --git a/test/nthArg/nthArg.js b/test4/nthArg/nthArg.js similarity index 100% rename from test/nthArg/nthArg.js rename to test4/nthArg/nthArg.js diff --git a/test4/nthArg/nthArg.test.js b/test4/nthArg/nthArg.test.js new file mode 100644 index 000000000..b63828fe4 --- /dev/null +++ b/test4/nthArg/nthArg.test.js @@ -0,0 +1,13 @@ +const expect = require('expect'); +const nthArg = require('./nthArg.js'); + +test('Testing nthArg', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof nthArg === 'function').toBeTruthy(); + const third = nthArg(2); + expect(third(1, 2, 3)).toBe(3); + expect(third(1, 2)).toBe(undefined); + const last = nthArg(-1); + expect(last(1, 2, 3, 4, 5)).toBe(5); +}); diff --git a/test/nthElement/nthElement.js b/test4/nthElement/nthElement.js similarity index 100% rename from test/nthElement/nthElement.js rename to test4/nthElement/nthElement.js diff --git a/test4/nthElement/nthElement.test.js b/test4/nthElement/nthElement.test.js new file mode 100644 index 000000000..3ba010c0d --- /dev/null +++ b/test4/nthElement/nthElement.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const nthElement = require('./nthElement.js'); + +test('Testing nthElement', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof nthElement === 'function').toBeTruthy(); + expect(nthElement(['a', 'b', 'c'], 1)).toBe('b'); + expect(nthElement(['a', 'b', 'c'], -3)).toBe('a'); +}); \ No newline at end of file diff --git a/test/objectFromPairs/objectFromPairs.js b/test4/objectFromPairs/objectFromPairs.js similarity index 100% rename from test/objectFromPairs/objectFromPairs.js rename to test4/objectFromPairs/objectFromPairs.js diff --git a/test4/objectFromPairs/objectFromPairs.test.js b/test4/objectFromPairs/objectFromPairs.test.js new file mode 100644 index 000000000..7497fee6a --- /dev/null +++ b/test4/objectFromPairs/objectFromPairs.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const objectFromPairs = require('./objectFromPairs.js'); + +test('Testing objectFromPairs', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof objectFromPairs === 'function').toBeTruthy(); + expect(objectFromPairs([['a', 1], ['b', 2]])).toEqual({a: 1, b: 2}); +}); \ No newline at end of file diff --git a/test/objectToPairs/objectToPairs.js b/test4/objectToPairs/objectToPairs.js similarity index 100% rename from test/objectToPairs/objectToPairs.js rename to test4/objectToPairs/objectToPairs.js diff --git a/test4/objectToPairs/objectToPairs.test.js b/test4/objectToPairs/objectToPairs.test.js new file mode 100644 index 000000000..c274408bd --- /dev/null +++ b/test4/objectToPairs/objectToPairs.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const objectToPairs = require('./objectToPairs.js'); + +test('Testing objectToPairs', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof objectToPairs === 'function').toBeTruthy(); + expect(objectToPairs({ a: 1, b: 2 })).toEqual([['a',1],['b',2]]); +}); \ No newline at end of file diff --git a/test/observeMutations/observeMutations.js b/test4/observeMutations/observeMutations.js similarity index 100% rename from test/observeMutations/observeMutations.js rename to test4/observeMutations/observeMutations.js diff --git a/test4/observeMutations/observeMutations.test.js b/test4/observeMutations/observeMutations.test.js new file mode 100644 index 000000000..4cf9349e0 --- /dev/null +++ b/test4/observeMutations/observeMutations.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const observeMutations = require('./observeMutations.js'); + +test('Testing observeMutations', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof observeMutations === 'function').toBeTruthy(); +}); diff --git a/test/off/off.js b/test4/off/off.js similarity index 100% rename from test/off/off.js rename to test4/off/off.js diff --git a/test4/off/off.test.js b/test4/off/off.test.js new file mode 100644 index 000000000..90702b03a --- /dev/null +++ b/test4/off/off.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const off = require('./off.js'); + +test('Testing off', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof off === 'function').toBeTruthy(); +}); diff --git a/test/offset/offset.js b/test4/offset/offset.js similarity index 100% rename from test/offset/offset.js rename to test4/offset/offset.js diff --git a/test4/offset/offset.test.js b/test4/offset/offset.test.js new file mode 100644 index 000000000..8cf281e0c --- /dev/null +++ b/test4/offset/offset.test.js @@ -0,0 +1,14 @@ +const expect = require('expect'); +const offset = require('./offset.js'); + +test('Testing offset', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof offset === 'function').toBeTruthy(); + expect(offset([1, 2, 3, 4, 5], 0)).toEqual([1, 2, 3, 4, 5]); + expect(offset([1, 2, 3, 4, 5], 2)).toEqual([3, 4, 5, 1, 2]); + expect(offset([1, 2, 3, 4, 5], -2)).toEqual([4, 5, 1, 2, 3]); + expect(offset([1, 2, 3, 4, 5], 6)).toEqual([1, 2, 3, 4, 5]); + expect(offset([1, 2, 3, 4, 5], -6)).toEqual([1, 2, 3, 4, 5]); + expect(offset([], 3)).toEqual([]); +}); diff --git a/test/omit/omit.js b/test4/omit/omit.js similarity index 100% rename from test/omit/omit.js rename to test4/omit/omit.js diff --git a/test4/omit/omit.test.js b/test4/omit/omit.test.js new file mode 100644 index 000000000..bcb2365ee --- /dev/null +++ b/test4/omit/omit.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const omit = require('./omit.js'); + +test('Testing omit', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof omit === 'function').toBeTruthy(); + expect(omit({ a: 1, b: '2', c: 3 }, ['b'])).toEqual({ 'a': 1, 'c': 3 }); +}); diff --git a/test/RGBToHex/RGBToHex.js b/test5/RGBToHex/RGBToHex.js similarity index 100% rename from test/RGBToHex/RGBToHex.js rename to test5/RGBToHex/RGBToHex.js diff --git a/test5/RGBToHex/RGBToHex.test.js b/test5/RGBToHex/RGBToHex.test.js new file mode 100644 index 000000000..d0fc0f92e --- /dev/null +++ b/test5/RGBToHex/RGBToHex.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const RGBToHex = require('./RGBToHex.js'); + +test('Testing RGBToHex', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof RGBToHex === 'function').toBeTruthy(); + expect(RGBToHex(255, 165, 1)).toBe('ffa501'); +}); \ No newline at end of file diff --git a/test/omitBy/omitBy.js b/test5/omitBy/omitBy.js similarity index 100% rename from test/omitBy/omitBy.js rename to test5/omitBy/omitBy.js diff --git a/test5/omitBy/omitBy.test.js b/test5/omitBy/omitBy.test.js new file mode 100644 index 000000000..dce45eea2 --- /dev/null +++ b/test5/omitBy/omitBy.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const omitBy = require('./omitBy.js'); + +test('Testing omitBy', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof omitBy === 'function').toBeTruthy(); + expect(omitBy({ a: 1, b: '2', c: 3 }, x => typeof x === 'number')).toEqual({ b: '2' }); +}); diff --git a/test/on/on.js b/test5/on/on.js similarity index 100% rename from test/on/on.js rename to test5/on/on.js diff --git a/test5/on/on.test.js b/test5/on/on.test.js new file mode 100644 index 000000000..7fbf62c6c --- /dev/null +++ b/test5/on/on.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const on = require('./on.js'); + +test('Testing on', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof on === 'function').toBeTruthy(); +}); diff --git a/test/onUserInputChange/onUserInputChange.js b/test5/onUserInputChange/onUserInputChange.js similarity index 100% rename from test/onUserInputChange/onUserInputChange.js rename to test5/onUserInputChange/onUserInputChange.js diff --git a/test5/onUserInputChange/onUserInputChange.test.js b/test5/onUserInputChange/onUserInputChange.test.js new file mode 100644 index 000000000..2224a0f2d --- /dev/null +++ b/test5/onUserInputChange/onUserInputChange.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const onUserInputChange = require('./onUserInputChange.js'); + +test('Testing onUserInputChange', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof onUserInputChange === 'function').toBeTruthy(); +}); diff --git a/test/once/once.js b/test5/once/once.js similarity index 100% rename from test/once/once.js rename to test5/once/once.js diff --git a/test5/once/once.test.js b/test5/once/once.test.js new file mode 100644 index 000000000..0df7c89b2 --- /dev/null +++ b/test5/once/once.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const once = require('./once.js'); + +test('Testing once', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof once === 'function').toBeTruthy(); +}); diff --git a/test/orderBy/orderBy.js b/test5/orderBy/orderBy.js similarity index 100% rename from test/orderBy/orderBy.js rename to test5/orderBy/orderBy.js diff --git a/test5/orderBy/orderBy.test.js b/test5/orderBy/orderBy.test.js new file mode 100644 index 000000000..b2f2079a7 --- /dev/null +++ b/test5/orderBy/orderBy.test.js @@ -0,0 +1,15 @@ +const expect = require('expect'); +const orderBy = require('./orderBy.js'); + +test('Testing orderBy', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof orderBy === 'function').toBeTruthy(); + const users = [{ name: 'fred', age: 48 }, { name: 'barney', age: 36 }, { name: 'fred', age: 40 }]; + expect(orderBy(users, ['name', 'age'], ['asc', 'desc'])).toEqual( + [{name: 'barney', age: 36}, {name: 'fred', age: 48}, {name: 'fred', age: 40}] + ); + expect(orderBy(users, ['name', 'age'])).toEqual( + [{name: 'barney', age: 36}, {name: 'fred', age: 40}, {name: 'fred', age: 48}] + ); +}); \ No newline at end of file diff --git a/test/over/over.js b/test5/over/over.js similarity index 100% rename from test/over/over.js rename to test5/over/over.js diff --git a/test5/over/over.test.js b/test5/over/over.test.js new file mode 100644 index 000000000..0ecda5749 --- /dev/null +++ b/test5/over/over.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const over = require('./over.js'); + +test('Testing over', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof over === 'function').toBeTruthy(); + const minMax = over(Math.min, Math.max); + expect(minMax(1, 2, 3, 4, 5)).toEqual([1,5]); +}); diff --git a/test/overArgs/overArgs.js b/test5/overArgs/overArgs.js similarity index 100% rename from test/overArgs/overArgs.js rename to test5/overArgs/overArgs.js diff --git a/test5/overArgs/overArgs.test.js b/test5/overArgs/overArgs.test.js new file mode 100644 index 000000000..78c9edfd3 --- /dev/null +++ b/test5/overArgs/overArgs.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const overArgs = require('./overArgs.js'); + +test('Testing overArgs', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof overArgs === 'function').toBeTruthy(); + const square = n => n * n; + const double = n => n * 2; + const fn = overArgs((x, y) => [x, y], [square, double]); + expect(fn(9, 3)).toEqual([81, 6]); +}); diff --git a/test/pad/pad.js b/test5/pad/pad.js similarity index 100% rename from test/pad/pad.js rename to test5/pad/pad.js diff --git a/test5/pad/pad.test.js b/test5/pad/pad.test.js new file mode 100644 index 000000000..a2a036ec5 --- /dev/null +++ b/test5/pad/pad.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const pad = require('./pad.js'); + +test('Testing pad', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof pad === 'function').toBeTruthy(); + expect(pad('cat',8)).toBe(' cat '); + expect(pad('cat',8).length).toBe(8); + expect(pad(String(42), 6, '0')).toBe('004200'); + expect(pad('foobar', 3)).toBe('foobar'); +}); diff --git a/test/palindrome/palindrome.js b/test5/palindrome/palindrome.js similarity index 100% rename from test/palindrome/palindrome.js rename to test5/palindrome/palindrome.js diff --git a/test5/palindrome/palindrome.test.js b/test5/palindrome/palindrome.test.js new file mode 100644 index 000000000..44d983dc9 --- /dev/null +++ b/test5/palindrome/palindrome.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const palindrome = require('./palindrome.js'); + +test('Testing palindrome', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof palindrome === 'function').toBeTruthy(); + expect(palindrome('taco cat')).toBe(true); + expect(palindrome('foobar')).toBe(false); +}); \ No newline at end of file diff --git a/test/parseCookie/parseCookie.js b/test5/parseCookie/parseCookie.js similarity index 100% rename from test/parseCookie/parseCookie.js rename to test5/parseCookie/parseCookie.js diff --git a/test5/parseCookie/parseCookie.test.js b/test5/parseCookie/parseCookie.test.js new file mode 100644 index 000000000..84e046a69 --- /dev/null +++ b/test5/parseCookie/parseCookie.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const parseCookie = require('./parseCookie.js'); + +test('Testing parseCookie', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof parseCookie === 'function').toBeTruthy(); + expect(parseCookie('foo=bar; equation=E%3Dmc%5E2')).toEqual({ foo: 'bar', equation: 'E=mc^2' }); +}); diff --git a/test/partial/partial.js b/test5/partial/partial.js similarity index 100% rename from test/partial/partial.js rename to test5/partial/partial.js diff --git a/test5/partial/partial.test.js b/test5/partial/partial.test.js new file mode 100644 index 000000000..813eef79a --- /dev/null +++ b/test5/partial/partial.test.js @@ -0,0 +1,13 @@ +const expect = require('expect'); +const partial = require('./partial.js'); + +test('Testing partial', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof partial === 'function').toBeTruthy(); + function greet(greeting, name) { + return greeting + ' ' + name + '!'; + } + const greetHello = partial(greet, 'Hello'); + expect(greetHello('John')).toBe('Hello John!'); +}); diff --git a/test/partialRight/partialRight.js b/test5/partialRight/partialRight.js similarity index 100% rename from test/partialRight/partialRight.js rename to test5/partialRight/partialRight.js diff --git a/test5/partialRight/partialRight.test.js b/test5/partialRight/partialRight.test.js new file mode 100644 index 000000000..480ce7ec6 --- /dev/null +++ b/test5/partialRight/partialRight.test.js @@ -0,0 +1,13 @@ +const expect = require('expect'); +const partialRight = require('./partialRight.js'); + +test('Testing partialRight', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof partialRight === 'function').toBeTruthy(); + function greet(greeting, name) { + return greeting + ' ' + name + '!'; + } + const greetJohn = partialRight(greet, 'John'); + expect(greetJohn('Hello')).toBe('Hello John!'); +}); diff --git a/test/partition/partition.js b/test5/partition/partition.js similarity index 100% rename from test/partition/partition.js rename to test5/partition/partition.js diff --git a/test5/partition/partition.test.js b/test5/partition/partition.test.js new file mode 100644 index 000000000..968876650 --- /dev/null +++ b/test5/partition/partition.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const partition = require('./partition.js'); + +test('Testing partition', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof partition === 'function').toBeTruthy(); + const users = [{ user: 'barney', age: 36, active: false }, { user: 'fred', age: 40, active: true }]; + expect(partition(users, o => o.active)).toEqual( + [[{ 'user': 'fred', 'age': 40, 'active': true }],[{ 'user': 'barney', 'age': 36, 'active': false }]] + ); +}); \ No newline at end of file diff --git a/test/percentile/percentile.js b/test5/percentile/percentile.js similarity index 100% rename from test/percentile/percentile.js rename to test5/percentile/percentile.js diff --git a/test5/percentile/percentile.test.js b/test5/percentile/percentile.test.js new file mode 100644 index 000000000..af64d3032 --- /dev/null +++ b/test5/percentile/percentile.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const percentile = require('./percentile.js'); + +test('Testing percentile', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof percentile === 'function').toBeTruthy(); + expect(percentile([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 6)).toBe(55); +}); \ No newline at end of file diff --git a/test/permutations/permutations.js b/test5/permutations/permutations.js similarity index 100% rename from test/permutations/permutations.js rename to test5/permutations/permutations.js diff --git a/test5/permutations/permutations.test.js b/test5/permutations/permutations.test.js new file mode 100644 index 000000000..9aa5fa4fb --- /dev/null +++ b/test5/permutations/permutations.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const permutations = require('./permutations.js'); + +test('Testing permutations', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof permutations === 'function').toBeTruthy(); + 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.js b/test5/pick/pick.js similarity index 100% rename from test/pick/pick.js rename to test5/pick/pick.js diff --git a/test5/pick/pick.test.js b/test5/pick/pick.test.js new file mode 100644 index 000000000..20f11cb4d --- /dev/null +++ b/test5/pick/pick.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const pick = require('./pick.js'); + +test('Testing pick', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof pick === 'function').toBeTruthy(); + expect(pick({ a: 1, b: '2', c: 3 }, ['a', 'c'])).toEqual({ 'a': 1, 'c': 3 }); +}); \ No newline at end of file diff --git a/test/pickBy/pickBy.js b/test5/pickBy/pickBy.js similarity index 100% rename from test/pickBy/pickBy.js rename to test5/pickBy/pickBy.js diff --git a/test5/pickBy/pickBy.test.js b/test5/pickBy/pickBy.test.js new file mode 100644 index 000000000..8c5620d33 --- /dev/null +++ b/test5/pickBy/pickBy.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const pickBy = require('./pickBy.js'); + +test('Testing pickBy', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof pickBy === 'function').toBeTruthy(); + expect(pickBy({ a: 1, b: '2', c: 3 }, x => typeof x === 'number')).toEqual({ 'a': 1, 'c': 3 }); +}); diff --git a/test/pipeAsyncFunctions/pipeAsyncFunctions.js b/test5/pipeAsyncFunctions/pipeAsyncFunctions.js similarity index 100% rename from test/pipeAsyncFunctions/pipeAsyncFunctions.js rename to test5/pipeAsyncFunctions/pipeAsyncFunctions.js diff --git a/test5/pipeAsyncFunctions/pipeAsyncFunctions.test.js b/test5/pipeAsyncFunctions/pipeAsyncFunctions.test.js new file mode 100644 index 000000000..5724dec11 --- /dev/null +++ b/test5/pipeAsyncFunctions/pipeAsyncFunctions.test.js @@ -0,0 +1,19 @@ +const expect = require('expect'); +const pipeAsyncFunctions = require('./pipeAsyncFunctions.js'); + +test('Testing pipeAsyncFunctions', async () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof pipeAsyncFunctions === 'function').toBeTruthy(); + //t.deepEqual(pipeAsyncFunctions(args..), 'Expected'); + //t.equal(pipeAsyncFunctions(args..), 'Expected'); + //t.false(pipeAsyncFunctions(args..), 'Expected'); + //t.throws(pipeAsyncFunctions(args..), 'Expected'); + expect(await pipeAsyncFunctions( + (x) => x + 1, + (x) => new Promise((resolve) => setTimeout(() => resolve(x + 2), 0)), + (x) => x + 3, + async (x) => await x + 4, + ) + (5)).toBe(15); +}); \ No newline at end of file diff --git a/test/pipeFunctions/pipeFunctions.js b/test5/pipeFunctions/pipeFunctions.js similarity index 100% rename from test/pipeFunctions/pipeFunctions.js rename to test5/pipeFunctions/pipeFunctions.js diff --git a/test5/pipeFunctions/pipeFunctions.test.js b/test5/pipeFunctions/pipeFunctions.test.js new file mode 100644 index 000000000..b334a71ae --- /dev/null +++ b/test5/pipeFunctions/pipeFunctions.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const pipeFunctions = require('./pipeFunctions.js'); + +test('Testing pipeFunctions', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof pipeFunctions === 'function').toBeTruthy(); + const add5 = x => x + 5; + const multiply = (x, y) => x * y; + const multiplyAndAdd5 = pipeFunctions(multiply, add5); + expect(multiplyAndAdd5(5, 2)).toBe(15); +}); diff --git a/test/pluralize/pluralize.js b/test5/pluralize/pluralize.js similarity index 100% rename from test/pluralize/pluralize.js rename to test5/pluralize/pluralize.js diff --git a/test5/pluralize/pluralize.test.js b/test5/pluralize/pluralize.test.js new file mode 100644 index 000000000..4fafc2f10 --- /dev/null +++ b/test5/pluralize/pluralize.test.js @@ -0,0 +1,18 @@ +const expect = require('expect'); +const pluralize = require('./pluralize.js'); + +test('Testing pluralize', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof pluralize === 'function').toBeTruthy(); + expect(pluralize(0, 'apple')).toBe('apples'); + expect(pluralize(1, 'apple')).toBe('apple'); + expect(pluralize(2, 'apple')).toBe('apples'); + expect(pluralize(2, 'person', 'people')).toBe('people'); + const PLURALS = { + person: 'people', + radius: 'radii' + }; + const autoPluralize = pluralize(PLURALS); + expect(autoPluralize(2, 'person')).toBe('people'); +}); diff --git a/test/powerset/powerset.js b/test5/powerset/powerset.js similarity index 100% rename from test/powerset/powerset.js rename to test5/powerset/powerset.js diff --git a/test5/powerset/powerset.test.js b/test5/powerset/powerset.test.js new file mode 100644 index 000000000..7413dedb8 --- /dev/null +++ b/test5/powerset/powerset.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const powerset = require('./powerset.js'); + +test('Testing powerset', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof powerset === 'function').toBeTruthy(); + expect(powerset([1, 2])).toEqual([[], [1], [2], [2,1]]); +}); \ No newline at end of file diff --git a/test/prefix/prefix.js b/test5/prefix/prefix.js similarity index 100% rename from test/prefix/prefix.js rename to test5/prefix/prefix.js diff --git a/test5/prefix/prefix.test.js b/test5/prefix/prefix.test.js new file mode 100644 index 000000000..c4f88eca6 --- /dev/null +++ b/test5/prefix/prefix.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const prefix = require('./prefix.js'); + +test('Testing prefix', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof prefix === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/prettyBytes/prettyBytes.js b/test5/prettyBytes/prettyBytes.js similarity index 100% rename from test/prettyBytes/prettyBytes.js rename to test5/prettyBytes/prettyBytes.js diff --git a/test5/prettyBytes/prettyBytes.test.js b/test5/prettyBytes/prettyBytes.test.js new file mode 100644 index 000000000..a2cccd3a6 --- /dev/null +++ b/test5/prettyBytes/prettyBytes.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const prettyBytes = require('./prettyBytes.js'); + +test('Testing prettyBytes', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof prettyBytes === 'function').toBeTruthy(); + expect(prettyBytes(1000)).toBe('1 KB'); + expect(prettyBytes(-27145424323.5821, 5)).toBe('-27.145 GB'); + expect(prettyBytes(123456789, 3, false)).toBe('123MB'); +}); \ No newline at end of file diff --git a/test/primes/primes.js b/test5/primes/primes.js similarity index 100% rename from test/primes/primes.js rename to test5/primes/primes.js diff --git a/test5/primes/primes.test.js b/test5/primes/primes.test.js new file mode 100644 index 000000000..d0b4ae15c --- /dev/null +++ b/test5/primes/primes.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const primes = require('./primes.js'); + +test('Testing primes', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof primes === 'function').toBeTruthy(); + expect(primes(10)).toEqual([2, 3, 5, 7]); +}); \ No newline at end of file diff --git a/test/promisify/promisify.js b/test5/promisify/promisify.js similarity index 100% rename from test/promisify/promisify.js rename to test5/promisify/promisify.js diff --git a/test5/promisify/promisify.test.js b/test5/promisify/promisify.test.js new file mode 100644 index 000000000..145a8c004 --- /dev/null +++ b/test5/promisify/promisify.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const promisify = require('./promisify.js'); + +test('Testing promisify', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof promisify === 'function').toBeTruthy(); + const x = promisify(Math.max); + expect(x() instanceof Promise).toBeTruthy(); + const delay = promisify((d, cb) => setTimeout(cb, d)); + delay(200).then(() => ); +}); diff --git a/test/pull/pull.js b/test5/pull/pull.js similarity index 100% rename from test/pull/pull.js rename to test5/pull/pull.js diff --git a/test5/pull/pull.test.js b/test5/pull/pull.test.js new file mode 100644 index 000000000..f38d1c0bf --- /dev/null +++ b/test5/pull/pull.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const pull = require('./pull.js'); + +test('Testing pull', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof pull === 'function').toBeTruthy(); + let myArray = ['a', 'b', 'c', 'a', 'b', 'c']; + pull(myArray, 'a', 'c'); + expect(myArray).toEqual(['b','b']); +}); diff --git a/test/pullAtIndex/pullAtIndex.js b/test5/pullAtIndex/pullAtIndex.js similarity index 100% rename from test/pullAtIndex/pullAtIndex.js rename to test5/pullAtIndex/pullAtIndex.js diff --git a/test5/pullAtIndex/pullAtIndex.test.js b/test5/pullAtIndex/pullAtIndex.test.js new file mode 100644 index 000000000..9715d6c95 --- /dev/null +++ b/test5/pullAtIndex/pullAtIndex.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const pullAtIndex = require('./pullAtIndex.js'); + +test('Testing pullAtIndex', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof pullAtIndex === 'function').toBeTruthy(); + let myArray = ['a', 'b', 'c', 'd']; + let pulled = pullAtIndex(myArray, [1, 3]); + expect(myArray).toEqual([ 'a', 'c' ]); + expect(pulled).toEqual([ 'b', 'd' ]); +}); diff --git a/test/pullAtValue/pullAtValue.js b/test5/pullAtValue/pullAtValue.js similarity index 100% rename from test/pullAtValue/pullAtValue.js rename to test5/pullAtValue/pullAtValue.js diff --git a/test5/pullAtValue/pullAtValue.test.js b/test5/pullAtValue/pullAtValue.test.js new file mode 100644 index 000000000..b15a3baa4 --- /dev/null +++ b/test5/pullAtValue/pullAtValue.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const pullAtValue = require('./pullAtValue.js'); + +test('Testing pullAtValue', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof pullAtValue === 'function').toBeTruthy(); + let myArray = ['a', 'b', 'c', 'd']; + let pulled = pullAtValue(myArray, ['b', 'd']); + expect(myArray).toEqual([ 'a', 'c' ]); + expect(pulled).toEqual([ 'b', 'd' ]); +}); diff --git a/test/pullBy/pullBy.js b/test5/pullBy/pullBy.js similarity index 100% rename from test/pullBy/pullBy.js rename to test5/pullBy/pullBy.js diff --git a/test5/pullBy/pullBy.test.js b/test5/pullBy/pullBy.test.js new file mode 100644 index 000000000..5b6f656d5 --- /dev/null +++ b/test5/pullBy/pullBy.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const pullBy = require('./pullBy.js'); + +test('Testing pullBy', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof pullBy === 'function').toBeTruthy(); + var myArray = [{ x: 1 }, { x: 2 }, { x: 3 }, { x: 1 }]; + pullBy(myArray, [{ x: 1 }, { x: 3 }], o => o.x); + expect(myArray).toEqual([{ x: 2 }]); +}); diff --git a/test/quickSort/quickSort.js b/test5/quickSort/quickSort.js similarity index 100% rename from test/quickSort/quickSort.js rename to test5/quickSort/quickSort.js diff --git a/test5/quickSort/quickSort.test.js b/test5/quickSort/quickSort.test.js new file mode 100644 index 000000000..019749405 --- /dev/null +++ b/test5/quickSort/quickSort.test.js @@ -0,0 +1,20 @@ +const expect = require('expect'); +const quickSort = require('./quickSort.js'); + +test('Testing quickSort', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof quickSort === 'function').toBeTruthy(); + expect(quickSort([5, 6, 4, 3, 1, 2])).toEqual([1, 2, 3, 4, 5, 6]); + expect(quickSort([-1, 0, -2])).toEqual([-2, -1, 0]); + expect(() => quickSort()).toThrow(); + expect(() => quickSort(123)).toThrow(); + expect(() => quickSort({ 234: string})).toThrow(); + expect(() => quickSort(null)).toThrow(); + 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(); + expect((end - start) < 2000).toBeTruthy(); +}); diff --git a/test/radsToDegrees/radsToDegrees.js b/test5/radsToDegrees/radsToDegrees.js similarity index 100% rename from test/radsToDegrees/radsToDegrees.js rename to test5/radsToDegrees/radsToDegrees.js diff --git a/test5/radsToDegrees/radsToDegrees.test.js b/test5/radsToDegrees/radsToDegrees.test.js new file mode 100644 index 000000000..4b492e176 --- /dev/null +++ b/test5/radsToDegrees/radsToDegrees.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const radsToDegrees = require('./radsToDegrees.js'); + +test('Testing radsToDegrees', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof radsToDegrees === 'function').toBeTruthy(); + expect(radsToDegrees(Math.PI / 2)).toBe(90); +}); diff --git a/test/randomHexColorCode/randomHexColorCode.js b/test5/randomHexColorCode/randomHexColorCode.js similarity index 100% rename from test/randomHexColorCode/randomHexColorCode.js rename to test5/randomHexColorCode/randomHexColorCode.js diff --git a/test5/randomHexColorCode/randomHexColorCode.test.js b/test5/randomHexColorCode/randomHexColorCode.test.js new file mode 100644 index 000000000..c2d92bf7c --- /dev/null +++ b/test5/randomHexColorCode/randomHexColorCode.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const randomHexColorCode = require('./randomHexColorCode.js'); + +test('Testing randomHexColorCode', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof randomHexColorCode === 'function').toBeTruthy(); + //t.deepEqual(randomHexColorCode(args..), 'Expected'); + expect(randomHexColorCode().length).toBe(7); + expect(randomHexColorCode().startsWith('#')).toBeTruthy(); + expect(randomHexColorCode().slice(1).match(/[^0123456789abcdef]/i) === null).toBeTruthy(); +}); diff --git a/test/randomIntArrayInRange/randomIntArrayInRange.js b/test5/randomIntArrayInRange/randomIntArrayInRange.js similarity index 100% rename from test/randomIntArrayInRange/randomIntArrayInRange.js rename to test5/randomIntArrayInRange/randomIntArrayInRange.js diff --git a/test5/randomIntArrayInRange/randomIntArrayInRange.test.js b/test5/randomIntArrayInRange/randomIntArrayInRange.test.js new file mode 100644 index 000000000..cff9657e5 --- /dev/null +++ b/test5/randomIntArrayInRange/randomIntArrayInRange.test.js @@ -0,0 +1,14 @@ +const expect = require('expect'); +const randomIntArrayInRange = require('./randomIntArrayInRange.js'); + +test('Testing randomIntArrayInRange', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof randomIntArrayInRange === 'function').toBeTruthy(); + const lowerLimit = Math.floor(Math.random() * 20); + const upperLimit = Math.floor(lowerLimit + Math.random() * 10); + const arr = randomIntArrayInRange(lowerLimit,upperLimit, 10); + expect(arr.every(x => typeof x === 'number')).toBeTruthy(); + expect(arr.length).toBe(10); + expect(arr.every(x => (x >= lowerLimit) && (x <= upperLimit))).toBeTruthy(); +}); diff --git a/test/randomIntegerInRange/randomIntegerInRange.js b/test5/randomIntegerInRange/randomIntegerInRange.js similarity index 100% rename from test/randomIntegerInRange/randomIntegerInRange.js rename to test5/randomIntegerInRange/randomIntegerInRange.js diff --git a/test5/randomIntegerInRange/randomIntegerInRange.test.js b/test5/randomIntegerInRange/randomIntegerInRange.test.js new file mode 100644 index 000000000..04ebd1d4f --- /dev/null +++ b/test5/randomIntegerInRange/randomIntegerInRange.test.js @@ -0,0 +1,13 @@ +const expect = require('expect'); +const randomIntegerInRange = require('./randomIntegerInRange.js'); + +test('Testing randomIntegerInRange', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof randomIntegerInRange === 'function').toBeTruthy(); + const lowerLimit = Math.floor(Math.random() * 20); + const upperLimit = Math.floor(lowerLimit + Math.random() * 10); + expect(Number.isInteger(randomIntegerInRange(lowerLimit,upperLimit))).toBeTruthy(); + const numberForTest = randomIntegerInRange(lowerLimit,upperLimit); + expect((numberForTest >= lowerLimit) && (numberForTest <= upperLimit)).toBeTruthy(); +}); diff --git a/test/randomNumberInRange/randomNumberInRange.js b/test5/randomNumberInRange/randomNumberInRange.js similarity index 100% rename from test/randomNumberInRange/randomNumberInRange.js rename to test5/randomNumberInRange/randomNumberInRange.js diff --git a/test5/randomNumberInRange/randomNumberInRange.test.js b/test5/randomNumberInRange/randomNumberInRange.test.js new file mode 100644 index 000000000..646322ce8 --- /dev/null +++ b/test5/randomNumberInRange/randomNumberInRange.test.js @@ -0,0 +1,13 @@ +const expect = require('expect'); +const randomNumberInRange = require('./randomNumberInRange.js'); + +test('Testing randomNumberInRange', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof randomNumberInRange === 'function').toBeTruthy(); + const lowerLimit = Math.floor(Math.random() * 20); + const upperLimit = Math.floor(lowerLimit + Math.random() * 10); + expect(typeof randomNumberInRange(lowerLimit,upperLimit) === 'number').toBeTruthy(); + const numberForTest = randomNumberInRange(lowerLimit,upperLimit); + expect((numberForTest >= lowerLimit) && (numberForTest <= upperLimit)).toBeTruthy(); +}); diff --git a/test/readFileLines/readFileLines.js b/test5/readFileLines/readFileLines.js similarity index 100% rename from test/readFileLines/readFileLines.js rename to test5/readFileLines/readFileLines.js diff --git a/test5/readFileLines/readFileLines.test.js b/test5/readFileLines/readFileLines.test.js new file mode 100644 index 000000000..36813c5b5 --- /dev/null +++ b/test5/readFileLines/readFileLines.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const readFileLines = require('./readFileLines.js'); + +test('Testing readFileLines', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof readFileLines === 'function').toBeTruthy(); +}); diff --git a/test/rearg/rearg.js b/test5/rearg/rearg.js similarity index 100% rename from test/rearg/rearg.js rename to test5/rearg/rearg.js diff --git a/test5/rearg/rearg.test.js b/test5/rearg/rearg.test.js new file mode 100644 index 000000000..ce426c97c --- /dev/null +++ b/test5/rearg/rearg.test.js @@ -0,0 +1,15 @@ +const expect = require('expect'); +const rearg = require('./rearg.js'); + +test('Testing rearg', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof rearg === 'function').toBeTruthy(); + var rearged = rearg( + function(a, b, c) { + return [a, b, c]; + }, + [2, 0, 1] + ); + expect(rearged('b', 'c', 'a')).toEqual(['a', 'b', 'c']); +}); diff --git a/test/recordAnimationFrames/recordAnimationFrames.js b/test5/recordAnimationFrames/recordAnimationFrames.js similarity index 100% rename from test/recordAnimationFrames/recordAnimationFrames.js rename to test5/recordAnimationFrames/recordAnimationFrames.js diff --git a/test5/recordAnimationFrames/recordAnimationFrames.test.js b/test5/recordAnimationFrames/recordAnimationFrames.test.js new file mode 100644 index 000000000..9c71212e5 --- /dev/null +++ b/test5/recordAnimationFrames/recordAnimationFrames.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const recordAnimationFrames = require('./recordAnimationFrames.js'); + +test('Testing recordAnimationFrames', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof recordAnimationFrames === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/redirect/redirect.js b/test5/redirect/redirect.js similarity index 100% rename from test/redirect/redirect.js rename to test5/redirect/redirect.js diff --git a/test5/redirect/redirect.test.js b/test5/redirect/redirect.test.js new file mode 100644 index 000000000..d468f09ec --- /dev/null +++ b/test5/redirect/redirect.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const redirect = require('./redirect.js'); + +test('Testing redirect', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof redirect === 'function').toBeTruthy(); +}); diff --git a/test/reduceSuccessive/reduceSuccessive.js b/test5/reduceSuccessive/reduceSuccessive.js similarity index 100% rename from test/reduceSuccessive/reduceSuccessive.js rename to test5/reduceSuccessive/reduceSuccessive.js diff --git a/test5/reduceSuccessive/reduceSuccessive.test.js b/test5/reduceSuccessive/reduceSuccessive.test.js new file mode 100644 index 000000000..4bb7fada1 --- /dev/null +++ b/test5/reduceSuccessive/reduceSuccessive.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const reduceSuccessive = require('./reduceSuccessive.js'); + +test('Testing reduceSuccessive', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof reduceSuccessive === 'function').toBeTruthy(); + 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.js b/test5/reduceWhich/reduceWhich.js similarity index 100% rename from test/reduceWhich/reduceWhich.js rename to test5/reduceWhich/reduceWhich.js diff --git a/test5/reduceWhich/reduceWhich.test.js b/test5/reduceWhich/reduceWhich.test.js new file mode 100644 index 000000000..46b14797e --- /dev/null +++ b/test5/reduceWhich/reduceWhich.test.js @@ -0,0 +1,14 @@ +const expect = require('expect'); +const reduceWhich = require('./reduceWhich.js'); + +test('Testing reduceWhich', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof reduceWhich === 'function').toBeTruthy(); + expect(reduceWhich([1, 3, 2])).toBe(1); + expect(reduceWhich([1, 3, 2], (a, b) => b - a)).toBe(3); + expect(reduceWhich( + [{ name: 'Tom', age: 12 }, { name: 'Jack', age: 18 }, { name: 'Lucy', age: 9 }], + (a, b) => a.age - b.age +)).toEqual({name: "Lucy", age: 9}); +}); diff --git a/test/reducedFilter/reducedFilter.js b/test5/reducedFilter/reducedFilter.js similarity index 100% rename from test/reducedFilter/reducedFilter.js rename to test5/reducedFilter/reducedFilter.js diff --git a/test5/reducedFilter/reducedFilter.test.js b/test5/reducedFilter/reducedFilter.test.js new file mode 100644 index 000000000..a9f87d3e6 --- /dev/null +++ b/test5/reducedFilter/reducedFilter.test.js @@ -0,0 +1,21 @@ +const expect = require('expect'); +const reducedFilter = require('./reducedFilter.js'); + +test('Testing reducedFilter', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof reducedFilter === 'function').toBeTruthy(); + const data = [ + { + id: 1, + name: 'john', + age: 24 + }, + { + id: 2, + name: 'mike', + age: 50 + } + ]; + expect(reducedFilter(data, ['id', 'name'], item => item.age > 24)).toEqual([{ id: 2, name: 'mike'}]); +}); \ No newline at end of file diff --git a/test/reject/reject.js b/test5/reject/reject.js similarity index 100% rename from test/reject/reject.js rename to test5/reject/reject.js diff --git a/test/reject/reject.test.js b/test5/reject/reject.test.js similarity index 60% rename from test/reject/reject.test.js rename to test5/reject/reject.test.js index a82244682..525aaeab4 100644 --- a/test/reject/reject.test.js +++ b/test5/reject/reject.test.js @@ -1,24 +1,22 @@ -const test = require('tape'); +const expect = require('expect'); const reject = require('./reject.js'); -test('Testing reject', (t) => { +test('Testing reject', () => { //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'); + expect(typeof reject === 'function').toBeTruthy(); const noEvens = reject( (x) => x % 2 === 0, [1, 2, 3, 4, 5] ); - t.deepEqual(noEvens, [1, 3, 5]); + expect(noEvens).toEqual([1, 3, 5]); const fourLettersOrLess = reject( (word) => word.length > 4, ['Apple', 'Pear', 'Kiwi', 'Banana'] ); - t.deepEqual(fourLettersOrLess, ['Pear', 'Kiwi']); - - t.end(); + expect(fourLettersOrLess).toEqual(['Pear', 'Kiwi']); }); diff --git a/test/remove/remove.js b/test5/remove/remove.js similarity index 100% rename from test/remove/remove.js rename to test5/remove/remove.js diff --git a/test5/remove/remove.test.js b/test5/remove/remove.test.js new file mode 100644 index 000000000..235ec23ac --- /dev/null +++ b/test5/remove/remove.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const remove = require('./remove.js'); + +test('Testing remove', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof remove === 'function').toBeTruthy(); + expect(remove([1, 2, 3, 4], n => n % 2 === 0)).toEqual([2, 4]); +}); diff --git a/test/removeNonASCII/removeNonASCII.js b/test5/removeNonASCII/removeNonASCII.js similarity index 100% rename from test/removeNonASCII/removeNonASCII.js rename to test5/removeNonASCII/removeNonASCII.js diff --git a/test5/removeNonASCII/removeNonASCII.test.js b/test5/removeNonASCII/removeNonASCII.test.js new file mode 100644 index 000000000..d0d22b435 --- /dev/null +++ b/test5/removeNonASCII/removeNonASCII.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const removeNonASCII = require('./removeNonASCII.js'); + +test('Testing removeNonASCII', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof removeNonASCII === 'function').toBeTruthy(); + expect(removeNonASCII('äÄçÇéÉêlorem-ipsumöÖÐþúÚ')).toBe('lorem-ipsum'); +}); diff --git a/test/removeVowels/removeVowels.js b/test5/removeVowels/removeVowels.js similarity index 100% rename from test/removeVowels/removeVowels.js rename to test5/removeVowels/removeVowels.js diff --git a/test5/removeVowels/removeVowels.test.js b/test5/removeVowels/removeVowels.test.js new file mode 100644 index 000000000..79896ad4a --- /dev/null +++ b/test5/removeVowels/removeVowels.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const removeVowels = require('./removeVowels.js'); + +test('Testing removeVowels', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof removeVowels === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/renameKeys/renameKeys.js b/test5/renameKeys/renameKeys.js similarity index 100% rename from test/renameKeys/renameKeys.js rename to test5/renameKeys/renameKeys.js diff --git a/test/renameKeys/renameKeys.test.js b/test5/renameKeys/renameKeys.test.js similarity index 56% rename from test/renameKeys/renameKeys.test.js rename to test5/renameKeys/renameKeys.test.js index 42900ec17..553959820 100644 --- a/test/renameKeys/renameKeys.test.js +++ b/test5/renameKeys/renameKeys.test.js @@ -1,15 +1,13 @@ -const test = require('tape'); +const expect = require('expect'); const renameKeys = require('./renameKeys.js'); -test('Testing renameKeys', (t) => { +test('Testing renameKeys', () => { //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'); + expect(typeof renameKeys === 'function').toBeTruthy(); 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(); + expect(renamedObj).toEqual({ firstName: 'Bobo', passion: 'Front-End Master', shoeSize: 100 }); }); diff --git a/test/reverseString/reverseString.js b/test5/reverseString/reverseString.js similarity index 100% rename from test/reverseString/reverseString.js rename to test5/reverseString/reverseString.js diff --git a/test5/reverseString/reverseString.test.js b/test5/reverseString/reverseString.test.js new file mode 100644 index 000000000..6891a2ca8 --- /dev/null +++ b/test5/reverseString/reverseString.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const reverseString = require('./reverseString.js'); + +test('Testing reverseString', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof reverseString === 'function').toBeTruthy(); + expect(reverseString('foobar')).toBe('raboof'); +}); \ No newline at end of file diff --git a/test/round/round.js b/test5/round/round.js similarity index 100% rename from test/round/round.js rename to test5/round/round.js diff --git a/test5/round/round.test.js b/test5/round/round.test.js new file mode 100644 index 000000000..3dda04bfe --- /dev/null +++ b/test5/round/round.test.js @@ -0,0 +1,22 @@ +const expect = require('expect'); +const round = require('./round.js'); + +test('Testing round', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof round === 'function').toBeTruthy(); + expect(round(1.005, 2)).toBe(1.01); + expect(round(123.3423345345345345344, 11)).toBe(123.34233453453); + expect(round(3.342, 11)).toBe(3.342); + expect(round(1.005)).toBe(1); + expect(isNaN(round([1.005, 2]))).toBeTruthy(); + expect(isNaN(round('string'))).toBeTruthy(); + expect(isNaN(round())).toBeTruthy(); + expect(isNaN(round(132, 413, 4134))).toBeTruthy(); + expect(isNaN(round({a: 132}, 413))).toBeTruthy(); + + let start = new Date().getTime(); + round(123.3423345345345345344, 11); + let end = new Date().getTime(); + expect((end - start) < 2000).toBeTruthy(); +}); diff --git a/test/URLJoin/URLJoin.js b/test6/URLJoin/URLJoin.js similarity index 100% rename from test/URLJoin/URLJoin.js rename to test6/URLJoin/URLJoin.js diff --git a/test6/URLJoin/URLJoin.test.js b/test6/URLJoin/URLJoin.test.js new file mode 100644 index 000000000..203e39fa3 --- /dev/null +++ b/test6/URLJoin/URLJoin.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const URLJoin = require('./URLJoin.js'); + +test('Testing URLJoin', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof URLJoin === 'function').toBeTruthy(); + 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'); + 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.js b/test6/UUIDGeneratorBrowser/UUIDGeneratorBrowser.js similarity index 100% rename from test/UUIDGeneratorBrowser/UUIDGeneratorBrowser.js rename to test6/UUIDGeneratorBrowser/UUIDGeneratorBrowser.js diff --git a/test6/UUIDGeneratorBrowser/UUIDGeneratorBrowser.test.js b/test6/UUIDGeneratorBrowser/UUIDGeneratorBrowser.test.js new file mode 100644 index 000000000..95bc482a7 --- /dev/null +++ b/test6/UUIDGeneratorBrowser/UUIDGeneratorBrowser.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const UUIDGeneratorBrowser = require('./UUIDGeneratorBrowser.js'); + +test('Testing UUIDGeneratorBrowser', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof UUIDGeneratorBrowser === 'function').toBeTruthy(); +}); diff --git a/test/UUIDGeneratorNode/UUIDGeneratorNode.js b/test6/UUIDGeneratorNode/UUIDGeneratorNode.js similarity index 100% rename from test/UUIDGeneratorNode/UUIDGeneratorNode.js rename to test6/UUIDGeneratorNode/UUIDGeneratorNode.js diff --git a/test6/UUIDGeneratorNode/UUIDGeneratorNode.test.js b/test6/UUIDGeneratorNode/UUIDGeneratorNode.test.js new file mode 100644 index 000000000..1be773a7e --- /dev/null +++ b/test6/UUIDGeneratorNode/UUIDGeneratorNode.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const UUIDGeneratorNode = require('./UUIDGeneratorNode.js'); + +test('Testing UUIDGeneratorNode', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof UUIDGeneratorNode === 'function').toBeTruthy(); + const uuid = UUIDGeneratorNode(); + expect([uuid[8], uuid[13], uuid[18], uuid[23]]).toEqual(['-', '-', '-', '-']); + expect(/^[0-9A-Fa-f-]+$/.test(uuid)).toBeTruthy(); +}); diff --git a/test/runAsync/runAsync.js b/test6/runAsync/runAsync.js similarity index 100% rename from test/runAsync/runAsync.js rename to test6/runAsync/runAsync.js diff --git a/test6/runAsync/runAsync.test.js b/test6/runAsync/runAsync.test.js new file mode 100644 index 000000000..703f15186 --- /dev/null +++ b/test6/runAsync/runAsync.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const runAsync = require('./runAsync.js'); + +test('Testing runAsync', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof runAsync === 'function').toBeTruthy(); +}); diff --git a/test/runPromisesInSeries/runPromisesInSeries.js b/test6/runPromisesInSeries/runPromisesInSeries.js similarity index 100% rename from test/runPromisesInSeries/runPromisesInSeries.js rename to test6/runPromisesInSeries/runPromisesInSeries.js diff --git a/test6/runPromisesInSeries/runPromisesInSeries.test.js b/test6/runPromisesInSeries/runPromisesInSeries.test.js new file mode 100644 index 000000000..51e937d2d --- /dev/null +++ b/test6/runPromisesInSeries/runPromisesInSeries.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const runPromisesInSeries = require('./runPromisesInSeries.js'); + +test('Testing runPromisesInSeries', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof runPromisesInSeries === 'function').toBeTruthy(); + const delay = d => new Promise(r => setTimeout(r, d)); + runPromisesInSeries([() => delay(100), () => delay(200).then(() => )]); +}); diff --git a/test/sample/sample.js b/test6/sample/sample.js similarity index 100% rename from test/sample/sample.js rename to test6/sample/sample.js diff --git a/test6/sample/sample.test.js b/test6/sample/sample.test.js new file mode 100644 index 000000000..11847222f --- /dev/null +++ b/test6/sample/sample.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const sample = require('./sample.js'); + +test('Testing sample', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof sample === 'function').toBeTruthy(); + const arr = [3,7,9,11]; + expect(arr.includes(sample(arr))).toBeTruthy(); + expect(sample([1])).toBe(1); + expect(sample([])).toBe(undefined); +}); diff --git a/test/sampleSize/sampleSize.js b/test6/sampleSize/sampleSize.js similarity index 100% rename from test/sampleSize/sampleSize.js rename to test6/sampleSize/sampleSize.js diff --git a/test6/sampleSize/sampleSize.test.js b/test6/sampleSize/sampleSize.test.js new file mode 100644 index 000000000..e955495cf --- /dev/null +++ b/test6/sampleSize/sampleSize.test.js @@ -0,0 +1,14 @@ +const expect = require('expect'); +const sampleSize = require('./sampleSize.js'); + +test('Testing sampleSize', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof sampleSize === 'function').toBeTruthy(); + const arr = [3,7,9,11]; + expect(sampleSize(arr).length).toBe(1); + expect(sampleSize(arr, 2).every(x => arr.includes(x))).toBeTruthy(); + expect(sampleSize(arr, 5).length).toBe(4); + expect(sampleSize([], 2)).toEqual([]); + expect(sampleSize(arr, 0)).toEqual([]); +}); diff --git a/test/scrollToTop/scrollToTop.js b/test6/scrollToTop/scrollToTop.js similarity index 100% rename from test/scrollToTop/scrollToTop.js rename to test6/scrollToTop/scrollToTop.js diff --git a/test6/scrollToTop/scrollToTop.test.js b/test6/scrollToTop/scrollToTop.test.js new file mode 100644 index 000000000..2f0f8ec27 --- /dev/null +++ b/test6/scrollToTop/scrollToTop.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const scrollToTop = require('./scrollToTop.js'); + +test('Testing scrollToTop', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof scrollToTop === 'function').toBeTruthy(); +}); diff --git a/test/sdbm/sdbm.js b/test6/sdbm/sdbm.js similarity index 100% rename from test/sdbm/sdbm.js rename to test6/sdbm/sdbm.js diff --git a/test6/sdbm/sdbm.test.js b/test6/sdbm/sdbm.test.js new file mode 100644 index 000000000..361581a59 --- /dev/null +++ b/test6/sdbm/sdbm.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const sdbm = require('./sdbm.js'); + +test('Testing sdbm', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof sdbm === 'function').toBeTruthy(); + expect(sdbm('name')).toBe(-3521204949); +}); \ No newline at end of file diff --git a/test/serializeCookie/serializeCookie.js b/test6/serializeCookie/serializeCookie.js similarity index 100% rename from test/serializeCookie/serializeCookie.js rename to test6/serializeCookie/serializeCookie.js diff --git a/test6/serializeCookie/serializeCookie.test.js b/test6/serializeCookie/serializeCookie.test.js new file mode 100644 index 000000000..181b0d4c1 --- /dev/null +++ b/test6/serializeCookie/serializeCookie.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const serializeCookie = require('./serializeCookie.js'); + +test('Testing serializeCookie', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof serializeCookie === 'function').toBeTruthy(); + expect(serializeCookie('foo', 'bar')).toBe('foo=bar'); +}); diff --git a/test/setStyle/setStyle.js b/test6/setStyle/setStyle.js similarity index 100% rename from test/setStyle/setStyle.js rename to test6/setStyle/setStyle.js diff --git a/test6/setStyle/setStyle.test.js b/test6/setStyle/setStyle.test.js new file mode 100644 index 000000000..395bb5621 --- /dev/null +++ b/test6/setStyle/setStyle.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const setStyle = require('./setStyle.js'); + +test('Testing setStyle', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof setStyle === 'function').toBeTruthy(); +}); diff --git a/test/shallowClone/shallowClone.js b/test6/shallowClone/shallowClone.js similarity index 100% rename from test/shallowClone/shallowClone.js rename to test6/shallowClone/shallowClone.js diff --git a/test6/shallowClone/shallowClone.test.js b/test6/shallowClone/shallowClone.test.js new file mode 100644 index 000000000..6d6d64666 --- /dev/null +++ b/test6/shallowClone/shallowClone.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const shallowClone = require('./shallowClone.js'); + +test('Testing shallowClone', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof shallowClone === 'function').toBeTruthy(); + const a = { foo: 'bar', obj: { a: 1, b: 2 } }; + const b = shallowClone(a); + expect(a).not.toBe(b); + expect(a.obj).toBe(b.obj); +}); diff --git a/test/show/show.js b/test6/show/show.js similarity index 100% rename from test/show/show.js rename to test6/show/show.js diff --git a/test6/show/show.test.js b/test6/show/show.test.js new file mode 100644 index 000000000..11113916a --- /dev/null +++ b/test6/show/show.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const show = require('./show.js'); + +test('Testing show', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof show === 'function').toBeTruthy(); +}); diff --git a/test/shuffle/shuffle.js b/test6/shuffle/shuffle.js similarity index 100% rename from test/shuffle/shuffle.js rename to test6/shuffle/shuffle.js diff --git a/test6/shuffle/shuffle.test.js b/test6/shuffle/shuffle.test.js new file mode 100644 index 000000000..56c472359 --- /dev/null +++ b/test6/shuffle/shuffle.test.js @@ -0,0 +1,13 @@ +const expect = require('expect'); +const shuffle = require('./shuffle.js'); + +test('Testing shuffle', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof shuffle === 'function').toBeTruthy(); + const arr = [1,2,3,4,5,6]; + expect(shuffle(arr)).not.toBe(arr); + expect(shuffle(arr).every(x => arr.includes(x))).toBeTruthy(); + expect(shuffle([])).toEqual([]); + expect(shuffle([1])).toEqual([1]); +}); diff --git a/test/similarity/similarity.js b/test6/similarity/similarity.js similarity index 100% rename from test/similarity/similarity.js rename to test6/similarity/similarity.js diff --git a/test6/similarity/similarity.test.js b/test6/similarity/similarity.test.js new file mode 100644 index 000000000..2de50178f --- /dev/null +++ b/test6/similarity/similarity.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const similarity = require('./similarity.js'); + +test('Testing similarity', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof similarity === 'function').toBeTruthy(); + expect(similarity([1, 2, 3], [1, 2, 4])).toEqual([1, 2]); //t.equal(similarity(args..), 'Expected'); +}); \ No newline at end of file diff --git a/test/size/size.js b/test6/size/size.js similarity index 100% rename from test/size/size.js rename to test6/size/size.js diff --git a/test6/size/size.test.js b/test6/size/size.test.js new file mode 100644 index 000000000..b35037e1a --- /dev/null +++ b/test6/size/size.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const size = require('./size.js'); + +test('Testing size', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof size === 'function').toBeTruthy(); + expect(size([1, 2, 3, 4, 5])).toBe(5); + // t.equal(size('size'), 4, "Get size of arrays, objects or strings."); DOESN'T WORK IN NODE ENV + expect(size({ one: 1, two: 2, three: 3 })).toBe(3); +}); \ No newline at end of file diff --git a/test/sleep/sleep.js b/test6/sleep/sleep.js similarity index 100% rename from test/sleep/sleep.js rename to test6/sleep/sleep.js diff --git a/test6/sleep/sleep.test.js b/test6/sleep/sleep.test.js new file mode 100644 index 000000000..72c1abf06 --- /dev/null +++ b/test6/sleep/sleep.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const sleep = require('./sleep.js'); + +test('Testing sleep', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof sleep === 'function').toBeTruthy(); + async function sleepyWork() { + await sleep(1000); + } +}); diff --git a/test/smoothScroll/smoothScroll.js b/test6/smoothScroll/smoothScroll.js similarity index 100% rename from test/smoothScroll/smoothScroll.js rename to test6/smoothScroll/smoothScroll.js diff --git a/test6/smoothScroll/smoothScroll.test.js b/test6/smoothScroll/smoothScroll.test.js new file mode 100644 index 000000000..f5475db0e --- /dev/null +++ b/test6/smoothScroll/smoothScroll.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const smoothScroll = require('./smoothScroll.js'); + +test('Testing smoothScroll', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof smoothScroll === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/solveRPN/solveRPN.js b/test6/solveRPN/solveRPN.js similarity index 100% rename from test/solveRPN/solveRPN.js rename to test6/solveRPN/solveRPN.js diff --git a/test6/solveRPN/solveRPN.test.js b/test6/solveRPN/solveRPN.test.js new file mode 100644 index 000000000..f2c2420de --- /dev/null +++ b/test6/solveRPN/solveRPN.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const solveRPN = require('./solveRPN.js'); + +test('Testing solveRPN', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof solveRPN === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/sortCharactersInString/sortCharactersInString.js b/test6/sortCharactersInString/sortCharactersInString.js similarity index 100% rename from test/sortCharactersInString/sortCharactersInString.js rename to test6/sortCharactersInString/sortCharactersInString.js diff --git a/test6/sortCharactersInString/sortCharactersInString.test.js b/test6/sortCharactersInString/sortCharactersInString.test.js new file mode 100644 index 000000000..ab0ab6e1d --- /dev/null +++ b/test6/sortCharactersInString/sortCharactersInString.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const sortCharactersInString = require('./sortCharactersInString.js'); + +test('Testing sortCharactersInString', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof sortCharactersInString === 'function').toBeTruthy(); + expect(sortCharactersInString('cabbage')).toBe('aabbceg'); +}); \ No newline at end of file diff --git a/test/sortedIndex/sortedIndex.js b/test6/sortedIndex/sortedIndex.js similarity index 100% rename from test/sortedIndex/sortedIndex.js rename to test6/sortedIndex/sortedIndex.js diff --git a/test6/sortedIndex/sortedIndex.test.js b/test6/sortedIndex/sortedIndex.test.js new file mode 100644 index 000000000..06af95ed1 --- /dev/null +++ b/test6/sortedIndex/sortedIndex.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const sortedIndex = require('./sortedIndex.js'); + +test('Testing sortedIndex', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof sortedIndex === 'function').toBeTruthy(); + expect(sortedIndex([5, 3, 2, 1], 4)).toBe(1); + expect(sortedIndex([30, 50], 40)).toBe(1); +}); \ No newline at end of file diff --git a/test/sortedIndexBy/sortedIndexBy.js b/test6/sortedIndexBy/sortedIndexBy.js similarity index 100% rename from test/sortedIndexBy/sortedIndexBy.js rename to test6/sortedIndexBy/sortedIndexBy.js diff --git a/test6/sortedIndexBy/sortedIndexBy.test.js b/test6/sortedIndexBy/sortedIndexBy.test.js new file mode 100644 index 000000000..dede4bfdd --- /dev/null +++ b/test6/sortedIndexBy/sortedIndexBy.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const sortedIndexBy = require('./sortedIndexBy.js'); + +test('Testing sortedIndexBy', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof sortedIndexBy === 'function').toBeTruthy(); + expect(sortedIndexBy([{ x: 4 }, { x: 5 }], { x: 4 }, o => o.x)).toBe(0); +}); diff --git a/test/sortedLastIndex/sortedLastIndex.js b/test6/sortedLastIndex/sortedLastIndex.js similarity index 100% rename from test/sortedLastIndex/sortedLastIndex.js rename to test6/sortedLastIndex/sortedLastIndex.js diff --git a/test6/sortedLastIndex/sortedLastIndex.test.js b/test6/sortedLastIndex/sortedLastIndex.test.js new file mode 100644 index 000000000..7ceb05736 --- /dev/null +++ b/test6/sortedLastIndex/sortedLastIndex.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const sortedLastIndex = require('./sortedLastIndex.js'); + +test('Testing sortedLastIndex', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof sortedLastIndex === 'function').toBeTruthy(); + expect(sortedLastIndex([10, 20, 30, 30, 40], 30)).toBe(4); +}); diff --git a/test/sortedLastIndexBy/sortedLastIndexBy.js b/test6/sortedLastIndexBy/sortedLastIndexBy.js similarity index 100% rename from test/sortedLastIndexBy/sortedLastIndexBy.js rename to test6/sortedLastIndexBy/sortedLastIndexBy.js diff --git a/test6/sortedLastIndexBy/sortedLastIndexBy.test.js b/test6/sortedLastIndexBy/sortedLastIndexBy.test.js new file mode 100644 index 000000000..ec71c7f4b --- /dev/null +++ b/test6/sortedLastIndexBy/sortedLastIndexBy.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const sortedLastIndexBy = require('./sortedLastIndexBy.js'); + +test('Testing sortedLastIndexBy', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof sortedLastIndexBy === 'function').toBeTruthy(); + expect(sortedLastIndexBy([{ x: 4 }, { x: 5 }], { x: 4 }, o => o.x)).toBe(1); +}); diff --git a/test/speechSynthesis/speechSynthesis.js b/test6/speechSynthesis/speechSynthesis.js similarity index 100% rename from test/speechSynthesis/speechSynthesis.js rename to test6/speechSynthesis/speechSynthesis.js diff --git a/test6/speechSynthesis/speechSynthesis.test.js b/test6/speechSynthesis/speechSynthesis.test.js new file mode 100644 index 000000000..7546f1972 --- /dev/null +++ b/test6/speechSynthesis/speechSynthesis.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const speechSynthesis = require('./speechSynthesis.js'); + +test('Testing speechSynthesis', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof speechSynthesis === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/splitLines/splitLines.js b/test6/splitLines/splitLines.js similarity index 100% rename from test/splitLines/splitLines.js rename to test6/splitLines/splitLines.js diff --git a/test6/splitLines/splitLines.test.js b/test6/splitLines/splitLines.test.js new file mode 100644 index 000000000..bbeb1c5d8 --- /dev/null +++ b/test6/splitLines/splitLines.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const splitLines = require('./splitLines.js'); + +test('Testing splitLines', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof splitLines === 'function').toBeTruthy(); + expect(splitLines('This\nis a\nmultiline\nstring.\n')).toEqual(['This', 'is a', 'multiline', 'string.' , '']); +}); \ No newline at end of file diff --git a/test/spreadOver/spreadOver.js b/test6/spreadOver/spreadOver.js similarity index 100% rename from test/spreadOver/spreadOver.js rename to test6/spreadOver/spreadOver.js diff --git a/test6/spreadOver/spreadOver.test.js b/test6/spreadOver/spreadOver.test.js new file mode 100644 index 000000000..e198d4c70 --- /dev/null +++ b/test6/spreadOver/spreadOver.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const spreadOver = require('./spreadOver.js'); + +test('Testing spreadOver', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof spreadOver === 'function').toBeTruthy(); + const arrayMax = spreadOver(Math.max); + expect(arrayMax([1, 2, 3])).toBe(3); +}); \ No newline at end of file diff --git a/test/stableSort/stableSort.js b/test6/stableSort/stableSort.js similarity index 100% rename from test/stableSort/stableSort.js rename to test6/stableSort/stableSort.js diff --git a/test/stableSort/stableSort.test.js b/test6/stableSort/stableSort.test.js similarity index 65% rename from test/stableSort/stableSort.test.js rename to test6/stableSort/stableSort.test.js index e8cf95496..1915459ea 100644 --- a/test/stableSort/stableSort.test.js +++ b/test6/stableSort/stableSort.test.js @@ -1,17 +1,16 @@ -const test = require('tape'); +const expect = require('expect'); const stableSort = require('./stableSort.js'); -test('Testing stableSort', (t) => { +test('Testing stableSort', () => { //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'); + expect(typeof stableSort === 'function').toBeTruthy(); //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(); + expect(stableSort(arr, compare)).toEqual(arr); }); diff --git a/test/standardDeviation/standardDeviation.js b/test6/standardDeviation/standardDeviation.js similarity index 100% rename from test/standardDeviation/standardDeviation.js rename to test6/standardDeviation/standardDeviation.js diff --git a/test6/standardDeviation/standardDeviation.test.js b/test6/standardDeviation/standardDeviation.test.js new file mode 100644 index 000000000..0708aff3a --- /dev/null +++ b/test6/standardDeviation/standardDeviation.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const standardDeviation = require('./standardDeviation.js'); + +test('Testing standardDeviation', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof standardDeviation === 'function').toBeTruthy(); + expect(standardDeviation([10, 2, 38, 23, 38, 23, 21])).toBe(13.284434142114991); + expect(standardDeviation([10, 2, 38, 23, 38, 23, 21], true)).toBe(12.29899614287479); +}); \ No newline at end of file diff --git a/test/stringPermutations/stringPermutations.js b/test6/stringPermutations/stringPermutations.js similarity index 100% rename from test/stringPermutations/stringPermutations.js rename to test6/stringPermutations/stringPermutations.js diff --git a/test6/stringPermutations/stringPermutations.test.js b/test6/stringPermutations/stringPermutations.test.js new file mode 100644 index 000000000..85c645ee3 --- /dev/null +++ b/test6/stringPermutations/stringPermutations.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const stringPermutations = require('./stringPermutations.js'); + +test('Testing stringPermutations', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof stringPermutations === 'function').toBeTruthy(); + expect(stringPermutations('abc')).toEqual(['abc','acb','bac','bca','cab','cba']); + expect(stringPermutations('a')).toEqual(['a']); + expect(stringPermutations('')).toEqual(['']); +}); diff --git a/test/stripHTMLTags/stripHTMLTags.js b/test6/stripHTMLTags/stripHTMLTags.js similarity index 100% rename from test/stripHTMLTags/stripHTMLTags.js rename to test6/stripHTMLTags/stripHTMLTags.js diff --git a/test6/stripHTMLTags/stripHTMLTags.test.js b/test6/stripHTMLTags/stripHTMLTags.test.js new file mode 100644 index 000000000..e3c59163f --- /dev/null +++ b/test6/stripHTMLTags/stripHTMLTags.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const stripHTMLTags = require('./stripHTMLTags.js'); + +test('Testing stripHTMLTags', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof stripHTMLTags === 'function').toBeTruthy(); + expect(stripHTMLTags('

lorem ipsum


')).toBe('lorem ipsum'); +}); diff --git a/test/sum/sum.js b/test6/sum/sum.js similarity index 100% rename from test/sum/sum.js rename to test6/sum/sum.js diff --git a/test6/sum/sum.test.js b/test6/sum/sum.test.js new file mode 100644 index 000000000..07b5cafc1 --- /dev/null +++ b/test6/sum/sum.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const sum = require('./sum.js'); + +test('Testing sum', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof sum === 'function').toBeTruthy(); + expect(sum(...[1, 2, 3, 4])).toBe(10); +}); \ No newline at end of file diff --git a/test/sumBy/sumBy.js b/test6/sumBy/sumBy.js similarity index 100% rename from test/sumBy/sumBy.js rename to test6/sumBy/sumBy.js diff --git a/test6/sumBy/sumBy.test.js b/test6/sumBy/sumBy.test.js new file mode 100644 index 000000000..390699e6a --- /dev/null +++ b/test6/sumBy/sumBy.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const sumBy = require('./sumBy.js'); + +test('Testing sumBy', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof sumBy === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/sumPower/sumPower.js b/test6/sumPower/sumPower.js similarity index 100% rename from test/sumPower/sumPower.js rename to test6/sumPower/sumPower.js diff --git a/test6/sumPower/sumPower.test.js b/test6/sumPower/sumPower.test.js new file mode 100644 index 000000000..684c57bc5 --- /dev/null +++ b/test6/sumPower/sumPower.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const sumPower = require('./sumPower.js'); + +test('Testing sumPower', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof sumPower === 'function').toBeTruthy(); + expect(sumPower(10)).toBe(385); + expect(sumPower(10, 3)).toBe(3025); + expect(sumPower(10, 3, 5)).toBe(2925); +}); \ No newline at end of file diff --git a/test/symmetricDifference/symmetricDifference.js b/test6/symmetricDifference/symmetricDifference.js similarity index 100% rename from test/symmetricDifference/symmetricDifference.js rename to test6/symmetricDifference/symmetricDifference.js diff --git a/test6/symmetricDifference/symmetricDifference.test.js b/test6/symmetricDifference/symmetricDifference.test.js new file mode 100644 index 000000000..62c87aed3 --- /dev/null +++ b/test6/symmetricDifference/symmetricDifference.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const symmetricDifference = require('./symmetricDifference.js'); + +test('Testing symmetricDifference', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof symmetricDifference === 'function').toBeTruthy(); + expect(symmetricDifference([1, 2, 3], [1, 2, 4])).toEqual([3, 4]); +}); \ No newline at end of file diff --git a/test/symmetricDifferenceBy/symmetricDifferenceBy.js b/test6/symmetricDifferenceBy/symmetricDifferenceBy.js similarity index 100% rename from test/symmetricDifferenceBy/symmetricDifferenceBy.js rename to test6/symmetricDifferenceBy/symmetricDifferenceBy.js diff --git a/test6/symmetricDifferenceBy/symmetricDifferenceBy.test.js b/test6/symmetricDifferenceBy/symmetricDifferenceBy.test.js new file mode 100644 index 000000000..537e68858 --- /dev/null +++ b/test6/symmetricDifferenceBy/symmetricDifferenceBy.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const symmetricDifferenceBy = require('./symmetricDifferenceBy.js'); + +test('Testing symmetricDifferenceBy', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof symmetricDifferenceBy === 'function').toBeTruthy(); + expect(symmetricDifferenceBy([2.1, 1.2], [2.3, 3.4], Math.floor)).toEqual([ 1.2, 3.4 ]); +}); diff --git a/test/symmetricDifferenceWith/symmetricDifferenceWith.js b/test6/symmetricDifferenceWith/symmetricDifferenceWith.js similarity index 100% rename from test/symmetricDifferenceWith/symmetricDifferenceWith.js rename to test6/symmetricDifferenceWith/symmetricDifferenceWith.js diff --git a/test6/symmetricDifferenceWith/symmetricDifferenceWith.test.js b/test6/symmetricDifferenceWith/symmetricDifferenceWith.test.js new file mode 100644 index 000000000..db58684a5 --- /dev/null +++ b/test6/symmetricDifferenceWith/symmetricDifferenceWith.test.js @@ -0,0 +1,13 @@ +const expect = require('expect'); +const symmetricDifferenceWith = require('./symmetricDifferenceWith.js'); + +test('Testing symmetricDifferenceWith', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof symmetricDifferenceWith === 'function').toBeTruthy(); + expect(symmetricDifferenceWith( + [1, 1.2, 1.5, 3, 0], + [1.9, 3, 0, 3.9], + (a, b) => Math.round(a) === Math.round(b) +)).toEqual([1, 1.2, 3.9]); +}); diff --git a/test/tail/tail.js b/test6/tail/tail.js similarity index 100% rename from test/tail/tail.js rename to test6/tail/tail.js diff --git a/test6/tail/tail.test.js b/test6/tail/tail.test.js new file mode 100644 index 000000000..198cdd6e9 --- /dev/null +++ b/test6/tail/tail.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const tail = require('./tail.js'); + +test('Testing tail', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof tail === 'function').toBeTruthy(); + expect(tail([1, 2, 3])).toEqual([2, 3]); + expect(tail([1])).toEqual([1]); +}); \ No newline at end of file diff --git a/test/take/take.js b/test6/take/take.js similarity index 100% rename from test/take/take.js rename to test6/take/take.js diff --git a/test6/take/take.test.js b/test6/take/take.test.js new file mode 100644 index 000000000..52938149d --- /dev/null +++ b/test6/take/take.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const take = require('./take.js'); + +test('Testing take', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof take === 'function').toBeTruthy(); + expect(take([1, 2, 3], 5)).toEqual([1, 2, 3]); + expect(take([1, 2, 3], 0)).toEqual([]); +}); diff --git a/test/takeRight/takeRight.js b/test6/takeRight/takeRight.js similarity index 100% rename from test/takeRight/takeRight.js rename to test6/takeRight/takeRight.js diff --git a/test6/takeRight/takeRight.test.js b/test6/takeRight/takeRight.test.js new file mode 100644 index 000000000..3181ac032 --- /dev/null +++ b/test6/takeRight/takeRight.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const takeRight = require('./takeRight.js'); + +test('Testing takeRight', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof takeRight === 'function').toBeTruthy(); + expect(takeRight([1, 2, 3], 2)).toEqual([2, 3]); + expect(takeRight([1, 2, 3])).toEqual([3]); +}); \ No newline at end of file diff --git a/test/takeRightWhile/takeRightWhile.js b/test6/takeRightWhile/takeRightWhile.js similarity index 100% rename from test/takeRightWhile/takeRightWhile.js rename to test6/takeRightWhile/takeRightWhile.js diff --git a/test6/takeRightWhile/takeRightWhile.test.js b/test6/takeRightWhile/takeRightWhile.test.js new file mode 100644 index 000000000..8adfeba6a --- /dev/null +++ b/test6/takeRightWhile/takeRightWhile.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const takeRightWhile = require('./takeRightWhile.js'); + +test('Testing takeRightWhile', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof takeRightWhile === 'function').toBeTruthy(); + expect(takeRightWhile([1, 2, 3, 4], n => n < 3)).toEqual([3, 4]); +}); diff --git a/test/takeWhile/takeWhile.js b/test6/takeWhile/takeWhile.js similarity index 100% rename from test/takeWhile/takeWhile.js rename to test6/takeWhile/takeWhile.js diff --git a/test6/takeWhile/takeWhile.test.js b/test6/takeWhile/takeWhile.test.js new file mode 100644 index 000000000..267e27bc2 --- /dev/null +++ b/test6/takeWhile/takeWhile.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const takeWhile = require('./takeWhile.js'); + +test('Testing takeWhile', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof takeWhile === 'function').toBeTruthy(); + expect(takeWhile([1, 2, 3, 4], n => n >= 3)).toEqual([1, 2]); +}); diff --git a/test/throttle/throttle.js b/test6/throttle/throttle.js similarity index 100% rename from test/throttle/throttle.js rename to test6/throttle/throttle.js diff --git a/test6/throttle/throttle.test.js b/test6/throttle/throttle.test.js new file mode 100644 index 000000000..9335ed791 --- /dev/null +++ b/test6/throttle/throttle.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const throttle = require('./throttle.js'); + +test('Testing throttle', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof throttle === 'function').toBeTruthy(); +}); diff --git a/test/timeTaken/timeTaken.js b/test6/timeTaken/timeTaken.js similarity index 100% rename from test/timeTaken/timeTaken.js rename to test6/timeTaken/timeTaken.js diff --git a/test6/timeTaken/timeTaken.test.js b/test6/timeTaken/timeTaken.test.js new file mode 100644 index 000000000..8105b99e7 --- /dev/null +++ b/test6/timeTaken/timeTaken.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const timeTaken = require('./timeTaken.js'); + +test('Testing timeTaken', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof timeTaken === 'function').toBeTruthy(); +}); diff --git a/test/times/times.js b/test6/times/times.js similarity index 100% rename from test/times/times.js rename to test6/times/times.js diff --git a/test6/times/times.test.js b/test6/times/times.test.js new file mode 100644 index 000000000..0bd27bb8d --- /dev/null +++ b/test6/times/times.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const times = require('./times.js'); + +test('Testing times', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof times === 'function').toBeTruthy(); + var output = ''; + times(5, i => (output += i)); + expect(output).toBe('01234'); +}); diff --git a/test/toCamelCase/toCamelCase.js b/test6/toCamelCase/toCamelCase.js similarity index 100% rename from test/toCamelCase/toCamelCase.js rename to test6/toCamelCase/toCamelCase.js diff --git a/test6/toCamelCase/toCamelCase.test.js b/test6/toCamelCase/toCamelCase.test.js new file mode 100644 index 000000000..44ed8eee7 --- /dev/null +++ b/test6/toCamelCase/toCamelCase.test.js @@ -0,0 +1,21 @@ +const expect = require('expect'); +const toCamelCase = require('./toCamelCase.js'); + +test('Testing toCamelCase', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof toCamelCase === 'function').toBeTruthy(); + expect(toCamelCase('some_database_field_name')).toBe('someDatabaseFieldName'); + expect(toCamelCase('Some label that needs to be camelized')).toBe('someLabelThatNeedsToBeCamelized'); + expect(toCamelCase('some-javascript-property')).toBe('someJavascriptProperty'); + expect(toCamelCase('some-mixed_string with spaces_underscores-and-hyphens')).toBe('someMixedStringWithSpacesUnderscoresAndHyphens'); + expect(() => toCamelCase()).toThrow(); + expect(() => toCamelCase([])).toThrow(); + expect(() => toCamelCase({})).toThrow(); + expect(() => toCamelCase(123)).toThrow(); + + let start = new Date().getTime(); + toCamelCase('some-mixed_string with spaces_underscores-and-hyphens'); + let end = new Date().getTime(); + expect((end - start) < 2000).toBeTruthy(); +}); diff --git a/test/toCurrency/toCurrency.js b/test6/toCurrency/toCurrency.js similarity index 100% rename from test/toCurrency/toCurrency.js rename to test6/toCurrency/toCurrency.js diff --git a/test6/toCurrency/toCurrency.test.js b/test6/toCurrency/toCurrency.test.js new file mode 100644 index 000000000..094796e01 --- /dev/null +++ b/test6/toCurrency/toCurrency.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const toCurrency = require('./toCurrency.js'); + +test('Testing toCurrency', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof toCurrency === 'function').toBeTruthy(); + expect(toCurrency(123456.789, 'EUR')).toBe('€ 123,456.79'); + expect(toCurrency(123456.789, 'USD', 'en-us')).toBe('$123,456.79'); + //t.equal(toCurrency(123456.789, 'USD', 'fa'), '۱۲۳٬۴۵۶٫۷۹ ؜$', 'currency: US Dollar | currencyLangFormat: Farsi'); - These break in node + expect(toCurrency(322342436423.2435, 'JPY')).toBe('JP¥ 322,342,436,423'); +}); diff --git a/test/toDecimalMark/toDecimalMark.js b/test6/toDecimalMark/toDecimalMark.js similarity index 100% rename from test/toDecimalMark/toDecimalMark.js rename to test6/toDecimalMark/toDecimalMark.js diff --git a/test6/toDecimalMark/toDecimalMark.test.js b/test6/toDecimalMark/toDecimalMark.test.js new file mode 100644 index 000000000..ccd255818 --- /dev/null +++ b/test6/toDecimalMark/toDecimalMark.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const toDecimalMark = require('./toDecimalMark.js'); + +test('Testing toDecimalMark', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof toDecimalMark === 'function').toBeTruthy(); + expect(toDecimalMark(12305030388.9087)).toBe("12,305,030,388.909"); +}); \ No newline at end of file diff --git a/test/toHash/toHash.js b/test6/toHash/toHash.js similarity index 100% rename from test/toHash/toHash.js rename to test6/toHash/toHash.js diff --git a/test6/toHash/toHash.test.js b/test6/toHash/toHash.test.js new file mode 100644 index 000000000..13d1b12ca --- /dev/null +++ b/test6/toHash/toHash.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const toHash = require('./toHash.js'); + +test('Testing toHash', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof toHash === 'function').toBeTruthy(); +}); \ No newline at end of file diff --git a/test/toKebabCase/toKebabCase.js b/test6/toKebabCase/toKebabCase.js similarity index 100% rename from test/toKebabCase/toKebabCase.js rename to test6/toKebabCase/toKebabCase.js diff --git a/test6/toKebabCase/toKebabCase.test.js b/test6/toKebabCase/toKebabCase.test.js new file mode 100644 index 000000000..df6540382 --- /dev/null +++ b/test6/toKebabCase/toKebabCase.test.js @@ -0,0 +1,25 @@ +const expect = require('expect'); +const toKebabCase = require('./toKebabCase.js'); + +test('Testing toKebabCase', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof toKebabCase === 'function').toBeTruthy(); + expect(toKebabCase('camelCase')).toBe('camel-case'); + expect(toKebabCase('some text')).toBe('some-text'); + expect(toKebabCase('some-mixed-string With spaces-underscores-and-hyphens')).toBe('some-mixed-string-with-spaces-underscores-and-hyphens'); + expect( + toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') + ).toBe( + 'i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html' + ); + expect(toKebabCase()).toBe(undefined); + expect(() => toKebabCase([])).toThrow(); + expect(() => toKebabCase({})).toThrow(); + expect(() => toKebabCase(123)).toThrow(); + + let start = new Date().getTime(); + toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML'); + let end = new Date().getTime(); + expect((end - start) < 2000).toBeTruthy(); +}); diff --git a/test/toOrdinalSuffix/toOrdinalSuffix.js b/test6/toOrdinalSuffix/toOrdinalSuffix.js similarity index 100% rename from test/toOrdinalSuffix/toOrdinalSuffix.js rename to test6/toOrdinalSuffix/toOrdinalSuffix.js diff --git a/test6/toOrdinalSuffix/toOrdinalSuffix.test.js b/test6/toOrdinalSuffix/toOrdinalSuffix.test.js new file mode 100644 index 000000000..03456a4a1 --- /dev/null +++ b/test6/toOrdinalSuffix/toOrdinalSuffix.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const toOrdinalSuffix = require('./toOrdinalSuffix.js'); + +test('Testing toOrdinalSuffix', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof toOrdinalSuffix === 'function').toBeTruthy(); + expect(toOrdinalSuffix('123')).toBe('123rd'); + expect(toOrdinalSuffix(5)).toBe('5th'); + expect(toOrdinalSuffix(1)).toBe('1st'); + expect(toOrdinalSuffix(0)).toBe('0th'); +}); \ No newline at end of file diff --git a/test/toSafeInteger/toSafeInteger.js b/test6/toSafeInteger/toSafeInteger.js similarity index 100% rename from test/toSafeInteger/toSafeInteger.js rename to test6/toSafeInteger/toSafeInteger.js diff --git a/test6/toSafeInteger/toSafeInteger.test.js b/test6/toSafeInteger/toSafeInteger.test.js new file mode 100644 index 000000000..82662b13b --- /dev/null +++ b/test6/toSafeInteger/toSafeInteger.test.js @@ -0,0 +1,23 @@ +const expect = require('expect'); +const toSafeInteger = require('./toSafeInteger.js'); + +test('Testing toSafeInteger', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof toSafeInteger === 'function').toBeTruthy(); + expect(Number(toSafeInteger(3.2))).toBeTruthy(); + expect(toSafeInteger(3.2)).toBe(3); + expect(toSafeInteger('4.2')).toBe(4); + expect(toSafeInteger(4.6)).toBe(5); + expect(toSafeInteger([])).toBe(0); + expect(isNaN(toSafeInteger([1.5, 3124]))).toBeTruthy(); + expect(isNaN(toSafeInteger('string'))).toBeTruthy(); + expect(isNaN(toSafeInteger({}))).toBeTruthy(); + expect(isNaN(toSafeInteger())).toBeTruthy(); + expect(toSafeInteger(Infinity)).toBe(9007199254740991); + + let start = new Date().getTime(); + toSafeInteger(3.2); + let end = new Date().getTime(); + expect((end - start) < 2000).toBeTruthy(); +}); diff --git a/test/toSnakeCase/toSnakeCase.js b/test6/toSnakeCase/toSnakeCase.js similarity index 100% rename from test/toSnakeCase/toSnakeCase.js rename to test6/toSnakeCase/toSnakeCase.js diff --git a/test6/toSnakeCase/toSnakeCase.test.js b/test6/toSnakeCase/toSnakeCase.test.js new file mode 100644 index 000000000..42bd32fe2 --- /dev/null +++ b/test6/toSnakeCase/toSnakeCase.test.js @@ -0,0 +1,25 @@ +const expect = require('expect'); +const toSnakeCase = require('./toSnakeCase.js'); + +test('Testing toSnakeCase', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof toSnakeCase === 'function').toBeTruthy(); + expect(toSnakeCase('camelCase')).toBe('camel_case'); + expect(toSnakeCase('some text')).toBe('some_text'); + expect(toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens')).toBe('some_mixed_string_with_spaces_underscores_and_hyphens'); + expect( + toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') + ).toBe( + 'i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html' + ); + expect(toSnakeCase()).toBe(undefined); + expect(() => toSnakeCase([])).toThrow(); + expect(() => toSnakeCase({})).toThrow(); + expect(() => toSnakeCase(123)).toThrow(); + + let start = new Date().getTime(); + toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML'); + let end = new Date().getTime(); + expect((end - start) < 2000).toBeTruthy(); +}); diff --git a/test/toggleClass/toggleClass.js b/test6/toggleClass/toggleClass.js similarity index 100% rename from test/toggleClass/toggleClass.js rename to test6/toggleClass/toggleClass.js diff --git a/test6/toggleClass/toggleClass.test.js b/test6/toggleClass/toggleClass.test.js new file mode 100644 index 000000000..ed3488b5b --- /dev/null +++ b/test6/toggleClass/toggleClass.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const toggleClass = require('./toggleClass.js'); + +test('Testing toggleClass', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof toggleClass === 'function').toBeTruthy(); +}); diff --git a/test/tomorrow/tomorrow.js b/test6/tomorrow/tomorrow.js similarity index 100% rename from test/tomorrow/tomorrow.js rename to test6/tomorrow/tomorrow.js diff --git a/test6/tomorrow/tomorrow.test.js b/test6/tomorrow/tomorrow.test.js new file mode 100644 index 000000000..ce4b5dddc --- /dev/null +++ b/test6/tomorrow/tomorrow.test.js @@ -0,0 +1,13 @@ +const expect = require('expect'); +const tomorrow = require('./tomorrow.js'); + +test('Testing tomorrow', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof tomorrow === 'function').toBeTruthy(); + const t1 = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate() + 1); + const t2 = new Date(tomorrow()); + expect(t1.getFullYear()).toBe(t2.getFullYear()); + expect(t1.getMonth()).toBe(t2.getMonth()); + expect(t1.getDate()).toBe(t2.getDate()); +}); diff --git a/test/transform/transform.js b/test6/transform/transform.js similarity index 100% rename from test/transform/transform.js rename to test6/transform/transform.js diff --git a/test6/transform/transform.test.js b/test6/transform/transform.test.js new file mode 100644 index 000000000..c53499392 --- /dev/null +++ b/test6/transform/transform.test.js @@ -0,0 +1,16 @@ +const expect = require('expect'); +const transform = require('./transform.js'); + +test('Testing transform', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof transform === 'function').toBeTruthy(); + expect(transform( + { a: 1, b: 2, c: 1 }, + (r, v, k) => { + (r[v] || (r[v] = [])).push(k); + return r; + }, + {} +)).toEqual({ '1': ['a', 'c'], '2': ['b'] }); +}); diff --git a/test/truncateString/truncateString.js b/test6/truncateString/truncateString.js similarity index 100% rename from test/truncateString/truncateString.js rename to test6/truncateString/truncateString.js diff --git a/test6/truncateString/truncateString.test.js b/test6/truncateString/truncateString.test.js new file mode 100644 index 000000000..fa9506bee --- /dev/null +++ b/test6/truncateString/truncateString.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const truncateString = require('./truncateString.js'); + +test('Testing truncateString', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof truncateString === 'function').toBeTruthy(); + expect(truncateString('boomerang', 7)).toBe('boom...'); +}); \ No newline at end of file diff --git a/test/truthCheckCollection/truthCheckCollection.js b/test6/truthCheckCollection/truthCheckCollection.js similarity index 100% rename from test/truthCheckCollection/truthCheckCollection.js rename to test6/truthCheckCollection/truthCheckCollection.js diff --git a/test6/truthCheckCollection/truthCheckCollection.test.js b/test6/truthCheckCollection/truthCheckCollection.test.js new file mode 100644 index 000000000..7df47434b --- /dev/null +++ b/test6/truthCheckCollection/truthCheckCollection.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const truthCheckCollection = require('./truthCheckCollection.js'); + +test('Testing truthCheckCollection', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof truthCheckCollection === 'function').toBeTruthy(); + expect( + truthCheckCollection([{ user: 'Tinky-Winky', sex: 'male' }, { user: 'Dipsy', sex: 'male' }], 'sex') + ).toBe(true); +}); \ No newline at end of file diff --git a/test/unary/unary.js b/test6/unary/unary.js similarity index 100% rename from test/unary/unary.js rename to test6/unary/unary.js diff --git a/test6/unary/unary.test.js b/test6/unary/unary.test.js new file mode 100644 index 000000000..0b62e983f --- /dev/null +++ b/test6/unary/unary.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const unary = require('./unary.js'); + +test('Testing unary', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof unary === 'function').toBeTruthy(); + expect(['6', '8', '10'].map(unary(parseInt))).toEqual([6, 8, 10]); +}); diff --git a/test/uncurry/uncurry.js b/test6/uncurry/uncurry.js similarity index 100% rename from test/uncurry/uncurry.js rename to test6/uncurry/uncurry.js diff --git a/test6/uncurry/uncurry.test.js b/test6/uncurry/uncurry.test.js new file mode 100644 index 000000000..72fa6bd80 --- /dev/null +++ b/test6/uncurry/uncurry.test.js @@ -0,0 +1,15 @@ +const expect = require('expect'); +const uncurry = require('./uncurry.js'); + +test('Testing uncurry', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof uncurry === 'function').toBeTruthy(); + const add = x => y => z => x + y + z; + const add1 = uncurry(add); + const add2 = uncurry(add, 2); + const add3 = uncurry(add, 3); + expect(add1(1)(2)(3)).toBe(6); + expect(add2(1,2)(3)).toBe(6); + expect(add3(1,2,3)).toBe(6); +}); diff --git a/test/unescapeHTML/unescapeHTML.js b/test6/unescapeHTML/unescapeHTML.js similarity index 100% rename from test/unescapeHTML/unescapeHTML.js rename to test6/unescapeHTML/unescapeHTML.js diff --git a/test6/unescapeHTML/unescapeHTML.test.js b/test6/unescapeHTML/unescapeHTML.test.js new file mode 100644 index 000000000..d1c7417a6 --- /dev/null +++ b/test6/unescapeHTML/unescapeHTML.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const unescapeHTML = require('./unescapeHTML.js'); + +test('Testing unescapeHTML', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof unescapeHTML === 'function').toBeTruthy(); + expect(unescapeHTML('<a href="#">Me & you</a>')).toBe('Me & you'); +}); \ No newline at end of file diff --git a/test/unflattenObject/unflattenObject.js b/test6/unflattenObject/unflattenObject.js similarity index 100% rename from test/unflattenObject/unflattenObject.js rename to test6/unflattenObject/unflattenObject.js diff --git a/test6/unflattenObject/unflattenObject.test.js b/test6/unflattenObject/unflattenObject.test.js new file mode 100644 index 000000000..48975c4a0 --- /dev/null +++ b/test6/unflattenObject/unflattenObject.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const unflattenObject = require('./unflattenObject.js'); + +test('Testing unflattenObject', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof unflattenObject === 'function').toBeTruthy(); + expect(unflattenObject({ 'a.b.c': 1, d: 1 })).toEqual({ a: { b: { c: 1 } }, d: 1 }); +}); diff --git a/test/unfold/unfold.js b/test6/unfold/unfold.js similarity index 100% rename from test/unfold/unfold.js rename to test6/unfold/unfold.js diff --git a/test6/unfold/unfold.test.js b/test6/unfold/unfold.test.js new file mode 100644 index 000000000..08dd245d5 --- /dev/null +++ b/test6/unfold/unfold.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const unfold = require('./unfold.js'); + +test('Testing unfold', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof unfold === 'function').toBeTruthy(); + var f = n => (n > 50 ? false : [-n, n + 10]); + expect(unfold(f, 10)).toEqual([-10, -20, -30, -40, -50]); +}); diff --git a/test/union/union.js b/test6/union/union.js similarity index 100% rename from test/union/union.js rename to test6/union/union.js diff --git a/test6/union/union.test.js b/test6/union/union.test.js new file mode 100644 index 000000000..a49ba0af5 --- /dev/null +++ b/test6/union/union.test.js @@ -0,0 +1,23 @@ +const expect = require('expect'); +const union = require('./union.js'); + +test('Testing union', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof union === 'function').toBeTruthy(); + expect(union([1, 2, 3], [4, 3, 2])).toEqual([1, 2, 3, 4]); + expect(union('str', 'asd')).toEqual([ 's', 't', 'r', 'a', 'd' ]); + expect(union([[], {}], [1, 2, 3])).toEqual([[], {}, 1, 2, 3]); + expect(union([], [])).toEqual([]); + expect(() => union()).toThrow(); + expect(() => union(true, 'str')).toThrow(); + expect(() => union('false', true)).toThrow(); + expect(() => union(123, {})).toThrow(); + expect(() => union([], {})).toThrow(); + expect(() => union(undefined, null)).toThrow(); + + let start = new Date().getTime(); + union([1, 2, 3], [4, 3, 2]); + let end = new Date().getTime(); + expect((end - start) < 2000).toBeTruthy(); +}); diff --git a/test/unionBy/unionBy.js b/test6/unionBy/unionBy.js similarity index 100% rename from test/unionBy/unionBy.js rename to test6/unionBy/unionBy.js diff --git a/test6/unionBy/unionBy.test.js b/test6/unionBy/unionBy.test.js new file mode 100644 index 000000000..730f9d05a --- /dev/null +++ b/test6/unionBy/unionBy.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const unionBy = require('./unionBy.js'); + +test('Testing unionBy', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof unionBy === 'function').toBeTruthy(); + expect(unionBy([2.1], [1.2, 2.3], Math.floor)).toEqual([2.1, 1.2]); +}); diff --git a/test/unionWith/unionWith.js b/test6/unionWith/unionWith.js similarity index 100% rename from test/unionWith/unionWith.js rename to test6/unionWith/unionWith.js diff --git a/test6/unionWith/unionWith.test.js b/test6/unionWith/unionWith.test.js new file mode 100644 index 000000000..f6d69956e --- /dev/null +++ b/test6/unionWith/unionWith.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const unionWith = require('./unionWith.js'); + +test('Testing unionWith', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof unionWith === 'function').toBeTruthy(); + expect( + unionWith([1, 1.2, 1.5, 3, 0], [1.9, 3, 0, 3.9], (a, b) => Math.round(a) === Math.round(b)) + ).toEqual([1, 1.2, 1.5, 3, 0, 3.9]); +}); diff --git a/test/uniqueElements/uniqueElements.js b/test6/uniqueElements/uniqueElements.js similarity index 100% rename from test/uniqueElements/uniqueElements.js rename to test6/uniqueElements/uniqueElements.js diff --git a/test6/uniqueElements/uniqueElements.test.js b/test6/uniqueElements/uniqueElements.test.js new file mode 100644 index 000000000..ca9a46bfe --- /dev/null +++ b/test6/uniqueElements/uniqueElements.test.js @@ -0,0 +1,26 @@ +const expect = require('expect'); +const uniqueElements = require('./uniqueElements.js'); + +test('Testing uniqueElements', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof uniqueElements === 'function').toBeTruthy(); + expect(uniqueElements([1, 2, 2, 3, 4, 4, 5])).toEqual([1,2,3,4,5]); + expect(uniqueElements([1, 23, 53])).toEqual([1, 23, 53]); + expect(uniqueElements([true, 0, 1, false, false, undefined, null, ''])).toEqual([true, 0, 1, false, undefined, null, '']); + expect(uniqueElements()).toEqual([]); + expect(uniqueElements(null)).toEqual([]); + expect(uniqueElements(undefined)).toEqual([]); + expect(uniqueElements('strt')).toEqual(['s', 't', 'r']); + expect(() => uniqueElements(1, 1, 2543, 534, 5)).toThrow(); + expect(() => uniqueElements({})).toThrow(); + expect(() => uniqueElements(true)).toThrow(); + expect(() => uniqueElements(false)).toThrow(); + + let start = new Date().getTime(); + uniqueElements([true, 0, 1, false, false, undefined, null, '']); + let end = new Date().getTime(); + expect((end - start) < 2000).toBeTruthy(); +}); + +uniqueElements([1, 2, 2, '1', 4, 4, 4, 5, true]); // [1,2,3,4,5] diff --git a/test/untildify/untildify.js b/test6/untildify/untildify.js similarity index 100% rename from test/untildify/untildify.js rename to test6/untildify/untildify.js diff --git a/test6/untildify/untildify.test.js b/test6/untildify/untildify.test.js new file mode 100644 index 000000000..cbad74b6b --- /dev/null +++ b/test6/untildify/untildify.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const untildify = require('./untildify.js'); + +test('Testing untildify', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof untildify === 'function').toBeTruthy(); + expect(untildify('~/test/dir/file.f').indexOf('~') === -1).toBeTruthy(); + expect(untildify('~/test/dir/file.f').slice(-16)).toBe('/test/dir/file.f'); + expect(untildify('test/dir/file.f')).toBe('test/dir/file.f'); +}); diff --git a/test/unzip/unzip.js b/test6/unzip/unzip.js similarity index 100% rename from test/unzip/unzip.js rename to test6/unzip/unzip.js diff --git a/test6/unzip/unzip.test.js b/test6/unzip/unzip.test.js new file mode 100644 index 000000000..e3b88825d --- /dev/null +++ b/test6/unzip/unzip.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const unzip = require('./unzip.js'); + +test('Testing unzip', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof unzip === 'function').toBeTruthy(); + expect(unzip([['a', 1, true], ['b', 2, false]])).toEqual([['a', 'b'], [1, 2], [true, false]]); + expect(unzip([['a', 1, true], ['b', 2]])).toEqual([['a', 'b'], [1, 2], [true]]); +}); diff --git a/test/unzipWith/unzipWith.js b/test6/unzipWith/unzipWith.js similarity index 100% rename from test/unzipWith/unzipWith.js rename to test6/unzipWith/unzipWith.js diff --git a/test6/unzipWith/unzipWith.test.js b/test6/unzipWith/unzipWith.test.js new file mode 100644 index 000000000..40752b618 --- /dev/null +++ b/test6/unzipWith/unzipWith.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const unzipWith = require('./unzipWith.js'); + +test('Testing unzipWith', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof unzipWith === 'function').toBeTruthy(); + expect( + unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)) + ).toEqual([3, 30, 300]); +}); diff --git a/test/validateNumber/validateNumber.js b/test6/validateNumber/validateNumber.js similarity index 100% rename from test/validateNumber/validateNumber.js rename to test6/validateNumber/validateNumber.js diff --git a/test6/validateNumber/validateNumber.test.js b/test6/validateNumber/validateNumber.test.js new file mode 100644 index 000000000..ef31971ae --- /dev/null +++ b/test6/validateNumber/validateNumber.test.js @@ -0,0 +1,20 @@ +const expect = require('expect'); +const validateNumber = require('./validateNumber.js'); + +test('Testing validateNumber', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof validateNumber === 'function').toBeTruthy(); + expect(validateNumber(9)).toBeTruthy(); + expect(validateNumber('234asd'.slice(0, 2))).toBeTruthy(); + expect(validateNumber(1232)).toBeTruthy(); + expect(validateNumber(1232 + 13423)).toBeTruthy(); + expect(validateNumber(1232 * 2342 * 123)).toBeTruthy(); + expect(validateNumber(1232.23423536)).toBeTruthy(); + expect(validateNumber('234asd')).toBeFalsy(); + expect(validateNumber('e234d')).toBeFalsy(); + expect(validateNumber(false)).toBeFalsy(); + expect(validateNumber(true)).toBeFalsy(); + expect(validateNumber(null)).toBeFalsy(); + expect(validateNumber(123 * 'asd')).toBeFalsy(); +}); diff --git a/test/when/when.js b/test6/when/when.js similarity index 100% rename from test/when/when.js rename to test6/when/when.js diff --git a/test/when/when.test.js b/test6/when/when.test.js similarity index 52% rename from test/when/when.test.js rename to test6/when/when.test.js index 1a814190f..154c84c4f 100644 --- a/test/when/when.test.js +++ b/test6/when/when.test.js @@ -1,18 +1,16 @@ -const test = require('tape'); +const expect = require('expect'); const when = require('./when.js'); -test('Testing when', (t) => { +test('Testing when', () => { //For more information on all the methods supported by tape //Please go to https://github.com/substack/tape - t.true(typeof when === 'function', 'when is a Function'); + expect(typeof when === 'function').toBeTruthy(); const doubleEvenNumbers = when( (x) => x % 2 === 0, (x) => x * 2 ); - t.true(doubleEvenNumbers(2) === 4); - t.true(doubleEvenNumbers(1) === 1); - - t.end(); + expect(doubleEvenNumbers(2) === 4).toBeTruthy(); + expect(doubleEvenNumbers(1) === 1).toBeTruthy(); }); diff --git a/test/without/without.js b/test6/without/without.js similarity index 100% rename from test/without/without.js rename to test6/without/without.js diff --git a/test6/without/without.test.js b/test6/without/without.test.js new file mode 100644 index 000000000..88053f595 --- /dev/null +++ b/test6/without/without.test.js @@ -0,0 +1,17 @@ +const expect = require('expect'); +const without = require('./without.js'); + +test('Testing without', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof without === 'function').toBeTruthy(); + expect(without([2, 1, 2, 3], 1, 2)).toEqual([3]); + expect(without([])).toEqual([]); + expect(without([3, 1, true, '3', true], '3', true)).toEqual([3, 1]); + expect(without('string'.split(''), 's', 't', 'g')).toEqual(['r', 'i', 'n']); + expect(() => without()).toThrow(); + expect(() => without(null)).toThrow(); + expect(() => without(undefined)).toThrow(); + expect(() => without(123)).toThrow(); + expect(() => without({})).toThrow(); +}); diff --git a/test/words/words.js b/test6/words/words.js similarity index 100% rename from test/words/words.js rename to test6/words/words.js diff --git a/test6/words/words.test.js b/test6/words/words.test.js new file mode 100644 index 000000000..9d57bdf0e --- /dev/null +++ b/test6/words/words.test.js @@ -0,0 +1,17 @@ +const expect = require('expect'); +const words = require('./words.js'); + +test('Testing words', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof words === 'function').toBeTruthy(); + expect(words('I love javaScript!!')).toEqual(["I", "love", "javaScript"]); + expect(words('python, javaScript & coffee')).toEqual(["python", "javaScript", "coffee"]); + expect(Array.isArray(words('I love javaScript!!'))).toBeTruthy(); + expect(() => words()).toThrow(); + expect(() => words(null)).toThrow(); + expect(() => words(undefined)).toThrow(); + expect(() => words({})).toThrow(); + expect(() => words([])).toThrow(); + expect(() => words(1234)).toThrow(); +}); diff --git a/test/xProd/xProd.js b/test6/xProd/xProd.js similarity index 100% rename from test/xProd/xProd.js rename to test6/xProd/xProd.js diff --git a/test6/xProd/xProd.test.js b/test6/xProd/xProd.test.js new file mode 100644 index 000000000..9c94485c4 --- /dev/null +++ b/test6/xProd/xProd.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const xProd = require('./xProd.js'); + +test('Testing xProd', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof xProd === 'function').toBeTruthy(); + expect(xProd([1, 2], ['a', 'b'])).toEqual([[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]); +}); diff --git a/test/yesNo/yesNo.js b/test6/yesNo/yesNo.js similarity index 100% rename from test/yesNo/yesNo.js rename to test6/yesNo/yesNo.js diff --git a/test6/yesNo/yesNo.test.js b/test6/yesNo/yesNo.test.js new file mode 100644 index 000000000..6947ca429 --- /dev/null +++ b/test6/yesNo/yesNo.test.js @@ -0,0 +1,20 @@ +const expect = require('expect'); +const yesNo = require('./yesNo.js'); + +test('Testing yesNo', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof yesNo === 'function').toBeTruthy(); + expect(yesNo('Y')).toBeTruthy(); + expect(yesNo('yes')).toBeTruthy(); + expect(yesNo('foo', true)).toBeTruthy(); + expect(yesNo('No')).toBeFalsy(); + expect(yesNo()).toBeFalsy(); + expect(yesNo(null)).toBeFalsy(); + expect(yesNo(undefined)).toBeFalsy(); + expect(yesNo([123, null])).toBeFalsy(); + expect(yesNo(['Yes', 'No'])).toBeFalsy(); + expect(yesNo({ 2: 'Yes' })).toBeFalsy(); + expect(yesNo(['Yes', 'No'], true)).toBeTruthy(); + expect(yesNo({ 2: 'Yes' }, true)).toBeTruthy(); +}); diff --git a/test/zip/zip.js b/test6/zip/zip.js similarity index 100% rename from test/zip/zip.js rename to test6/zip/zip.js diff --git a/test6/zip/zip.test.js b/test6/zip/zip.test.js new file mode 100644 index 000000000..7da9b8d65 --- /dev/null +++ b/test6/zip/zip.test.js @@ -0,0 +1,16 @@ +const expect = require('expect'); +const zip = require('./zip.js'); + +test('Testing zip', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof zip === 'function').toBeTruthy(); + expect(zip(['a', 'b'], [1, 2], [true, false])).toEqual([['a', 1, true], ['b', 2, false]]); + expect(zip(['a'], [1, 2], [true, false])).toEqual([['a', 1, true], [undefined, 2, false]]); + expect(zip()).toEqual([]); + expect(zip(123)).toEqual([]); + expect(Array.isArray(zip(['a', 'b'], [1, 2], [true, false]))).toBeTruthy(); + expect(Array.isArray(zip(['a'], [1, 2], [true, false]))).toBeTruthy(); + expect(() => zip(null)).toThrow(); + expect(() => zip(undefined)).toThrow(); +}); diff --git a/test/zipObject/zipObject.js b/test6/zipObject/zipObject.js similarity index 100% rename from test/zipObject/zipObject.js rename to test6/zipObject/zipObject.js diff --git a/test6/zipObject/zipObject.test.js b/test6/zipObject/zipObject.test.js new file mode 100644 index 000000000..de895be37 --- /dev/null +++ b/test6/zipObject/zipObject.test.js @@ -0,0 +1,17 @@ +const expect = require('expect'); +const zipObject = require('./zipObject.js'); + +test('Testing zipObject', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof zipObject === 'function').toBeTruthy(); + expect(zipObject(['a', 'b', 'c'], [1, 2])).toEqual({a: 1, b: 2, c: undefined}); + expect(zipObject(['a', 'b'], [1, 2, 3])).toEqual({a: 1, b: 2}); + expect(zipObject(['a', 'b', 'c'], 'string')).toEqual({ a: 's', b: 't', c: 'r' }); + expect(zipObject(['a'], 'string')).toEqual({ a: 's' }); + expect(() => zipObject()).toThrow(); + expect(() => zipObject(['string'], null)).toThrow(); + expect(() => zipObject(null, [1])).toThrow(); + expect(() => zipObject('string')).toThrow(); + expect(() => zipObject('test', 'string')).toThrow(); +}); diff --git a/test/zipWith/zipWith.js b/test6/zipWith/zipWith.js similarity index 100% rename from test/zipWith/zipWith.js rename to test6/zipWith/zipWith.js diff --git a/test6/zipWith/zipWith.test.js b/test6/zipWith/zipWith.test.js new file mode 100644 index 000000000..1c6f8199e --- /dev/null +++ b/test6/zipWith/zipWith.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const zipWith = require('./zipWith.js'); + +test('Testing zipWith', () => { + //For more information on all the methods supported by tape + //Please go to https://github.com/substack/tape + expect(typeof zipWith === 'function').toBeTruthy(); +}); \ No newline at end of file From 977949ca61cf15f7c4d56a8bbd36bbcd8ed6c705 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Mon, 18 Jun 2018 14:22:06 +0300 Subject: [PATCH 02/19] Ignore old tests, start updating new ones --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) 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/ From 4f7da1be9bb18232c66f352e064c90d231e5ecdd Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Mon, 18 Jun 2018 15:15:56 +0300 Subject: [PATCH 03/19] Test migration to jest by hand Apparently using regular expressions is way easier. --- package.json | 2 +- {test4 => test}/JSONToDate/JSONToDate.js | 0 test/JSONToDate/JSONToDate.test.js | 8 + {test4 => test}/JSONToFile/JSONToFile.js | 0 test/JSONToFile/JSONToFile.test.js | 10 + {test5 => test}/RGBToHex/RGBToHex.js | 0 test/RGBToHex/RGBToHex.test.js | 9 + {test6 => test}/URLJoin/URLJoin.js | 2 +- test/URLJoin/URLJoin.test.js | 11 + .../UUIDGeneratorBrowser.js | 0 .../UUIDGeneratorBrowser.test.js | 10 + .../UUIDGeneratorNode/UUIDGeneratorNode.js | 0 .../UUIDGeneratorNode.test.js | 14 + test/all/all.test.js | 22 +- test/any/any.test.js | 16 +- .../approximatelyEqual.test.js | 17 +- test/arrayToHtmlList/arrayToHtmlList.test.js | 10 +- test/ary/ary.test.js | 15 +- test/atob/atob.test.js | 17 +- test/attempt/attempt.test.js | 15 +- test/average/average.test.js | 34 +- test/averageBy/averageBy.test.js | 17 +- test/bifurcate/bifurcate.test.js | 11 +- test/bifurcateBy/bifurcateBy.test.js | 11 +- test/binarySearch/binarySearch.test.js | 19 +- test/bind/bind.test.js | 13 +- test/bindAll/bindAll.test.js | 13 +- test/bindKey/bindKey.test.js | 13 +- .../binomialCoefficient.test.js | 19 +- test/bottomVisible/bottomVisible.test.js | 10 +- test/btoa/btoa.test.js | 13 +- test/byteSize/byteSize.test.js | 19 +- test/call/call.test.js | 11 +- test/capitalize/capitalize.test.js | 18 +- .../capitalizeEveryWord.test.js | 16 +- test/castArray/castArray.test.js | 19 +- test/chainAsync/chainAsync.test.js | 15 +- test/chunk/chunk.test.js | 27 +- test/clampNumber/clampNumber.test.js | 12 +- test/cleanObj/cleanObj.js | 2 +- test/cleanObj/cleanObj.test.js | 12 +- test/cloneRegExp/cloneRegExp.test.js | 13 +- test/coalesce/coalesce.test.js | 12 +- test/coalesceFactory/coalesceFactory.test.js | 12 +- test/collatz/collatz.test.js | 17 +- test/collectInto/collectInto.test.js | 13 +- test/colorize/colorize.js | 2 +- test/colorize/colorize.test.js | 10 +- test/compact/compact.test.js | 12 +- test/compose/compose.test.js | 12 +- test/composeRight/composeRight.test.js | 13 +- test/converge/converge.test.js | 15 +- test/copyToClipboard/copyToClipboard.test.js | 10 +- test/countBy/countBy.js | 2 +- test/countBy/countBy.test.js | 13 +- .../countOccurrences/countOccurrences.test.js | 12 +- test/countVowels/countVowels.test.js | 10 +- test/counter/counter.test.js | 10 +- test/createElement/createElement.test.js | 10 +- test/createEventHub/createEventHub.js | 2 +- test/createEventHub/createEventHub.test.js | 10 +- test/currentURL/currentURL.test.js | 10 +- test/curry/curry.test.js | 14 +- test/debounce/debounce.test.js | 11 +- test/decapitalize/decapitalize.test.js | 13 +- test/deepClone/deepClone.test.js | 19 +- test/deepFlatten/deepFlatten.test.js | 12 +- {test2 => test}/defaults/defaults.js | 0 test/defaults/defaults.test.js | 10 + {test2 => test}/defer/defer.js | 0 test/defer/defer.test.js | 10 + .../degreesToRads/degreesToRads.js | 0 test/degreesToRads/degreesToRads.test.js | 13 + {test2 => test}/delay/delay.js | 0 test/delay/delay.test.js | 18 + .../detectDeviceType/detectDeviceType.js | 0 .../detectDeviceType/detectDeviceType.test.js | 10 + {test2 => test}/difference/difference.js | 0 test/difference/difference.test.js | 9 + {test2 => test}/differenceBy/differenceBy.js | 0 test/differenceBy/differenceBy.test.js | 11 + .../differenceWith/differenceWith.js | 0 test/differenceWith/differenceWith.test.js | 9 + {test2 => test}/digitize/digitize.js | 0 test/digitize/digitize.test.js | 9 + {test2 => test}/distance/distance.js | 0 test/distance/distance.test.js | 12 + {test2 => test}/drop/drop.js | 0 test/drop/drop.test.js | 12 + {test2 => test}/dropRight/dropRight.js | 0 test/dropRight/dropRight.test.js | 11 + .../dropRightWhile/dropRightWhile.js | 0 test/dropRightWhile/dropRightWhile.test.js | 10 + {test2 => test}/dropWhile/dropWhile.js | 0 test/dropWhile/dropWhile.test.js | 10 + .../elementIsVisibleInViewport.js | 0 .../elementIsVisibleInViewport.test.js | 10 + {test2 => test}/elo/elo.js | 0 test/elo/elo.test.js | 11 + {test2 => test}/equals/equals.js | 0 test/equals/equals.test.js | 22 + {test2 => test}/escapeHTML/escapeHTML.js | 0 test/escapeHTML/escapeHTML.test.js | 9 + {test2 => test}/escapeRegExp/escapeRegExp.js | 0 test/escapeRegExp/escapeRegExp.test.js | 9 + {test2 => test}/everyNth/everyNth.js | 0 test/everyNth/everyNth.test.js | 9 + {test2 => test}/extendHex/extendHex.js | 0 test/extendHex/extendHex.test.js | 10 + {test2 => test}/factorial/factorial.js | 0 test/factorial/factorial.test.js | 13 + {test2 => test}/factors/factors.js | 0 test/factors/factors.test.js | 8 + {test2 => test}/fibonacci/fibonacci.js | 0 test/fibonacci/fibonacci.test.js | 9 + .../fibonacciCountUntilNum.js | 0 .../fibonacciCountUntilNum.test.js | 8 + .../fibonacciUntilNum/fibonacciUntilNum.js | 0 .../fibonacciUntilNum.test.js | 8 + .../filterNonUnique/filterNonUnique.js | 0 test/filterNonUnique/filterNonUnique.test.js | 9 + {test2 => test}/findKey/findKey.js | 0 test/findKey/findKey.test.js | 17 + {test2 => test}/findLast/findLast.js | 0 test/findLast/findLast.test.js | 10 + .../findLastIndex/findLastIndex.js | 0 test/findLastIndex/findLastIndex.test.js | 10 + {test2 => test}/findLastKey/findLastKey.js | 0 test/findLastKey/findLastKey.test.js | 17 + {test2 => test}/flatten/flatten.js | 0 test/flatten/flatten.test.js | 10 + .../flattenObject/flattenObject.js | 2 +- test/flattenObject/flattenObject.test.js | 11 + {test2 => test}/flip/flip.js | 0 test/flip/flip.test.js | 14 + {test2 => test}/forEachRight/forEachRight.js | 0 test/forEachRight/forEachRight.test.js | 12 + {test2 => test}/forOwn/forOwn.js | 0 test/forOwn/forOwn.test.js | 12 + {test2 => test}/forOwnRight/forOwnRight.js | 0 test/forOwnRight/forOwnRight.test.js | 12 + .../formatDuration/formatDuration.js | 0 test/formatDuration/formatDuration.test.js | 10 + .../fromCamelCase/fromCamelCase.js | 0 test/fromCamelCase/fromCamelCase.test.js | 11 + {test2 => test}/functionName/functionName.js | 0 test/functionName/functionName.test.js | 19 + {test2 => test}/functions/functions.js | 0 test/functions/functions.test.js | 16 + {test2 => test}/gcd/gcd.js | 0 test/gcd/gcd.test.js | 10 + .../geometricProgression.js | 0 .../geometricProgression.test.js | 11 + {test2 => test}/get/get.js | 0 test/get/get.test.js | 11 + .../getColonTimeFromDate.js | 0 .../getColonTimeFromDate.test.js | 8 + .../getDaysDiffBetweenDates.js | 0 .../getDaysDiffBetweenDates.test.js | 9 + .../getMeridiemSuffixOfInteger.js | 0 .../getMeridiemSuffixOfInteger.test.js | 8 + .../getScrollPosition/getScrollPosition.js | 2 +- .../getScrollPosition.test.js | 10 + {test2 => test}/getStyle/getStyle.js | 0 test/getStyle/getStyle.test.js | 10 + {test2 => test}/getType/getType.js | 0 test/getType/getType.test.js | 9 + .../getURLParameters/getURLParameters.js | 0 .../getURLParameters/getURLParameters.test.js | 9 + {test3 => test}/groupBy/groupBy.js | 2 +- test/groupBy/groupBy.test.js | 10 + .../hammingDistance/hammingDistance.js | 0 test/hammingDistance/hammingDistance.test.js | 9 + {test3 => test}/hasClass/hasClass.js | 0 test/hasClass/hasClass.test.js | 8 + {test3 => test}/hasFlags/hasFlags.js | 0 test/hasFlags/hasFlags.test.js | 10 + {test3 => test}/hashBrowser/hashBrowser.js | 2 +- test/hashBrowser/hashBrowser.test.js | 10 + {test3 => test}/hashNode/hashNode.js | 0 test/hashNode/hashNode.test.js | 10 + {test3 => test}/head/head.js | 0 test/head/head.test.js | 24 + {test3 => test}/hexToRGB/hexToRGB.js | 0 test/hexToRGB/hexToRGB.test.js | 11 + {test3 => test}/hide/hide.js | 0 test/hide/hide.test.js | 10 + {test3 => test}/howManyTimes/howManyTimes.js | 0 test/howManyTimes/howManyTimes.test.js | 8 + {test3 => test}/httpDelete/httpDelete.js | 0 test/httpDelete/httpDelete.test.js | 8 + {test3 => test}/httpGet/httpGet.js | 0 {test3 => test}/httpGet/httpGet.test.js | 136 +- {test3 => test}/httpPost/httpPost.js | 0 {test3 => test}/httpPost/httpPost.test.js | 133 +- {test3 => test}/httpPut/httpPut.js | 0 test/httpPut/httpPut.test.js | 8 + test/httpsRedirect/httpsRedirect.js | 4 + test/httpsRedirect/httpsRedirect.test.js | 10 + {test3 => test}/hz/hz.js | 0 test/hz/hz.test.js | 8 + {test3 => test}/inRange/inRange.js | 0 test/inRange/inRange.test.js | 12 + {test3 => test}/indexOfAll/indexOfAll.js | 0 test/indexOfAll/indexOfAll.test.js | 10 + {test3 => test}/initial/initial.js | 0 test/initial/initial.test.js | 9 + .../initialize2DArray/initialize2DArray.js | 0 .../initialize2DArray.test.js | 9 + .../initializeArrayWithRange.js | 0 .../initializeArrayWithRange.test.js | 9 + .../initializeArrayWithRangeRight.js | 0 .../initializeArrayWithRangeRight.test.js | 8 + .../initializeArrayWithValues.js | 0 .../initializeArrayWithValues.test.js | 9 + .../initializeNDArray/initializeNDArray.js | 0 .../initializeNDArray.test.js | 8 + {test3 => test}/intersection/intersection.js | 0 test/intersection/intersection.test.js | 9 + .../intersectionBy/intersectionBy.js | 0 test/intersectionBy/intersectionBy.test.js | 10 + .../intersectionWith/intersectionWith.js | 0 .../intersectionWith/intersectionWith.test.js | 10 + .../invertKeyValues/invertKeyValues.js | 2 +- test/invertKeyValues/invertKeyValues.test.js | 10 + {test3 => test}/is/is.js | 0 test/is/is.test.js | 25 + .../isAbsoluteURL/isAbsoluteURL.js | 0 test/isAbsoluteURL/isAbsoluteURL.test.js | 11 + {test3 => test}/isAnagram/isAnagram.js | 0 {test3 => test}/isAnagram/isAnagram.test.js | 17 +- .../isArmstrongNumber/isArmstrongNumber.js | 0 .../isArmstrongNumber.test.js | 8 + {test3 => test}/isArray/isArray.js | 0 test/isArray/isArray.test.js | 10 + .../isArrayBuffer/isArrayBuffer.js | 0 test/isArrayBuffer/isArrayBuffer.test.js | 8 + {test3 => test}/isArrayLike/isArrayLike.js | 0 test/isArrayLike/isArrayLike.test.js | 12 + {test3 => test}/isBoolean/isBoolean.js | 0 test/isBoolean/isBoolean.test.js | 10 + {test3 => test}/isBrowser/isBrowser.js | 0 test/isBrowser/isBrowser.test.js | 8 + .../isBrowserTabFocused.js | 0 .../isBrowserTabFocused.test.js | 8 + {test3 => test}/isDivisible/isDivisible.js | 0 test/isDivisible/isDivisible.test.js | 9 + {test3 => test}/isEmpty/isEmpty.js | 0 test/isEmpty/isEmpty.test.js | 19 + {test3 => test}/isEven/isEven.js | 0 test/isEven/isEven.test.js | 12 + {test3 => test}/isFunction/isFunction.js | 0 test/isFunction/isFunction.test.js | 10 + {test3 => test}/isLowerCase/isLowerCase.js | 0 test/isLowerCase/isLowerCase.test.js | 11 + {test3 => test}/isMap/isMap.js | 0 test/isMap/isMap.test.js | 8 + {test3 => test}/isNil/isNil.js | 0 test/isNil/isNil.test.js | 12 + {test3 => test}/isNull/isNull.js | 0 test/isNull/isNull.test.js | 10 + {test3 => test}/isNumber/isNumber.js | 0 test/isNumber/isNumber.test.js | 10 + {test3 => test}/isObject/isObject.js | 0 test/isObject/isObject.test.js | 22 + {test3 => test}/isObjectLike/isObjectLike.js | 0 test/isObjectLike/isObjectLike.test.js | 13 + .../isPlainObject/isPlainObject.js | 0 test/isPlainObject/isPlainObject.test.js | 11 + {test4 => test}/isPrime/isPrime.js | 0 test/isPrime/isPrime.test.js | 9 + {test4 => test}/isPrimitive/isPrimitive.js | 0 test/isPrimitive/isPrimitive.test.js | 25 + .../isPromiseLike/isPromiseLike.js | 0 test/isPromiseLike/isPromiseLike.test.js | 16 + {test4 => test}/isRegExp/isRegExp.js | 0 test/isRegExp/isRegExp.test.js | 8 + {test4 => test}/isSet/isSet.js | 0 test/isSet/isSet.test.js | 8 + {test4 => test}/isSimilar/isSimilar.js | 0 test/isSimilar/isSimilar.test.js | 8 + {test4 => test}/isSorted/isSorted.js | 0 test/isSorted/isSorted.test.js | 20 + {test4 => test}/isString/isString.js | 0 test/isString/isString.test.js | 13 + {test4 => test}/isSymbol/isSymbol.js | 0 test/isSymbol/isSymbol.test.js | 9 + {test4 => test}/isTravisCI/isTravisCI.js | 0 test/isTravisCI/isTravisCI.test.js | 17 + {test4 => test}/isTypedArray/isTypedArray.js | 0 test/isTypedArray/isTypedArray.test.js | 8 + {test4 => test}/isUndefined/isUndefined.js | 0 test/isUndefined/isUndefined.test.js | 12 + {test4 => test}/isUpperCase/isUpperCase.js | 0 test/isUpperCase/isUpperCase.test.js | 11 + {test4 => test}/isValidJSON/isValidJSON.js | 0 test/isValidJSON/isValidJSON.test.js | 11 + {test4 => test}/isWeakMap/isWeakMap.js | 0 test/isWeakMap/isWeakMap.test.js | 8 + {test4 => test}/isWeakSet/isWeakSet.js | 0 test/isWeakSet/isWeakSet.test.js | 8 + {test4 => test}/join/join.js | 0 test/join/join.test.js | 11 + {test4 => test}/last/last.js | 0 test/last/last.test.js | 24 + {test4 => test}/lcm/lcm.js | 0 test/lcm/lcm.test.js | 10 + .../levenshteinDistance.js | 0 .../levenshteinDistance.test.js | 8 + {test4 => test}/longestItem/longestItem.js | 0 test/longestItem/longestItem.test.js | 9 + .../lowercaseKeys/lowercaseKeys.js | 2 +- test/lowercaseKeys/lowercaseKeys.test.js | 13 + {test4 => test}/luhnCheck/luhnCheck.js | 0 test/luhnCheck/luhnCheck.test.js | 11 + {test4 => test}/mapKeys/mapKeys.js | 2 +- test/mapKeys/mapKeys.test.js | 10 + {test4 => test}/mapObject/mapObject.js | 0 test/mapObject/mapObject.test.js | 12 + {test4 => test}/mapValues/mapValues.js | 2 +- test/mapValues/mapValues.test.js | 14 + {test4 => test}/mask/mask.js | 0 test/mask/mask.test.js | 11 + {test4 => test}/matches/matches.js | 0 test/matches/matches.test.js | 15 + {test4 => test}/matchesWith/matchesWith.js | 0 test/matchesWith/matchesWith.test.js | 15 + {test4 => test}/maxBy/maxBy.js | 0 test/maxBy/maxBy.test.js | 15 + {test4 => test}/maxN/maxN.js | 0 test/maxN/maxN.test.js | 10 + {test4 => test}/median/median.js | 0 test/median/median.test.js | 10 + {test4 => test}/memoize/memoize.js | 0 test/memoize/memoize.test.js | 14 + {test4 => test}/merge/merge.js | 0 test/merge/merge.test.js | 19 + {test4 => test}/minBy/minBy.js | 0 test/minBy/minBy.test.js | 15 + {test4 => test}/minN/minN.js | 0 test/minN/minN.test.js | 10 + .../mostPerformant/mostPerformant.js | 2 +- test/mostPerformant/mostPerformant.test.js | 10 + {test4 => test}/negate/negate.js | 0 test/negate/negate.test.js | 10 + {test4 => test}/nest/nest.js | 0 test/nest/nest.test.js | 8 + .../nodeListToArray/nodeListToArray.js | 0 test/nodeListToArray/nodeListToArray.test.js | 8 + {test4 => test}/none/none.js | 0 test/none/none.test.js | 21 + {test4 => test}/nthArg/nthArg.js | 0 test/nthArg/nthArg.test.js | 14 + {test4 => test}/nthElement/nthElement.js | 0 test/nthElement/nthElement.test.js | 10 + .../objectFromPairs/objectFromPairs.js | 2 +- test/objectFromPairs/objectFromPairs.test.js | 9 + .../objectToPairs/objectToPairs.js | 0 test/objectToPairs/objectToPairs.test.js | 9 + .../observeMutations/observeMutations.js | 0 .../observeMutations/observeMutations.test.js | 10 + {test4 => test}/off/off.js | 0 test/off/off.test.js | 10 + {test4 => test}/offset/offset.js | 0 test/offset/offset.test.js | 15 + {test4 => test}/omit/omit.js | 2 +- test/omit/omit.test.js | 10 + {test5 => test}/omitBy/omitBy.js | 2 +- test/omitBy/omitBy.test.js | 10 + {test5 => test}/on/on.js | 0 test/on/on.test.js | 10 + .../onUserInputChange/onUserInputChange.js | 2 +- .../onUserInputChange.test.js | 10 + {test5 => test}/once/once.js | 0 test/once/once.test.js | 10 + {test5 => test}/orderBy/orderBy.js | 0 test/orderBy/orderBy.test.js | 11 + {test5 => test}/over/over.js | 0 test/over/over.test.js | 11 + {test5 => test}/overArgs/overArgs.js | 0 test/overArgs/overArgs.test.js | 13 + {test5 => test}/pad/pad.js | 0 test/pad/pad.test.js | 13 + {test5 => test}/palindrome/palindrome.js | 0 test/palindrome/palindrome.test.js | 10 + {test5 => test}/parseCookie/parseCookie.js | 2 +- test/parseCookie/parseCookie.test.js | 10 + {test5 => test}/partial/partial.js | 0 test/partial/partial.test.js | 14 + {test5 => test}/partialRight/partialRight.js | 0 test/partialRight/partialRight.test.js | 14 + {test5 => test}/partition/partition.js | 0 test/partition/partition.test.js | 10 + {test5 => test}/percentile/percentile.js | 0 test/percentile/percentile.test.js | 9 + {test5 => test}/permutations/permutations.js | 0 test/permutations/permutations.test.js | 10 + {test5 => test}/pick/pick.js | 2 +- test/pick/pick.test.js | 9 + {test5 => test}/pickBy/pickBy.js | 2 +- test/pickBy/pickBy.test.js | 10 + .../pipeAsyncFunctions/pipeAsyncFunctions.js | 0 .../pipeAsyncFunctions.test.js | 19 + .../pipeFunctions/pipeFunctions.js | 0 test/pipeFunctions/pipeFunctions.test.js | 13 + {test5 => test}/pluralize/pluralize.js | 0 test/pluralize/pluralize.test.js | 19 + {test5 => test}/powerset/powerset.js | 0 test/powerset/powerset.test.js | 9 + {test5 => test}/prefix/prefix.js | 0 test/prefix/prefix.test.js | 8 + {test5 => test}/prettyBytes/prettyBytes.js | 0 test/prettyBytes/prettyBytes.test.js | 11 + {test5 => test}/primes/primes.js | 0 test/primes/primes.test.js | 9 + {test5 => test}/promisify/promisify.js | 0 test/promisify/promisify.test.js | 15 + {test5 => test}/pull/pull.js | 0 test/pull/pull.test.js | 12 + {test5 => test}/pullAtIndex/pullAtIndex.js | 0 test/pullAtIndex/pullAtIndex.test.js | 13 + {test5 => test}/pullAtValue/pullAtValue.js | 0 test/pullAtValue/pullAtValue.test.js | 13 + {test5 => test}/pullBy/pullBy.js | 0 test/pullBy/pullBy.test.js | 12 + {test5 => test}/quickSort/quickSort.js | 0 test/quickSort/quickSort.test.js | 24 + .../radsToDegrees/radsToDegrees.js | 0 test/radsToDegrees/radsToDegrees.test.js | 10 + .../randomHexColorCode/randomHexColorCode.js | 0 .../randomHexColorCode.test.js | 16 + .../randomIntArrayInRange.js | 0 .../randomIntArrayInRange.test.js | 15 +- .../randomIntegerInRange.js | 0 .../randomIntegerInRange.test.js | 13 +- .../randomNumberInRange.js | 0 .../randomNumberInRange.test.js | 13 +- .../readFileLines/readFileLines.js | 0 test/readFileLines/readFileLines.test.js | 10 + {test5 => test}/rearg/rearg.js | 0 test/rearg/rearg.test.js | 16 + .../recordAnimationFrames.js | 2 +- .../recordAnimationFrames.test.js | 8 + {test5 => test}/redirect/redirect.js | 0 test/redirect/redirect.test.js | 10 + .../reduceSuccessive/reduceSuccessive.js | 0 .../reduceSuccessive/reduceSuccessive.test.js | 10 + {test5 => test}/reduceWhich/reduceWhich.js | 0 test/reduceWhich/reduceWhich.test.js | 15 + .../reducedFilter/reducedFilter.js | 0 test/reducedFilter/reducedFilter.test.js | 21 + {test5 => test}/reject/reject.js | 0 test/reject/reject.test.js | 24 + {test5 => test}/remove/remove.js | 0 test/remove/remove.test.js | 10 + .../removeNonASCII/removeNonASCII.js | 0 test/removeNonASCII/removeNonASCII.test.js | 10 + {test5 => test}/removeVowels/removeVowels.js | 0 test/removeVowels/removeVowels.test.js | 8 + {test5 => test}/renameKeys/renameKeys.js | 0 test/renameKeys/renameKeys.test.js | 15 + .../reverseString/reverseString.js | 0 test/reverseString/reverseString.test.js | 9 + {test5 => test}/round/round.js | 0 test/round/round.test.js | 35 + {test6 => test}/runAsync/runAsync.js | 2 +- test/runAsync/runAsync.test.js | 10 + .../runPromisesInSeries.js | 0 .../runPromisesInSeries.test.js | 11 + {test6 => test}/sample/sample.js | 0 test/sample/sample.test.js | 15 + {test6 => test}/sampleSize/sampleSize.js | 0 test/sampleSize/sampleSize.test.js | 17 + {test6 => test}/scrollToTop/scrollToTop.js | 0 test/scrollToTop/scrollToTop.test.js | 10 + {test6 => test}/sdbm/sdbm.js | 0 test/sdbm/sdbm.test.js | 9 + .../serializeCookie/serializeCookie.js | 0 test/serializeCookie/serializeCookie.test.js | 10 + {test6 => test}/setStyle/setStyle.js | 0 test/setStyle/setStyle.test.js | 10 + {test6 => test}/shallowClone/shallowClone.js | 0 test/shallowClone/shallowClone.test.js | 13 + {test6 => test}/show/show.js | 0 test/show/show.test.js | 10 + {test6 => test}/shuffle/shuffle.js | 0 test/shuffle/shuffle.test.js | 16 + {test6 => test}/similarity/similarity.js | 0 test/similarity/similarity.test.js | 9 + {test6 => test}/size/size.js | 0 test/size/size.test.js | 10 + {test6 => test}/sleep/sleep.js | 0 test/sleep/sleep.test.js | 13 + {test6 => test}/smoothScroll/smoothScroll.js | 2 +- test/smoothScroll/smoothScroll.test.js | 8 + {test6 => test}/solveRPN/solveRPN.js | 2 +- test/solveRPN/solveRPN.test.js | 8 + .../sortCharactersInString.js | 0 .../sortCharactersInString.test.js | 9 + {test6 => test}/sortedIndex/sortedIndex.js | 0 test/sortedIndex/sortedIndex.test.js | 10 + .../sortedIndexBy/sortedIndexBy.js | 0 test/sortedIndexBy/sortedIndexBy.test.js | 10 + .../sortedLastIndex/sortedLastIndex.js | 0 test/sortedLastIndex/sortedLastIndex.test.js | 10 + .../sortedLastIndexBy/sortedLastIndexBy.js | 0 .../sortedLastIndexBy.test.js | 10 + .../speechSynthesis/speechSynthesis.js | 0 test/speechSynthesis/speechSynthesis.test.js | 8 + {test6 => test}/splitLines/splitLines.js | 0 test/splitLines/splitLines.test.js | 9 + {test6 => test}/spreadOver/spreadOver.js | 0 test/spreadOver/spreadOver.test.js | 10 + {test6 => test}/stableSort/stableSort.js | 0 test/stableSort/stableSort.test.js | 13 + .../standardDeviation/standardDeviation.js | 0 .../standardDeviation.test.js | 10 + .../stringPermutations/stringPermutations.js | 0 .../stringPermutations.test.js | 12 + .../stripHTMLTags/stripHTMLTags.js | 0 test/stripHTMLTags/stripHTMLTags.test.js | 12 + {test6 => test}/sum/sum.js | 0 test/sum/sum.test.js | 9 + {test6 => test}/sumBy/sumBy.js | 0 test/sumBy/sumBy.test.js | 8 + {test6 => test}/sumPower/sumPower.js | 0 test/sumPower/sumPower.test.js | 11 + .../symmetricDifference.js | 0 .../symmetricDifference.test.js | 9 + .../symmetricDifferenceBy.js | 0 .../symmetricDifferenceBy.test.js | 10 + .../symmetricDifferenceWith.js | 0 .../symmetricDifferenceWith.test.js | 14 + {test6 => test}/tail/tail.js | 0 test/tail/tail.test.js | 10 + {test6 => test}/take/take.js | 0 test/take/take.test.js | 11 + {test6 => test}/takeRight/takeRight.js | 0 test/takeRight/takeRight.test.js | 10 + .../takeRightWhile/takeRightWhile.js | 0 test/takeRightWhile/takeRightWhile.test.js | 10 + {test6 => test}/takeWhile/takeWhile.js | 0 test/takeWhile/takeWhile.test.js | 10 + test/testlog | 2054 +++++++++++++++++ {test6 => test}/throttle/throttle.js | 0 test/throttle/throttle.test.js | 10 + {test6 => test}/timeTaken/timeTaken.js | 0 test/timeTaken/timeTaken.test.js | 10 + {test6 => test}/times/times.js | 0 test/times/times.test.js | 14 + {test6 => test}/toCamelCase/toCamelCase.js | 0 test/toCamelCase/toCamelCase.test.js | 24 + {test6 => test}/toCurrency/toCurrency.js | 0 test/toCurrency/toCurrency.test.js | 12 + .../toDecimalMark/toDecimalMark.js | 0 test/toDecimalMark/toDecimalMark.test.js | 9 + {test6 => test}/toHash/toHash.js | 0 test/toHash/toHash.test.js | 8 + {test6 => test}/toKebabCase/toKebabCase.js | 0 test/toKebabCase/toKebabCase.test.js | 24 + .../toOrdinalSuffix/toOrdinalSuffix.js | 0 test/toOrdinalSuffix/toOrdinalSuffix.test.js | 12 + .../toSafeInteger/toSafeInteger.js | 0 test/toSafeInteger/toSafeInteger.test.js | 28 + {test6 => test}/toSnakeCase/toSnakeCase.js | 0 test/toSnakeCase/toSnakeCase.test.js | 24 + {test6 => test}/toggleClass/toggleClass.js | 0 test/toggleClass/toggleClass.test.js | 10 + {test6 => test}/tomorrow/tomorrow.js | 0 test/tomorrow/tomorrow.test.js | 14 + {test6 => test}/transform/transform.js | 0 test/transform/transform.test.js | 17 + .../truncateString/truncateString.js | 0 test/truncateString/truncateString.test.js | 9 + .../truthCheckCollection.js | 0 .../truthCheckCollection.test.js | 9 + {test6 => test}/unary/unary.js | 0 test/unary/unary.test.js | 10 + {test6 => test}/uncurry/uncurry.js | 0 test/uncurry/uncurry.test.js | 16 + {test6 => test}/unescapeHTML/unescapeHTML.js | 0 test/unescapeHTML/unescapeHTML.test.js | 9 + .../unflattenObject/unflattenObject.js | 2 +- test/unflattenObject/unflattenObject.test.js | 10 + {test6 => test}/unfold/unfold.js | 0 test/unfold/unfold.test.js | 11 + {test6 => test}/union/union.js | 0 test/union/union.test.js | 26 + {test6 => test}/unionBy/unionBy.js | 0 test/unionBy/unionBy.test.js | 10 + {test6 => test}/unionWith/unionWith.js | 0 test/unionWith/unionWith.test.js | 10 + .../uniqueElements/uniqueElements.js | 0 test/uniqueElements/uniqueElements.test.js | 30 + {test6 => test}/untildify/untildify.js | 0 test/untildify/untildify.test.js | 14 + {test6 => test}/unzip/unzip.js | 0 test/unzip/unzip.test.js | 11 + {test6 => test}/unzipWith/unzipWith.js | 0 test/unzipWith/unzipWith.test.js | 10 + .../validateNumber/validateNumber.js | 0 test/validateNumber/validateNumber.test.js | 46 + {test6 => test}/when/when.js | 0 test/when/when.test.js | 18 + {test6 => test}/without/without.js | 0 test/without/without.test.js | 19 + {test6 => test}/words/words.js | 0 test/words/words.test.js | 21 + {test6 => test}/xProd/xProd.js | 0 test/xProd/xProd.test.js | 10 + {test6 => test}/yesNo/yesNo.js | 0 test/yesNo/yesNo.test.js | 46 + {test6 => test}/zip/zip.js | 2 +- test/zip/zip.test.js | 22 + {test6 => test}/zipObject/zipObject.js | 2 +- test/zipObject/zipObject.test.js | 19 + {test6 => test}/zipWith/zipWith.js | 0 test/zipWith/zipWith.test.js | 8 + test2/defaults/defaults.test.js | 9 - test2/defer/defer.test.js | 8 - test2/degreesToRads/degreesToRads.test.js | 10 - test2/delay/delay.test.js | 15 - .../detectDeviceType/detectDeviceType.test.js | 8 - test2/difference/difference.test.js | 9 - test2/differenceBy/differenceBy.test.js | 10 - test2/differenceWith/differenceWith.test.js | 11 - test2/digitize/digitize.test.js | 9 - test2/distance/distance.test.js | 9 - test2/drop/drop.test.js | 11 - test2/dropRight/dropRight.test.js | 11 - test2/dropRightWhile/dropRightWhile.test.js | 9 - test2/dropWhile/dropWhile.test.js | 9 - .../elementIsVisibleInViewport.test.js | 8 - test2/elo/elo.test.js | 11 - test2/equals/equals.test.js | 15 - test2/escapeHTML/escapeHTML.test.js | 9 - test2/escapeRegExp/escapeRegExp.test.js | 9 - test2/everyNth/everyNth.test.js | 9 - test2/extendHex/extendHex.test.js | 10 - test2/factorial/factorial.test.js | 13 - test2/factors/factors.test.js | 8 - test2/fibonacci/fibonacci.test.js | 9 - .../fibonacciCountUntilNum.test.js | 8 - .../fibonacciUntilNum.test.js | 8 - test2/filterNonUnique/filterNonUnique.test.js | 9 - test2/findKey/findKey.test.js | 16 - test2/findLast/findLast.test.js | 9 - test2/findLastIndex/findLastIndex.test.js | 9 - test2/findLastKey/findLastKey.test.js | 16 - test2/flatten/flatten.test.js | 10 - test2/flattenObject/flattenObject.test.js | 10 - test2/flip/flip.test.js | 13 - test2/forEachRight/forEachRight.test.js | 11 - test2/forOwn/forOwn.test.js | 11 - test2/forOwnRight/forOwnRight.test.js | 11 - test2/formatDuration/formatDuration.test.js | 10 - test2/fromCamelCase/fromCamelCase.test.js | 11 - test2/functionName/functionName.test.js | 19 - test2/functions/functions.test.js | 15 - test2/gcd/gcd.test.js | 10 - .../geometricProgression.test.js | 11 - test2/get/get.test.js | 10 - .../getColonTimeFromDate.test.js | 8 - .../getDaysDiffBetweenDates.test.js | 9 - .../getMeridiemSuffixOfInteger.test.js | 8 - .../getScrollPosition.test.js | 8 - test2/getStyle/getStyle.test.js | 8 - test2/getType/getType.test.js | 9 - .../getURLParameters/getURLParameters.test.js | 9 - test3/groupBy/groupBy.test.js | 10 - test3/hammingDistance/hammingDistance.test.js | 9 - test3/hasClass/hasClass.test.js | 8 - test3/hasFlags/hasFlags.test.js | 8 - test3/hashBrowser/hashBrowser.test.js | 8 - test3/hashNode/hashNode.test.js | 9 - test3/head/head.test.js | 20 - test3/hexToRGB/hexToRGB.test.js | 11 - test3/hide/hide.test.js | 8 - test3/howManyTimes/howManyTimes.test.js | 8 - test3/httpDelete/httpDelete.test.js | 8 - test3/httpPut/httpPut.test.js | 8 - test3/httpsRedirect/httpsRedirect.js | 4 - test3/httpsRedirect/httpsRedirect.test.js | 8 - test3/hz/hz.test.js | 8 - test3/inRange/inRange.test.js | 12 - test3/indexOfAll/indexOfAll.test.js | 10 - test3/initial/initial.test.js | 9 - .../initialize2DArray.test.js | 9 - .../initializeArrayWithRange.test.js | 9 - .../initializeArrayWithRangeRight.test.js | 8 - .../initializeArrayWithValues.test.js | 9 - .../initializeNDArray.test.js | 8 - test3/intersection/intersection.test.js | 9 - test3/intersectionBy/intersectionBy.test.js | 9 - .../intersectionWith/intersectionWith.test.js | 11 - test3/invertKeyValues/invertKeyValues.test.js | 10 - test3/is/is.test.js | 24 - test3/isAbsoluteURL/isAbsoluteURL.test.js | 11 - .../isArmstrongNumber.test.js | 8 - test3/isArray/isArray.test.js | 10 - test3/isArrayBuffer/isArrayBuffer.test.js | 8 - test3/isArrayLike/isArrayLike.test.js | 11 - test3/isBoolean/isBoolean.test.js | 10 - test3/isBrowser/isBrowser.test.js | 8 - .../isBrowserTabFocused.test.js | 8 - test3/isDivisible/isDivisible.test.js | 9 - test3/isEmpty/isEmpty.test.js | 18 - test3/isEven/isEven.test.js | 10 - test3/isFunction/isFunction.test.js | 10 - test3/isLowerCase/isLowerCase.test.js | 11 - test3/isMap/isMap.test.js | 8 - test3/isNil/isNil.test.js | 11 - test3/isNull/isNull.test.js | 10 - test3/isNumber/isNumber.test.js | 10 - test3/isObject/isObject.test.js | 13 - test3/isObjectLike/isObjectLike.test.js | 12 - test3/isPlainObject/isPlainObject.test.js | 10 - test4/JSONToDate/JSONToDate.test.js | 8 - test4/JSONToFile/JSONToFile.test.js | 8 - test4/isPrime/isPrime.test.js | 9 - test4/isPrimitive/isPrimitive.test.js | 23 - test4/isPromiseLike/isPromiseLike.test.js | 15 - test4/isRegExp/isRegExp.test.js | 8 - test4/isSet/isSet.test.js | 8 - test4/isSimilar/isSimilar.test.js | 8 - test4/isSorted/isSorted.test.js | 20 - test4/isString/isString.test.js | 13 - test4/isSymbol/isSymbol.test.js | 9 - test4/isTravisCI/isTravisCI.test.js | 12 - test4/isTypedArray/isTypedArray.test.js | 8 - test4/isUndefined/isUndefined.test.js | 9 - test4/isUpperCase/isUpperCase.test.js | 12 - test4/isValidJSON/isValidJSON.test.js | 11 - test4/isWeakMap/isWeakMap.test.js | 8 - test4/isWeakSet/isWeakSet.test.js | 8 - test4/join/join.test.js | 11 - test4/last/last.test.js | 20 - test4/lcm/lcm.test.js | 10 - .../levenshteinDistance.test.js | 8 - test4/longestItem/longestItem.test.js | 9 - test4/lowercaseKeys/lowercaseKeys.test.js | 12 - test4/luhnCheck/luhnCheck.test.js | 11 - test4/mapKeys/mapKeys.test.js | 9 - test4/mapObject/mapObject.test.js | 11 - test4/mapValues/mapValues.test.js | 13 - test4/mask/mask.test.js | 11 - test4/matches/matches.test.js | 14 - test4/matchesWith/matchesWith.test.js | 14 - test4/maxBy/maxBy.test.js | 10 - test4/maxN/maxN.test.js | 10 - test4/median/median.test.js | 10 - test4/memoize/memoize.test.js | 13 - test4/merge/merge.test.js | 18 - test4/minBy/minBy.test.js | 10 - test4/minN/minN.test.js | 10 - test4/mostPerformant/mostPerformant.test.js | 8 - test4/negate/negate.test.js | 9 - test4/nest/nest.test.js | 8 - test4/nodeListToArray/nodeListToArray.test.js | 8 - test4/none/none.test.js | 12 - test4/nthArg/nthArg.test.js | 13 - test4/nthElement/nthElement.test.js | 10 - test4/objectFromPairs/objectFromPairs.test.js | 9 - test4/objectToPairs/objectToPairs.test.js | 9 - .../observeMutations/observeMutations.test.js | 8 - test4/off/off.test.js | 8 - test4/offset/offset.test.js | 14 - test4/omit/omit.test.js | 9 - test5/RGBToHex/RGBToHex.test.js | 9 - test5/omitBy/omitBy.test.js | 9 - test5/on/on.test.js | 8 - .../onUserInputChange.test.js | 8 - test5/once/once.test.js | 8 - test5/orderBy/orderBy.test.js | 15 - test5/over/over.test.js | 10 - test5/overArgs/overArgs.test.js | 12 - test5/pad/pad.test.js | 12 - test5/palindrome/palindrome.test.js | 10 - test5/parseCookie/parseCookie.test.js | 9 - test5/partial/partial.test.js | 13 - test5/partialRight/partialRight.test.js | 13 - test5/partition/partition.test.js | 12 - test5/percentile/percentile.test.js | 9 - test5/permutations/permutations.test.js | 11 - test5/pick/pick.test.js | 9 - test5/pickBy/pickBy.test.js | 9 - .../pipeAsyncFunctions.test.js | 19 - test5/pipeFunctions/pipeFunctions.test.js | 12 - test5/pluralize/pluralize.test.js | 18 - test5/powerset/powerset.test.js | 9 - test5/prefix/prefix.test.js | 8 - test5/prettyBytes/prettyBytes.test.js | 11 - test5/primes/primes.test.js | 9 - test5/promisify/promisify.test.js | 12 - test5/pull/pull.test.js | 11 - test5/pullAtIndex/pullAtIndex.test.js | 12 - test5/pullAtValue/pullAtValue.test.js | 12 - test5/pullBy/pullBy.test.js | 11 - test5/quickSort/quickSort.test.js | 20 - test5/radsToDegrees/radsToDegrees.test.js | 9 - .../randomHexColorCode.test.js | 12 - test5/readFileLines/readFileLines.test.js | 8 - test5/rearg/rearg.test.js | 15 - .../recordAnimationFrames.test.js | 8 - test5/redirect/redirect.test.js | 8 - .../reduceSuccessive/reduceSuccessive.test.js | 9 - test5/reduceWhich/reduceWhich.test.js | 14 - test5/reducedFilter/reducedFilter.test.js | 21 - test5/reject/reject.test.js | 22 - test5/remove/remove.test.js | 9 - test5/removeNonASCII/removeNonASCII.test.js | 9 - test5/removeVowels/removeVowels.test.js | 8 - test5/renameKeys/renameKeys.test.js | 13 - test5/reverseString/reverseString.test.js | 9 - test5/round/round.test.js | 22 - test6/URLJoin/URLJoin.test.js | 10 - .../UUIDGeneratorBrowser.test.js | 8 - .../UUIDGeneratorNode.test.js | 11 - test6/runAsync/runAsync.test.js | 8 - .../runPromisesInSeries.test.js | 10 - test6/sample/sample.test.js | 12 - test6/sampleSize/sampleSize.test.js | 14 - test6/scrollToTop/scrollToTop.test.js | 8 - test6/sdbm/sdbm.test.js | 9 - test6/serializeCookie/serializeCookie.test.js | 9 - test6/setStyle/setStyle.test.js | 8 - test6/shallowClone/shallowClone.test.js | 12 - test6/show/show.test.js | 8 - test6/shuffle/shuffle.test.js | 13 - test6/similarity/similarity.test.js | 9 - test6/size/size.test.js | 11 - test6/sleep/sleep.test.js | 11 - test6/smoothScroll/smoothScroll.test.js | 8 - test6/solveRPN/solveRPN.test.js | 8 - .../sortCharactersInString.test.js | 9 - test6/sortedIndex/sortedIndex.test.js | 10 - test6/sortedIndexBy/sortedIndexBy.test.js | 9 - test6/sortedLastIndex/sortedLastIndex.test.js | 9 - .../sortedLastIndexBy.test.js | 9 - test6/speechSynthesis/speechSynthesis.test.js | 8 - test6/splitLines/splitLines.test.js | 9 - test6/spreadOver/spreadOver.test.js | 10 - test6/stableSort/stableSort.test.js | 16 - .../standardDeviation.test.js | 10 - .../stringPermutations.test.js | 11 - test6/stripHTMLTags/stripHTMLTags.test.js | 9 - test6/sum/sum.test.js | 9 - test6/sumBy/sumBy.test.js | 8 - test6/sumPower/sumPower.test.js | 11 - .../symmetricDifference.test.js | 9 - .../symmetricDifferenceBy.test.js | 9 - .../symmetricDifferenceWith.test.js | 13 - test6/tail/tail.test.js | 10 - test6/take/take.test.js | 10 - test6/takeRight/takeRight.test.js | 10 - test6/takeRightWhile/takeRightWhile.test.js | 9 - test6/takeWhile/takeWhile.test.js | 9 - test6/throttle/throttle.test.js | 8 - test6/timeTaken/timeTaken.test.js | 8 - test6/times/times.test.js | 11 - test6/toCamelCase/toCamelCase.test.js | 21 - test6/toCurrency/toCurrency.test.js | 12 - test6/toDecimalMark/toDecimalMark.test.js | 9 - test6/toHash/toHash.test.js | 8 - test6/toKebabCase/toKebabCase.test.js | 25 - test6/toOrdinalSuffix/toOrdinalSuffix.test.js | 12 - test6/toSafeInteger/toSafeInteger.test.js | 23 - test6/toSnakeCase/toSnakeCase.test.js | 25 - test6/toggleClass/toggleClass.test.js | 8 - test6/tomorrow/tomorrow.test.js | 13 - test6/transform/transform.test.js | 16 - test6/truncateString/truncateString.test.js | 9 - .../truthCheckCollection.test.js | 11 - test6/unary/unary.test.js | 9 - test6/uncurry/uncurry.test.js | 15 - test6/unescapeHTML/unescapeHTML.test.js | 9 - test6/unflattenObject/unflattenObject.test.js | 9 - test6/unfold/unfold.test.js | 10 - test6/union/union.test.js | 23 - test6/unionBy/unionBy.test.js | 9 - test6/unionWith/unionWith.test.js | 11 - test6/uniqueElements/uniqueElements.test.js | 26 - test6/untildify/untildify.test.js | 11 - test6/unzip/unzip.test.js | 10 - test6/unzipWith/unzipWith.test.js | 11 - test6/validateNumber/validateNumber.test.js | 20 - test6/when/when.test.js | 16 - test6/without/without.test.js | 17 - test6/words/words.test.js | 17 - test6/xProd/xProd.test.js | 9 - test6/yesNo/yesNo.test.js | 20 - test6/zip/zip.test.js | 16 - test6/zipObject/zipObject.test.js | 17 - test6/zipWith/zipWith.test.js | 8 - 894 files changed, 5917 insertions(+), 3607 deletions(-) rename {test4 => test}/JSONToDate/JSONToDate.js (100%) create mode 100644 test/JSONToDate/JSONToDate.test.js rename {test4 => test}/JSONToFile/JSONToFile.js (100%) create mode 100644 test/JSONToFile/JSONToFile.test.js rename {test5 => test}/RGBToHex/RGBToHex.js (100%) create mode 100644 test/RGBToHex/RGBToHex.test.js rename {test6 => test}/URLJoin/URLJoin.js (86%) create mode 100644 test/URLJoin/URLJoin.test.js rename {test6 => test}/UUIDGeneratorBrowser/UUIDGeneratorBrowser.js (100%) create mode 100644 test/UUIDGeneratorBrowser/UUIDGeneratorBrowser.test.js rename {test6 => test}/UUIDGeneratorNode/UUIDGeneratorNode.js (100%) create mode 100644 test/UUIDGeneratorNode/UUIDGeneratorNode.test.js rename {test2 => test}/defaults/defaults.js (100%) create mode 100644 test/defaults/defaults.test.js rename {test2 => test}/defer/defer.js (100%) create mode 100644 test/defer/defer.test.js rename {test2 => test}/degreesToRads/degreesToRads.js (100%) create mode 100644 test/degreesToRads/degreesToRads.test.js rename {test2 => test}/delay/delay.js (100%) create mode 100644 test/delay/delay.test.js rename {test2 => test}/detectDeviceType/detectDeviceType.js (100%) create mode 100644 test/detectDeviceType/detectDeviceType.test.js rename {test2 => test}/difference/difference.js (100%) create mode 100644 test/difference/difference.test.js rename {test2 => test}/differenceBy/differenceBy.js (100%) create mode 100644 test/differenceBy/differenceBy.test.js rename {test2 => test}/differenceWith/differenceWith.js (100%) create mode 100644 test/differenceWith/differenceWith.test.js rename {test2 => test}/digitize/digitize.js (100%) create mode 100644 test/digitize/digitize.test.js rename {test2 => test}/distance/distance.js (100%) create mode 100644 test/distance/distance.test.js rename {test2 => test}/drop/drop.js (100%) create mode 100644 test/drop/drop.test.js rename {test2 => test}/dropRight/dropRight.js (100%) create mode 100644 test/dropRight/dropRight.test.js rename {test2 => test}/dropRightWhile/dropRightWhile.js (100%) create mode 100644 test/dropRightWhile/dropRightWhile.test.js rename {test2 => test}/dropWhile/dropWhile.js (100%) create mode 100644 test/dropWhile/dropWhile.test.js rename {test2 => test}/elementIsVisibleInViewport/elementIsVisibleInViewport.js (100%) create mode 100644 test/elementIsVisibleInViewport/elementIsVisibleInViewport.test.js rename {test2 => test}/elo/elo.js (100%) create mode 100644 test/elo/elo.test.js rename {test2 => test}/equals/equals.js (100%) create mode 100644 test/equals/equals.test.js rename {test2 => test}/escapeHTML/escapeHTML.js (100%) create mode 100644 test/escapeHTML/escapeHTML.test.js rename {test2 => test}/escapeRegExp/escapeRegExp.js (100%) create mode 100644 test/escapeRegExp/escapeRegExp.test.js rename {test2 => test}/everyNth/everyNth.js (100%) create mode 100644 test/everyNth/everyNth.test.js rename {test2 => test}/extendHex/extendHex.js (100%) create mode 100644 test/extendHex/extendHex.test.js rename {test2 => test}/factorial/factorial.js (100%) create mode 100644 test/factorial/factorial.test.js rename {test2 => test}/factors/factors.js (100%) create mode 100644 test/factors/factors.test.js rename {test2 => test}/fibonacci/fibonacci.js (100%) create mode 100644 test/fibonacci/fibonacci.test.js rename {test2 => test}/fibonacciCountUntilNum/fibonacciCountUntilNum.js (100%) create mode 100644 test/fibonacciCountUntilNum/fibonacciCountUntilNum.test.js rename {test2 => test}/fibonacciUntilNum/fibonacciUntilNum.js (100%) create mode 100644 test/fibonacciUntilNum/fibonacciUntilNum.test.js rename {test2 => test}/filterNonUnique/filterNonUnique.js (100%) create mode 100644 test/filterNonUnique/filterNonUnique.test.js rename {test2 => test}/findKey/findKey.js (100%) create mode 100644 test/findKey/findKey.test.js rename {test2 => test}/findLast/findLast.js (100%) create mode 100644 test/findLast/findLast.test.js rename {test2 => test}/findLastIndex/findLastIndex.js (100%) create mode 100644 test/findLastIndex/findLastIndex.test.js rename {test2 => test}/findLastKey/findLastKey.js (100%) create mode 100644 test/findLastKey/findLastKey.test.js rename {test2 => test}/flatten/flatten.js (100%) create mode 100644 test/flatten/flatten.test.js rename {test2 => test}/flattenObject/flattenObject.js (97%) create mode 100644 test/flattenObject/flattenObject.test.js rename {test2 => test}/flip/flip.js (100%) create mode 100644 test/flip/flip.test.js rename {test2 => test}/forEachRight/forEachRight.js (100%) create mode 100644 test/forEachRight/forEachRight.test.js rename {test2 => test}/forOwn/forOwn.js (100%) create mode 100644 test/forOwn/forOwn.test.js rename {test2 => test}/forOwnRight/forOwnRight.js (100%) create mode 100644 test/forOwnRight/forOwnRight.test.js rename {test2 => test}/formatDuration/formatDuration.js (100%) create mode 100644 test/formatDuration/formatDuration.test.js rename {test2 => test}/fromCamelCase/fromCamelCase.js (100%) create mode 100644 test/fromCamelCase/fromCamelCase.test.js rename {test2 => test}/functionName/functionName.js (100%) create mode 100644 test/functionName/functionName.test.js rename {test2 => test}/functions/functions.js (100%) create mode 100644 test/functions/functions.test.js rename {test2 => test}/gcd/gcd.js (100%) create mode 100644 test/gcd/gcd.test.js rename {test2 => test}/geometricProgression/geometricProgression.js (100%) create mode 100644 test/geometricProgression/geometricProgression.test.js rename {test2 => test}/get/get.js (100%) create mode 100644 test/get/get.test.js rename {test2 => test}/getColonTimeFromDate/getColonTimeFromDate.js (100%) create mode 100644 test/getColonTimeFromDate/getColonTimeFromDate.test.js rename {test2 => test}/getDaysDiffBetweenDates/getDaysDiffBetweenDates.js (100%) create mode 100644 test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js rename {test2 => test}/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.js (100%) create mode 100644 test/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.test.js rename {test2 => test}/getScrollPosition/getScrollPosition.js (98%) create mode 100644 test/getScrollPosition/getScrollPosition.test.js rename {test2 => test}/getStyle/getStyle.js (100%) create mode 100644 test/getStyle/getStyle.test.js rename {test2 => test}/getType/getType.js (100%) create mode 100644 test/getType/getType.test.js rename {test2 => test}/getURLParameters/getURLParameters.js (100%) create mode 100644 test/getURLParameters/getURLParameters.test.js rename {test3 => test}/groupBy/groupBy.js (96%) create mode 100644 test/groupBy/groupBy.test.js rename {test3 => test}/hammingDistance/hammingDistance.js (100%) create mode 100644 test/hammingDistance/hammingDistance.test.js rename {test3 => test}/hasClass/hasClass.js (100%) create mode 100644 test/hasClass/hasClass.test.js rename {test3 => test}/hasFlags/hasFlags.js (100%) create mode 100644 test/hasFlags/hasFlags.test.js rename {test3 => test}/hashBrowser/hashBrowser.js (98%) create mode 100644 test/hashBrowser/hashBrowser.test.js rename {test3 => test}/hashNode/hashNode.js (100%) create mode 100644 test/hashNode/hashNode.test.js rename {test3 => test}/head/head.js (100%) create mode 100644 test/head/head.test.js rename {test3 => test}/hexToRGB/hexToRGB.js (100%) create mode 100644 test/hexToRGB/hexToRGB.test.js rename {test3 => test}/hide/hide.js (100%) create mode 100644 test/hide/hide.test.js rename {test3 => test}/howManyTimes/howManyTimes.js (100%) create mode 100644 test/howManyTimes/howManyTimes.test.js rename {test3 => test}/httpDelete/httpDelete.js (100%) create mode 100644 test/httpDelete/httpDelete.test.js rename {test3 => test}/httpGet/httpGet.js (100%) rename {test3 => test}/httpGet/httpGet.test.js (80%) rename {test3 => test}/httpPost/httpPost.js (100%) rename {test3 => test}/httpPost/httpPost.test.js (80%) rename {test3 => test}/httpPut/httpPut.js (100%) create mode 100644 test/httpPut/httpPut.test.js create mode 100644 test/httpsRedirect/httpsRedirect.js create mode 100644 test/httpsRedirect/httpsRedirect.test.js rename {test3 => test}/hz/hz.js (100%) create mode 100644 test/hz/hz.test.js rename {test3 => test}/inRange/inRange.js (100%) create mode 100644 test/inRange/inRange.test.js rename {test3 => test}/indexOfAll/indexOfAll.js (100%) create mode 100644 test/indexOfAll/indexOfAll.test.js rename {test3 => test}/initial/initial.js (100%) create mode 100644 test/initial/initial.test.js rename {test3 => test}/initialize2DArray/initialize2DArray.js (100%) create mode 100644 test/initialize2DArray/initialize2DArray.test.js rename {test3 => test}/initializeArrayWithRange/initializeArrayWithRange.js (100%) create mode 100644 test/initializeArrayWithRange/initializeArrayWithRange.test.js rename {test3 => test}/initializeArrayWithRangeRight/initializeArrayWithRangeRight.js (100%) create mode 100644 test/initializeArrayWithRangeRight/initializeArrayWithRangeRight.test.js rename {test3 => test}/initializeArrayWithValues/initializeArrayWithValues.js (100%) create mode 100644 test/initializeArrayWithValues/initializeArrayWithValues.test.js rename {test3 => test}/initializeNDArray/initializeNDArray.js (100%) create mode 100644 test/initializeNDArray/initializeNDArray.test.js rename {test3 => test}/intersection/intersection.js (100%) create mode 100644 test/intersection/intersection.test.js rename {test3 => test}/intersectionBy/intersectionBy.js (100%) create mode 100644 test/intersectionBy/intersectionBy.test.js rename {test3 => test}/intersectionWith/intersectionWith.js (100%) create mode 100644 test/intersectionWith/intersectionWith.test.js rename {test3 => test}/invertKeyValues/invertKeyValues.js (96%) create mode 100644 test/invertKeyValues/invertKeyValues.test.js rename {test3 => test}/is/is.js (100%) create mode 100644 test/is/is.test.js rename {test3 => test}/isAbsoluteURL/isAbsoluteURL.js (100%) create mode 100644 test/isAbsoluteURL/isAbsoluteURL.test.js rename {test3 => test}/isAnagram/isAnagram.js (100%) rename {test3 => test}/isAnagram/isAnagram.test.js (56%) rename {test3 => test}/isArmstrongNumber/isArmstrongNumber.js (100%) create mode 100644 test/isArmstrongNumber/isArmstrongNumber.test.js rename {test3 => test}/isArray/isArray.js (100%) create mode 100644 test/isArray/isArray.test.js rename {test3 => test}/isArrayBuffer/isArrayBuffer.js (100%) create mode 100644 test/isArrayBuffer/isArrayBuffer.test.js rename {test3 => test}/isArrayLike/isArrayLike.js (100%) create mode 100644 test/isArrayLike/isArrayLike.test.js rename {test3 => test}/isBoolean/isBoolean.js (100%) create mode 100644 test/isBoolean/isBoolean.test.js rename {test3 => test}/isBrowser/isBrowser.js (100%) create mode 100644 test/isBrowser/isBrowser.test.js rename {test3 => test}/isBrowserTabFocused/isBrowserTabFocused.js (100%) create mode 100644 test/isBrowserTabFocused/isBrowserTabFocused.test.js rename {test3 => test}/isDivisible/isDivisible.js (100%) create mode 100644 test/isDivisible/isDivisible.test.js rename {test3 => test}/isEmpty/isEmpty.js (100%) create mode 100644 test/isEmpty/isEmpty.test.js rename {test3 => test}/isEven/isEven.js (100%) create mode 100644 test/isEven/isEven.test.js rename {test3 => test}/isFunction/isFunction.js (100%) create mode 100644 test/isFunction/isFunction.test.js rename {test3 => test}/isLowerCase/isLowerCase.js (100%) create mode 100644 test/isLowerCase/isLowerCase.test.js rename {test3 => test}/isMap/isMap.js (100%) create mode 100644 test/isMap/isMap.test.js rename {test3 => test}/isNil/isNil.js (100%) create mode 100644 test/isNil/isNil.test.js rename {test3 => test}/isNull/isNull.js (100%) create mode 100644 test/isNull/isNull.test.js rename {test3 => test}/isNumber/isNumber.js (100%) create mode 100644 test/isNumber/isNumber.test.js rename {test3 => test}/isObject/isObject.js (100%) create mode 100644 test/isObject/isObject.test.js rename {test3 => test}/isObjectLike/isObjectLike.js (100%) create mode 100644 test/isObjectLike/isObjectLike.test.js rename {test3 => test}/isPlainObject/isPlainObject.js (100%) create mode 100644 test/isPlainObject/isPlainObject.test.js rename {test4 => test}/isPrime/isPrime.js (100%) create mode 100644 test/isPrime/isPrime.test.js rename {test4 => test}/isPrimitive/isPrimitive.js (100%) create mode 100644 test/isPrimitive/isPrimitive.test.js rename {test4 => test}/isPromiseLike/isPromiseLike.js (100%) create mode 100644 test/isPromiseLike/isPromiseLike.test.js rename {test4 => test}/isRegExp/isRegExp.js (100%) create mode 100644 test/isRegExp/isRegExp.test.js rename {test4 => test}/isSet/isSet.js (100%) create mode 100644 test/isSet/isSet.test.js rename {test4 => test}/isSimilar/isSimilar.js (100%) create mode 100644 test/isSimilar/isSimilar.test.js rename {test4 => test}/isSorted/isSorted.js (100%) create mode 100644 test/isSorted/isSorted.test.js rename {test4 => test}/isString/isString.js (100%) create mode 100644 test/isString/isString.test.js rename {test4 => test}/isSymbol/isSymbol.js (100%) create mode 100644 test/isSymbol/isSymbol.test.js rename {test4 => test}/isTravisCI/isTravisCI.js (100%) create mode 100644 test/isTravisCI/isTravisCI.test.js rename {test4 => test}/isTypedArray/isTypedArray.js (100%) create mode 100644 test/isTypedArray/isTypedArray.test.js rename {test4 => test}/isUndefined/isUndefined.js (100%) create mode 100644 test/isUndefined/isUndefined.test.js rename {test4 => test}/isUpperCase/isUpperCase.js (100%) create mode 100644 test/isUpperCase/isUpperCase.test.js rename {test4 => test}/isValidJSON/isValidJSON.js (100%) create mode 100644 test/isValidJSON/isValidJSON.test.js rename {test4 => test}/isWeakMap/isWeakMap.js (100%) create mode 100644 test/isWeakMap/isWeakMap.test.js rename {test4 => test}/isWeakSet/isWeakSet.js (100%) create mode 100644 test/isWeakSet/isWeakSet.test.js rename {test4 => test}/join/join.js (100%) create mode 100644 test/join/join.test.js rename {test4 => test}/last/last.js (100%) create mode 100644 test/last/last.test.js rename {test4 => test}/lcm/lcm.js (100%) create mode 100644 test/lcm/lcm.test.js rename {test4 => test}/levenshteinDistance/levenshteinDistance.js (100%) create mode 100644 test/levenshteinDistance/levenshteinDistance.test.js rename {test4 => test}/longestItem/longestItem.js (100%) create mode 100644 test/longestItem/longestItem.test.js rename {test4 => test}/lowercaseKeys/lowercaseKeys.js (94%) create mode 100644 test/lowercaseKeys/lowercaseKeys.test.js rename {test4 => test}/luhnCheck/luhnCheck.js (100%) create mode 100644 test/luhnCheck/luhnCheck.test.js rename {test4 => test}/mapKeys/mapKeys.js (94%) create mode 100644 test/mapKeys/mapKeys.test.js rename {test4 => test}/mapObject/mapObject.js (100%) create mode 100644 test/mapObject/mapObject.test.js rename {test4 => test}/mapValues/mapValues.js (94%) create mode 100644 test/mapValues/mapValues.test.js rename {test4 => test}/mask/mask.js (100%) create mode 100644 test/mask/mask.test.js rename {test4 => test}/matches/matches.js (100%) create mode 100644 test/matches/matches.test.js rename {test4 => test}/matchesWith/matchesWith.js (100%) create mode 100644 test/matchesWith/matchesWith.test.js rename {test4 => test}/maxBy/maxBy.js (100%) create mode 100644 test/maxBy/maxBy.test.js rename {test4 => test}/maxN/maxN.js (100%) create mode 100644 test/maxN/maxN.test.js rename {test4 => test}/median/median.js (100%) create mode 100644 test/median/median.test.js rename {test4 => test}/memoize/memoize.js (100%) create mode 100644 test/memoize/memoize.test.js rename {test4 => test}/merge/merge.js (100%) create mode 100644 test/merge/merge.test.js rename {test4 => test}/minBy/minBy.js (100%) create mode 100644 test/minBy/minBy.test.js rename {test4 => test}/minN/minN.js (100%) create mode 100644 test/minN/minN.test.js rename {test4 => test}/mostPerformant/mostPerformant.js (98%) create mode 100644 test/mostPerformant/mostPerformant.test.js rename {test4 => test}/negate/negate.js (100%) create mode 100644 test/negate/negate.test.js rename {test4 => test}/nest/nest.js (100%) create mode 100644 test/nest/nest.test.js rename {test4 => test}/nodeListToArray/nodeListToArray.js (100%) create mode 100644 test/nodeListToArray/nodeListToArray.test.js rename {test4 => test}/none/none.js (100%) create mode 100644 test/none/none.test.js rename {test4 => test}/nthArg/nthArg.js (100%) create mode 100644 test/nthArg/nthArg.test.js rename {test4 => test}/nthElement/nthElement.js (100%) create mode 100644 test/nthElement/nthElement.test.js rename {test4 => test}/objectFromPairs/objectFromPairs.js (85%) create mode 100644 test/objectFromPairs/objectFromPairs.test.js rename {test4 => test}/objectToPairs/objectToPairs.js (100%) create mode 100644 test/objectToPairs/objectToPairs.test.js rename {test4 => test}/observeMutations/observeMutations.js (100%) create mode 100644 test/observeMutations/observeMutations.test.js rename {test4 => test}/off/off.js (100%) create mode 100644 test/off/off.test.js rename {test4 => test}/offset/offset.js (100%) create mode 100644 test/offset/offset.test.js rename {test4 => test}/omit/omit.js (62%) create mode 100644 test/omit/omit.test.js rename {test5 => test}/omitBy/omitBy.js (63%) create mode 100644 test/omitBy/omitBy.test.js rename {test5 => test}/on/on.js (100%) create mode 100644 test/on/on.test.js rename {test5 => test}/onUserInputChange/onUserInputChange.js (99%) create mode 100644 test/onUserInputChange/onUserInputChange.test.js rename {test5 => test}/once/once.js (100%) create mode 100644 test/once/once.test.js rename {test5 => test}/orderBy/orderBy.js (100%) create mode 100644 test/orderBy/orderBy.test.js rename {test5 => test}/over/over.js (100%) create mode 100644 test/over/over.test.js rename {test5 => test}/overArgs/overArgs.js (100%) create mode 100644 test/overArgs/overArgs.test.js rename {test5 => test}/pad/pad.js (100%) create mode 100644 test/pad/pad.test.js rename {test5 => test}/palindrome/palindrome.js (100%) create mode 100644 test/palindrome/palindrome.test.js rename {test5 => test}/parseCookie/parseCookie.js (96%) create mode 100644 test/parseCookie/parseCookie.test.js rename {test5 => test}/partial/partial.js (100%) create mode 100644 test/partial/partial.test.js rename {test5 => test}/partialRight/partialRight.js (100%) create mode 100644 test/partialRight/partialRight.test.js rename {test5 => test}/partition/partition.js (100%) create mode 100644 test/partition/partition.test.js rename {test5 => test}/percentile/percentile.js (100%) create mode 100644 test/percentile/percentile.test.js rename {test5 => test}/permutations/permutations.js (100%) create mode 100644 test/permutations/permutations.test.js rename {test5 => test}/pick/pick.js (88%) create mode 100644 test/pick/pick.test.js rename {test5 => test}/pickBy/pickBy.js (62%) create mode 100644 test/pickBy/pickBy.test.js rename {test5 => test}/pipeAsyncFunctions/pipeAsyncFunctions.js (100%) create mode 100644 test/pipeAsyncFunctions/pipeAsyncFunctions.test.js rename {test5 => test}/pipeFunctions/pipeFunctions.js (100%) create mode 100644 test/pipeFunctions/pipeFunctions.test.js rename {test5 => test}/pluralize/pluralize.js (100%) create mode 100644 test/pluralize/pluralize.test.js rename {test5 => test}/powerset/powerset.js (100%) create mode 100644 test/powerset/powerset.test.js rename {test5 => test}/prefix/prefix.js (100%) create mode 100644 test/prefix/prefix.test.js rename {test5 => test}/prettyBytes/prettyBytes.js (100%) create mode 100644 test/prettyBytes/prettyBytes.test.js rename {test5 => test}/primes/primes.js (100%) create mode 100644 test/primes/primes.test.js rename {test5 => test}/promisify/promisify.js (100%) create mode 100644 test/promisify/promisify.test.js rename {test5 => test}/pull/pull.js (100%) create mode 100644 test/pull/pull.test.js rename {test5 => test}/pullAtIndex/pullAtIndex.js (100%) create mode 100644 test/pullAtIndex/pullAtIndex.test.js rename {test5 => test}/pullAtValue/pullAtValue.js (100%) create mode 100644 test/pullAtValue/pullAtValue.test.js rename {test5 => test}/pullBy/pullBy.js (100%) create mode 100644 test/pullBy/pullBy.test.js rename {test5 => test}/quickSort/quickSort.js (100%) create mode 100644 test/quickSort/quickSort.test.js rename {test5 => test}/radsToDegrees/radsToDegrees.js (100%) create mode 100644 test/radsToDegrees/radsToDegrees.test.js rename {test5 => test}/randomHexColorCode/randomHexColorCode.js (100%) create mode 100644 test/randomHexColorCode/randomHexColorCode.test.js rename {test5 => test}/randomIntArrayInRange/randomIntArrayInRange.js (100%) rename {test5 => test}/randomIntArrayInRange/randomIntArrayInRange.test.js (54%) rename {test5 => test}/randomIntegerInRange/randomIntegerInRange.js (100%) rename {test5 => test}/randomIntegerInRange/randomIntegerInRange.test.js (62%) rename {test5 => test}/randomNumberInRange/randomNumberInRange.js (100%) rename {test5 => test}/randomNumberInRange/randomNumberInRange.test.js (63%) rename {test5 => test}/readFileLines/readFileLines.js (100%) create mode 100644 test/readFileLines/readFileLines.test.js rename {test5 => test}/rearg/rearg.js (100%) create mode 100644 test/rearg/rearg.test.js rename {test5 => test}/recordAnimationFrames/recordAnimationFrames.js (98%) create mode 100644 test/recordAnimationFrames/recordAnimationFrames.test.js rename {test5 => test}/redirect/redirect.js (100%) create mode 100644 test/redirect/redirect.test.js rename {test5 => test}/reduceSuccessive/reduceSuccessive.js (100%) create mode 100644 test/reduceSuccessive/reduceSuccessive.test.js rename {test5 => test}/reduceWhich/reduceWhich.js (100%) create mode 100644 test/reduceWhich/reduceWhich.test.js rename {test5 => test}/reducedFilter/reducedFilter.js (100%) create mode 100644 test/reducedFilter/reducedFilter.test.js rename {test5 => test}/reject/reject.js (100%) create mode 100644 test/reject/reject.test.js rename {test5 => test}/remove/remove.js (100%) create mode 100644 test/remove/remove.test.js rename {test5 => test}/removeNonASCII/removeNonASCII.js (100%) create mode 100644 test/removeNonASCII/removeNonASCII.test.js rename {test5 => test}/removeVowels/removeVowels.js (100%) create mode 100644 test/removeVowels/removeVowels.test.js rename {test5 => test}/renameKeys/renameKeys.js (100%) create mode 100644 test/renameKeys/renameKeys.test.js rename {test5 => test}/reverseString/reverseString.js (100%) create mode 100644 test/reverseString/reverseString.test.js rename {test5 => test}/round/round.js (100%) create mode 100644 test/round/round.test.js rename {test6 => test}/runAsync/runAsync.js (98%) create mode 100644 test/runAsync/runAsync.test.js rename {test6 => test}/runPromisesInSeries/runPromisesInSeries.js (100%) create mode 100644 test/runPromisesInSeries/runPromisesInSeries.test.js rename {test6 => test}/sample/sample.js (100%) create mode 100644 test/sample/sample.test.js rename {test6 => test}/sampleSize/sampleSize.js (100%) create mode 100644 test/sampleSize/sampleSize.test.js rename {test6 => test}/scrollToTop/scrollToTop.js (100%) create mode 100644 test/scrollToTop/scrollToTop.test.js rename {test6 => test}/sdbm/sdbm.js (100%) create mode 100644 test/sdbm/sdbm.test.js rename {test6 => test}/serializeCookie/serializeCookie.js (100%) create mode 100644 test/serializeCookie/serializeCookie.test.js rename {test6 => test}/setStyle/setStyle.js (100%) create mode 100644 test/setStyle/setStyle.test.js rename {test6 => test}/shallowClone/shallowClone.js (100%) create mode 100644 test/shallowClone/shallowClone.test.js rename {test6 => test}/show/show.js (100%) create mode 100644 test/show/show.test.js rename {test6 => test}/shuffle/shuffle.js (100%) create mode 100644 test/shuffle/shuffle.test.js rename {test6 => test}/similarity/similarity.js (100%) create mode 100644 test/similarity/similarity.test.js rename {test6 => test}/size/size.js (100%) create mode 100644 test/size/size.test.js rename {test6 => test}/sleep/sleep.js (100%) create mode 100644 test/sleep/sleep.test.js rename {test6 => test}/smoothScroll/smoothScroll.js (97%) create mode 100644 test/smoothScroll/smoothScroll.test.js rename {test6 => test}/solveRPN/solveRPN.js (99%) create mode 100644 test/solveRPN/solveRPN.test.js rename {test6 => test}/sortCharactersInString/sortCharactersInString.js (100%) create mode 100644 test/sortCharactersInString/sortCharactersInString.test.js rename {test6 => test}/sortedIndex/sortedIndex.js (100%) create mode 100644 test/sortedIndex/sortedIndex.test.js rename {test6 => test}/sortedIndexBy/sortedIndexBy.js (100%) create mode 100644 test/sortedIndexBy/sortedIndexBy.test.js rename {test6 => test}/sortedLastIndex/sortedLastIndex.js (100%) create mode 100644 test/sortedLastIndex/sortedLastIndex.test.js rename {test6 => test}/sortedLastIndexBy/sortedLastIndexBy.js (100%) create mode 100644 test/sortedLastIndexBy/sortedLastIndexBy.test.js rename {test6 => test}/speechSynthesis/speechSynthesis.js (100%) create mode 100644 test/speechSynthesis/speechSynthesis.test.js rename {test6 => test}/splitLines/splitLines.js (100%) create mode 100644 test/splitLines/splitLines.test.js rename {test6 => test}/spreadOver/spreadOver.js (100%) create mode 100644 test/spreadOver/spreadOver.test.js rename {test6 => test}/stableSort/stableSort.js (100%) create mode 100644 test/stableSort/stableSort.test.js rename {test6 => test}/standardDeviation/standardDeviation.js (100%) create mode 100644 test/standardDeviation/standardDeviation.test.js rename {test6 => test}/stringPermutations/stringPermutations.js (100%) create mode 100644 test/stringPermutations/stringPermutations.test.js rename {test6 => test}/stripHTMLTags/stripHTMLTags.js (100%) create mode 100644 test/stripHTMLTags/stripHTMLTags.test.js rename {test6 => test}/sum/sum.js (100%) create mode 100644 test/sum/sum.test.js rename {test6 => test}/sumBy/sumBy.js (100%) create mode 100644 test/sumBy/sumBy.test.js rename {test6 => test}/sumPower/sumPower.js (100%) create mode 100644 test/sumPower/sumPower.test.js rename {test6 => test}/symmetricDifference/symmetricDifference.js (100%) create mode 100644 test/symmetricDifference/symmetricDifference.test.js rename {test6 => test}/symmetricDifferenceBy/symmetricDifferenceBy.js (100%) create mode 100644 test/symmetricDifferenceBy/symmetricDifferenceBy.test.js rename {test6 => test}/symmetricDifferenceWith/symmetricDifferenceWith.js (100%) create mode 100644 test/symmetricDifferenceWith/symmetricDifferenceWith.test.js rename {test6 => test}/tail/tail.js (100%) create mode 100644 test/tail/tail.test.js rename {test6 => test}/take/take.js (100%) create mode 100644 test/take/take.test.js rename {test6 => test}/takeRight/takeRight.js (100%) create mode 100644 test/takeRight/takeRight.test.js rename {test6 => test}/takeRightWhile/takeRightWhile.js (100%) create mode 100644 test/takeRightWhile/takeRightWhile.test.js rename {test6 => test}/takeWhile/takeWhile.js (100%) create mode 100644 test/takeWhile/takeWhile.test.js create mode 100644 test/testlog rename {test6 => test}/throttle/throttle.js (100%) create mode 100644 test/throttle/throttle.test.js rename {test6 => test}/timeTaken/timeTaken.js (100%) create mode 100644 test/timeTaken/timeTaken.test.js rename {test6 => test}/times/times.js (100%) create mode 100644 test/times/times.test.js rename {test6 => test}/toCamelCase/toCamelCase.js (100%) create mode 100644 test/toCamelCase/toCamelCase.test.js rename {test6 => test}/toCurrency/toCurrency.js (100%) create mode 100644 test/toCurrency/toCurrency.test.js rename {test6 => test}/toDecimalMark/toDecimalMark.js (100%) create mode 100644 test/toDecimalMark/toDecimalMark.test.js rename {test6 => test}/toHash/toHash.js (100%) create mode 100644 test/toHash/toHash.test.js rename {test6 => test}/toKebabCase/toKebabCase.js (100%) create mode 100644 test/toKebabCase/toKebabCase.test.js rename {test6 => test}/toOrdinalSuffix/toOrdinalSuffix.js (100%) create mode 100644 test/toOrdinalSuffix/toOrdinalSuffix.test.js rename {test6 => test}/toSafeInteger/toSafeInteger.js (100%) create mode 100644 test/toSafeInteger/toSafeInteger.test.js rename {test6 => test}/toSnakeCase/toSnakeCase.js (100%) create mode 100644 test/toSnakeCase/toSnakeCase.test.js rename {test6 => test}/toggleClass/toggleClass.js (100%) create mode 100644 test/toggleClass/toggleClass.test.js rename {test6 => test}/tomorrow/tomorrow.js (100%) create mode 100644 test/tomorrow/tomorrow.test.js rename {test6 => test}/transform/transform.js (100%) create mode 100644 test/transform/transform.test.js rename {test6 => test}/truncateString/truncateString.js (100%) create mode 100644 test/truncateString/truncateString.test.js rename {test6 => test}/truthCheckCollection/truthCheckCollection.js (100%) create mode 100644 test/truthCheckCollection/truthCheckCollection.test.js rename {test6 => test}/unary/unary.js (100%) create mode 100644 test/unary/unary.test.js rename {test6 => test}/uncurry/uncurry.js (100%) create mode 100644 test/uncurry/uncurry.test.js rename {test6 => test}/unescapeHTML/unescapeHTML.js (100%) create mode 100644 test/unescapeHTML/unescapeHTML.test.js rename {test6 => test}/unflattenObject/unflattenObject.js (97%) create mode 100644 test/unflattenObject/unflattenObject.test.js rename {test6 => test}/unfold/unfold.js (100%) create mode 100644 test/unfold/unfold.test.js rename {test6 => test}/union/union.js (100%) create mode 100644 test/union/union.test.js rename {test6 => test}/unionBy/unionBy.js (100%) create mode 100644 test/unionBy/unionBy.test.js rename {test6 => test}/unionWith/unionWith.js (100%) create mode 100644 test/unionWith/unionWith.test.js rename {test6 => test}/uniqueElements/uniqueElements.js (100%) create mode 100644 test/uniqueElements/uniqueElements.test.js rename {test6 => test}/untildify/untildify.js (100%) create mode 100644 test/untildify/untildify.test.js rename {test6 => test}/unzip/unzip.js (100%) create mode 100644 test/unzip/unzip.test.js rename {test6 => test}/unzipWith/unzipWith.js (100%) create mode 100644 test/unzipWith/unzipWith.test.js rename {test6 => test}/validateNumber/validateNumber.js (100%) create mode 100644 test/validateNumber/validateNumber.test.js rename {test6 => test}/when/when.js (100%) create mode 100644 test/when/when.test.js rename {test6 => test}/without/without.js (100%) create mode 100644 test/without/without.test.js rename {test6 => test}/words/words.js (100%) create mode 100644 test/words/words.test.js rename {test6 => test}/xProd/xProd.js (100%) create mode 100644 test/xProd/xProd.test.js rename {test6 => test}/yesNo/yesNo.js (100%) create mode 100644 test/yesNo/yesNo.test.js rename {test6 => test}/zip/zip.js (98%) create mode 100644 test/zip/zip.test.js rename {test6 => test}/zipObject/zipObject.js (91%) create mode 100644 test/zipObject/zipObject.test.js rename {test6 => test}/zipWith/zipWith.js (100%) create mode 100644 test/zipWith/zipWith.test.js delete mode 100644 test2/defaults/defaults.test.js delete mode 100644 test2/defer/defer.test.js delete mode 100644 test2/degreesToRads/degreesToRads.test.js delete mode 100644 test2/delay/delay.test.js delete mode 100644 test2/detectDeviceType/detectDeviceType.test.js delete mode 100644 test2/difference/difference.test.js delete mode 100644 test2/differenceBy/differenceBy.test.js delete mode 100644 test2/differenceWith/differenceWith.test.js delete mode 100644 test2/digitize/digitize.test.js delete mode 100644 test2/distance/distance.test.js delete mode 100644 test2/drop/drop.test.js delete mode 100644 test2/dropRight/dropRight.test.js delete mode 100644 test2/dropRightWhile/dropRightWhile.test.js delete mode 100644 test2/dropWhile/dropWhile.test.js delete mode 100644 test2/elementIsVisibleInViewport/elementIsVisibleInViewport.test.js delete mode 100644 test2/elo/elo.test.js delete mode 100644 test2/equals/equals.test.js delete mode 100644 test2/escapeHTML/escapeHTML.test.js delete mode 100644 test2/escapeRegExp/escapeRegExp.test.js delete mode 100644 test2/everyNth/everyNth.test.js delete mode 100644 test2/extendHex/extendHex.test.js delete mode 100644 test2/factorial/factorial.test.js delete mode 100644 test2/factors/factors.test.js delete mode 100644 test2/fibonacci/fibonacci.test.js delete mode 100644 test2/fibonacciCountUntilNum/fibonacciCountUntilNum.test.js delete mode 100644 test2/fibonacciUntilNum/fibonacciUntilNum.test.js delete mode 100644 test2/filterNonUnique/filterNonUnique.test.js delete mode 100644 test2/findKey/findKey.test.js delete mode 100644 test2/findLast/findLast.test.js delete mode 100644 test2/findLastIndex/findLastIndex.test.js delete mode 100644 test2/findLastKey/findLastKey.test.js delete mode 100644 test2/flatten/flatten.test.js delete mode 100644 test2/flattenObject/flattenObject.test.js delete mode 100644 test2/flip/flip.test.js delete mode 100644 test2/forEachRight/forEachRight.test.js delete mode 100644 test2/forOwn/forOwn.test.js delete mode 100644 test2/forOwnRight/forOwnRight.test.js delete mode 100644 test2/formatDuration/formatDuration.test.js delete mode 100644 test2/fromCamelCase/fromCamelCase.test.js delete mode 100644 test2/functionName/functionName.test.js delete mode 100644 test2/functions/functions.test.js delete mode 100644 test2/gcd/gcd.test.js delete mode 100644 test2/geometricProgression/geometricProgression.test.js delete mode 100644 test2/get/get.test.js delete mode 100644 test2/getColonTimeFromDate/getColonTimeFromDate.test.js delete mode 100644 test2/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js delete mode 100644 test2/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.test.js delete mode 100644 test2/getScrollPosition/getScrollPosition.test.js delete mode 100644 test2/getStyle/getStyle.test.js delete mode 100644 test2/getType/getType.test.js delete mode 100644 test2/getURLParameters/getURLParameters.test.js delete mode 100644 test3/groupBy/groupBy.test.js delete mode 100644 test3/hammingDistance/hammingDistance.test.js delete mode 100644 test3/hasClass/hasClass.test.js delete mode 100644 test3/hasFlags/hasFlags.test.js delete mode 100644 test3/hashBrowser/hashBrowser.test.js delete mode 100644 test3/hashNode/hashNode.test.js delete mode 100644 test3/head/head.test.js delete mode 100644 test3/hexToRGB/hexToRGB.test.js delete mode 100644 test3/hide/hide.test.js delete mode 100644 test3/howManyTimes/howManyTimes.test.js delete mode 100644 test3/httpDelete/httpDelete.test.js delete mode 100644 test3/httpPut/httpPut.test.js delete mode 100644 test3/httpsRedirect/httpsRedirect.js delete mode 100644 test3/httpsRedirect/httpsRedirect.test.js delete mode 100644 test3/hz/hz.test.js delete mode 100644 test3/inRange/inRange.test.js delete mode 100644 test3/indexOfAll/indexOfAll.test.js delete mode 100644 test3/initial/initial.test.js delete mode 100644 test3/initialize2DArray/initialize2DArray.test.js delete mode 100644 test3/initializeArrayWithRange/initializeArrayWithRange.test.js delete mode 100644 test3/initializeArrayWithRangeRight/initializeArrayWithRangeRight.test.js delete mode 100644 test3/initializeArrayWithValues/initializeArrayWithValues.test.js delete mode 100644 test3/initializeNDArray/initializeNDArray.test.js delete mode 100644 test3/intersection/intersection.test.js delete mode 100644 test3/intersectionBy/intersectionBy.test.js delete mode 100644 test3/intersectionWith/intersectionWith.test.js delete mode 100644 test3/invertKeyValues/invertKeyValues.test.js delete mode 100644 test3/is/is.test.js delete mode 100644 test3/isAbsoluteURL/isAbsoluteURL.test.js delete mode 100644 test3/isArmstrongNumber/isArmstrongNumber.test.js delete mode 100644 test3/isArray/isArray.test.js delete mode 100644 test3/isArrayBuffer/isArrayBuffer.test.js delete mode 100644 test3/isArrayLike/isArrayLike.test.js delete mode 100644 test3/isBoolean/isBoolean.test.js delete mode 100644 test3/isBrowser/isBrowser.test.js delete mode 100644 test3/isBrowserTabFocused/isBrowserTabFocused.test.js delete mode 100644 test3/isDivisible/isDivisible.test.js delete mode 100644 test3/isEmpty/isEmpty.test.js delete mode 100644 test3/isEven/isEven.test.js delete mode 100644 test3/isFunction/isFunction.test.js delete mode 100644 test3/isLowerCase/isLowerCase.test.js delete mode 100644 test3/isMap/isMap.test.js delete mode 100644 test3/isNil/isNil.test.js delete mode 100644 test3/isNull/isNull.test.js delete mode 100644 test3/isNumber/isNumber.test.js delete mode 100644 test3/isObject/isObject.test.js delete mode 100644 test3/isObjectLike/isObjectLike.test.js delete mode 100644 test3/isPlainObject/isPlainObject.test.js delete mode 100644 test4/JSONToDate/JSONToDate.test.js delete mode 100644 test4/JSONToFile/JSONToFile.test.js delete mode 100644 test4/isPrime/isPrime.test.js delete mode 100644 test4/isPrimitive/isPrimitive.test.js delete mode 100644 test4/isPromiseLike/isPromiseLike.test.js delete mode 100644 test4/isRegExp/isRegExp.test.js delete mode 100644 test4/isSet/isSet.test.js delete mode 100644 test4/isSimilar/isSimilar.test.js delete mode 100644 test4/isSorted/isSorted.test.js delete mode 100644 test4/isString/isString.test.js delete mode 100644 test4/isSymbol/isSymbol.test.js delete mode 100644 test4/isTravisCI/isTravisCI.test.js delete mode 100644 test4/isTypedArray/isTypedArray.test.js delete mode 100644 test4/isUndefined/isUndefined.test.js delete mode 100644 test4/isUpperCase/isUpperCase.test.js delete mode 100644 test4/isValidJSON/isValidJSON.test.js delete mode 100644 test4/isWeakMap/isWeakMap.test.js delete mode 100644 test4/isWeakSet/isWeakSet.test.js delete mode 100644 test4/join/join.test.js delete mode 100644 test4/last/last.test.js delete mode 100644 test4/lcm/lcm.test.js delete mode 100644 test4/levenshteinDistance/levenshteinDistance.test.js delete mode 100644 test4/longestItem/longestItem.test.js delete mode 100644 test4/lowercaseKeys/lowercaseKeys.test.js delete mode 100644 test4/luhnCheck/luhnCheck.test.js delete mode 100644 test4/mapKeys/mapKeys.test.js delete mode 100644 test4/mapObject/mapObject.test.js delete mode 100644 test4/mapValues/mapValues.test.js delete mode 100644 test4/mask/mask.test.js delete mode 100644 test4/matches/matches.test.js delete mode 100644 test4/matchesWith/matchesWith.test.js delete mode 100644 test4/maxBy/maxBy.test.js delete mode 100644 test4/maxN/maxN.test.js delete mode 100644 test4/median/median.test.js delete mode 100644 test4/memoize/memoize.test.js delete mode 100644 test4/merge/merge.test.js delete mode 100644 test4/minBy/minBy.test.js delete mode 100644 test4/minN/minN.test.js delete mode 100644 test4/mostPerformant/mostPerformant.test.js delete mode 100644 test4/negate/negate.test.js delete mode 100644 test4/nest/nest.test.js delete mode 100644 test4/nodeListToArray/nodeListToArray.test.js delete mode 100644 test4/none/none.test.js delete mode 100644 test4/nthArg/nthArg.test.js delete mode 100644 test4/nthElement/nthElement.test.js delete mode 100644 test4/objectFromPairs/objectFromPairs.test.js delete mode 100644 test4/objectToPairs/objectToPairs.test.js delete mode 100644 test4/observeMutations/observeMutations.test.js delete mode 100644 test4/off/off.test.js delete mode 100644 test4/offset/offset.test.js delete mode 100644 test4/omit/omit.test.js delete mode 100644 test5/RGBToHex/RGBToHex.test.js delete mode 100644 test5/omitBy/omitBy.test.js delete mode 100644 test5/on/on.test.js delete mode 100644 test5/onUserInputChange/onUserInputChange.test.js delete mode 100644 test5/once/once.test.js delete mode 100644 test5/orderBy/orderBy.test.js delete mode 100644 test5/over/over.test.js delete mode 100644 test5/overArgs/overArgs.test.js delete mode 100644 test5/pad/pad.test.js delete mode 100644 test5/palindrome/palindrome.test.js delete mode 100644 test5/parseCookie/parseCookie.test.js delete mode 100644 test5/partial/partial.test.js delete mode 100644 test5/partialRight/partialRight.test.js delete mode 100644 test5/partition/partition.test.js delete mode 100644 test5/percentile/percentile.test.js delete mode 100644 test5/permutations/permutations.test.js delete mode 100644 test5/pick/pick.test.js delete mode 100644 test5/pickBy/pickBy.test.js delete mode 100644 test5/pipeAsyncFunctions/pipeAsyncFunctions.test.js delete mode 100644 test5/pipeFunctions/pipeFunctions.test.js delete mode 100644 test5/pluralize/pluralize.test.js delete mode 100644 test5/powerset/powerset.test.js delete mode 100644 test5/prefix/prefix.test.js delete mode 100644 test5/prettyBytes/prettyBytes.test.js delete mode 100644 test5/primes/primes.test.js delete mode 100644 test5/promisify/promisify.test.js delete mode 100644 test5/pull/pull.test.js delete mode 100644 test5/pullAtIndex/pullAtIndex.test.js delete mode 100644 test5/pullAtValue/pullAtValue.test.js delete mode 100644 test5/pullBy/pullBy.test.js delete mode 100644 test5/quickSort/quickSort.test.js delete mode 100644 test5/radsToDegrees/radsToDegrees.test.js delete mode 100644 test5/randomHexColorCode/randomHexColorCode.test.js delete mode 100644 test5/readFileLines/readFileLines.test.js delete mode 100644 test5/rearg/rearg.test.js delete mode 100644 test5/recordAnimationFrames/recordAnimationFrames.test.js delete mode 100644 test5/redirect/redirect.test.js delete mode 100644 test5/reduceSuccessive/reduceSuccessive.test.js delete mode 100644 test5/reduceWhich/reduceWhich.test.js delete mode 100644 test5/reducedFilter/reducedFilter.test.js delete mode 100644 test5/reject/reject.test.js delete mode 100644 test5/remove/remove.test.js delete mode 100644 test5/removeNonASCII/removeNonASCII.test.js delete mode 100644 test5/removeVowels/removeVowels.test.js delete mode 100644 test5/renameKeys/renameKeys.test.js delete mode 100644 test5/reverseString/reverseString.test.js delete mode 100644 test5/round/round.test.js delete mode 100644 test6/URLJoin/URLJoin.test.js delete mode 100644 test6/UUIDGeneratorBrowser/UUIDGeneratorBrowser.test.js delete mode 100644 test6/UUIDGeneratorNode/UUIDGeneratorNode.test.js delete mode 100644 test6/runAsync/runAsync.test.js delete mode 100644 test6/runPromisesInSeries/runPromisesInSeries.test.js delete mode 100644 test6/sample/sample.test.js delete mode 100644 test6/sampleSize/sampleSize.test.js delete mode 100644 test6/scrollToTop/scrollToTop.test.js delete mode 100644 test6/sdbm/sdbm.test.js delete mode 100644 test6/serializeCookie/serializeCookie.test.js delete mode 100644 test6/setStyle/setStyle.test.js delete mode 100644 test6/shallowClone/shallowClone.test.js delete mode 100644 test6/show/show.test.js delete mode 100644 test6/shuffle/shuffle.test.js delete mode 100644 test6/similarity/similarity.test.js delete mode 100644 test6/size/size.test.js delete mode 100644 test6/sleep/sleep.test.js delete mode 100644 test6/smoothScroll/smoothScroll.test.js delete mode 100644 test6/solveRPN/solveRPN.test.js delete mode 100644 test6/sortCharactersInString/sortCharactersInString.test.js delete mode 100644 test6/sortedIndex/sortedIndex.test.js delete mode 100644 test6/sortedIndexBy/sortedIndexBy.test.js delete mode 100644 test6/sortedLastIndex/sortedLastIndex.test.js delete mode 100644 test6/sortedLastIndexBy/sortedLastIndexBy.test.js delete mode 100644 test6/speechSynthesis/speechSynthesis.test.js delete mode 100644 test6/splitLines/splitLines.test.js delete mode 100644 test6/spreadOver/spreadOver.test.js delete mode 100644 test6/stableSort/stableSort.test.js delete mode 100644 test6/standardDeviation/standardDeviation.test.js delete mode 100644 test6/stringPermutations/stringPermutations.test.js delete mode 100644 test6/stripHTMLTags/stripHTMLTags.test.js delete mode 100644 test6/sum/sum.test.js delete mode 100644 test6/sumBy/sumBy.test.js delete mode 100644 test6/sumPower/sumPower.test.js delete mode 100644 test6/symmetricDifference/symmetricDifference.test.js delete mode 100644 test6/symmetricDifferenceBy/symmetricDifferenceBy.test.js delete mode 100644 test6/symmetricDifferenceWith/symmetricDifferenceWith.test.js delete mode 100644 test6/tail/tail.test.js delete mode 100644 test6/take/take.test.js delete mode 100644 test6/takeRight/takeRight.test.js delete mode 100644 test6/takeRightWhile/takeRightWhile.test.js delete mode 100644 test6/takeWhile/takeWhile.test.js delete mode 100644 test6/throttle/throttle.test.js delete mode 100644 test6/timeTaken/timeTaken.test.js delete mode 100644 test6/times/times.test.js delete mode 100644 test6/toCamelCase/toCamelCase.test.js delete mode 100644 test6/toCurrency/toCurrency.test.js delete mode 100644 test6/toDecimalMark/toDecimalMark.test.js delete mode 100644 test6/toHash/toHash.test.js delete mode 100644 test6/toKebabCase/toKebabCase.test.js delete mode 100644 test6/toOrdinalSuffix/toOrdinalSuffix.test.js delete mode 100644 test6/toSafeInteger/toSafeInteger.test.js delete mode 100644 test6/toSnakeCase/toSnakeCase.test.js delete mode 100644 test6/toggleClass/toggleClass.test.js delete mode 100644 test6/tomorrow/tomorrow.test.js delete mode 100644 test6/transform/transform.test.js delete mode 100644 test6/truncateString/truncateString.test.js delete mode 100644 test6/truthCheckCollection/truthCheckCollection.test.js delete mode 100644 test6/unary/unary.test.js delete mode 100644 test6/uncurry/uncurry.test.js delete mode 100644 test6/unescapeHTML/unescapeHTML.test.js delete mode 100644 test6/unflattenObject/unflattenObject.test.js delete mode 100644 test6/unfold/unfold.test.js delete mode 100644 test6/union/union.test.js delete mode 100644 test6/unionBy/unionBy.test.js delete mode 100644 test6/unionWith/unionWith.test.js delete mode 100644 test6/uniqueElements/uniqueElements.test.js delete mode 100644 test6/untildify/untildify.test.js delete mode 100644 test6/unzip/unzip.test.js delete mode 100644 test6/unzipWith/unzipWith.test.js delete mode 100644 test6/validateNumber/validateNumber.test.js delete mode 100644 test6/when/when.test.js delete mode 100644 test6/without/without.test.js delete mode 100644 test6/words/words.test.js delete mode 100644 test6/xProd/xProd.test.js delete mode 100644 test6/yesNo/yesNo.test.js delete mode 100644 test6/zip/zip.test.js delete mode 100644 test6/zipObject/zipObject.test.js delete mode 100644 test6/zipWith/zipWith.test.js diff --git a/package.json b/package.json index b2a1e4c0f..60601fc5f 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "packager": "node ./scripts/module.js", "localizer": "node ./scripts/localize.js", "test": "tape test/**/*.test.js | tap-spec", - "test2": "jest ./jesttest/**/*.test.js" + "test2": "jest test/**/*.test.js" }, "repository": { "type": "git", diff --git a/test4/JSONToDate/JSONToDate.js b/test/JSONToDate/JSONToDate.js similarity index 100% rename from test4/JSONToDate/JSONToDate.js rename to test/JSONToDate/JSONToDate.js diff --git a/test/JSONToDate/JSONToDate.test.js b/test/JSONToDate/JSONToDate.test.js new file mode 100644 index 000000000..9e271ee0c --- /dev/null +++ b/test/JSONToDate/JSONToDate.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const JSONToDate = require('./JSONToDate.js'); + + + test('JSONToDate is a Function', () => { + expect(JSONToDate).toBeInstanceOf(Function); +}); + diff --git a/test4/JSONToFile/JSONToFile.js b/test/JSONToFile/JSONToFile.js similarity index 100% rename from test4/JSONToFile/JSONToFile.js rename to test/JSONToFile/JSONToFile.js diff --git a/test/JSONToFile/JSONToFile.test.js b/test/JSONToFile/JSONToFile.test.js new file mode 100644 index 000000000..cdec2fda6 --- /dev/null +++ b/test/JSONToFile/JSONToFile.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const JSONToFile = require('./JSONToFile.js'); + + + test('JSONToFile is a Function', () => { + expect(JSONToFile).toBeInstanceOf(Function); +}); + t.pass('Tested on 09/02/2018 by @chalarangelo'); + + diff --git a/test5/RGBToHex/RGBToHex.js b/test/RGBToHex/RGBToHex.js similarity index 100% rename from test5/RGBToHex/RGBToHex.js rename to test/RGBToHex/RGBToHex.js diff --git a/test/RGBToHex/RGBToHex.test.js b/test/RGBToHex/RGBToHex.test.js new file mode 100644 index 000000000..e290b6bb5 --- /dev/null +++ b/test/RGBToHex/RGBToHex.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const RGBToHex = require('./RGBToHex.js'); + + + test('RGBToHex is a Function', () => { + expect(RGBToHex).toBeInstanceOf(Function); +}); + t.equal(RGBToHex(255, 165, 1), 'ffa501', "Converts the values of RGB components to a color code."); + diff --git a/test6/URLJoin/URLJoin.js b/test/URLJoin/URLJoin.js similarity index 86% rename from test6/URLJoin/URLJoin.js rename to test/URLJoin/URLJoin.js index 0125c4ffa..5280f8ac7 100644 --- a/test6/URLJoin/URLJoin.js +++ b/test/URLJoin/URLJoin.js @@ -2,7 +2,7 @@ const URLJoin = (...args) => args .join('/') .replace(/[\/]+/g, '/') -.replace(/^(.+):\//, '$1://') +.replace(/^(.+):\ .replace(/^file:/, 'file:/') .replace(/\/(\?|&|#[^!])/g, '$1') .replace(/\?/g, '&') diff --git a/test/URLJoin/URLJoin.test.js b/test/URLJoin/URLJoin.test.js new file mode 100644 index 000000000..fd51c5c5b --- /dev/null +++ b/test/URLJoin/URLJoin.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const URLJoin = require('./URLJoin.js'); + + + test('URLJoin is a Function', () => { + expect(URLJoin).toBeInstanceOf(Function); +}); + t.equal(URLJoin('http: + t.equal(URLJoin('file: + + diff --git a/test6/UUIDGeneratorBrowser/UUIDGeneratorBrowser.js b/test/UUIDGeneratorBrowser/UUIDGeneratorBrowser.js similarity index 100% rename from test6/UUIDGeneratorBrowser/UUIDGeneratorBrowser.js rename to test/UUIDGeneratorBrowser/UUIDGeneratorBrowser.js diff --git a/test/UUIDGeneratorBrowser/UUIDGeneratorBrowser.test.js b/test/UUIDGeneratorBrowser/UUIDGeneratorBrowser.test.js new file mode 100644 index 000000000..cf2376860 --- /dev/null +++ b/test/UUIDGeneratorBrowser/UUIDGeneratorBrowser.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const UUIDGeneratorBrowser = require('./UUIDGeneratorBrowser.js'); + + + test('UUIDGeneratorBrowser is a Function', () => { + expect(UUIDGeneratorBrowser).toBeInstanceOf(Function); +}); + t.pass('Tested 09/02/2018 by @chalarangelo'); + + diff --git a/test6/UUIDGeneratorNode/UUIDGeneratorNode.js b/test/UUIDGeneratorNode/UUIDGeneratorNode.js similarity index 100% rename from test6/UUIDGeneratorNode/UUIDGeneratorNode.js rename to test/UUIDGeneratorNode/UUIDGeneratorNode.js diff --git a/test/UUIDGeneratorNode/UUIDGeneratorNode.test.js b/test/UUIDGeneratorNode/UUIDGeneratorNode.test.js new file mode 100644 index 000000000..85ebf8b53 --- /dev/null +++ b/test/UUIDGeneratorNode/UUIDGeneratorNode.test.js @@ -0,0 +1,14 @@ +const expect = require('expect'); +const UUIDGeneratorNode = require('./UUIDGeneratorNode.js'); + + + test('UUIDGeneratorNode is a Function', () => { + expect(UUIDGeneratorNode).toBeInstanceOf(Function); +}); + const uuid = UUIDGeneratorNode(); + t.deepEqual([uuid[8], uuid[13], uuid[18], uuid[23]], ['-', '-', '-', '-'], 'Contains dashes in the proper places'); + 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 b3b238577..9c07329df 100644 --- a/test/all/all.test.js +++ b/test/all/all.test.js @@ -1,16 +1,30 @@ const expect = require('expect'); const all = require('./all.js'); -test('Testing all', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof all === 'function').toBeTruthy(); +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 a5ae70981..083545c1e 100644 --- a/test/any/any.test.js +++ b/test/any/any.test.js @@ -1,13 +1,21 @@ const expect = require('expect'); const any = require('./any.js'); -test('Testing any', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof any === 'function').toBeTruthy(); +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 5e223172e..87272be4e 100644 --- a/test/approximatelyEqual/approximatelyEqual.test.js +++ b/test/approximatelyEqual/approximatelyEqual.test.js @@ -1,12 +1,21 @@ const expect = require('expect'); const approximatelyEqual = require('./approximatelyEqual.js'); -test('Testing approximatelyEqual', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof approximatelyEqual === 'function').toBeTruthy(); + + 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 005e1a472..33ad61cae 100644 --- a/test/arrayToHtmlList/arrayToHtmlList.test.js +++ b/test/arrayToHtmlList/arrayToHtmlList.test.js @@ -1,8 +1,10 @@ const expect = require('expect'); const arrayToHtmlList = require('./arrayToHtmlList.js'); -test('Testing arrayToHtmlList', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof arrayToHtmlList === 'function').toBeTruthy(); + + test('arrayToHtmlList is a Function', () => { + expect(arrayToHtmlList).toBeInstanceOf(Function); }); + t.pass('Tested by @chalarangelo on 16/02/2018'); + + diff --git a/test/ary/ary.test.js b/test/ary/ary.test.js index 66ca2da84..45ada26a6 100644 --- a/test/ary/ary.test.js +++ b/test/ary/ary.test.js @@ -1,10 +1,13 @@ const expect = require('expect'); const ary = require('./ary.js'); -test('Testing ary', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof ary === 'function').toBeTruthy(); - const firstTwoMax = ary(Math.max, 2); - expect([[2, 6, 'a'], [8, 4, 6], [10]].map(x => firstTwoMax(...x))).toEqual([6, 8, 10]); + + 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)), [6, 8, 10]).toEqual() +}); + + diff --git a/test/atob/atob.test.js b/test/atob/atob.test.js index 1ea997aed..4032a531a 100644 --- a/test/atob/atob.test.js +++ b/test/atob/atob.test.js @@ -1,10 +1,15 @@ const expect = require('expect'); const atob = require('./atob.js'); -test('Testing atob', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof atob === 'function').toBeTruthy(); - expect(atob('Zm9vYmFy')).toBe('foobar'); - expect(atob('Z')).toBe(''); + + test('atob is a Function', () => { + expect(atob).toBeInstanceOf(Function); }); + test('atob("Zm9vYmFy") equals "foobar"', () => { + expect(atob('Zm9vYmFy'), 'foobar').toBe() +}); + test('atob("Z") returns ""', () => { + expect(atob('Z'), '').toBe() +}); + + diff --git a/test/attempt/attempt.test.js b/test/attempt/attempt.test.js index 0e6b0d5b0..1bd0179da 100644 --- a/test/attempt/attempt.test.js +++ b/test/attempt/attempt.test.js @@ -1,10 +1,15 @@ const expect = require('expect'); const attempt = require('./attempt.js'); -test('Testing attempt', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof attempt === 'function').toBeTruthy(); - expect(attempt(() => 0)).toBe(0); + + test('attempt is a Function', () => { + expect(attempt).toBeInstanceOf(Function); +}); + test('Returns a value', () => { + expect(attempt(() => 0), 0).toBe() +}); + test('Returns an error', () => { expect(attempt(() => {throw new Error();}) instanceof Error).toBeTruthy(); }); + + diff --git a/test/average/average.test.js b/test/average/average.test.js index b07cc6380..039daaba6 100644 --- a/test/average/average.test.js +++ b/test/average/average.test.js @@ -1,23 +1,37 @@ const expect = require('expect'); const average = require('./average.js'); -test('Testing average', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof average === 'function').toBeTruthy(); + + 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(); - expect(average(9, 1)).toBe(5); - expect(average(153, 44, 55, 64, 71, 1122, 322774, 2232, 23423, 234, 3631)).toBe(32163.909090909092); - expect(average(1, 2, 3)).toBe(2); - expect(average(null)).toBe(0); +}); + 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'); + 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(); + 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(); -}); \ No newline at end of file +}); + diff --git a/test/averageBy/averageBy.test.js b/test/averageBy/averageBy.test.js index d1a1839c3..1176c7e65 100644 --- a/test/averageBy/averageBy.test.js +++ b/test/averageBy/averageBy.test.js @@ -1,10 +1,15 @@ const expect = require('expect'); const averageBy = require('./averageBy.js'); -test('Testing averageBy', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof averageBy === 'function').toBeTruthy(); - expect(averageBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], o => o.n)).toBe(5); - expect(averageBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], 'n')).toBe(5); + + 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), 5).toBe() +}); + test('Produces the right result with a property name', () => { + expect(averageBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], 'n'), 5).toBe() +}); + + diff --git a/test/bifurcate/bifurcate.test.js b/test/bifurcate/bifurcate.test.js index b8bbda4bf..c7707c710 100644 --- a/test/bifurcate/bifurcate.test.js +++ b/test/bifurcate/bifurcate.test.js @@ -1,9 +1,10 @@ const expect = require('expect'); const bifurcate = require('./bifurcate.js'); -test('Testing bifurcate', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof bifurcate === 'function').toBeTruthy(); - expect(bifurcate([ 'beep', 'boop', 'foo', 'bar' ], [ true, true, false, true ])).toEqual([ ['beep', 'boop', 'bar'], ['foo'] ]); + + test('bifurcate is a Function', () => { + expect(bifurcate).toBeInstanceOf(Function); }); + t.deepEqual(bifurcate([ 'beep', 'boop', 'foo', 'bar' ], [ true, true, false, true ]), [ ['beep', 'boop', 'bar'], ['foo'] ], 'Splits the collection into two groups'); + + diff --git a/test/bifurcateBy/bifurcateBy.test.js b/test/bifurcateBy/bifurcateBy.test.js index 2eebcb6e6..ca3864909 100644 --- a/test/bifurcateBy/bifurcateBy.test.js +++ b/test/bifurcateBy/bifurcateBy.test.js @@ -1,9 +1,10 @@ const expect = require('expect'); const bifurcateBy = require('./bifurcateBy.js'); -test('Testing bifurcateBy', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof bifurcateBy === 'function').toBeTruthy(); - expect(bifurcateBy([ 'beep', 'boop', 'foo', 'bar' ], x => x[0] === 'b')).toEqual([ ['beep', 'boop', 'bar'], ['foo'] ]); + + test('bifurcateBy is a Function', () => { + expect(bifurcateBy).toBeInstanceOf(Function); }); + t.deepEqual(bifurcateBy([ 'beep', 'boop', 'foo', 'bar' ], x => x[0] === 'b'), [ ['beep', 'boop', 'bar'], ['foo'] ], 'Splits the collection into two groups'); + + diff --git a/test/binarySearch/binarySearch.test.js b/test/binarySearch/binarySearch.test.js index 34620e797..7fcee6d01 100644 --- a/test/binarySearch/binarySearch.test.js +++ b/test/binarySearch/binarySearch.test.js @@ -1,13 +1,12 @@ const expect = require('expect'); const binarySearch = require('./binarySearch.js'); -test('Testing binarySearch', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof binarySearch === 'function').toBeTruthy(); - //t.deepEqual(binarySearch(args..), 'Expected'); - expect(binarySearch([1, 4, 6, 7, 12, 13, 15, 18, 19, 20, 22, 24], 6)).toBe(2); - expect(binarySearch([1, 4, 6, 7, 12, 13, 15, 18, 19, 20, 22, 24], 21)).toBe(-1); - expect(binarySearch([], 21)).toBe(-1); - expect(binarySearch([1], 1)).toBe(0); -}); \ No newline at end of file + + test('binarySearch is a Function', () => { + expect(binarySearch).toBeInstanceOf(Function); +}); + 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"); + diff --git a/test/bind/bind.test.js b/test/bind/bind.test.js index 552c40249..db56f2d50 100644 --- a/test/bind/bind.test.js +++ b/test/bind/bind.test.js @@ -1,14 +1,17 @@ const expect = require('expect'); const bind = require('./bind.js'); -test('Testing bind', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof bind === 'function').toBeTruthy(); + + 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); - expect(freddyBound('hi', '!')).toBe('hi fred!'); + test('Binds to an object context', () => { + expect(freddyBound('hi', '!'),'hi fred!').toBe() }); + + diff --git a/test/bindAll/bindAll.test.js b/test/bindAll/bindAll.test.js index 2d6a07c8d..0e2ddb66d 100644 --- a/test/bindAll/bindAll.test.js +++ b/test/bindAll/bindAll.test.js @@ -1,10 +1,10 @@ const expect = require('expect'); const bindAll = require('./bindAll.js'); -test('Testing bindAll', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof bindAll === 'function').toBeTruthy(); + + test('bindAll is a Function', () => { + expect(bindAll).toBeInstanceOf(Function); +}); var view = { label: 'docs', 'click': function() { @@ -12,5 +12,6 @@ test('Testing bindAll', () => { } }; bindAll(view, 'click'); - expect(view.click()).toBe('clicked docs'); -}); + t.equal(view.click(), 'clicked docs', 'Binds to an object context'); + + diff --git a/test/bindKey/bindKey.test.js b/test/bindKey/bindKey.test.js index b34d80dd3..d526a79f8 100644 --- a/test/bindKey/bindKey.test.js +++ b/test/bindKey/bindKey.test.js @@ -1,10 +1,10 @@ const expect = require('expect'); const bindKey = require('./bindKey.js'); -test('Testing bindKey', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof bindKey === 'function').toBeTruthy(); + + test('bindKey is a Function', () => { + expect(bindKey).toBeInstanceOf(Function); +}); const freddy = { user: 'fred', greet: function(greeting, punctuation) { @@ -12,5 +12,6 @@ test('Testing bindKey', () => { } }; const freddyBound = bindKey(freddy, 'greet'); - expect(freddyBound('hi', '!')).toBe('hi fred!'); -}); + t.equal(freddyBound('hi', '!'), 'hi fred!', 'Binds function to an object context'); + + diff --git a/test/binomialCoefficient/binomialCoefficient.test.js b/test/binomialCoefficient/binomialCoefficient.test.js index 2549bb0e8..74b9f5b2e 100644 --- a/test/binomialCoefficient/binomialCoefficient.test.js +++ b/test/binomialCoefficient/binomialCoefficient.test.js @@ -1,13 +1,18 @@ const expect = require('expect'); const binomialCoefficient = require('./binomialCoefficient.js'); -test('Testing binomialCoefficient', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof binomialCoefficient === 'function').toBeTruthy(); - expect(binomialCoefficient(8, 2)).toBe(28); - expect(binomialCoefficient(0, 0)).toBe(1); - expect(binomialCoefficient(5, 3)).toBe(10); + + test('binomialCoefficient is a Function', () => { + expect(binomialCoefficient).toBeInstanceOf(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'); + 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 ba92fa3de..f81b9b59a 100644 --- a/test/bottomVisible/bottomVisible.test.js +++ b/test/bottomVisible/bottomVisible.test.js @@ -1,8 +1,10 @@ const expect = require('expect'); const bottomVisible = require('./bottomVisible.js'); -test('Testing bottomVisible', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof bottomVisible === 'function').toBeTruthy(); + + test('bottomVisible is a Function', () => { + expect(bottomVisible).toBeInstanceOf(Function); }); + t.pass('Tested on 09/02/2018 by @chalarangelo'); + + diff --git a/test/btoa/btoa.test.js b/test/btoa/btoa.test.js index 6720da7bc..d0d97bb75 100644 --- a/test/btoa/btoa.test.js +++ b/test/btoa/btoa.test.js @@ -1,9 +1,12 @@ const expect = require('expect'); const btoa = require('./btoa.js'); -test('Testing btoa', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof btoa === 'function').toBeTruthy(); - expect(btoa('foobar')).toBe('Zm9vYmFy'); + + test('btoa is a Function', () => { + expect(btoa).toBeInstanceOf(Function); }); + test('btoa("foobar") equals "Zm9vYmFy"', () => { + expect(btoa('foobar'), 'Zm9vYmFy').toBe() +}); + + diff --git a/test/byteSize/byteSize.test.js b/test/byteSize/byteSize.test.js index f0cafd212..2e6bfee63 100644 --- a/test/byteSize/byteSize.test.js +++ b/test/byteSize/byteSize.test.js @@ -1,4 +1,4 @@ -import expect from 'expect'; +const expect = require('expect'); const Blob = class{ constructor(s) { return { @@ -6,14 +6,13 @@ const Blob = class{ }; } }; -// const byteSize = require('./byteSize.js'); -// Override const byteSize = str => new Blob([str]).size; -test('Testing byteSize', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof byteSize === 'function').toBeTruthy(); - expect(byteSize('a')).toBe(1); - expect(byteSize('Hello World')).toBe(11); - expect(byteSize('😀')).toBe(4); + + test('byteSize is a Function', () => { + expect(byteSize).toBeInstanceOf(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'); + + diff --git a/test/call/call.test.js b/test/call/call.test.js index 831054502..a4585ac22 100644 --- a/test/call/call.test.js +++ b/test/call/call.test.js @@ -1,10 +1,9 @@ const expect = require('expect'); const call = require('./call.js'); -test('Testing call', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof call === 'function').toBeTruthy(); - //t.deepEqual(call(args..), 'Expected'); + + test('call is a Function', () => { + expect(call).toBeInstanceOf(Function); +}); t.looseEqual(call('map', x => x * 2)([1, 2, 3]), [2, 4, 6], 'Calls function on given object'); -}); \ No newline at end of file + diff --git a/test/capitalize/capitalize.test.js b/test/capitalize/capitalize.test.js index 677d1198b..c031fedf2 100644 --- a/test/capitalize/capitalize.test.js +++ b/test/capitalize/capitalize.test.js @@ -1,12 +1,12 @@ const expect = require('expect'); const capitalize = require('./capitalize.js'); -test('Testing capitalize', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof capitalize === 'function').toBeTruthy(); - expect(capitalize('fooBar')).toBe('FooBar'); - expect(capitalize('fooBar', true)).toBe('Foobar'); - expect(capitalize('#!#', true)).toBe('#!#'); - expect(capitalize('a', true)).toBe('A'); -}); \ No newline at end of file + + test('capitalize is a Function', () => { + expect(capitalize).toBeInstanceOf(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"); + diff --git a/test/capitalizeEveryWord/capitalizeEveryWord.test.js b/test/capitalizeEveryWord/capitalizeEveryWord.test.js index 2f3482a35..7da925b9a 100644 --- a/test/capitalizeEveryWord/capitalizeEveryWord.test.js +++ b/test/capitalizeEveryWord/capitalizeEveryWord.test.js @@ -1,11 +1,11 @@ const expect = require('expect'); const capitalizeEveryWord = require('./capitalizeEveryWord.js'); -test('Testing capitalizeEveryWord', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof capitalizeEveryWord === 'function').toBeTruthy(); - expect(capitalizeEveryWord('hello world!')).toBe('Hello World!'); - expect(capitalizeEveryWord('$# @!')).toBe('$# @!'); - expect(capitalizeEveryWord('a')).toBe('A'); -}); \ No newline at end of file + + test('capitalizeEveryWord is a Function', () => { + expect(capitalizeEveryWord).toBeInstanceOf(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"); + diff --git a/test/castArray/castArray.test.js b/test/castArray/castArray.test.js index b66526e2f..5b849197c 100644 --- a/test/castArray/castArray.test.js +++ b/test/castArray/castArray.test.js @@ -1,13 +1,14 @@ const expect = require('expect'); const castArray = require('./castArray.js'); -test('Testing castArray', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof castArray === 'function').toBeTruthy(); - expect(castArray(1)).toEqual([1]); - expect(castArray([1])).toEqual([1]); - expect(castArray([1,2,3])).toEqual([1,2,3]); - expect(castArray('test')).toEqual(['test']); - expect(castArray({})).toEqual([{}]); + + test('castArray is a Function', () => { + expect(castArray).toBeInstanceOf(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'); + + diff --git a/test/chainAsync/chainAsync.test.js b/test/chainAsync/chainAsync.test.js index 1fa7bf1eb..43cd39c4f 100644 --- a/test/chainAsync/chainAsync.test.js +++ b/test/chainAsync/chainAsync.test.js @@ -1,10 +1,10 @@ const expect = require('expect'); const chainAsync = require('./chainAsync.js'); -test('Testing chainAsync', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof chainAsync === 'function').toBeTruthy(); + + test('chainAsync is a Function', () => { + expect(chainAsync).toBeInstanceOf(Function); +}); chainAsync([ next => { next(); @@ -14,6 +14,9 @@ test('Testing chainAsync', () => { next(); })(); }, - next => {} + next => { + t.pass("Calls all functions in an array"); + } ]); -}); + + diff --git a/test/chunk/chunk.test.js b/test/chunk/chunk.test.js index 18b6bf623..8db6625c8 100644 --- a/test/chunk/chunk.test.js +++ b/test/chunk/chunk.test.js @@ -1,21 +1,24 @@ const expect = require('expect'); const chunk = require('./chunk.js'); -test('Testing chunk', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof chunk === 'function').toBeTruthy(); - expect(chunk([1, 2, 3, 4, 5], 2)).toEqual([[1,2],[3,4],[5]]); - expect(chunk([])).toEqual([]); - expect(chunk(123)).toEqual([]); - expect(chunk({ a: 123})).toEqual([]); - expect(chunk('string', 2)).toEqual([ 'st', 'ri', 'ng' ]); - expect(() => chunk()).toThrow(); - expect(() => chunk(undefined)).toThrow(); - expect(() => chunk(null)).toThrow(); + + test('chunk is a Function', () => { + expect(chunk).toBeInstanceOf(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(); + 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 2ee01ebc7..9d4cd64b3 100644 --- a/test/clampNumber/clampNumber.test.js +++ b/test/clampNumber/clampNumber.test.js @@ -1,9 +1,9 @@ const expect = require('expect'); const clampNumber = require('./clampNumber.js'); -test('Testing clampNumber', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof clampNumber === 'function').toBeTruthy(); - expect(clampNumber(2, 3, 5)).toBe(3); -}); \ No newline at end of file + + test('clampNumber is a Function', () => { + expect(clampNumber).toBeInstanceOf(Function); +}); + t.equal(clampNumber(2, 3, 5), 3, "Clamps num within the inclusive range specified by the boundary values a and b"); + diff --git a/test/cleanObj/cleanObj.js b/test/cleanObj/cleanObj.js index 0d38b03f8..9e7573fb4 100644 --- a/test/cleanObj/cleanObj.js +++ b/test/cleanObj/cleanObj.js @@ -5,7 +5,7 @@ cleanObj(obj[key], keysToKeep, childIndicator); } else if (!keysToKeep.includes(key)) { delete obj[key]; } -}); + return obj; }; module.exports = cleanObj; \ No newline at end of file diff --git a/test/cleanObj/cleanObj.test.js b/test/cleanObj/cleanObj.test.js index 15ea30712..916281b31 100644 --- a/test/cleanObj/cleanObj.test.js +++ b/test/cleanObj/cleanObj.test.js @@ -1,10 +1,10 @@ const expect = require('expect'); const cleanObj = require('./cleanObj.js'); -test('Testing cleanObj', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof cleanObj === 'function').toBeTruthy(); + + test('cleanObj is a Function', () => { + expect(cleanObj).toBeInstanceOf(Function); +}); const testObj = { a: 1, b: 2, children: { a: 1, b: 2 } }; - expect(cleanObj(testObj, ['a'], 'children')).toEqual({ a: 1, children : { a: 1}}); -}); \ No newline at end of file + t.deepEqual(cleanObj(testObj, ['a'], 'children'), { a: 1, children : { a: 1}}, "Removes any properties except the ones specified from a JSON object"); + diff --git a/test/cloneRegExp/cloneRegExp.test.js b/test/cloneRegExp/cloneRegExp.test.js index 3a323061b..8f6e675c9 100644 --- a/test/cloneRegExp/cloneRegExp.test.js +++ b/test/cloneRegExp/cloneRegExp.test.js @@ -1,10 +1,11 @@ const expect = require('expect'); const cloneRegExp = require('./cloneRegExp.js'); -test('Testing cloneRegExp', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof cloneRegExp === 'function').toBeTruthy(); - const rgTest = /./g; - expect(cloneRegExp(rgTest)).not.toBe(rgTest); + + test('cloneRegExp is a Function', () => { + expect(cloneRegExp).toBeInstanceOf(Function); }); + const rgTest = /./g; + t.notEqual(cloneRegExp(rgTest), rgTest, 'Clones regular expressions properly'); + + diff --git a/test/coalesce/coalesce.test.js b/test/coalesce/coalesce.test.js index fb0876734..aacedc163 100644 --- a/test/coalesce/coalesce.test.js +++ b/test/coalesce/coalesce.test.js @@ -1,9 +1,9 @@ const expect = require('expect'); const coalesce = require('./coalesce.js'); -test('Testing coalesce', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof coalesce === 'function').toBeTruthy(); - expect(coalesce(null, undefined, '', NaN, 'Waldo')).toEqual(''); -}); \ No newline at end of file + + test('coalesce is a Function', () => { + expect(coalesce).toBeInstanceOf(Function); +}); + t.deepEqual(coalesce(null, undefined, '', NaN, 'Waldo'), '', "Returns the first non-null/undefined argument"); + diff --git a/test/coalesceFactory/coalesceFactory.test.js b/test/coalesceFactory/coalesceFactory.test.js index 74cd3b817..f6645b692 100644 --- a/test/coalesceFactory/coalesceFactory.test.js +++ b/test/coalesceFactory/coalesceFactory.test.js @@ -1,10 +1,10 @@ const expect = require('expect'); const coalesceFactory = require('./coalesceFactory.js'); -test('Testing coalesceFactory', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof coalesceFactory === 'function').toBeTruthy(); + + test('coalesceFactory is a Function', () => { + expect(coalesceFactory).toBeInstanceOf(Function); +}); const customCoalesce = coalesceFactory(_ => ![null, undefined, '', NaN].includes(_)); - expect(customCoalesce(undefined, null, NaN, '', 'Waldo')).toEqual('Waldo'); -}); \ No newline at end of file + t.deepEqual(customCoalesce(undefined, null, NaN, '', 'Waldo'), 'Waldo', "Returns a customized coalesce function"); + diff --git a/test/collatz/collatz.test.js b/test/collatz/collatz.test.js index 3163ac75c..fa2b6ed25 100644 --- a/test/collatz/collatz.test.js +++ b/test/collatz/collatz.test.js @@ -1,19 +1,20 @@ const expect = require('expect'); const collatz = require('./collatz.js'); -test('Testing collatz', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof collatz === 'function').toBeTruthy(); - //t.deepEqual(collatz(args..), 'Expected'); - expect(collatz(8)).toBe(4); - expect(collatz(9)).toBe(28); + + test('collatz is a Function', () => { + expect(collatz).toBeInstanceOf(Function); +}); + 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'); let n = 9; while(true){ if (n === 1){ + t.pass('Eventually reaches 1'); break; } n = collatz(n); } -}); + + diff --git a/test/collectInto/collectInto.test.js b/test/collectInto/collectInto.test.js index ecfc30293..30e358c50 100644 --- a/test/collectInto/collectInto.test.js +++ b/test/collectInto/collectInto.test.js @@ -1,13 +1,14 @@ const expect = require('expect'); const collectInto = require('./collectInto.js'); -test('Testing collectInto', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof collectInto === 'function').toBeTruthy(); + + 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)); - Pall(p1, p2, p3).then(function(val){ expect(val).toEqual([1,2,3]);}, function(reason){}); -}); + Pall(p1, p2, p3).then(function(val){ t.deepEqual(val, [1,2,3], 'Works with multiple promises');}, function(reason){ + + diff --git a/test/colorize/colorize.js b/test/colorize/colorize.js index 7c8fe1846..1322cc934 100644 --- a/test/colorize/colorize.js +++ b/test/colorize/colorize.js @@ -15,5 +15,5 @@ bgBlue: `\x1b[44m${args.join(' ')}\x1b[0m`, bgMagenta: `\x1b[45m${args.join(' ')}\x1b[0m`, bgCyan: `\x1b[46m${args.join(' ')}\x1b[0m`, bgWhite: `\x1b[47m${args.join(' ')}\x1b[0m` -}); + module.exports = colorize; \ No newline at end of file diff --git a/test/colorize/colorize.test.js b/test/colorize/colorize.test.js index 85def3607..b708096d8 100644 --- a/test/colorize/colorize.test.js +++ b/test/colorize/colorize.test.js @@ -1,8 +1,10 @@ const expect = require('expect'); const colorize = require('./colorize.js'); -test('Testing colorize', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof colorize === 'function').toBeTruthy(); + + test('colorize is a Function', () => { + expect(colorize).toBeInstanceOf(Function); }); + t.pass('Tested on 09/02/2018 by @chalarangelo'); + + diff --git a/test/compact/compact.test.js b/test/compact/compact.test.js index f3a4af122..087340a4c 100644 --- a/test/compact/compact.test.js +++ b/test/compact/compact.test.js @@ -1,9 +1,9 @@ const expect = require('expect'); const compact = require('./compact.js'); -test('Testing compact', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof compact === 'function').toBeTruthy(); - expect(compact([0, 1, false, 2, '', 3, 'a', 'e' * 23, NaN, 's', 34])).toEqual([ 1, 2, 3, 'a', 's', 34 ]); -}); \ No newline at end of file + + test('compact is a Function', () => { + expect(compact).toBeInstanceOf(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"); + diff --git a/test/compose/compose.test.js b/test/compose/compose.test.js index b8788829b..b5332a0be 100644 --- a/test/compose/compose.test.js +++ b/test/compose/compose.test.js @@ -1,12 +1,12 @@ const expect = require('expect'); const compose = require('./compose.js'); -test('Testing compose', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof compose === 'function').toBeTruthy(); + + 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); - expect(multiplyAndAdd5(5, 2)).toBe(15); -}); \ No newline at end of file + t.equal(multiplyAndAdd5(5, 2), 15, "Performs right-to-left function composition"); + diff --git a/test/composeRight/composeRight.test.js b/test/composeRight/composeRight.test.js index bf6ff5ed9..f24024bdd 100644 --- a/test/composeRight/composeRight.test.js +++ b/test/composeRight/composeRight.test.js @@ -1,12 +1,13 @@ const expect = require('expect'); const composeRight = require('./composeRight.js'); -test('Testing composeRight', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof composeRight === 'function').toBeTruthy(); + + 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); - expect(addAndSquare(1, 2)).toBe(9); -}); + t.equal(addAndSquare(1, 2), 9, "Performs left-to-right function composition"); + + diff --git a/test/converge/converge.test.js b/test/converge/converge.test.js index d066c0937..34c71906d 100644 --- a/test/converge/converge.test.js +++ b/test/converge/converge.test.js @@ -1,18 +1,19 @@ const expect = require('expect'); const converge = require('./converge.js'); -test('Testing converge', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof converge === 'function').toBeTruthy(); + + 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, ]); - expect(average([1, 2, 3, 4, 5, 6, 7])).toBe(4); + 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()] ); - expect(strangeConcat('Yodel')).toBe("YODELyodel"); -}); + t.equal(strangeConcat('Yodel'), "YODELyodel", 'Produces the strange concatenation'); + + diff --git a/test/copyToClipboard/copyToClipboard.test.js b/test/copyToClipboard/copyToClipboard.test.js index 3dbcdf2db..9344d6296 100644 --- a/test/copyToClipboard/copyToClipboard.test.js +++ b/test/copyToClipboard/copyToClipboard.test.js @@ -1,8 +1,10 @@ const expect = require('expect'); const copyToClipboard = require('./copyToClipboard.js'); -test('Testing copyToClipboard', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof copyToClipboard === 'function').toBeTruthy(); + + test('copyToClipboard is a Function', () => { + expect(copyToClipboard).toBeInstanceOf(Function); }); + t.pass('Tested on 09/02/2018 by @chalarangelo'); + + diff --git a/test/countBy/countBy.js b/test/countBy/countBy.js index 256070afb..c75f9fd51 100644 --- a/test/countBy/countBy.js +++ b/test/countBy/countBy.js @@ -2,5 +2,5 @@ const countBy = (arr, fn) => arr.map(typeof fn === 'function' ? fn : val => val[fn]).reduce((acc, val, i) => { acc[val] = (acc[val] || 0) + 1; return acc; -}, {}); +}, { module.exports = countBy; \ No newline at end of file diff --git a/test/countBy/countBy.test.js b/test/countBy/countBy.test.js index 87b969afa..c73ffa3ac 100644 --- a/test/countBy/countBy.test.js +++ b/test/countBy/countBy.test.js @@ -1,10 +1,11 @@ const expect = require('expect'); const countBy = require('./countBy.js'); -test('Testing countBy', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof countBy === 'function').toBeTruthy(); - expect(countBy([6.1, 4.2, 6.3], Math.floor)).toEqual({4: 1, 6: 2}); - expect(countBy(['one', 'two', 'three'], 'length')).toEqual({3: 2, 5: 1}); + + test('countBy is a Function', () => { + expect(countBy).toBeInstanceOf(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'); + + diff --git a/test/countOccurrences/countOccurrences.test.js b/test/countOccurrences/countOccurrences.test.js index 518b29888..1b43f1be8 100644 --- a/test/countOccurrences/countOccurrences.test.js +++ b/test/countOccurrences/countOccurrences.test.js @@ -1,9 +1,9 @@ const expect = require('expect'); const countOccurrences = require('./countOccurrences.js'); -test('Testing countOccurrences', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof countOccurrences === 'function').toBeTruthy(); - expect(countOccurrences([1, 1, 2, 1, 2, 3], 1)).toEqual(3); -}); \ No newline at end of file + + test('countOccurrences is a Function', () => { + expect(countOccurrences).toBeInstanceOf(Function); +}); + t.deepEqual(countOccurrences([1, 1, 2, 1, 2, 3], 1), 3, "Counts the occurrences of a value in an array"); + diff --git a/test/countVowels/countVowels.test.js b/test/countVowels/countVowels.test.js index f631109ec..dc5fc72a7 100644 --- a/test/countVowels/countVowels.test.js +++ b/test/countVowels/countVowels.test.js @@ -1,8 +1,8 @@ const expect = require('expect'); const countVowels = require('./countVowels.js'); -test('Testing countVowels', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof countVowels === 'function').toBeTruthy(); -}); \ 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 93c889ed4..d7a7e4e91 100644 --- a/test/counter/counter.test.js +++ b/test/counter/counter.test.js @@ -1,8 +1,8 @@ const expect = require('expect'); const counter = require('./counter.js'); -test('Testing counter', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof counter === 'function').toBeTruthy(); -}); \ 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 f8dadcc16..2ad5a2124 100644 --- a/test/createElement/createElement.test.js +++ b/test/createElement/createElement.test.js @@ -1,8 +1,10 @@ const expect = require('expect'); const createElement = require('./createElement.js'); -test('Testing createElement', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof createElement === 'function').toBeTruthy(); + + test('createElement is a Function', () => { + expect(createElement).toBeInstanceOf(Function); }); + t.pass('Tested by @chalarangelo on 16/02/2018'); + + diff --git a/test/createEventHub/createEventHub.js b/test/createEventHub/createEventHub.js index 949f8fbc0..d219a0815 100644 --- a/test/createEventHub/createEventHub.js +++ b/test/createEventHub/createEventHub.js @@ -11,5 +11,5 @@ off(event, handler) { const i = (this.hub[event] || []).findIndex(h => h === handler); if (i > -1) this.hub[event].splice(i, 1); } -}); + module.exports = createEventHub; \ No newline at end of file diff --git a/test/createEventHub/createEventHub.test.js b/test/createEventHub/createEventHub.test.js index 4991ebaca..179f2c7c1 100644 --- a/test/createEventHub/createEventHub.test.js +++ b/test/createEventHub/createEventHub.test.js @@ -1,8 +1,10 @@ const expect = require('expect'); const createEventHub = require('./createEventHub.js'); -test('Testing createEventHub', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof createEventHub === 'function').toBeTruthy(); + + test('createEventHub is a Function', () => { + expect(createEventHub).toBeInstanceOf(Function); }); + t.pass('Tested by @chalarangelo on 16/02/2018'); + + diff --git a/test/currentURL/currentURL.test.js b/test/currentURL/currentURL.test.js index 52aeb37b3..8344c7163 100644 --- a/test/currentURL/currentURL.test.js +++ b/test/currentURL/currentURL.test.js @@ -1,8 +1,10 @@ const expect = require('expect'); const currentURL = require('./currentURL.js'); -test('Testing currentURL', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof currentURL === 'function').toBeTruthy(); + + test('currentURL is a Function', () => { + expect(currentURL).toBeInstanceOf(Function); }); + t.pass('Tested by @chalarangelo on 16/02/2018'); + + diff --git a/test/curry/curry.test.js b/test/curry/curry.test.js index b2f8cae8a..f97b6a260 100644 --- a/test/curry/curry.test.js +++ b/test/curry/curry.test.js @@ -1,10 +1,10 @@ const expect = require('expect'); const curry = require('./curry.js'); -test('Testing curry', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof curry === 'function').toBeTruthy(); - expect(curry(Math.pow)(2)(10)).toBe(1024); - expect(curry(Math.min, 3)(10)(50)(2)).toBe(2); -}); \ No newline at end of file + + test('curry is a Function', () => { + expect(curry).toBeInstanceOf(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"); + diff --git a/test/debounce/debounce.test.js b/test/debounce/debounce.test.js index 88d9c3b75..81e49d2bd 100644 --- a/test/debounce/debounce.test.js +++ b/test/debounce/debounce.test.js @@ -1,9 +1,10 @@ const expect = require('expect'); const debounce = require('./debounce.js'); -test('Testing debounce', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof debounce === 'function').toBeTruthy(); - debounce(() => {}, 250); + + test('debounce is a Function', () => { + expect(debounce).toBeInstanceOf(Function); }); + debounce(() => {t.pass('Works as expected');}, 250); + + diff --git a/test/decapitalize/decapitalize.test.js b/test/decapitalize/decapitalize.test.js index b600ace89..5adbd21a1 100644 --- a/test/decapitalize/decapitalize.test.js +++ b/test/decapitalize/decapitalize.test.js @@ -1,10 +1,11 @@ const expect = require('expect'); const decapitalize = require('./decapitalize.js'); -test('Testing decapitalize', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof decapitalize === 'function').toBeTruthy(); - expect(decapitalize('FooBar')).toBe('fooBar'); - expect(decapitalize('FooBar', true)).toBe('fOOBAR'); + + test('decapitalize is a Function', () => { + expect(decapitalize).toBeInstanceOf(Function); }); + t.equal(decapitalize('FooBar'), 'fooBar', 'Works with default parameter'); + t.equal(decapitalize('FooBar', true), 'fOOBAR', 'Works with second parameter set to true'); + + diff --git a/test/deepClone/deepClone.test.js b/test/deepClone/deepClone.test.js index dca7e3a64..8996449eb 100644 --- a/test/deepClone/deepClone.test.js +++ b/test/deepClone/deepClone.test.js @@ -1,16 +1,17 @@ const expect = require('expect'); const deepClone = require('./deepClone.js'); -test('Testing deepClone', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof deepClone === 'function').toBeTruthy(); + + 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); - expect(a).not.toBe(b); - expect(a.obj).not.toBe(b.obj); - expect(c).not.toBe(d); - expect(c[0]).not.toBe(d[0]); -}); + 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"); + + diff --git a/test/deepFlatten/deepFlatten.test.js b/test/deepFlatten/deepFlatten.test.js index 2d57901e4..fa77ac6a7 100644 --- a/test/deepFlatten/deepFlatten.test.js +++ b/test/deepFlatten/deepFlatten.test.js @@ -1,9 +1,9 @@ const expect = require('expect'); const deepFlatten = require('./deepFlatten.js'); -test('Testing deepFlatten', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof deepFlatten === 'function').toBeTruthy(); - expect(deepFlatten([1, [2], [[3], 4], 5])).toEqual([1, 2, 3, 4, 5]); -}); \ No newline at end of file + + test('deepFlatten is a Function', () => { + expect(deepFlatten).toBeInstanceOf(Function); +}); + t.deepEqual(deepFlatten([1, [2], [[3], 4], 5]), [1, 2, 3, 4, 5], "Deep flattens an array"); + diff --git a/test2/defaults/defaults.js b/test/defaults/defaults.js similarity index 100% rename from test2/defaults/defaults.js rename to test/defaults/defaults.js diff --git a/test/defaults/defaults.test.js b/test/defaults/defaults.test.js new file mode 100644 index 000000000..41e3224aa --- /dev/null +++ b/test/defaults/defaults.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const defaults = require('./defaults.js'); + + + test('defaults is a Function', () => { + expect(defaults).toBeInstanceOf(Function); +}); + t.deepEqual(defaults({ a: 1 }, { b: 2 }, { b: 6 }, { a: 3 }), { a: 1, b: 2 }, 'Assigns default values for undefined properties'); + + diff --git a/test2/defer/defer.js b/test/defer/defer.js similarity index 100% rename from test2/defer/defer.js rename to test/defer/defer.js diff --git a/test/defer/defer.test.js b/test/defer/defer.test.js new file mode 100644 index 000000000..1e05fdb09 --- /dev/null +++ b/test/defer/defer.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const defer = require('./defer.js'); + + + test('defer is a Function', () => { + expect(defer).toBeInstanceOf(Function); +}); + t.pass('Tested by @chalarangelo on 16/02/2018'); + + diff --git a/test2/degreesToRads/degreesToRads.js b/test/degreesToRads/degreesToRads.js similarity index 100% rename from test2/degreesToRads/degreesToRads.js rename to test/degreesToRads/degreesToRads.js diff --git a/test/degreesToRads/degreesToRads.test.js b/test/degreesToRads/degreesToRads.test.js new file mode 100644 index 000000000..a434d4bbd --- /dev/null +++ b/test/degreesToRads/degreesToRads.test.js @@ -0,0 +1,13 @@ +const expect = require('expect'); +const degreesToRads = require('./degreesToRads.js'); + + + 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(approxeq(degreesToRads(90.0), Math.PI / 2)).toBeTruthy(); +}); + + diff --git a/test2/delay/delay.js b/test/delay/delay.js similarity index 100% rename from test2/delay/delay.js rename to test/delay/delay.js diff --git a/test/delay/delay.test.js b/test/delay/delay.test.js new file mode 100644 index 000000000..afe547b5f --- /dev/null +++ b/test/delay/delay.test.js @@ -0,0 +1,18 @@ +const expect = require('expect'); +const delay = require('./delay.js'); + + + test('delay is a Function', () => { + expect(delay).toBeInstanceOf(Function); +}); + delay( + function(text) { + test('Works as expecting, passing arguments properly', () => { + expect(text, 'test').toBe() +}); + }, + 1000, + 'test' + ); + + diff --git a/test2/detectDeviceType/detectDeviceType.js b/test/detectDeviceType/detectDeviceType.js similarity index 100% rename from test2/detectDeviceType/detectDeviceType.js rename to test/detectDeviceType/detectDeviceType.js diff --git a/test/detectDeviceType/detectDeviceType.test.js b/test/detectDeviceType/detectDeviceType.test.js new file mode 100644 index 000000000..55f89c2e1 --- /dev/null +++ b/test/detectDeviceType/detectDeviceType.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const detectDeviceType = require('./detectDeviceType.js'); + + + test('detectDeviceType is a Function', () => { + expect(detectDeviceType).toBeInstanceOf(Function); +}); + t.pass('Tested on 09/02/2018 by @chalarangelo'); + + diff --git a/test2/difference/difference.js b/test/difference/difference.js similarity index 100% rename from test2/difference/difference.js rename to test/difference/difference.js diff --git a/test/difference/difference.test.js b/test/difference/difference.test.js new file mode 100644 index 000000000..6062511a3 --- /dev/null +++ b/test/difference/difference.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const difference = require('./difference.js'); + + + test('difference is a Function', () => { + expect(difference).toBeInstanceOf(Function); +}); + t.deepEqual(difference([1, 2, 3], [1, 2, 4]), [3], "Returns the difference between two arrays"); + diff --git a/test2/differenceBy/differenceBy.js b/test/differenceBy/differenceBy.js similarity index 100% rename from test2/differenceBy/differenceBy.js rename to test/differenceBy/differenceBy.js diff --git a/test/differenceBy/differenceBy.test.js b/test/differenceBy/differenceBy.test.js new file mode 100644 index 000000000..dc25227a6 --- /dev/null +++ b/test/differenceBy/differenceBy.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const differenceBy = require('./differenceBy.js'); + + + test('differenceBy is a Function', () => { + expect(differenceBy).toBeInstanceOf(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'); + + diff --git a/test2/differenceWith/differenceWith.js b/test/differenceWith/differenceWith.js similarity index 100% rename from test2/differenceWith/differenceWith.js rename to test/differenceWith/differenceWith.js diff --git a/test/differenceWith/differenceWith.test.js b/test/differenceWith/differenceWith.test.js new file mode 100644 index 000000000..2d840b5bf --- /dev/null +++ b/test/differenceWith/differenceWith.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const differenceWith = require('./differenceWith.js'); + + + test('differenceWith is a Function', () => { + expect(differenceWith).toBeInstanceOf(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"); + diff --git a/test2/digitize/digitize.js b/test/digitize/digitize.js similarity index 100% rename from test2/digitize/digitize.js rename to test/digitize/digitize.js diff --git a/test/digitize/digitize.test.js b/test/digitize/digitize.test.js new file mode 100644 index 000000000..27ef11539 --- /dev/null +++ b/test/digitize/digitize.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const digitize = require('./digitize.js'); + + + test('digitize is a Function', () => { + expect(digitize).toBeInstanceOf(Function); +}); + t.deepEqual(digitize(123), [1, 2, 3], "Converts a number to an array of digits"); + diff --git a/test2/distance/distance.js b/test/distance/distance.js similarity index 100% rename from test2/distance/distance.js rename to test/distance/distance.js diff --git a/test/distance/distance.test.js b/test/distance/distance.test.js new file mode 100644 index 000000000..769d128c2 --- /dev/null +++ b/test/distance/distance.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const distance = require('./distance.js'); + + + test('distance is a Function', () => { + expect(distance).toBeInstanceOf(Function); +}); + test('Calculates the distance between two points', () => { + expect(distance(1, 1, 2, 3), 2.23606797749979).toBe() +}); + + diff --git a/test2/drop/drop.js b/test/drop/drop.js similarity index 100% rename from test2/drop/drop.js rename to test/drop/drop.js diff --git a/test/drop/drop.test.js b/test/drop/drop.test.js new file mode 100644 index 000000000..679f96926 --- /dev/null +++ b/test/drop/drop.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const drop = require('./drop.js'); + + + test('drop is a Function', () => { + expect(drop).toBeInstanceOf(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'); + + diff --git a/test2/dropRight/dropRight.js b/test/dropRight/dropRight.js similarity index 100% rename from test2/dropRight/dropRight.js rename to test/dropRight/dropRight.js diff --git a/test/dropRight/dropRight.test.js b/test/dropRight/dropRight.test.js new file mode 100644 index 000000000..e5d4523ec --- /dev/null +++ b/test/dropRight/dropRight.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const dropRight = require('./dropRight.js'); + + + test('dropRight is a Function', () => { + expect(dropRight).toBeInstanceOf(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"); + diff --git a/test2/dropRightWhile/dropRightWhile.js b/test/dropRightWhile/dropRightWhile.js similarity index 100% rename from test2/dropRightWhile/dropRightWhile.js rename to test/dropRightWhile/dropRightWhile.js diff --git a/test/dropRightWhile/dropRightWhile.test.js b/test/dropRightWhile/dropRightWhile.test.js new file mode 100644 index 000000000..b59d5d0e3 --- /dev/null +++ b/test/dropRightWhile/dropRightWhile.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const dropRightWhile = require('./dropRightWhile.js'); + + + test('dropRightWhile is a Function', () => { + expect(dropRightWhile).toBeInstanceOf(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.'); + + diff --git a/test2/dropWhile/dropWhile.js b/test/dropWhile/dropWhile.js similarity index 100% rename from test2/dropWhile/dropWhile.js rename to test/dropWhile/dropWhile.js diff --git a/test/dropWhile/dropWhile.test.js b/test/dropWhile/dropWhile.test.js new file mode 100644 index 000000000..380a55d10 --- /dev/null +++ b/test/dropWhile/dropWhile.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const dropWhile = require('./dropWhile.js'); + + + test('dropWhile is a Function', () => { + expect(dropWhile).toBeInstanceOf(Function); +}); + t.deepEqual(dropWhile([1, 2, 3, 4], n => n >= 3), [3,4], 'Removes elements in an array until the passed function returns true.'); + + diff --git a/test2/elementIsVisibleInViewport/elementIsVisibleInViewport.js b/test/elementIsVisibleInViewport/elementIsVisibleInViewport.js similarity index 100% rename from test2/elementIsVisibleInViewport/elementIsVisibleInViewport.js rename to test/elementIsVisibleInViewport/elementIsVisibleInViewport.js diff --git a/test/elementIsVisibleInViewport/elementIsVisibleInViewport.test.js b/test/elementIsVisibleInViewport/elementIsVisibleInViewport.test.js new file mode 100644 index 000000000..0970f53cf --- /dev/null +++ b/test/elementIsVisibleInViewport/elementIsVisibleInViewport.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const elementIsVisibleInViewport = require('./elementIsVisibleInViewport.js'); + + + test('elementIsVisibleInViewport is a Function', () => { + expect(elementIsVisibleInViewport).toBeInstanceOf(Function); +}); + t.pass('Tested on 09/02/2018 by @chalarangelo'); + + diff --git a/test2/elo/elo.js b/test/elo/elo.js similarity index 100% rename from test2/elo/elo.js rename to test/elo/elo.js diff --git a/test/elo/elo.test.js b/test/elo/elo.test.js new file mode 100644 index 000000000..28aaf5c5c --- /dev/null +++ b/test/elo/elo.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const elo = require('./elo.js'); + + + test('elo is a Function', () => { + expect(elo).toBeInstanceOf(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"); + diff --git a/test2/equals/equals.js b/test/equals/equals.js similarity index 100% rename from test2/equals/equals.js rename to test/equals/equals.js diff --git a/test/equals/equals.test.js b/test/equals/equals.test.js new file mode 100644 index 000000000..4cdb12e39 --- /dev/null +++ b/test/equals/equals.test.js @@ -0,0 +1,22 @@ +const expect = require('expect'); +const equals = require('./equals.js'); + + + test('equals is a Function', () => { + expect(equals).toBeInstanceOf(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' }"); + 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/test2/escapeHTML/escapeHTML.js b/test/escapeHTML/escapeHTML.js similarity index 100% rename from test2/escapeHTML/escapeHTML.js rename to test/escapeHTML/escapeHTML.js diff --git a/test/escapeHTML/escapeHTML.test.js b/test/escapeHTML/escapeHTML.test.js new file mode 100644 index 000000000..8d280f42e --- /dev/null +++ b/test/escapeHTML/escapeHTML.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const escapeHTML = require('./escapeHTML.js'); + + + test('escapeHTML is a Function', () => { + expect(escapeHTML).toBeInstanceOf(Function); +}); + t.equal(escapeHTML('Me & you'), '<a href="#">Me & you</a>', "Escapes a string for use in HTML"); + diff --git a/test2/escapeRegExp/escapeRegExp.js b/test/escapeRegExp/escapeRegExp.js similarity index 100% rename from test2/escapeRegExp/escapeRegExp.js rename to test/escapeRegExp/escapeRegExp.js diff --git a/test/escapeRegExp/escapeRegExp.test.js b/test/escapeRegExp/escapeRegExp.test.js new file mode 100644 index 000000000..a39ebd21e --- /dev/null +++ b/test/escapeRegExp/escapeRegExp.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const escapeRegExp = require('./escapeRegExp.js'); + + + test('escapeRegExp is a Function', () => { + expect(escapeRegExp).toBeInstanceOf(Function); +}); + t.equal(escapeRegExp('(test)'), '\\(test\\)', "Escapes a string to use in a regular expression"); + diff --git a/test2/everyNth/everyNth.js b/test/everyNth/everyNth.js similarity index 100% rename from test2/everyNth/everyNth.js rename to test/everyNth/everyNth.js diff --git a/test/everyNth/everyNth.test.js b/test/everyNth/everyNth.test.js new file mode 100644 index 000000000..4bc7aabea --- /dev/null +++ b/test/everyNth/everyNth.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const everyNth = require('./everyNth.js'); + + + test('everyNth is a Function', () => { + expect(everyNth).toBeInstanceOf(Function); +}); + t.deepEqual(everyNth([1, 2, 3, 4, 5, 6], 2), [ 2, 4, 6 ], "Returns every nth element in an array"); + diff --git a/test2/extendHex/extendHex.js b/test/extendHex/extendHex.js similarity index 100% rename from test2/extendHex/extendHex.js rename to test/extendHex/extendHex.js diff --git a/test/extendHex/extendHex.test.js b/test/extendHex/extendHex.test.js new file mode 100644 index 000000000..798dee0e6 --- /dev/null +++ b/test/extendHex/extendHex.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const extendHex = require('./extendHex.js'); + + + test('extendHex is a Function', () => { + expect(extendHex).toBeInstanceOf(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"); + diff --git a/test2/factorial/factorial.js b/test/factorial/factorial.js similarity index 100% rename from test2/factorial/factorial.js rename to test/factorial/factorial.js diff --git a/test/factorial/factorial.test.js b/test/factorial/factorial.test.js new file mode 100644 index 000000000..7bf338a83 --- /dev/null +++ b/test/factorial/factorial.test.js @@ -0,0 +1,13 @@ +const expect = require('expect'); +const factorial = require('./factorial.js'); + + + test('factorial is a Function', () => { + expect(factorial).toBeInstanceOf(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"); + diff --git a/test2/factors/factors.js b/test/factors/factors.js similarity index 100% rename from test2/factors/factors.js rename to test/factors/factors.js diff --git a/test/factors/factors.test.js b/test/factors/factors.test.js new file mode 100644 index 000000000..f25d0073a --- /dev/null +++ b/test/factors/factors.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const factors = require('./factors.js'); + + + test('factors is a Function', () => { + expect(factors).toBeInstanceOf(Function); +}); + diff --git a/test2/fibonacci/fibonacci.js b/test/fibonacci/fibonacci.js similarity index 100% rename from test2/fibonacci/fibonacci.js rename to test/fibonacci/fibonacci.js diff --git a/test/fibonacci/fibonacci.test.js b/test/fibonacci/fibonacci.test.js new file mode 100644 index 000000000..6db435ec9 --- /dev/null +++ b/test/fibonacci/fibonacci.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const fibonacci = require('./fibonacci.js'); + + + test('fibonacci is a Function', () => { + expect(fibonacci).toBeInstanceOf(Function); +}); + t.deepEqual(fibonacci(6), [0, 1, 1, 2, 3, 5], "Generates an array, containing the Fibonacci sequence"); + diff --git a/test2/fibonacciCountUntilNum/fibonacciCountUntilNum.js b/test/fibonacciCountUntilNum/fibonacciCountUntilNum.js similarity index 100% rename from test2/fibonacciCountUntilNum/fibonacciCountUntilNum.js rename to test/fibonacciCountUntilNum/fibonacciCountUntilNum.js diff --git a/test/fibonacciCountUntilNum/fibonacciCountUntilNum.test.js b/test/fibonacciCountUntilNum/fibonacciCountUntilNum.test.js new file mode 100644 index 000000000..015094d79 --- /dev/null +++ b/test/fibonacciCountUntilNum/fibonacciCountUntilNum.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const fibonacciCountUntilNum = require('./fibonacciCountUntilNum.js'); + + + test('fibonacciCountUntilNum is a Function', () => { + expect(fibonacciCountUntilNum).toBeInstanceOf(Function); +}); + diff --git a/test2/fibonacciUntilNum/fibonacciUntilNum.js b/test/fibonacciUntilNum/fibonacciUntilNum.js similarity index 100% rename from test2/fibonacciUntilNum/fibonacciUntilNum.js rename to test/fibonacciUntilNum/fibonacciUntilNum.js diff --git a/test/fibonacciUntilNum/fibonacciUntilNum.test.js b/test/fibonacciUntilNum/fibonacciUntilNum.test.js new file mode 100644 index 000000000..7ad0c0649 --- /dev/null +++ b/test/fibonacciUntilNum/fibonacciUntilNum.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const fibonacciUntilNum = require('./fibonacciUntilNum.js'); + + + test('fibonacciUntilNum is a Function', () => { + expect(fibonacciUntilNum).toBeInstanceOf(Function); +}); + diff --git a/test2/filterNonUnique/filterNonUnique.js b/test/filterNonUnique/filterNonUnique.js similarity index 100% rename from test2/filterNonUnique/filterNonUnique.js rename to test/filterNonUnique/filterNonUnique.js diff --git a/test/filterNonUnique/filterNonUnique.test.js b/test/filterNonUnique/filterNonUnique.test.js new file mode 100644 index 000000000..003c26e07 --- /dev/null +++ b/test/filterNonUnique/filterNonUnique.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const filterNonUnique = require('./filterNonUnique.js'); + + + test('filterNonUnique is a Function', () => { + expect(filterNonUnique).toBeInstanceOf(Function); +}); + t.deepEqual(filterNonUnique([1, 2, 2, 3, 4, 4, 5]), [1,3,5], "Filters out the non-unique values in an array"); + diff --git a/test2/findKey/findKey.js b/test/findKey/findKey.js similarity index 100% rename from test2/findKey/findKey.js rename to test/findKey/findKey.js diff --git a/test/findKey/findKey.test.js b/test/findKey/findKey.test.js new file mode 100644 index 000000000..44fe47811 --- /dev/null +++ b/test/findKey/findKey.test.js @@ -0,0 +1,17 @@ +const expect = require('expect'); +const findKey = require('./findKey.js'); + + + test('findKey is a Function', () => { + expect(findKey).toBeInstanceOf(Function); +}); + t.deepEqual(findKey( + { + barney: { age: 36, active: true }, + fred: { age: 40, active: false }, + pebbles: { age: 1, active: true } + }, + o => o['active'] +), 'barney', 'Returns the appropriate key'); + + diff --git a/test2/findLast/findLast.js b/test/findLast/findLast.js similarity index 100% rename from test2/findLast/findLast.js rename to test/findLast/findLast.js diff --git a/test/findLast/findLast.test.js b/test/findLast/findLast.test.js new file mode 100644 index 000000000..2435d0b09 --- /dev/null +++ b/test/findLast/findLast.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const findLast = require('./findLast.js'); + + + test('findLast is a Function', () => { + expect(findLast).toBeInstanceOf(Function); +}); + t.equal(findLast([1, 2, 3, 4], n => n % 2 === 1), 3, 'Finds last element for which the given function returns true'); + + diff --git a/test2/findLastIndex/findLastIndex.js b/test/findLastIndex/findLastIndex.js similarity index 100% rename from test2/findLastIndex/findLastIndex.js rename to test/findLastIndex/findLastIndex.js diff --git a/test/findLastIndex/findLastIndex.test.js b/test/findLastIndex/findLastIndex.test.js new file mode 100644 index 000000000..5fc425166 --- /dev/null +++ b/test/findLastIndex/findLastIndex.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const findLastIndex = require('./findLastIndex.js'); + + + test('findLastIndex is a Function', () => { + expect(findLastIndex).toBeInstanceOf(Function); +}); + t.equal(findLastIndex([1, 2, 3, 4], n => n % 2 === 1), 2, 'Finds last index for which the given function returns true'); + + diff --git a/test2/findLastKey/findLastKey.js b/test/findLastKey/findLastKey.js similarity index 100% rename from test2/findLastKey/findLastKey.js rename to test/findLastKey/findLastKey.js diff --git a/test/findLastKey/findLastKey.test.js b/test/findLastKey/findLastKey.test.js new file mode 100644 index 000000000..3ab1dc4ce --- /dev/null +++ b/test/findLastKey/findLastKey.test.js @@ -0,0 +1,17 @@ +const expect = require('expect'); +const findLastKey = require('./findLastKey.js'); + + + test('findLastKey is a Function', () => { + expect(findLastKey).toBeInstanceOf(Function); +}); + t.equal(findLastKey( + { + barney: { age: 36, active: true }, + fred: { age: 40, active: false }, + pebbles: { age: 1, active: true } + }, + o => o['active'] +), 'pebbles', 'Returns the appropriate key'); + + diff --git a/test2/flatten/flatten.js b/test/flatten/flatten.js similarity index 100% rename from test2/flatten/flatten.js rename to test/flatten/flatten.js diff --git a/test/flatten/flatten.test.js b/test/flatten/flatten.test.js new file mode 100644 index 000000000..fa1c01167 --- /dev/null +++ b/test/flatten/flatten.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const flatten = require('./flatten.js'); + + + test('flatten is a Function', () => { + expect(flatten).toBeInstanceOf(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"); + diff --git a/test2/flattenObject/flattenObject.js b/test/flattenObject/flattenObject.js similarity index 97% rename from test2/flattenObject/flattenObject.js rename to test/flattenObject/flattenObject.js index 1a01f7f0a..9607a2fb8 100644 --- a/test2/flattenObject/flattenObject.js +++ b/test/flattenObject/flattenObject.js @@ -4,5 +4,5 @@ const pre = prefix.length ? prefix + '.' : ''; if (typeof obj[k] === 'object') Object.assign(acc, flattenObject(obj[k], pre + k)); else acc[pre + k] = obj[k]; return acc; -}, {}); +}, { module.exports = flattenObject; \ No newline at end of file diff --git a/test/flattenObject/flattenObject.test.js b/test/flattenObject/flattenObject.test.js new file mode 100644 index 000000000..2d3b9a758 --- /dev/null +++ b/test/flattenObject/flattenObject.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const flattenObject = require('./flattenObject.js'); + + + test('flattenObject is a Function', () => { + expect(flattenObject).toBeInstanceOf(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'); + + diff --git a/test2/flip/flip.js b/test/flip/flip.js similarity index 100% rename from test2/flip/flip.js rename to test/flip/flip.js diff --git a/test/flip/flip.test.js b/test/flip/flip.test.js new file mode 100644 index 000000000..f5b120b8c --- /dev/null +++ b/test/flip/flip.test.js @@ -0,0 +1,14 @@ +const expect = require('expect'); +const flip = require('./flip.js'); + + + 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); + t.deepEqual(mergePerson(b), a, 'Flips argument order'); + + diff --git a/test2/forEachRight/forEachRight.js b/test/forEachRight/forEachRight.js similarity index 100% rename from test2/forEachRight/forEachRight.js rename to test/forEachRight/forEachRight.js diff --git a/test/forEachRight/forEachRight.test.js b/test/forEachRight/forEachRight.test.js new file mode 100644 index 000000000..69b66df3f --- /dev/null +++ b/test/forEachRight/forEachRight.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const forEachRight = require('./forEachRight.js'); + + + test('forEachRight is a Function', () => { + expect(forEachRight).toBeInstanceOf(Function); +}); + let output = ''; + forEachRight([1, 2, 3, 4], val => output+=val); + t.equal(output, '4321', 'Iterates over the array in reverse'); + + diff --git a/test2/forOwn/forOwn.js b/test/forOwn/forOwn.js similarity index 100% rename from test2/forOwn/forOwn.js rename to test/forOwn/forOwn.js diff --git a/test/forOwn/forOwn.test.js b/test/forOwn/forOwn.test.js new file mode 100644 index 000000000..4b6931628 --- /dev/null +++ b/test/forOwn/forOwn.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const forOwn = require('./forOwn.js'); + + + test('forOwn is a Function', () => { + expect(forOwn).toBeInstanceOf(Function); +}); + let output = []; + forOwn({ foo: 'bar', a: 1 }, v => output.push(v)); + t.deepEqual(output, ['bar', 1], 'Iterates over an element\'s key-value pairs'); + + diff --git a/test2/forOwnRight/forOwnRight.js b/test/forOwnRight/forOwnRight.js similarity index 100% rename from test2/forOwnRight/forOwnRight.js rename to test/forOwnRight/forOwnRight.js diff --git a/test/forOwnRight/forOwnRight.test.js b/test/forOwnRight/forOwnRight.test.js new file mode 100644 index 000000000..9e18b97f7 --- /dev/null +++ b/test/forOwnRight/forOwnRight.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const forOwnRight = require('./forOwnRight.js'); + + + test('forOwnRight is a Function', () => { + expect(forOwnRight).toBeInstanceOf(Function); +}); + let output = []; + forOwnRight({ foo: 'bar', a: 1 }, v => output.push(v)); + t.deepEqual(output, [1, 'bar'], 'Iterates over an element\'s key-value pairs in reverse'); + + diff --git a/test2/formatDuration/formatDuration.js b/test/formatDuration/formatDuration.js similarity index 100% rename from test2/formatDuration/formatDuration.js rename to test/formatDuration/formatDuration.js diff --git a/test/formatDuration/formatDuration.test.js b/test/formatDuration/formatDuration.test.js new file mode 100644 index 000000000..c1b9e7306 --- /dev/null +++ b/test/formatDuration/formatDuration.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const formatDuration = require('./formatDuration.js'); + + + test('formatDuration is a Function', () => { + expect(formatDuration).toBeInstanceOf(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"); + diff --git a/test2/fromCamelCase/fromCamelCase.js b/test/fromCamelCase/fromCamelCase.js similarity index 100% rename from test2/fromCamelCase/fromCamelCase.js rename to test/fromCamelCase/fromCamelCase.js diff --git a/test/fromCamelCase/fromCamelCase.test.js b/test/fromCamelCase/fromCamelCase.test.js new file mode 100644 index 000000000..5e89f57b6 --- /dev/null +++ b/test/fromCamelCase/fromCamelCase.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const fromCamelCase = require('./fromCamelCase.js'); + + + test('fromCamelCase is a Function', () => { + expect(fromCamelCase).toBeInstanceOf(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"); + diff --git a/test2/functionName/functionName.js b/test/functionName/functionName.js similarity index 100% rename from test2/functionName/functionName.js rename to test/functionName/functionName.js diff --git a/test/functionName/functionName.test.js b/test/functionName/functionName.test.js new file mode 100644 index 000000000..e23478794 --- /dev/null +++ b/test/functionName/functionName.test.js @@ -0,0 +1,19 @@ +const expect = require('expect'); +let output = ''; +const console = {}; +console.debug = (x) => output = x; +const functionName = fn => (console.debug(fn.name), fn); + + test('functionName is a Function', () => { + expect(functionName).toBeInstanceOf(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'); + + diff --git a/test2/functions/functions.js b/test/functions/functions.js similarity index 100% rename from test2/functions/functions.js rename to test/functions/functions.js diff --git a/test/functions/functions.test.js b/test/functions/functions.test.js new file mode 100644 index 000000000..eb182cbb0 --- /dev/null +++ b/test/functions/functions.test.js @@ -0,0 +1,16 @@ +const expect = require('expect'); +const functions = require('./functions.js'); + + + test('functions is a Function', () => { + expect(functions).toBeInstanceOf(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'); + + diff --git a/test2/gcd/gcd.js b/test/gcd/gcd.js similarity index 100% rename from test2/gcd/gcd.js rename to test/gcd/gcd.js diff --git a/test/gcd/gcd.test.js b/test/gcd/gcd.test.js new file mode 100644 index 000000000..70fa782f5 --- /dev/null +++ b/test/gcd/gcd.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const gcd = require('./gcd.js'); + + + test('gcd is a Function', () => { + expect(gcd).toBeInstanceOf(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"); + diff --git a/test2/geometricProgression/geometricProgression.js b/test/geometricProgression/geometricProgression.js similarity index 100% rename from test2/geometricProgression/geometricProgression.js rename to test/geometricProgression/geometricProgression.js diff --git a/test/geometricProgression/geometricProgression.test.js b/test/geometricProgression/geometricProgression.test.js new file mode 100644 index 000000000..f42e0aafb --- /dev/null +++ b/test/geometricProgression/geometricProgression.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const geometricProgression = require('./geometricProgression.js'); + + + test('geometricProgression is a Function', () => { + expect(geometricProgression).toBeInstanceOf(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"); + diff --git a/test2/get/get.js b/test/get/get.js similarity index 100% rename from test2/get/get.js rename to test/get/get.js diff --git a/test/get/get.test.js b/test/get/get.test.js new file mode 100644 index 000000000..667f3e104 --- /dev/null +++ b/test/get/get.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const get = require('./get.js'); + + + test('get is a Function', () => { + expect(get).toBeInstanceOf(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."); + + diff --git a/test2/getColonTimeFromDate/getColonTimeFromDate.js b/test/getColonTimeFromDate/getColonTimeFromDate.js similarity index 100% rename from test2/getColonTimeFromDate/getColonTimeFromDate.js rename to test/getColonTimeFromDate/getColonTimeFromDate.js diff --git a/test/getColonTimeFromDate/getColonTimeFromDate.test.js b/test/getColonTimeFromDate/getColonTimeFromDate.test.js new file mode 100644 index 000000000..1f863ae33 --- /dev/null +++ b/test/getColonTimeFromDate/getColonTimeFromDate.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const getColonTimeFromDate = require('./getColonTimeFromDate.js'); + + + test('getColonTimeFromDate is a Function', () => { + expect(getColonTimeFromDate).toBeInstanceOf(Function); +}); + diff --git a/test2/getDaysDiffBetweenDates/getDaysDiffBetweenDates.js b/test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.js similarity index 100% rename from test2/getDaysDiffBetweenDates/getDaysDiffBetweenDates.js rename to test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.js diff --git a/test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js b/test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js new file mode 100644 index 000000000..25052d94d --- /dev/null +++ b/test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const getDaysDiffBetweenDates = require('./getDaysDiffBetweenDates.js'); + + + test('getDaysDiffBetweenDates is a Function', () => { + expect(getDaysDiffBetweenDates).toBeInstanceOf(Function); +}); + t.equal(getDaysDiffBetweenDates(new Date('2017-12-13'), new Date('2017-12-22')), 9, "Returns the difference in days between two dates"); + diff --git a/test2/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.js b/test/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.js similarity index 100% rename from test2/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.js rename to test/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.js diff --git a/test/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.test.js b/test/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.test.js new file mode 100644 index 000000000..f18244388 --- /dev/null +++ b/test/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const getMeridiemSuffixOfInteger = require('./getMeridiemSuffixOfInteger.js'); + + + test('getMeridiemSuffixOfInteger is a Function', () => { + expect(getMeridiemSuffixOfInteger).toBeInstanceOf(Function); +}); + diff --git a/test2/getScrollPosition/getScrollPosition.js b/test/getScrollPosition/getScrollPosition.js similarity index 98% rename from test2/getScrollPosition/getScrollPosition.js rename to test/getScrollPosition/getScrollPosition.js index 5bedcc1fe..ad622cf02 100644 --- a/test2/getScrollPosition/getScrollPosition.js +++ b/test/getScrollPosition/getScrollPosition.js @@ -1,5 +1,5 @@ const getScrollPosition = (el = window) => ({ x: el.pageXOffset !== undefined ? el.pageXOffset : el.scrollLeft, y: el.pageYOffset !== undefined ? el.pageYOffset : el.scrollTop -}); + module.exports = getScrollPosition; \ No newline at end of file diff --git a/test/getScrollPosition/getScrollPosition.test.js b/test/getScrollPosition/getScrollPosition.test.js new file mode 100644 index 000000000..24746b482 --- /dev/null +++ b/test/getScrollPosition/getScrollPosition.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const getScrollPosition = require('./getScrollPosition.js'); + + + test('getScrollPosition is a Function', () => { + expect(getScrollPosition).toBeInstanceOf(Function); +}); + t.pass('Tested by @chalarangelo on 16/02/2018'); + + diff --git a/test2/getStyle/getStyle.js b/test/getStyle/getStyle.js similarity index 100% rename from test2/getStyle/getStyle.js rename to test/getStyle/getStyle.js diff --git a/test/getStyle/getStyle.test.js b/test/getStyle/getStyle.test.js new file mode 100644 index 000000000..0c50ec687 --- /dev/null +++ b/test/getStyle/getStyle.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const getStyle = require('./getStyle.js'); + + + test('getStyle is a Function', () => { + expect(getStyle).toBeInstanceOf(Function); +}); + t.pass('Tested by @chalarangelo on 16/02/2018'); + + diff --git a/test2/getType/getType.js b/test/getType/getType.js similarity index 100% rename from test2/getType/getType.js rename to test/getType/getType.js diff --git a/test/getType/getType.test.js b/test/getType/getType.test.js new file mode 100644 index 000000000..dedd1d8b5 --- /dev/null +++ b/test/getType/getType.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const getType = require('./getType.js'); + + + test('getType is a Function', () => { + expect(getType).toBeInstanceOf(Function); +}); + t.equal(getType(new Set([1, 2, 3])), 'set', "Returns the native type of a value"); + diff --git a/test2/getURLParameters/getURLParameters.js b/test/getURLParameters/getURLParameters.js similarity index 100% rename from test2/getURLParameters/getURLParameters.js rename to test/getURLParameters/getURLParameters.js diff --git a/test/getURLParameters/getURLParameters.test.js b/test/getURLParameters/getURLParameters.test.js new file mode 100644 index 000000000..e9e75eaa1 --- /dev/null +++ b/test/getURLParameters/getURLParameters.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const getURLParameters = require('./getURLParameters.js'); + + + test('getURLParameters is a Function', () => { + expect(getURLParameters).toBeInstanceOf(Function); +}); + t.deepEqual(getURLParameters('http: + diff --git a/test3/groupBy/groupBy.js b/test/groupBy/groupBy.js similarity index 96% rename from test3/groupBy/groupBy.js rename to test/groupBy/groupBy.js index b423945a4..2ab3ffb3d 100644 --- a/test3/groupBy/groupBy.js +++ b/test/groupBy/groupBy.js @@ -2,5 +2,5 @@ const groupBy = (arr, fn) => arr.map(typeof fn === 'function' ? fn : val => val[fn]).reduce((acc, val, i) => { acc[val] = (acc[val] || []).concat(arr[i]); return acc; -}, {}); +}, { module.exports = groupBy; \ No newline at end of file diff --git a/test/groupBy/groupBy.test.js b/test/groupBy/groupBy.test.js new file mode 100644 index 000000000..194886b8d --- /dev/null +++ b/test/groupBy/groupBy.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const groupBy = require('./groupBy.js'); + + + test('groupBy is a Function', () => { + expect(groupBy).toBeInstanceOf(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"); + diff --git a/test3/hammingDistance/hammingDistance.js b/test/hammingDistance/hammingDistance.js similarity index 100% rename from test3/hammingDistance/hammingDistance.js rename to test/hammingDistance/hammingDistance.js diff --git a/test/hammingDistance/hammingDistance.test.js b/test/hammingDistance/hammingDistance.test.js new file mode 100644 index 000000000..f72b78043 --- /dev/null +++ b/test/hammingDistance/hammingDistance.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const hammingDistance = require('./hammingDistance.js'); + + + test('hammingDistance is a Function', () => { + expect(hammingDistance).toBeInstanceOf(Function); +}); + t.equal(hammingDistance(2, 3), 1, "retuns hamming disance between 2 values"); + diff --git a/test3/hasClass/hasClass.js b/test/hasClass/hasClass.js similarity index 100% rename from test3/hasClass/hasClass.js rename to test/hasClass/hasClass.js diff --git a/test/hasClass/hasClass.test.js b/test/hasClass/hasClass.test.js new file mode 100644 index 000000000..34ba77c26 --- /dev/null +++ b/test/hasClass/hasClass.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const hasClass = require('./hasClass.js'); + + + test('hasClass is a Function', () => { + expect(hasClass).toBeInstanceOf(Function); +}); + diff --git a/test3/hasFlags/hasFlags.js b/test/hasFlags/hasFlags.js similarity index 100% rename from test3/hasFlags/hasFlags.js rename to test/hasFlags/hasFlags.js diff --git a/test/hasFlags/hasFlags.test.js b/test/hasFlags/hasFlags.test.js new file mode 100644 index 000000000..a8eeb0dc3 --- /dev/null +++ b/test/hasFlags/hasFlags.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const hasFlags = require('./hasFlags.js'); + + + test('hasFlags is a Function', () => { + expect(hasFlags).toBeInstanceOf(Function); +}); + t.pass('Tested by @chalarangelo on 16/02/2018'); + + diff --git a/test3/hashBrowser/hashBrowser.js b/test/hashBrowser/hashBrowser.js similarity index 98% rename from test3/hashBrowser/hashBrowser.js rename to test/hashBrowser/hashBrowser.js index d7d70d6a7..c2a79576b 100644 --- a/test3/hashBrowser/hashBrowser.js +++ b/test/hashBrowser/hashBrowser.js @@ -5,5 +5,5 @@ view = new DataView(h); for (let i = 0; i < view.byteLength; i += 4) hexes.push(('00000000' + view.getUint32(i).toString(16)).slice(-8)); return hexes.join(''); -}); + module.exports = hashBrowser; \ No newline at end of file diff --git a/test/hashBrowser/hashBrowser.test.js b/test/hashBrowser/hashBrowser.test.js new file mode 100644 index 000000000..71043e545 --- /dev/null +++ b/test/hashBrowser/hashBrowser.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const hashBrowser = require('./hashBrowser.js'); + + + test('hashBrowser is a Function', () => { + expect(hashBrowser).toBeInstanceOf(Function); +}); + t.pass('Tested by @chalarangelo on 16/02/2018'); + + diff --git a/test3/hashNode/hashNode.js b/test/hashNode/hashNode.js similarity index 100% rename from test3/hashNode/hashNode.js rename to test/hashNode/hashNode.js diff --git a/test/hashNode/hashNode.test.js b/test/hashNode/hashNode.test.js new file mode 100644 index 000000000..a66d989e0 --- /dev/null +++ b/test/hashNode/hashNode.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const hashNode = require('./hashNode.js'); + + + test('hashNode is a Function', () => { + expect(hashNode).toBeInstanceOf(Function); +}); + hashNode(JSON.stringify({ a: 'a', b: [1, 2, 3, 4], foo: { c: 'bar' } })).then(v => t.equal(v, '04aa106279f5977f59f9067fa9712afc4aedc6f5862a8defc34552d8c7206393', 'Produces the appropriate hash')); + + diff --git a/test3/head/head.js b/test/head/head.js similarity index 100% rename from test3/head/head.js rename to test/head/head.js diff --git a/test/head/head.test.js b/test/head/head.test.js new file mode 100644 index 000000000..3a672d76b --- /dev/null +++ b/test/head/head.test.js @@ -0,0 +1,24 @@ +const expect = require('expect'); +const head = require('./head.js'); + + + test('head is a Function', () => { + expect(head).toBeInstanceOf(Function); +}); + test('head({ a: 1234}) returns undefined', () => { + expect(head({ a: 1234}) === undefined).toBeTruthy(); +}); + 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(); + 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/test3/hexToRGB/hexToRGB.js b/test/hexToRGB/hexToRGB.js similarity index 100% rename from test3/hexToRGB/hexToRGB.js rename to test/hexToRGB/hexToRGB.js diff --git a/test/hexToRGB/hexToRGB.test.js b/test/hexToRGB/hexToRGB.test.js new file mode 100644 index 000000000..a3ffd412c --- /dev/null +++ b/test/hexToRGB/hexToRGB.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const hexToRGB = require('./hexToRGB.js'); + + + test('hexToRGB is a Function', () => { + expect(hexToRGB).toBeInstanceOf(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"); + diff --git a/test3/hide/hide.js b/test/hide/hide.js similarity index 100% rename from test3/hide/hide.js rename to test/hide/hide.js diff --git a/test/hide/hide.test.js b/test/hide/hide.test.js new file mode 100644 index 000000000..e5cf19bdd --- /dev/null +++ b/test/hide/hide.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const hide = require('./hide.js'); + + + test('hide is a Function', () => { + expect(hide).toBeInstanceOf(Function); +}); + t.pass('Tested by @chalarangelo on 16/02/2018'); + + diff --git a/test3/howManyTimes/howManyTimes.js b/test/howManyTimes/howManyTimes.js similarity index 100% rename from test3/howManyTimes/howManyTimes.js rename to test/howManyTimes/howManyTimes.js diff --git a/test/howManyTimes/howManyTimes.test.js b/test/howManyTimes/howManyTimes.test.js new file mode 100644 index 000000000..c5b17e44b --- /dev/null +++ b/test/howManyTimes/howManyTimes.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const howManyTimes = require('./howManyTimes.js'); + + + test('howManyTimes is a Function', () => { + expect(howManyTimes).toBeInstanceOf(Function); +}); + diff --git a/test3/httpDelete/httpDelete.js b/test/httpDelete/httpDelete.js similarity index 100% rename from test3/httpDelete/httpDelete.js rename to test/httpDelete/httpDelete.js diff --git a/test/httpDelete/httpDelete.test.js b/test/httpDelete/httpDelete.test.js new file mode 100644 index 000000000..fc67eb414 --- /dev/null +++ b/test/httpDelete/httpDelete.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const httpDelete = require('./httpDelete.js'); + + + test('httpDelete is a Function', () => { + expect(httpDelete).toBeInstanceOf(Function); +}); + diff --git a/test3/httpGet/httpGet.js b/test/httpGet/httpGet.js similarity index 100% rename from test3/httpGet/httpGet.js rename to test/httpGet/httpGet.js diff --git a/test3/httpGet/httpGet.test.js b/test/httpGet/httpGet.test.js similarity index 80% rename from test3/httpGet/httpGet.test.js rename to test/httpGet/httpGet.test.js index 813289a70..1270778c7 100644 --- a/test3/httpGet/httpGet.test.js +++ b/test/httpGet/httpGet.test.js @@ -1,4 +1,4 @@ -const expect = require("expect"); +const expect = require('expect'); const httpGet = (url, callback, err = console.error) => { const request = new XMLHttpRequest(); request.open('GET', url, true); @@ -7,23 +7,22 @@ const httpGet = (url, callback, err = console.error) => { request.send(); }; -test('Testing httpGet', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof httpGet === 'function').toBeTruthy(); - httpGet('https://jsonplaceholder.typicode.com/posts/1', response => { - expect(JSON.parse(response)).toEqual({ + + test('httpGet is a Function', () => { + expect(httpGet).toBeInstanceOf(Function); +}); + httpGet('https: + 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', - }); - }); -}); -// Custom implementation of XMLHttpRequest for the requirements of this snippet. -// Based on https://github.com/driverdan/node-XMLHttpRequest + }, 'Sends a GET request'); + + + var Url = require("url"); var spawn = require("child_process").spawn; var fs = require("fs"); @@ -36,19 +35,10 @@ XMLHttpRequest = function() { 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": "*/*", @@ -56,10 +46,6 @@ XMLHttpRequest = function() { 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", @@ -82,20 +68,13 @@ XMLHttpRequest = function() { "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 = {}; /** @@ -111,21 +90,12 @@ XMLHttpRequest = function() { /** * 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; /** @@ -168,8 +138,6 @@ XMLHttpRequest = function() { 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"); } @@ -249,7 +217,6 @@ XMLHttpRequest = function() { 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"; } @@ -288,11 +255,9 @@ XMLHttpRequest = function() { 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; @@ -310,8 +275,6 @@ XMLHttpRequest = function() { 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"); @@ -326,7 +289,7 @@ XMLHttpRequest = function() { self.responseText = data; setState(self.DONE); } - }); + } else { try { this.responseText = fs.readFileSync(url.pathname, "utf8"); @@ -339,27 +302,17 @@ XMLHttpRequest = function() { 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 = ""; @@ -367,8 +320,6 @@ XMLHttpRequest = function() { 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) { @@ -378,8 +329,6 @@ XMLHttpRequest = function() { 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; } @@ -392,35 +341,17 @@ XMLHttpRequest = function() { 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, @@ -429,11 +360,8 @@ XMLHttpRequest = function() { 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 + reques return; } @@ -443,51 +371,40 @@ XMLHttpRequest = function() { 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(); + reques self.dispatchEvent("loadstart"); - } else { // Synchronous - // Create a temporary file for communication with the other Node process + } else { 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) + ";" @@ -496,30 +413,26 @@ XMLHttpRequest = function() { + "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) { @@ -578,7 +491,6 @@ XMLHttpRequest = function() { if (!(event in listeners)) { listeners[event] = []; } - // Currently allows duplicate callbacks. Should it? listeners[event].push(callback); }; @@ -588,10 +500,9 @@ XMLHttpRequest = function() { */ 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; - }); + } }; @@ -624,7 +535,6 @@ XMLHttpRequest = function() { if (self.readyState === self.DONE && !errorFlag) { self.dispatchEvent("load"); - // @TODO figure out InspectorInstrumentation::didLoadXHR(cookie) self.dispatchEvent("loadend"); } } diff --git a/test3/httpPost/httpPost.js b/test/httpPost/httpPost.js similarity index 100% rename from test3/httpPost/httpPost.js rename to test/httpPost/httpPost.js diff --git a/test3/httpPost/httpPost.test.js b/test/httpPost/httpPost.test.js similarity index 80% rename from test3/httpPost/httpPost.test.js rename to test/httpPost/httpPost.test.js index e3367ba47..876e5a69d 100644 --- a/test3/httpPost/httpPost.test.js +++ b/test/httpPost/httpPost.test.js @@ -1,4 +1,4 @@ -const expect = require("expect"); +const expect = require('expect'); const httpPost = (url, data, callback, err = console.error) => { const request = new XMLHttpRequest(); request.open('POST', url, true); @@ -7,22 +7,20 @@ const httpPost = (url, data, callback, err = console.error) => { request.onerror = () => err(request); request.send(data); }; -test('Testing httpPost', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof httpPost === 'function').toBeTruthy(); + + test('httpPost is a Function', () => { + expect(httpPost).toBeInstanceOf(Function); +}); const data = { title: 'foo', body: 'bar', userId: 1 }; - httpPost('https://jsonplaceholder.typicode.com/posts', JSON.stringify(data), response => { - expect(JSON.parse(response).id).toEqual(101); - }); -}); + httpPost('https: + t.deepEqual(JSON.parse(response).id, 101, 'Sends a POST request'); + + -// 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"); @@ -35,19 +33,10 @@ XMLHttpRequest = function() { 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": "*/*", @@ -55,10 +44,6 @@ XMLHttpRequest = function() { 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", @@ -81,20 +66,13 @@ XMLHttpRequest = function() { "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 = {}; /** @@ -110,21 +88,12 @@ XMLHttpRequest = function() { /** * 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; /** @@ -167,8 +136,6 @@ XMLHttpRequest = function() { 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"); } @@ -248,7 +215,6 @@ XMLHttpRequest = function() { 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"; } @@ -287,11 +253,9 @@ XMLHttpRequest = function() { 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; @@ -309,8 +273,6 @@ XMLHttpRequest = function() { 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"); @@ -325,7 +287,7 @@ XMLHttpRequest = function() { self.responseText = data; setState(self.DONE); } - }); + } else { try { this.responseText = fs.readFileSync(url.pathname, "utf8"); @@ -338,27 +300,17 @@ XMLHttpRequest = function() { 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 = ""; @@ -366,8 +318,6 @@ XMLHttpRequest = function() { 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) { @@ -377,8 +327,6 @@ XMLHttpRequest = function() { 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; } @@ -391,35 +339,17 @@ XMLHttpRequest = function() { 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, @@ -428,11 +358,8 @@ XMLHttpRequest = function() { 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 + reques return; } @@ -442,51 +369,40 @@ XMLHttpRequest = function() { 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(); + reques self.dispatchEvent("loadstart"); - } else { // Synchronous - // Create a temporary file for communication with the other Node process + } else { 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) + ";" @@ -495,30 +411,26 @@ XMLHttpRequest = function() { + "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) { @@ -577,7 +489,6 @@ XMLHttpRequest = function() { if (!(event in listeners)) { listeners[event] = []; } - // Currently allows duplicate callbacks. Should it? listeners[event].push(callback); }; @@ -587,10 +498,9 @@ XMLHttpRequest = function() { */ 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; - }); + } }; @@ -623,7 +533,6 @@ XMLHttpRequest = function() { if (self.readyState === self.DONE && !errorFlag) { self.dispatchEvent("load"); - // @TODO figure out InspectorInstrumentation::didLoadXHR(cookie) self.dispatchEvent("loadend"); } } diff --git a/test3/httpPut/httpPut.js b/test/httpPut/httpPut.js similarity index 100% rename from test3/httpPut/httpPut.js rename to test/httpPut/httpPut.js diff --git a/test/httpPut/httpPut.test.js b/test/httpPut/httpPut.test.js new file mode 100644 index 000000000..a9beac9db --- /dev/null +++ b/test/httpPut/httpPut.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const httpPut = require('./httpPut.js'); + + + test('httpPut is a Function', () => { + expect(httpPut).toBeInstanceOf(Function); +}); + diff --git a/test/httpsRedirect/httpsRedirect.js b/test/httpsRedirect/httpsRedirect.js new file mode 100644 index 000000000..e3084f306 --- /dev/null +++ b/test/httpsRedirect/httpsRedirect.js @@ -0,0 +1,4 @@ +const httpsRedirect = () => { +if (location.protocol !== 'https:') location.replace('https: +}; +module.exports = httpsRedirect; \ No newline at end of file diff --git a/test/httpsRedirect/httpsRedirect.test.js b/test/httpsRedirect/httpsRedirect.test.js new file mode 100644 index 000000000..338c0f925 --- /dev/null +++ b/test/httpsRedirect/httpsRedirect.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const httpsRedirect = require('./httpsRedirect.js'); + + + test('httpsRedirect is a Function', () => { + expect(httpsRedirect).toBeInstanceOf(Function); +}); + t.pass('Tested on 09/02/2018 by @chalarangelo'); + + diff --git a/test3/hz/hz.js b/test/hz/hz.js similarity index 100% rename from test3/hz/hz.js rename to test/hz/hz.js diff --git a/test/hz/hz.test.js b/test/hz/hz.test.js new file mode 100644 index 000000000..a9ae095f1 --- /dev/null +++ b/test/hz/hz.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const hz = require('./hz.js'); + + + test('hz is a Function', () => { + expect(hz).toBeInstanceOf(Function); +}); + diff --git a/test3/inRange/inRange.js b/test/inRange/inRange.js similarity index 100% rename from test3/inRange/inRange.js rename to test/inRange/inRange.js diff --git a/test/inRange/inRange.test.js b/test/inRange/inRange.test.js new file mode 100644 index 000000000..545c3991a --- /dev/null +++ b/test/inRange/inRange.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const inRange = require('./inRange.js'); + + + test('inRange is a Function', () => { + expect(inRange).toBeInstanceOf(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"); + diff --git a/test3/indexOfAll/indexOfAll.js b/test/indexOfAll/indexOfAll.js similarity index 100% rename from test3/indexOfAll/indexOfAll.js rename to test/indexOfAll/indexOfAll.js diff --git a/test/indexOfAll/indexOfAll.test.js b/test/indexOfAll/indexOfAll.test.js new file mode 100644 index 000000000..21fbb0cf3 --- /dev/null +++ b/test/indexOfAll/indexOfAll.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const indexOfAll = require('./indexOfAll.js'); + + + test('indexOfAll is a Function', () => { + expect(indexOfAll).toBeInstanceOf(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"); + diff --git a/test3/initial/initial.js b/test/initial/initial.js similarity index 100% rename from test3/initial/initial.js rename to test/initial/initial.js diff --git a/test/initial/initial.test.js b/test/initial/initial.test.js new file mode 100644 index 000000000..7dd301fe4 --- /dev/null +++ b/test/initial/initial.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const initial = require('./initial.js'); + + + test('initial is a Function', () => { + expect(initial).toBeInstanceOf(Function); +}); + t.deepEqual(initial([1, 2, 3]), [1, 2], "Returns all the elements of an array except the last one"); + diff --git a/test3/initialize2DArray/initialize2DArray.js b/test/initialize2DArray/initialize2DArray.js similarity index 100% rename from test3/initialize2DArray/initialize2DArray.js rename to test/initialize2DArray/initialize2DArray.js diff --git a/test/initialize2DArray/initialize2DArray.test.js b/test/initialize2DArray/initialize2DArray.test.js new file mode 100644 index 000000000..441c34a4a --- /dev/null +++ b/test/initialize2DArray/initialize2DArray.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const initialize2DArray = require('./initialize2DArray.js'); + + + test('initialize2DArray is a Function', () => { + expect(initialize2DArray).toBeInstanceOf(Function); +}); + t.deepEqual(initialize2DArray(2, 2, 0), [[0,0], [0,0]], "Initializes a 2D array of given width and height and value"); + diff --git a/test3/initializeArrayWithRange/initializeArrayWithRange.js b/test/initializeArrayWithRange/initializeArrayWithRange.js similarity index 100% rename from test3/initializeArrayWithRange/initializeArrayWithRange.js rename to test/initializeArrayWithRange/initializeArrayWithRange.js diff --git a/test/initializeArrayWithRange/initializeArrayWithRange.test.js b/test/initializeArrayWithRange/initializeArrayWithRange.test.js new file mode 100644 index 000000000..18da3a9e4 --- /dev/null +++ b/test/initializeArrayWithRange/initializeArrayWithRange.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const initializeArrayWithRange = require('./initializeArrayWithRange.js'); + + + test('initializeArrayWithRange is a Function', () => { + expect(initializeArrayWithRange).toBeInstanceOf(Function); +}); + t.deepEqual(initializeArrayWithRange(5), [0, 1, 2, 3, 4, 5], "Initializes an array containing the numbers in the specified range"); + diff --git a/test3/initializeArrayWithRangeRight/initializeArrayWithRangeRight.js b/test/initializeArrayWithRangeRight/initializeArrayWithRangeRight.js similarity index 100% rename from test3/initializeArrayWithRangeRight/initializeArrayWithRangeRight.js rename to test/initializeArrayWithRangeRight/initializeArrayWithRangeRight.js diff --git a/test/initializeArrayWithRangeRight/initializeArrayWithRangeRight.test.js b/test/initializeArrayWithRangeRight/initializeArrayWithRangeRight.test.js new file mode 100644 index 000000000..0bc006ff7 --- /dev/null +++ b/test/initializeArrayWithRangeRight/initializeArrayWithRangeRight.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const initializeArrayWithRangeRight = require('./initializeArrayWithRangeRight.js'); + + + test('initializeArrayWithRangeRight is a Function', () => { + expect(initializeArrayWithRangeRight).toBeInstanceOf(Function); +}); + diff --git a/test3/initializeArrayWithValues/initializeArrayWithValues.js b/test/initializeArrayWithValues/initializeArrayWithValues.js similarity index 100% rename from test3/initializeArrayWithValues/initializeArrayWithValues.js rename to test/initializeArrayWithValues/initializeArrayWithValues.js diff --git a/test/initializeArrayWithValues/initializeArrayWithValues.test.js b/test/initializeArrayWithValues/initializeArrayWithValues.test.js new file mode 100644 index 000000000..ee1f5ea89 --- /dev/null +++ b/test/initializeArrayWithValues/initializeArrayWithValues.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const initializeArrayWithValues = require('./initializeArrayWithValues.js'); + + + test('initializeArrayWithValues is a Function', () => { + expect(initializeArrayWithValues).toBeInstanceOf(Function); +}); + t.deepEqual(initializeArrayWithValues(5, 2), [2, 2, 2, 2, 2], "Initializes and fills an array with the specified values"); + diff --git a/test3/initializeNDArray/initializeNDArray.js b/test/initializeNDArray/initializeNDArray.js similarity index 100% rename from test3/initializeNDArray/initializeNDArray.js rename to test/initializeNDArray/initializeNDArray.js diff --git a/test/initializeNDArray/initializeNDArray.test.js b/test/initializeNDArray/initializeNDArray.test.js new file mode 100644 index 000000000..52de243ff --- /dev/null +++ b/test/initializeNDArray/initializeNDArray.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const initializeNDArray = require('./initializeNDArray.js'); + + + test('initializeNDArray is a Function', () => { + expect(initializeNDArray).toBeInstanceOf(Function); +}); + diff --git a/test3/intersection/intersection.js b/test/intersection/intersection.js similarity index 100% rename from test3/intersection/intersection.js rename to test/intersection/intersection.js diff --git a/test/intersection/intersection.test.js b/test/intersection/intersection.test.js new file mode 100644 index 000000000..e94b8df5e --- /dev/null +++ b/test/intersection/intersection.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const intersection = require('./intersection.js'); + + + test('intersection is a Function', () => { + expect(intersection).toBeInstanceOf(Function); +}); + t.deepEqual(intersection([1, 2, 3], [4, 3, 2]), [2, 3], "Returns a list of elements that exist in both arrays"); + diff --git a/test3/intersectionBy/intersectionBy.js b/test/intersectionBy/intersectionBy.js similarity index 100% rename from test3/intersectionBy/intersectionBy.js rename to test/intersectionBy/intersectionBy.js diff --git a/test/intersectionBy/intersectionBy.test.js b/test/intersectionBy/intersectionBy.test.js new file mode 100644 index 000000000..f6efdbfae --- /dev/null +++ b/test/intersectionBy/intersectionBy.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const intersectionBy = require('./intersectionBy.js'); + + + test('intersectionBy is a Function', () => { + expect(intersectionBy).toBeInstanceOf(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'); + + diff --git a/test3/intersectionWith/intersectionWith.js b/test/intersectionWith/intersectionWith.js similarity index 100% rename from test3/intersectionWith/intersectionWith.js rename to test/intersectionWith/intersectionWith.js diff --git a/test/intersectionWith/intersectionWith.test.js b/test/intersectionWith/intersectionWith.test.js new file mode 100644 index 000000000..28f704a38 --- /dev/null +++ b/test/intersectionWith/intersectionWith.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const intersectionWith = require('./intersectionWith.js'); + + + test('intersectionWith is a Function', () => { + expect(intersectionWith).toBeInstanceOf(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'); + + diff --git a/test3/invertKeyValues/invertKeyValues.js b/test/invertKeyValues/invertKeyValues.js similarity index 96% rename from test3/invertKeyValues/invertKeyValues.js rename to test/invertKeyValues/invertKeyValues.js index 59c52315a..7712379e2 100644 --- a/test3/invertKeyValues/invertKeyValues.js +++ b/test/invertKeyValues/invertKeyValues.js @@ -4,5 +4,5 @@ const val = fn ? fn(obj[key]) : obj[key]; acc[val] = acc[val] || []; acc[val].push(key); return acc; -}, {}); +}, { module.exports = invertKeyValues; \ No newline at end of file diff --git a/test/invertKeyValues/invertKeyValues.test.js b/test/invertKeyValues/invertKeyValues.test.js new file mode 100644 index 000000000..2619e5814 --- /dev/null +++ b/test/invertKeyValues/invertKeyValues.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const invertKeyValues = require('./invertKeyValues.js'); + + + test('invertKeyValues is a Function', () => { + expect(invertKeyValues).toBeInstanceOf(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' ] }"); + diff --git a/test3/is/is.js b/test/is/is.js similarity index 100% rename from test3/is/is.js rename to test/is/is.js diff --git a/test/is/is.test.js b/test/is/is.test.js new file mode 100644 index 000000000..e1fafc039 --- /dev/null +++ b/test/is/is.test.js @@ -0,0 +1,25 @@ +const expect = require('expect'); +const is = require('./is.js'); + + + test('is is a Function', () => { + expect(is).toBeInstanceOf(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`); + + diff --git a/test3/isAbsoluteURL/isAbsoluteURL.js b/test/isAbsoluteURL/isAbsoluteURL.js similarity index 100% rename from test3/isAbsoluteURL/isAbsoluteURL.js rename to test/isAbsoluteURL/isAbsoluteURL.js diff --git a/test/isAbsoluteURL/isAbsoluteURL.test.js b/test/isAbsoluteURL/isAbsoluteURL.test.js new file mode 100644 index 000000000..81dfb2539 --- /dev/null +++ b/test/isAbsoluteURL/isAbsoluteURL.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const isAbsoluteURL = require('./isAbsoluteURL.js'); + + + test('isAbsoluteURL is a Function', () => { + expect(isAbsoluteURL).toBeInstanceOf(Function); +}); + t.equal(isAbsoluteURL('https: + t.equal(isAbsoluteURL('ftp: + t.equal(isAbsoluteURL('/foo/bar'), false, "Given string is not an absolute URL"); + diff --git a/test3/isAnagram/isAnagram.js b/test/isAnagram/isAnagram.js similarity index 100% rename from test3/isAnagram/isAnagram.js rename to test/isAnagram/isAnagram.js diff --git a/test3/isAnagram/isAnagram.test.js b/test/isAnagram/isAnagram.test.js similarity index 56% rename from test3/isAnagram/isAnagram.test.js rename to test/isAnagram/isAnagram.test.js index 0508183a8..426050546 100644 --- a/test3/isAnagram/isAnagram.test.js +++ b/test/isAnagram/isAnagram.test.js @@ -1,12 +1,21 @@ const expect = require('expect'); const isAnagram = require('./isAnagram.js'); -test('Testing isAnagram', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isAnagram === 'function').toBeTruthy(); + + 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/test3/isArmstrongNumber/isArmstrongNumber.js b/test/isArmstrongNumber/isArmstrongNumber.js similarity index 100% rename from test3/isArmstrongNumber/isArmstrongNumber.js rename to test/isArmstrongNumber/isArmstrongNumber.js diff --git a/test/isArmstrongNumber/isArmstrongNumber.test.js b/test/isArmstrongNumber/isArmstrongNumber.test.js new file mode 100644 index 000000000..a62809e2a --- /dev/null +++ b/test/isArmstrongNumber/isArmstrongNumber.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const isArmstrongNumber = require('./isArmstrongNumber.js'); + + + test('isArmstrongNumber is a Function', () => { + expect(isArmstrongNumber).toBeInstanceOf(Function); +}); + diff --git a/test3/isArray/isArray.js b/test/isArray/isArray.js similarity index 100% rename from test3/isArray/isArray.js rename to test/isArray/isArray.js diff --git a/test/isArray/isArray.test.js b/test/isArray/isArray.test.js new file mode 100644 index 000000000..a14d72e1f --- /dev/null +++ b/test/isArray/isArray.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const isArray = require('./isArray.js'); + + + test('isArray is a Function', () => { + expect(isArray).toBeInstanceOf(Function); +}); + t.equal(isArray([1]), true, "passed value is an array"); + t.equal(isArray('array'), false, "passed value is not an array"); + diff --git a/test3/isArrayBuffer/isArrayBuffer.js b/test/isArrayBuffer/isArrayBuffer.js similarity index 100% rename from test3/isArrayBuffer/isArrayBuffer.js rename to test/isArrayBuffer/isArrayBuffer.js diff --git a/test/isArrayBuffer/isArrayBuffer.test.js b/test/isArrayBuffer/isArrayBuffer.test.js new file mode 100644 index 000000000..54471ef95 --- /dev/null +++ b/test/isArrayBuffer/isArrayBuffer.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const isArrayBuffer = require('./isArrayBuffer.js'); + + + test('isArrayBuffer is a Function', () => { + expect(isArrayBuffer).toBeInstanceOf(Function); +}); + diff --git a/test3/isArrayLike/isArrayLike.js b/test/isArrayLike/isArrayLike.js similarity index 100% rename from test3/isArrayLike/isArrayLike.js rename to test/isArrayLike/isArrayLike.js diff --git a/test/isArrayLike/isArrayLike.test.js b/test/isArrayLike/isArrayLike.test.js new file mode 100644 index 000000000..253efd87d --- /dev/null +++ b/test/isArrayLike/isArrayLike.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const isArrayLike = require('./isArrayLike.js'); + + + test('isArrayLike is a Function', () => { + expect(isArrayLike).toBeInstanceOf(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'); + + diff --git a/test3/isBoolean/isBoolean.js b/test/isBoolean/isBoolean.js similarity index 100% rename from test3/isBoolean/isBoolean.js rename to test/isBoolean/isBoolean.js diff --git a/test/isBoolean/isBoolean.test.js b/test/isBoolean/isBoolean.test.js new file mode 100644 index 000000000..68b737800 --- /dev/null +++ b/test/isBoolean/isBoolean.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const isBoolean = require('./isBoolean.js'); + + + test('isBoolean is a Function', () => { + expect(isBoolean).toBeInstanceOf(Function); +}); + t.equal(isBoolean(null), false, "passed value is not a boolean"); + t.equal(isBoolean(false), true, "passed value is not a boolean"); + diff --git a/test3/isBrowser/isBrowser.js b/test/isBrowser/isBrowser.js similarity index 100% rename from test3/isBrowser/isBrowser.js rename to test/isBrowser/isBrowser.js diff --git a/test/isBrowser/isBrowser.test.js b/test/isBrowser/isBrowser.test.js new file mode 100644 index 000000000..7296ed250 --- /dev/null +++ b/test/isBrowser/isBrowser.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const isBrowser = require('./isBrowser.js'); + + + test('isBrowser is a Function', () => { + expect(isBrowser).toBeInstanceOf(Function); +}); + diff --git a/test3/isBrowserTabFocused/isBrowserTabFocused.js b/test/isBrowserTabFocused/isBrowserTabFocused.js similarity index 100% rename from test3/isBrowserTabFocused/isBrowserTabFocused.js rename to test/isBrowserTabFocused/isBrowserTabFocused.js diff --git a/test/isBrowserTabFocused/isBrowserTabFocused.test.js b/test/isBrowserTabFocused/isBrowserTabFocused.test.js new file mode 100644 index 000000000..3ec43b2db --- /dev/null +++ b/test/isBrowserTabFocused/isBrowserTabFocused.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const isBrowserTabFocused = require('./isBrowserTabFocused.js'); + + + test('isBrowserTabFocused is a Function', () => { + expect(isBrowserTabFocused).toBeInstanceOf(Function); +}); + diff --git a/test3/isDivisible/isDivisible.js b/test/isDivisible/isDivisible.js similarity index 100% rename from test3/isDivisible/isDivisible.js rename to test/isDivisible/isDivisible.js diff --git a/test/isDivisible/isDivisible.test.js b/test/isDivisible/isDivisible.test.js new file mode 100644 index 000000000..741dd3f1d --- /dev/null +++ b/test/isDivisible/isDivisible.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const isDivisible = require('./isDivisible.js'); + + + test('isDivisible is a Function', () => { + expect(isDivisible).toBeInstanceOf(Function); +}); + t.equal(isDivisible(6, 3), true, 'The number 6 is divisible by 3'); + diff --git a/test3/isEmpty/isEmpty.js b/test/isEmpty/isEmpty.js similarity index 100% rename from test3/isEmpty/isEmpty.js rename to test/isEmpty/isEmpty.js diff --git a/test/isEmpty/isEmpty.test.js b/test/isEmpty/isEmpty.test.js new file mode 100644 index 000000000..21e96f65d --- /dev/null +++ b/test/isEmpty/isEmpty.test.js @@ -0,0 +1,19 @@ +const expect = require('expect'); +const isEmpty = require('./isEmpty.js'); + + + test('isEmpty is a Function', () => { + expect(isEmpty).toBeInstanceOf(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'); + + diff --git a/test3/isEven/isEven.js b/test/isEven/isEven.js similarity index 100% rename from test3/isEven/isEven.js rename to test/isEven/isEven.js diff --git a/test/isEven/isEven.test.js b/test/isEven/isEven.test.js new file mode 100644 index 000000000..5065b80c8 --- /dev/null +++ b/test/isEven/isEven.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const isEven = require('./isEven.js'); + + + test('isEven is a Function', () => { + expect(isEven).toBeInstanceOf(Function); +}); + t.equal(isEven(4), true, '4 is even number'); + test('5 is not an even number', () => { + expect(isEven(5), false).toBeFalsy(); +}); + diff --git a/test3/isFunction/isFunction.js b/test/isFunction/isFunction.js similarity index 100% rename from test3/isFunction/isFunction.js rename to test/isFunction/isFunction.js diff --git a/test/isFunction/isFunction.test.js b/test/isFunction/isFunction.test.js new file mode 100644 index 000000000..030d4b73f --- /dev/null +++ b/test/isFunction/isFunction.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const isFunction = require('./isFunction.js'); + + + test('isFunction is a Function', () => { + expect(isFunction).toBeInstanceOf(Function); +}); + t.equal(isFunction(x => x), true, "passed value is a function"); + t.equal(isFunction('x'), false, "passed value is not a function"); + diff --git a/test3/isLowerCase/isLowerCase.js b/test/isLowerCase/isLowerCase.js similarity index 100% rename from test3/isLowerCase/isLowerCase.js rename to test/isLowerCase/isLowerCase.js diff --git a/test/isLowerCase/isLowerCase.test.js b/test/isLowerCase/isLowerCase.test.js new file mode 100644 index 000000000..90f795f50 --- /dev/null +++ b/test/isLowerCase/isLowerCase.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const isLowerCase = require('./isLowerCase.js'); + + + test('isLowerCase is a Function', () => { + expect(isLowerCase).toBeInstanceOf(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"); + diff --git a/test3/isMap/isMap.js b/test/isMap/isMap.js similarity index 100% rename from test3/isMap/isMap.js rename to test/isMap/isMap.js diff --git a/test/isMap/isMap.test.js b/test/isMap/isMap.test.js new file mode 100644 index 000000000..3be014cbb --- /dev/null +++ b/test/isMap/isMap.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const isMap = require('./isMap.js'); + + + test('isMap is a Function', () => { + expect(isMap).toBeInstanceOf(Function); +}); + diff --git a/test3/isNil/isNil.js b/test/isNil/isNil.js similarity index 100% rename from test3/isNil/isNil.js rename to test/isNil/isNil.js diff --git a/test/isNil/isNil.test.js b/test/isNil/isNil.test.js new file mode 100644 index 000000000..3ee0892a0 --- /dev/null +++ b/test/isNil/isNil.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const isNil = require('./isNil.js'); + + + test('isNil is a Function', () => { + expect(isNil).toBeInstanceOf(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'); + + diff --git a/test3/isNull/isNull.js b/test/isNull/isNull.js similarity index 100% rename from test3/isNull/isNull.js rename to test/isNull/isNull.js diff --git a/test/isNull/isNull.test.js b/test/isNull/isNull.test.js new file mode 100644 index 000000000..84ffdc594 --- /dev/null +++ b/test/isNull/isNull.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const isNull = require('./isNull.js'); + + + test('isNull is a Function', () => { + expect(isNull).toBeInstanceOf(Function); +}); + t.equal(isNull(null), true, "passed argument is a null"); + t.equal(isNull(NaN), false, "passed argument is a null"); + diff --git a/test3/isNumber/isNumber.js b/test/isNumber/isNumber.js similarity index 100% rename from test3/isNumber/isNumber.js rename to test/isNumber/isNumber.js diff --git a/test/isNumber/isNumber.test.js b/test/isNumber/isNumber.test.js new file mode 100644 index 000000000..2211dd343 --- /dev/null +++ b/test/isNumber/isNumber.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const isNumber = require('./isNumber.js'); + + + test('isNumber is a Function', () => { + expect(isNumber).toBeInstanceOf(Function); +}); + t.equal(isNumber(1), true, "passed argument is a number"); + t.equal(isNumber('1'), false, "passed argument is not a number"); + diff --git a/test3/isObject/isObject.js b/test/isObject/isObject.js similarity index 100% rename from test3/isObject/isObject.js rename to test/isObject/isObject.js diff --git a/test/isObject/isObject.test.js b/test/isObject/isObject.test.js new file mode 100644 index 000000000..a4f79d110 --- /dev/null +++ b/test/isObject/isObject.test.js @@ -0,0 +1,22 @@ +const expect = require('expect'); +const isObject = require('./isObject.js'); + + + 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/test3/isObjectLike/isObjectLike.js b/test/isObjectLike/isObjectLike.js similarity index 100% rename from test3/isObjectLike/isObjectLike.js rename to test/isObjectLike/isObjectLike.js diff --git a/test/isObjectLike/isObjectLike.test.js b/test/isObjectLike/isObjectLike.test.js new file mode 100644 index 000000000..1bf9fe014 --- /dev/null +++ b/test/isObjectLike/isObjectLike.test.js @@ -0,0 +1,13 @@ +const expect = require('expect'); +const isObjectLike = require('./isObjectLike.js'); + + + test('isObjectLike is a Function', () => { + expect(isObjectLike).toBeInstanceOf(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'); + + diff --git a/test3/isPlainObject/isPlainObject.js b/test/isPlainObject/isPlainObject.js similarity index 100% rename from test3/isPlainObject/isPlainObject.js rename to test/isPlainObject/isPlainObject.js diff --git a/test/isPlainObject/isPlainObject.test.js b/test/isPlainObject/isPlainObject.test.js new file mode 100644 index 000000000..985a1f704 --- /dev/null +++ b/test/isPlainObject/isPlainObject.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const isPlainObject = require('./isPlainObject.js'); + + + test('isPlainObject is a Function', () => { + expect(isPlainObject).toBeInstanceOf(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)'); + + diff --git a/test4/isPrime/isPrime.js b/test/isPrime/isPrime.js similarity index 100% rename from test4/isPrime/isPrime.js rename to test/isPrime/isPrime.js diff --git a/test/isPrime/isPrime.test.js b/test/isPrime/isPrime.test.js new file mode 100644 index 000000000..ded341837 --- /dev/null +++ b/test/isPrime/isPrime.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const isPrime = require('./isPrime.js'); + + + test('isPrime is a Function', () => { + expect(isPrime).toBeInstanceOf(Function); +}); + t.equal(isPrime(11), true, "passed number is a prime"); + diff --git a/test4/isPrimitive/isPrimitive.js b/test/isPrimitive/isPrimitive.js similarity index 100% rename from test4/isPrimitive/isPrimitive.js rename to test/isPrimitive/isPrimitive.js diff --git a/test/isPrimitive/isPrimitive.test.js b/test/isPrimitive/isPrimitive.test.js new file mode 100644 index 000000000..edd290d1a --- /dev/null +++ b/test/isPrimitive/isPrimitive.test.js @@ -0,0 +1,25 @@ +const expect = require('expect'); +const isPrimitive = require('./isPrimitive.js'); + + + test('isPrimitive is a Function', () => { + expect(isPrimitive).toBeInstanceOf(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(); + test('isPrimitive({ a: 123 }) takes less than 2s to run', () => { + expect((end - start) < 2000).toBeTruthy(); +}); + diff --git a/test4/isPromiseLike/isPromiseLike.js b/test/isPromiseLike/isPromiseLike.js similarity index 100% rename from test4/isPromiseLike/isPromiseLike.js rename to test/isPromiseLike/isPromiseLike.js diff --git a/test/isPromiseLike/isPromiseLike.test.js b/test/isPromiseLike/isPromiseLike.test.js new file mode 100644 index 000000000..a87ceb480 --- /dev/null +++ b/test/isPromiseLike/isPromiseLike.test.js @@ -0,0 +1,16 @@ +const expect = require('expect'); +const isPromiseLike = require('./isPromiseLike.js'); + + + test('isPromiseLike is a Function', () => { + expect(isPromiseLike).toBeInstanceOf(Function); +}); + t.equal(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'); + + diff --git a/test4/isRegExp/isRegExp.js b/test/isRegExp/isRegExp.js similarity index 100% rename from test4/isRegExp/isRegExp.js rename to test/isRegExp/isRegExp.js diff --git a/test/isRegExp/isRegExp.test.js b/test/isRegExp/isRegExp.test.js new file mode 100644 index 000000000..ef99fcdd0 --- /dev/null +++ b/test/isRegExp/isRegExp.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const isRegExp = require('./isRegExp.js'); + + + test('isRegExp is a Function', () => { + expect(isRegExp).toBeInstanceOf(Function); +}); + diff --git a/test4/isSet/isSet.js b/test/isSet/isSet.js similarity index 100% rename from test4/isSet/isSet.js rename to test/isSet/isSet.js diff --git a/test/isSet/isSet.test.js b/test/isSet/isSet.test.js new file mode 100644 index 000000000..e5e4c3630 --- /dev/null +++ b/test/isSet/isSet.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const isSet = require('./isSet.js'); + + + test('isSet is a Function', () => { + expect(isSet).toBeInstanceOf(Function); +}); + diff --git a/test4/isSimilar/isSimilar.js b/test/isSimilar/isSimilar.js similarity index 100% rename from test4/isSimilar/isSimilar.js rename to test/isSimilar/isSimilar.js diff --git a/test/isSimilar/isSimilar.test.js b/test/isSimilar/isSimilar.test.js new file mode 100644 index 000000000..f349dc7c9 --- /dev/null +++ b/test/isSimilar/isSimilar.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const isSimilar = require('./isSimilar.js'); + + + test('isSimilar is a Function', () => { + expect(isSimilar).toBeInstanceOf(Function); +}); + diff --git a/test4/isSorted/isSorted.js b/test/isSorted/isSorted.js similarity index 100% rename from test4/isSorted/isSorted.js rename to test/isSorted/isSorted.js diff --git a/test/isSorted/isSorted.test.js b/test/isSorted/isSorted.test.js new file mode 100644 index 000000000..06c7f459b --- /dev/null +++ b/test/isSorted/isSorted.test.js @@ -0,0 +1,20 @@ +const expect = require('expect'); +const isSorted = require('./isSorted.js'); + + + test('isSorted is a Function', () => { + expect(isSorted).toBeInstanceOf(Function); +}); + 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'); + + diff --git a/test4/isString/isString.js b/test/isString/isString.js similarity index 100% rename from test4/isString/isString.js rename to test/isString/isString.js diff --git a/test/isString/isString.test.js b/test/isString/isString.test.js new file mode 100644 index 000000000..ce50d62c7 --- /dev/null +++ b/test/isString/isString.test.js @@ -0,0 +1,13 @@ +const expect = require('expect'); +const isString = require('./isString.js'); + + + test('isString is a Function', () => { + expect(isString).toBeInstanceOf(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'); + diff --git a/test4/isSymbol/isSymbol.js b/test/isSymbol/isSymbol.js similarity index 100% rename from test4/isSymbol/isSymbol.js rename to test/isSymbol/isSymbol.js diff --git a/test/isSymbol/isSymbol.test.js b/test/isSymbol/isSymbol.test.js new file mode 100644 index 000000000..e779b9500 --- /dev/null +++ b/test/isSymbol/isSymbol.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const isSymbol = require('./isSymbol.js'); + + + test('isSymbol is a Function', () => { + expect(isSymbol).toBeInstanceOf(Function); +}); + t.equal(isSymbol(Symbol('x')), true, "Checks if the given argument is a symbol"); + diff --git a/test4/isTravisCI/isTravisCI.js b/test/isTravisCI/isTravisCI.js similarity index 100% rename from test4/isTravisCI/isTravisCI.js rename to test/isTravisCI/isTravisCI.js diff --git a/test/isTravisCI/isTravisCI.test.js b/test/isTravisCI/isTravisCI.test.js new file mode 100644 index 000000000..787d4845f --- /dev/null +++ b/test/isTravisCI/isTravisCI.test.js @@ -0,0 +1,17 @@ +const expect = require('expect'); +const isTravisCI = require('./isTravisCI.js'); + + + 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/test4/isTypedArray/isTypedArray.js b/test/isTypedArray/isTypedArray.js similarity index 100% rename from test4/isTypedArray/isTypedArray.js rename to test/isTypedArray/isTypedArray.js diff --git a/test/isTypedArray/isTypedArray.test.js b/test/isTypedArray/isTypedArray.test.js new file mode 100644 index 000000000..cf37182b7 --- /dev/null +++ b/test/isTypedArray/isTypedArray.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const isTypedArray = require('./isTypedArray.js'); + + + test('isTypedArray is a Function', () => { + expect(isTypedArray).toBeInstanceOf(Function); +}); + diff --git a/test4/isUndefined/isUndefined.js b/test/isUndefined/isUndefined.js similarity index 100% rename from test4/isUndefined/isUndefined.js rename to test/isUndefined/isUndefined.js diff --git a/test/isUndefined/isUndefined.test.js b/test/isUndefined/isUndefined.test.js new file mode 100644 index 000000000..01b7b9095 --- /dev/null +++ b/test/isUndefined/isUndefined.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const isUndefined = require('./isUndefined.js'); + + + test('isUndefined is a Function', () => { + expect(isUndefined).toBeInstanceOf(Function); +}); + test('Returns true for undefined', () => { + expect(isUndefined(undefined)).toBeTruthy(); +}); + + diff --git a/test4/isUpperCase/isUpperCase.js b/test/isUpperCase/isUpperCase.js similarity index 100% rename from test4/isUpperCase/isUpperCase.js rename to test/isUpperCase/isUpperCase.js diff --git a/test/isUpperCase/isUpperCase.test.js b/test/isUpperCase/isUpperCase.test.js new file mode 100644 index 000000000..a50c7aa2a --- /dev/null +++ b/test/isUpperCase/isUpperCase.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const isUpperCase = require('./isUpperCase.js'); + + + test('isUpperCase is a Function', () => { + expect(isUpperCase).toBeInstanceOf(Function); +}); + 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'); + diff --git a/test4/isValidJSON/isValidJSON.js b/test/isValidJSON/isValidJSON.js similarity index 100% rename from test4/isValidJSON/isValidJSON.js rename to test/isValidJSON/isValidJSON.js diff --git a/test/isValidJSON/isValidJSON.test.js b/test/isValidJSON/isValidJSON.test.js new file mode 100644 index 000000000..8ab0fd2fa --- /dev/null +++ b/test/isValidJSON/isValidJSON.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const isValidJSON = require('./isValidJSON.js'); + + + test('isValidJSON is a Function', () => { + expect(isValidJSON).toBeInstanceOf(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'); + diff --git a/test4/isWeakMap/isWeakMap.js b/test/isWeakMap/isWeakMap.js similarity index 100% rename from test4/isWeakMap/isWeakMap.js rename to test/isWeakMap/isWeakMap.js diff --git a/test/isWeakMap/isWeakMap.test.js b/test/isWeakMap/isWeakMap.test.js new file mode 100644 index 000000000..6ffa40525 --- /dev/null +++ b/test/isWeakMap/isWeakMap.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const isWeakMap = require('./isWeakMap.js'); + + + test('isWeakMap is a Function', () => { + expect(isWeakMap).toBeInstanceOf(Function); +}); + diff --git a/test4/isWeakSet/isWeakSet.js b/test/isWeakSet/isWeakSet.js similarity index 100% rename from test4/isWeakSet/isWeakSet.js rename to test/isWeakSet/isWeakSet.js diff --git a/test/isWeakSet/isWeakSet.test.js b/test/isWeakSet/isWeakSet.test.js new file mode 100644 index 000000000..f071c38b3 --- /dev/null +++ b/test/isWeakSet/isWeakSet.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const isWeakSet = require('./isWeakSet.js'); + + + test('isWeakSet is a Function', () => { + expect(isWeakSet).toBeInstanceOf(Function); +}); + diff --git a/test4/join/join.js b/test/join/join.js similarity index 100% rename from test4/join/join.js rename to test/join/join.js diff --git a/test/join/join.test.js b/test/join/join.test.js new file mode 100644 index 000000000..4380658a2 --- /dev/null +++ b/test/join/join.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const join = require('./join.js'); + + + test('join is a Function', () => { + expect(join).toBeInstanceOf(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"); + diff --git a/test4/last/last.js b/test/last/last.js similarity index 100% rename from test4/last/last.js rename to test/last/last.js diff --git a/test/last/last.test.js b/test/last/last.test.js new file mode 100644 index 000000000..f2d4081a1 --- /dev/null +++ b/test/last/last.test.js @@ -0,0 +1,24 @@ +const expect = require('expect'); +const last = require('./last.js'); + + + test('last is a Function', () => { + expect(last).toBeInstanceOf(Function); +}); + test('last({ a: 1234}) returns undefined', () => { + expect(last({ a: 1234}) === undefined).toBeTruthy(); +}); + 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(); + 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/test4/lcm/lcm.js b/test/lcm/lcm.js similarity index 100% rename from test4/lcm/lcm.js rename to test/lcm/lcm.js diff --git a/test/lcm/lcm.test.js b/test/lcm/lcm.test.js new file mode 100644 index 000000000..cf85e5970 --- /dev/null +++ b/test/lcm/lcm.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const lcm = require('./lcm.js'); + + + test('lcm is a Function', () => { + expect(lcm).toBeInstanceOf(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."); + diff --git a/test4/levenshteinDistance/levenshteinDistance.js b/test/levenshteinDistance/levenshteinDistance.js similarity index 100% rename from test4/levenshteinDistance/levenshteinDistance.js rename to test/levenshteinDistance/levenshteinDistance.js diff --git a/test/levenshteinDistance/levenshteinDistance.test.js b/test/levenshteinDistance/levenshteinDistance.test.js new file mode 100644 index 000000000..44ae20d78 --- /dev/null +++ b/test/levenshteinDistance/levenshteinDistance.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const levenshteinDistance = require('./levenshteinDistance.js'); + + + test('levenshteinDistance is a Function', () => { + expect(levenshteinDistance).toBeInstanceOf(Function); +}); + diff --git a/test4/longestItem/longestItem.js b/test/longestItem/longestItem.js similarity index 100% rename from test4/longestItem/longestItem.js rename to test/longestItem/longestItem.js diff --git a/test/longestItem/longestItem.test.js b/test/longestItem/longestItem.test.js new file mode 100644 index 000000000..7d2b0b6e2 --- /dev/null +++ b/test/longestItem/longestItem.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const longestItem = require('./longestItem.js'); + + + test('longestItem is a Function', () => { + expect(longestItem).toBeInstanceOf(Function); +}); + t.deepEqual(longestItem('this', 'is', 'a', 'testcase'), 'testcase', "Returns the longest object"); + diff --git a/test4/lowercaseKeys/lowercaseKeys.js b/test/lowercaseKeys/lowercaseKeys.js similarity index 94% rename from test4/lowercaseKeys/lowercaseKeys.js rename to test/lowercaseKeys/lowercaseKeys.js index 3c5901fe4..e78c5fba2 100644 --- a/test4/lowercaseKeys/lowercaseKeys.js +++ b/test/lowercaseKeys/lowercaseKeys.js @@ -2,5 +2,5 @@ const lowercaseKeys = obj => Object.keys(obj).reduce((acc, key) => { acc[key.toLowerCase()] = obj[key]; return acc; -}, {}); +}, { module.exports = lowercaseKeys; \ No newline at end of file diff --git a/test/lowercaseKeys/lowercaseKeys.test.js b/test/lowercaseKeys/lowercaseKeys.test.js new file mode 100644 index 000000000..eb0c9bd02 --- /dev/null +++ b/test/lowercaseKeys/lowercaseKeys.test.js @@ -0,0 +1,13 @@ +const expect = require('expect'); +const lowercaseKeys = require('./lowercaseKeys.js'); + + + test('lowercaseKeys is a Function', () => { + expect(lowercaseKeys).toBeInstanceOf(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'); + + diff --git a/test4/luhnCheck/luhnCheck.js b/test/luhnCheck/luhnCheck.js similarity index 100% rename from test4/luhnCheck/luhnCheck.js rename to test/luhnCheck/luhnCheck.js diff --git a/test/luhnCheck/luhnCheck.test.js b/test/luhnCheck/luhnCheck.test.js new file mode 100644 index 000000000..7c1647865 --- /dev/null +++ b/test/luhnCheck/luhnCheck.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const luhnCheck = require('./luhnCheck.js'); + + + test('luhnCheck is a Function', () => { + expect(luhnCheck).toBeInstanceOf(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"); + diff --git a/test4/mapKeys/mapKeys.js b/test/mapKeys/mapKeys.js similarity index 94% rename from test4/mapKeys/mapKeys.js rename to test/mapKeys/mapKeys.js index 524a636c3..1600ca90e 100644 --- a/test4/mapKeys/mapKeys.js +++ b/test/mapKeys/mapKeys.js @@ -2,5 +2,5 @@ const mapKeys = (obj, fn) => Object.keys(obj).reduce((acc, k) => { acc[fn(obj[k], k, obj)] = obj[k]; return acc; -}, {}); +}, { module.exports = mapKeys; \ No newline at end of file diff --git a/test/mapKeys/mapKeys.test.js b/test/mapKeys/mapKeys.test.js new file mode 100644 index 000000000..312dadee9 --- /dev/null +++ b/test/mapKeys/mapKeys.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const mapKeys = require('./mapKeys.js'); + + + test('mapKeys is a Function', () => { + expect(mapKeys).toBeInstanceOf(Function); +}); + t.deepEqual(mapKeys({ a: 1, b: 2 }, (val, key) => key + val), { a1: 1, b2: 2 }, 'Maps keys'); + + diff --git a/test4/mapObject/mapObject.js b/test/mapObject/mapObject.js similarity index 100% rename from test4/mapObject/mapObject.js rename to test/mapObject/mapObject.js diff --git a/test/mapObject/mapObject.test.js b/test/mapObject/mapObject.test.js new file mode 100644 index 000000000..2c3b5a01d --- /dev/null +++ b/test/mapObject/mapObject.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const mapObject = require('./mapObject.js'); + + + test('mapObject is a Function', () => { + expect(mapObject).toBeInstanceOf(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 }'); + + diff --git a/test4/mapValues/mapValues.js b/test/mapValues/mapValues.js similarity index 94% rename from test4/mapValues/mapValues.js rename to test/mapValues/mapValues.js index abec7632d..34955dbd4 100644 --- a/test4/mapValues/mapValues.js +++ b/test/mapValues/mapValues.js @@ -2,5 +2,5 @@ const mapValues = (obj, fn) => Object.keys(obj).reduce((acc, k) => { acc[k] = fn(obj[k], k, obj); return acc; -}, {}); +}, { module.exports = mapValues; \ No newline at end of file diff --git a/test/mapValues/mapValues.test.js b/test/mapValues/mapValues.test.js new file mode 100644 index 000000000..75ab17b96 --- /dev/null +++ b/test/mapValues/mapValues.test.js @@ -0,0 +1,14 @@ +const expect = require('expect'); +const mapValues = require('./mapValues.js'); + + + test('mapValues is a Function', () => { + expect(mapValues).toBeInstanceOf(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'); + + diff --git a/test4/mask/mask.js b/test/mask/mask.js similarity index 100% rename from test4/mask/mask.js rename to test/mask/mask.js diff --git a/test/mask/mask.test.js b/test/mask/mask.test.js new file mode 100644 index 000000000..ca1fab4ab --- /dev/null +++ b/test/mask/mask.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const mask = require('./mask.js'); + + + test('mask is a Function', () => { + expect(mask).toBeInstanceOf(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"); + diff --git a/test4/matches/matches.js b/test/matches/matches.js similarity index 100% rename from test4/matches/matches.js rename to test/matches/matches.js diff --git a/test/matches/matches.test.js b/test/matches/matches.test.js new file mode 100644 index 000000000..e0e33998d --- /dev/null +++ b/test/matches/matches.test.js @@ -0,0 +1,15 @@ +const expect = require('expect'); +const matches = require('./matches.js'); + + + 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/test4/matchesWith/matchesWith.js b/test/matchesWith/matchesWith.js similarity index 100% rename from test4/matchesWith/matchesWith.js rename to test/matchesWith/matchesWith.js diff --git a/test/matchesWith/matchesWith.test.js b/test/matchesWith/matchesWith.test.js new file mode 100644 index 000000000..d463b7817 --- /dev/null +++ b/test/matchesWith/matchesWith.test.js @@ -0,0 +1,15 @@ +const expect = require('expect'); +const matchesWith = require('./matchesWith.js'); + + + test('matchesWith is a Function', () => { + expect(matchesWith).toBeInstanceOf(Function); +}); + const isGreeting = val => /^h(?:i|ello)$/.test(val); + t.true(matchesWith( + { greeting: 'hello' }, + { greeting: 'hi' }, + (oV, sV) => isGreeting(oV) && isGreeting(sV) + ), 'Returns true for two objects with similar values, based on the provided function'); + + diff --git a/test4/maxBy/maxBy.js b/test/maxBy/maxBy.js similarity index 100% rename from test4/maxBy/maxBy.js rename to test/maxBy/maxBy.js diff --git a/test/maxBy/maxBy.test.js b/test/maxBy/maxBy.test.js new file mode 100644 index 000000000..b9866da4b --- /dev/null +++ b/test/maxBy/maxBy.test.js @@ -0,0 +1,15 @@ +const expect = require('expect'); +const maxBy = require('./maxBy.js'); + + + 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), 8).toBe() +}); + test('Produces the right result with a property name', () => { + expect(maxBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], 'n'), 8).toBe() +}); + + diff --git a/test4/maxN/maxN.js b/test/maxN/maxN.js similarity index 100% rename from test4/maxN/maxN.js rename to test/maxN/maxN.js diff --git a/test/maxN/maxN.test.js b/test/maxN/maxN.test.js new file mode 100644 index 000000000..aaad1b7c3 --- /dev/null +++ b/test/maxN/maxN.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const maxN = require('./maxN.js'); + + + test('maxN is a Function', () => { + expect(maxN).toBeInstanceOf(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"); + diff --git a/test4/median/median.js b/test/median/median.js similarity index 100% rename from test4/median/median.js rename to test/median/median.js diff --git a/test/median/median.test.js b/test/median/median.test.js new file mode 100644 index 000000000..da38d46cc --- /dev/null +++ b/test/median/median.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const median = require('./median.js'); + + + test('median is a Function', () => { + expect(median).toBeInstanceOf(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"); + diff --git a/test4/memoize/memoize.js b/test/memoize/memoize.js similarity index 100% rename from test4/memoize/memoize.js rename to test/memoize/memoize.js diff --git a/test/memoize/memoize.test.js b/test/memoize/memoize.test.js new file mode 100644 index 000000000..f646ed27a --- /dev/null +++ b/test/memoize/memoize.test.js @@ -0,0 +1,14 @@ +const expect = require('expect'); +const memoize = require('./memoize.js'); + + + test('memoize is a Function', () => { + expect(memoize).toBeInstanceOf(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'); + + diff --git a/test4/merge/merge.js b/test/merge/merge.js similarity index 100% rename from test4/merge/merge.js rename to test/merge/merge.js diff --git a/test/merge/merge.test.js b/test/merge/merge.test.js new file mode 100644 index 000000000..337c466ca --- /dev/null +++ b/test/merge/merge.test.js @@ -0,0 +1,19 @@ +const expect = require('expect'); +const merge = require('./merge.js'); + + + 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' + }; + t.deepEqual(merge(object, other), { a: [ { x: 2 }, { y: 4 }, { z: 3 } ], b: [ 1, 2, 3 ], c: 'foo' }, 'Merges two objects'); + + diff --git a/test4/minBy/minBy.js b/test/minBy/minBy.js similarity index 100% rename from test4/minBy/minBy.js rename to test/minBy/minBy.js diff --git a/test/minBy/minBy.test.js b/test/minBy/minBy.test.js new file mode 100644 index 000000000..dfd8ba57a --- /dev/null +++ b/test/minBy/minBy.test.js @@ -0,0 +1,15 @@ +const expect = require('expect'); +const minBy = require('./minBy.js'); + + + 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), 2).toBe() +}); + test('Produces the right result with a property name', () => { + expect(minBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], 'n'), 2).toBe() +}); + + diff --git a/test4/minN/minN.js b/test/minN/minN.js similarity index 100% rename from test4/minN/minN.js rename to test/minN/minN.js diff --git a/test/minN/minN.test.js b/test/minN/minN.test.js new file mode 100644 index 000000000..5f171662d --- /dev/null +++ b/test/minN/minN.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const minN = require('./minN.js'); + + + test('minN is a Function', () => { + expect(minN).toBeInstanceOf(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"); + diff --git a/test4/mostPerformant/mostPerformant.js b/test/mostPerformant/mostPerformant.js similarity index 98% rename from test4/mostPerformant/mostPerformant.js rename to test/mostPerformant/mostPerformant.js index ae084a5cf..f1764e058 100644 --- a/test4/mostPerformant/mostPerformant.js +++ b/test/mostPerformant/mostPerformant.js @@ -3,7 +3,7 @@ const times = fns.map(fn => { const before = performance.now(); for (let i = 0; i < iterations; i++) fn(); return performance.now() - before; -}); + return times.indexOf(Math.min(...times)); }; module.exports = mostPerformant; \ No newline at end of file diff --git a/test/mostPerformant/mostPerformant.test.js b/test/mostPerformant/mostPerformant.test.js new file mode 100644 index 000000000..cffb718a6 --- /dev/null +++ b/test/mostPerformant/mostPerformant.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const mostPerformant = require('./mostPerformant.js'); + + + test('mostPerformant is a Function', () => { + expect(mostPerformant).toBeInstanceOf(Function); +}); + t.pass('Tested by @chalarangelo on 16/02/2018'); + + diff --git a/test4/negate/negate.js b/test/negate/negate.js similarity index 100% rename from test4/negate/negate.js rename to test/negate/negate.js diff --git a/test/negate/negate.test.js b/test/negate/negate.test.js new file mode 100644 index 000000000..1787751a9 --- /dev/null +++ b/test/negate/negate.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const negate = require('./negate.js'); + + + test('negate is a Function', () => { + expect(negate).toBeInstanceOf(Function); +}); + t.deepEqual([1, 2, 3, 4, 5, 6].filter(negate(n => n % 2 === 0)), [1, 3, 5], "Negates a predicate function"); + + diff --git a/test4/nest/nest.js b/test/nest/nest.js similarity index 100% rename from test4/nest/nest.js rename to test/nest/nest.js diff --git a/test/nest/nest.test.js b/test/nest/nest.test.js new file mode 100644 index 000000000..65649a3c8 --- /dev/null +++ b/test/nest/nest.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const nest = require('./nest.js'); + + + test('nest is a Function', () => { + expect(nest).toBeInstanceOf(Function); +}); + diff --git a/test4/nodeListToArray/nodeListToArray.js b/test/nodeListToArray/nodeListToArray.js similarity index 100% rename from test4/nodeListToArray/nodeListToArray.js rename to test/nodeListToArray/nodeListToArray.js diff --git a/test/nodeListToArray/nodeListToArray.test.js b/test/nodeListToArray/nodeListToArray.test.js new file mode 100644 index 000000000..175ce6cc7 --- /dev/null +++ b/test/nodeListToArray/nodeListToArray.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const nodeListToArray = require('./nodeListToArray.js'); + + + test('nodeListToArray is a Function', () => { + expect(nodeListToArray).toBeInstanceOf(Function); +}); + diff --git a/test4/none/none.js b/test/none/none.js similarity index 100% rename from test4/none/none.js rename to test/none/none.js diff --git a/test/none/none.test.js b/test/none/none.test.js new file mode 100644 index 000000000..89a701c87 --- /dev/null +++ b/test/none/none.test.js @@ -0,0 +1,21 @@ +const expect = require('expect'); +const none = require('./none.js'); + + + 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/test4/nthArg/nthArg.js b/test/nthArg/nthArg.js similarity index 100% rename from test4/nthArg/nthArg.js rename to test/nthArg/nthArg.js diff --git a/test/nthArg/nthArg.test.js b/test/nthArg/nthArg.test.js new file mode 100644 index 000000000..edbce4300 --- /dev/null +++ b/test/nthArg/nthArg.test.js @@ -0,0 +1,14 @@ +const expect = require('expect'); +const nthArg = require('./nthArg.js'); + + + test('nthArg is a Function', () => { + expect(nthArg).toBeInstanceOf(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'); + + diff --git a/test4/nthElement/nthElement.js b/test/nthElement/nthElement.js similarity index 100% rename from test4/nthElement/nthElement.js rename to test/nthElement/nthElement.js diff --git a/test/nthElement/nthElement.test.js b/test/nthElement/nthElement.test.js new file mode 100644 index 000000000..4a0f701b5 --- /dev/null +++ b/test/nthElement/nthElement.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const nthElement = require('./nthElement.js'); + + + test('nthElement is a Function', () => { + expect(nthElement).toBeInstanceOf(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."); + diff --git a/test4/objectFromPairs/objectFromPairs.js b/test/objectFromPairs/objectFromPairs.js similarity index 85% rename from test4/objectFromPairs/objectFromPairs.js rename to test/objectFromPairs/objectFromPairs.js index fa1f3fe47..ba14b229f 100644 --- a/test4/objectFromPairs/objectFromPairs.js +++ b/test/objectFromPairs/objectFromPairs.js @@ -1,2 +1,2 @@ -const objectFromPairs = arr => arr.reduce((a, v) => ((a[v[0]] = v[1]), a), {}); +const objectFromPairs = arr => arr.reduce((a, v) => ((a[v[0]] = v[1]), a), { module.exports = objectFromPairs; \ No newline at end of file diff --git a/test/objectFromPairs/objectFromPairs.test.js b/test/objectFromPairs/objectFromPairs.test.js new file mode 100644 index 000000000..f158cd137 --- /dev/null +++ b/test/objectFromPairs/objectFromPairs.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const objectFromPairs = require('./objectFromPairs.js'); + + + test('objectFromPairs is a Function', () => { + expect(objectFromPairs).toBeInstanceOf(Function); +}); + t.deepEqual(objectFromPairs([['a', 1], ['b', 2]]), {a: 1, b: 2}, "Creates an object from the given key-value pairs."); + diff --git a/test4/objectToPairs/objectToPairs.js b/test/objectToPairs/objectToPairs.js similarity index 100% rename from test4/objectToPairs/objectToPairs.js rename to test/objectToPairs/objectToPairs.js diff --git a/test/objectToPairs/objectToPairs.test.js b/test/objectToPairs/objectToPairs.test.js new file mode 100644 index 000000000..cc7b858d5 --- /dev/null +++ b/test/objectToPairs/objectToPairs.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const objectToPairs = require('./objectToPairs.js'); + + + test('objectToPairs is a Function', () => { + expect(objectToPairs).toBeInstanceOf(Function); +}); + t.deepEqual(objectToPairs({ a: 1, b: 2 }), [['a',1],['b',2]], "Creates an array of key-value pair arrays from an object."); + diff --git a/test4/observeMutations/observeMutations.js b/test/observeMutations/observeMutations.js similarity index 100% rename from test4/observeMutations/observeMutations.js rename to test/observeMutations/observeMutations.js diff --git a/test/observeMutations/observeMutations.test.js b/test/observeMutations/observeMutations.test.js new file mode 100644 index 000000000..9de9fd425 --- /dev/null +++ b/test/observeMutations/observeMutations.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const observeMutations = require('./observeMutations.js'); + + + test('observeMutations is a Function', () => { + expect(observeMutations).toBeInstanceOf(Function); +}); + t.pass('Tested on 09/02/2018 by @chalarangelo'); + + diff --git a/test4/off/off.js b/test/off/off.js similarity index 100% rename from test4/off/off.js rename to test/off/off.js diff --git a/test/off/off.test.js b/test/off/off.test.js new file mode 100644 index 000000000..ab48b3167 --- /dev/null +++ b/test/off/off.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const off = require('./off.js'); + + + test('off is a Function', () => { + expect(off).toBeInstanceOf(Function); +}); + t.pass('Tested by @chalarangelo on 16/02/2018'); + + diff --git a/test4/offset/offset.js b/test/offset/offset.js similarity index 100% rename from test4/offset/offset.js rename to test/offset/offset.js diff --git a/test/offset/offset.test.js b/test/offset/offset.test.js new file mode 100644 index 000000000..cf2622bf1 --- /dev/null +++ b/test/offset/offset.test.js @@ -0,0 +1,15 @@ +const expect = require('expect'); +const offset = require('./offset.js'); + + + test('offset is a Function', () => { + expect(offset).toBeInstanceOf(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.'); + + diff --git a/test4/omit/omit.js b/test/omit/omit.js similarity index 62% rename from test4/omit/omit.js rename to test/omit/omit.js index ffdbcbd82..d86c40009 100644 --- a/test4/omit/omit.js +++ b/test/omit/omit.js @@ -1,5 +1,5 @@ const omit = (obj, arr) => Object.keys(obj) .filter(k => !arr.includes(k)) -.reduce((acc, key) => ((acc[key] = obj[key]), acc), {}); +.reduce((acc, key) => ((acc[key] = obj[key]), acc), { module.exports = omit; \ No newline at end of file diff --git a/test/omit/omit.test.js b/test/omit/omit.test.js new file mode 100644 index 000000000..3629dfc96 --- /dev/null +++ b/test/omit/omit.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const omit = require('./omit.js'); + + + test('omit is a Function', () => { + expect(omit).toBeInstanceOf(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'); + + diff --git a/test5/omitBy/omitBy.js b/test/omitBy/omitBy.js similarity index 63% rename from test5/omitBy/omitBy.js rename to test/omitBy/omitBy.js index 5937a3d8a..ae8328ef9 100644 --- a/test5/omitBy/omitBy.js +++ b/test/omitBy/omitBy.js @@ -1,5 +1,5 @@ const omitBy = (obj, fn) => Object.keys(obj) .filter(k => !fn(obj[k], k)) -.reduce((acc, key) => ((acc[key] = obj[key]), acc), {}); +.reduce((acc, key) => ((acc[key] = obj[key]), acc), { module.exports = omitBy; \ No newline at end of file diff --git a/test/omitBy/omitBy.test.js b/test/omitBy/omitBy.test.js new file mode 100644 index 000000000..586bbd6b9 --- /dev/null +++ b/test/omitBy/omitBy.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const omitBy = require('./omitBy.js'); + + + test('omitBy is a Function', () => { + expect(omitBy).toBeInstanceOf(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'); + + diff --git a/test5/on/on.js b/test/on/on.js similarity index 100% rename from test5/on/on.js rename to test/on/on.js diff --git a/test/on/on.test.js b/test/on/on.test.js new file mode 100644 index 000000000..8496fd977 --- /dev/null +++ b/test/on/on.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const on = require('./on.js'); + + + test('on is a Function', () => { + expect(on).toBeInstanceOf(Function); +}); + t.pass('Tested by @chalarangelo on 16/02/2018'); + + diff --git a/test5/onUserInputChange/onUserInputChange.js b/test/onUserInputChange/onUserInputChange.js similarity index 99% rename from test5/onUserInputChange/onUserInputChange.js rename to test/onUserInputChange/onUserInputChange.js index 5cb956112..aea7639a8 100644 --- a/test5/onUserInputChange/onUserInputChange.js +++ b/test/onUserInputChange/onUserInputChange.js @@ -10,6 +10,6 @@ lastTime = now; document.addEventListener('touchstart', () => { if (type === 'touch') return; (type = 'touch'), callback(type), document.addEventListener('mousemove', mousemoveHandler); -}); + }; module.exports = onUserInputChange; \ No newline at end of file diff --git a/test/onUserInputChange/onUserInputChange.test.js b/test/onUserInputChange/onUserInputChange.test.js new file mode 100644 index 000000000..a31a50a88 --- /dev/null +++ b/test/onUserInputChange/onUserInputChange.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const onUserInputChange = require('./onUserInputChange.js'); + + + test('onUserInputChange is a Function', () => { + expect(onUserInputChange).toBeInstanceOf(Function); +}); + t.pass('Tested by @chalarangelo on 16/02/2018'); + + diff --git a/test5/once/once.js b/test/once/once.js similarity index 100% rename from test5/once/once.js rename to test/once/once.js diff --git a/test/once/once.test.js b/test/once/once.test.js new file mode 100644 index 000000000..c8ea9c9e9 --- /dev/null +++ b/test/once/once.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const once = require('./once.js'); + + + test('once is a Function', () => { + expect(once).toBeInstanceOf(Function); +}); + t.pass('Tested by @chalarangelo on 16/02/2018'); + + diff --git a/test5/orderBy/orderBy.js b/test/orderBy/orderBy.js similarity index 100% rename from test5/orderBy/orderBy.js rename to test/orderBy/orderBy.js diff --git a/test/orderBy/orderBy.test.js b/test/orderBy/orderBy.test.js new file mode 100644 index 000000000..82cc69fe2 --- /dev/null +++ b/test/orderBy/orderBy.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const orderBy = require('./orderBy.js'); + + + test('orderBy is a Function', () => { + expect(orderBy).toBeInstanceOf(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."); + diff --git a/test5/over/over.js b/test/over/over.js similarity index 100% rename from test5/over/over.js rename to test/over/over.js diff --git a/test/over/over.test.js b/test/over/over.test.js new file mode 100644 index 000000000..8ed724cfb --- /dev/null +++ b/test/over/over.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const over = require('./over.js'); + + + test('over is a Function', () => { + expect(over).toBeInstanceOf(Function); +}); + const minMax = over(Math.min, Math.max); + t.deepEqual(minMax(1, 2, 3, 4, 5), [1,5], 'Applies given functions over multiple arguments'); + + diff --git a/test5/overArgs/overArgs.js b/test/overArgs/overArgs.js similarity index 100% rename from test5/overArgs/overArgs.js rename to test/overArgs/overArgs.js diff --git a/test/overArgs/overArgs.test.js b/test/overArgs/overArgs.test.js new file mode 100644 index 000000000..19cce2cfa --- /dev/null +++ b/test/overArgs/overArgs.test.js @@ -0,0 +1,13 @@ +const expect = require('expect'); +const overArgs = require('./overArgs.js'); + + + 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]); + t.deepEqual(fn(9, 3), [81, 6], 'Invokes the provided function with its arguments transformed'); + + diff --git a/test5/pad/pad.js b/test/pad/pad.js similarity index 100% rename from test5/pad/pad.js rename to test/pad/pad.js diff --git a/test/pad/pad.test.js b/test/pad/pad.test.js new file mode 100644 index 000000000..f01524b50 --- /dev/null +++ b/test/pad/pad.test.js @@ -0,0 +1,13 @@ +const expect = require('expect'); +const pad = require('./pad.js'); + + + test('pad is a Function', () => { + expect(pad).toBeInstanceOf(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'); + + diff --git a/test5/palindrome/palindrome.js b/test/palindrome/palindrome.js similarity index 100% rename from test5/palindrome/palindrome.js rename to test/palindrome/palindrome.js diff --git a/test/palindrome/palindrome.test.js b/test/palindrome/palindrome.test.js new file mode 100644 index 000000000..559ea76b4 --- /dev/null +++ b/test/palindrome/palindrome.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const palindrome = require('./palindrome.js'); + + + test('palindrome is a Function', () => { + expect(palindrome).toBeInstanceOf(Function); +}); + t.equal(palindrome('taco cat'), true, "Given string is a palindrome"); + t.equal(palindrome('foobar'), false, "Given string is not a palindrome"); + diff --git a/test5/parseCookie/parseCookie.js b/test/parseCookie/parseCookie.js similarity index 96% rename from test5/parseCookie/parseCookie.js rename to test/parseCookie/parseCookie.js index 9e620bfe0..4a36c778c 100644 --- a/test5/parseCookie/parseCookie.js +++ b/test/parseCookie/parseCookie.js @@ -5,5 +5,5 @@ str .reduce((acc, v) => { acc[decodeURIComponent(v[0].trim())] = decodeURIComponent(v[1].trim()); return acc; -}, {}); +}, { module.exports = parseCookie; \ No newline at end of file diff --git a/test/parseCookie/parseCookie.test.js b/test/parseCookie/parseCookie.test.js new file mode 100644 index 000000000..b1c64e056 --- /dev/null +++ b/test/parseCookie/parseCookie.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const parseCookie = require('./parseCookie.js'); + + + test('parseCookie is a Function', () => { + expect(parseCookie).toBeInstanceOf(Function); +}); + t.deepEqual(parseCookie('foo=bar; equation=E%3Dmc%5E2'), { foo: 'bar', equation: 'E=mc^2' }, 'Parses the cookie'); + + diff --git a/test5/partial/partial.js b/test/partial/partial.js similarity index 100% rename from test5/partial/partial.js rename to test/partial/partial.js diff --git a/test/partial/partial.test.js b/test/partial/partial.test.js new file mode 100644 index 000000000..d9dc5dbf5 --- /dev/null +++ b/test/partial/partial.test.js @@ -0,0 +1,14 @@ +const expect = require('expect'); +const partial = require('./partial.js'); + + + test('partial is a Function', () => { + expect(partial).toBeInstanceOf(Function); +}); + function greet(greeting, name) { + return greeting + ' ' + name + '!'; + } + const greetHello = partial(greet, 'Hello'); + t.equal(greetHello('John'), 'Hello John!', 'Prepends arguments'); + + diff --git a/test5/partialRight/partialRight.js b/test/partialRight/partialRight.js similarity index 100% rename from test5/partialRight/partialRight.js rename to test/partialRight/partialRight.js diff --git a/test/partialRight/partialRight.test.js b/test/partialRight/partialRight.test.js new file mode 100644 index 000000000..d5e29fe1a --- /dev/null +++ b/test/partialRight/partialRight.test.js @@ -0,0 +1,14 @@ +const expect = require('expect'); +const partialRight = require('./partialRight.js'); + + + test('partialRight is a Function', () => { + expect(partialRight).toBeInstanceOf(Function); +}); + function greet(greeting, name) { + return greeting + ' ' + name + '!'; + } + const greetJohn = partialRight(greet, 'John'); + t.equal(greetJohn('Hello'), 'Hello John!', 'Appends arguments'); + + diff --git a/test5/partition/partition.js b/test/partition/partition.js similarity index 100% rename from test5/partition/partition.js rename to test/partition/partition.js diff --git a/test/partition/partition.test.js b/test/partition/partition.test.js new file mode 100644 index 000000000..958a9786d --- /dev/null +++ b/test/partition/partition.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const partition = require('./partition.js'); + + + test('partition is a Function', () => { + expect(partition).toBeInstanceOf(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."); + diff --git a/test5/percentile/percentile.js b/test/percentile/percentile.js similarity index 100% rename from test5/percentile/percentile.js rename to test/percentile/percentile.js diff --git a/test/percentile/percentile.test.js b/test/percentile/percentile.test.js new file mode 100644 index 000000000..b3288143c --- /dev/null +++ b/test/percentile/percentile.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const percentile = require('./percentile.js'); + + + test('percentile is a Function', () => { + expect(percentile).toBeInstanceOf(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."); + diff --git a/test5/permutations/permutations.js b/test/permutations/permutations.js similarity index 100% rename from test5/permutations/permutations.js rename to test/permutations/permutations.js diff --git a/test/permutations/permutations.test.js b/test/permutations/permutations.test.js new file mode 100644 index 000000000..3b1ffac73 --- /dev/null +++ b/test/permutations/permutations.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const permutations = require('./permutations.js'); + + + test('permutations is a Function', () => { + expect(permutations).toBeInstanceOf(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'); + + diff --git a/test5/pick/pick.js b/test/pick/pick.js similarity index 88% rename from test5/pick/pick.js rename to test/pick/pick.js index 28e8caac7..305fc06af 100644 --- a/test5/pick/pick.js +++ b/test/pick/pick.js @@ -1,3 +1,3 @@ const pick = (obj, arr) => -arr.reduce((acc, curr) => (curr in obj && (acc[curr] = obj[curr]), acc), {}); +arr.reduce((acc, curr) => (curr in obj && (acc[curr] = obj[curr]), acc), { module.exports = pick; \ No newline at end of file diff --git a/test/pick/pick.test.js b/test/pick/pick.test.js new file mode 100644 index 000000000..418f48d2d --- /dev/null +++ b/test/pick/pick.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const pick = require('./pick.js'); + + + test('pick is a Function', () => { + expect(pick).toBeInstanceOf(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."); + diff --git a/test5/pickBy/pickBy.js b/test/pickBy/pickBy.js similarity index 62% rename from test5/pickBy/pickBy.js rename to test/pickBy/pickBy.js index fa2f4701f..7d10b8139 100644 --- a/test5/pickBy/pickBy.js +++ b/test/pickBy/pickBy.js @@ -1,5 +1,5 @@ const pickBy = (obj, fn) => Object.keys(obj) .filter(k => fn(obj[k], k)) -.reduce((acc, key) => ((acc[key] = obj[key]), acc), {}); +.reduce((acc, key) => ((acc[key] = obj[key]), acc), { module.exports = pickBy; \ No newline at end of file diff --git a/test/pickBy/pickBy.test.js b/test/pickBy/pickBy.test.js new file mode 100644 index 000000000..d0e5d9b19 --- /dev/null +++ b/test/pickBy/pickBy.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const pickBy = require('./pickBy.js'); + + + test('pickBy is a Function', () => { + expect(pickBy).toBeInstanceOf(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.'); + + diff --git a/test5/pipeAsyncFunctions/pipeAsyncFunctions.js b/test/pipeAsyncFunctions/pipeAsyncFunctions.js similarity index 100% rename from test5/pipeAsyncFunctions/pipeAsyncFunctions.js rename to test/pipeAsyncFunctions/pipeAsyncFunctions.js diff --git a/test/pipeAsyncFunctions/pipeAsyncFunctions.test.js b/test/pipeAsyncFunctions/pipeAsyncFunctions.test.js new file mode 100644 index 000000000..b70731c9c --- /dev/null +++ b/test/pipeAsyncFunctions/pipeAsyncFunctions.test.js @@ -0,0 +1,19 @@ +const expect = require('expect'); +const pipeAsyncFunctions = require('./pipeAsyncFunctions.js'); + + + test('pipeAsyncFunctions is a Function', () => { + expect(pipeAsyncFunctions).toBeInstanceOf(Function); +}); + 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' + ); + diff --git a/test5/pipeFunctions/pipeFunctions.js b/test/pipeFunctions/pipeFunctions.js similarity index 100% rename from test5/pipeFunctions/pipeFunctions.js rename to test/pipeFunctions/pipeFunctions.js diff --git a/test/pipeFunctions/pipeFunctions.test.js b/test/pipeFunctions/pipeFunctions.test.js new file mode 100644 index 000000000..ddf1a3c0d --- /dev/null +++ b/test/pipeFunctions/pipeFunctions.test.js @@ -0,0 +1,13 @@ +const expect = require('expect'); +const pipeFunctions = require('./pipeFunctions.js'); + + + 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); + t.equal(multiplyAndAdd5(5, 2), 15, 'Performs left-to-right function composition'); + + diff --git a/test5/pluralize/pluralize.js b/test/pluralize/pluralize.js similarity index 100% rename from test5/pluralize/pluralize.js rename to test/pluralize/pluralize.js diff --git a/test/pluralize/pluralize.test.js b/test/pluralize/pluralize.test.js new file mode 100644 index 000000000..7f2147e2d --- /dev/null +++ b/test/pluralize/pluralize.test.js @@ -0,0 +1,19 @@ +const expect = require('expect'); +const pluralize = require('./pluralize.js'); + + + test('pluralize is a Function', () => { + expect(pluralize).toBeInstanceOf(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'); + + diff --git a/test5/powerset/powerset.js b/test/powerset/powerset.js similarity index 100% rename from test5/powerset/powerset.js rename to test/powerset/powerset.js diff --git a/test/powerset/powerset.test.js b/test/powerset/powerset.test.js new file mode 100644 index 000000000..355d18110 --- /dev/null +++ b/test/powerset/powerset.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const powerset = require('./powerset.js'); + + + test('powerset is a Function', () => { + expect(powerset).toBeInstanceOf(Function); +}); + t.deepEqual(powerset([1, 2]), [[], [1], [2], [2,1]], "Returns the powerset of a given array of numbers."); + diff --git a/test5/prefix/prefix.js b/test/prefix/prefix.js similarity index 100% rename from test5/prefix/prefix.js rename to test/prefix/prefix.js diff --git a/test/prefix/prefix.test.js b/test/prefix/prefix.test.js new file mode 100644 index 000000000..0949f258c --- /dev/null +++ b/test/prefix/prefix.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const prefix = require('./prefix.js'); + + + test('prefix is a Function', () => { + expect(prefix).toBeInstanceOf(Function); +}); + diff --git a/test5/prettyBytes/prettyBytes.js b/test/prettyBytes/prettyBytes.js similarity index 100% rename from test5/prettyBytes/prettyBytes.js rename to test/prettyBytes/prettyBytes.js diff --git a/test/prettyBytes/prettyBytes.test.js b/test/prettyBytes/prettyBytes.test.js new file mode 100644 index 000000000..44e629b2d --- /dev/null +++ b/test/prettyBytes/prettyBytes.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const prettyBytes = require('./prettyBytes.js'); + + + test('prettyBytes is a Function', () => { + expect(prettyBytes).toBeInstanceOf(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."); + diff --git a/test5/primes/primes.js b/test/primes/primes.js similarity index 100% rename from test5/primes/primes.js rename to test/primes/primes.js diff --git a/test/primes/primes.test.js b/test/primes/primes.test.js new file mode 100644 index 000000000..bc302c481 --- /dev/null +++ b/test/primes/primes.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const primes = require('./primes.js'); + + + test('primes is a Function', () => { + expect(primes).toBeInstanceOf(Function); +}); + t.deepEqual(primes(10), [2, 3, 5, 7], "Generates primes up to a given number, using the Sieve of Eratosthenes."); + diff --git a/test5/promisify/promisify.js b/test/promisify/promisify.js similarity index 100% rename from test5/promisify/promisify.js rename to test/promisify/promisify.js diff --git a/test/promisify/promisify.test.js b/test/promisify/promisify.test.js new file mode 100644 index 000000000..53b656aeb --- /dev/null +++ b/test/promisify/promisify.test.js @@ -0,0 +1,15 @@ +const expect = require('expect'); +const promisify = require('./promisify.js'); + + + test('promisify is a Function', () => { + expect(promisify).toBeInstanceOf(Function); +}); + const x = promisify(Math.max); + test('Returns a promise', () => { + expect(x() instanceof Promise).toBeTruthy(); +}); + const delay = promisify((d, cb) => setTimeout(cb, d)); + delay(200).then(() => t.pass('Runs the function provided')); + + diff --git a/test5/pull/pull.js b/test/pull/pull.js similarity index 100% rename from test5/pull/pull.js rename to test/pull/pull.js diff --git a/test/pull/pull.test.js b/test/pull/pull.test.js new file mode 100644 index 000000000..c7458e3a2 --- /dev/null +++ b/test/pull/pull.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const pull = require('./pull.js'); + + + test('pull is a Function', () => { + expect(pull).toBeInstanceOf(Function); +}); + let myArray = ['a', 'b', 'c', 'a', 'b', 'c']; + pull(myArray, 'a', 'c'); + t.deepEqual(myArray, ['b','b'], 'Pulls the specified values'); + + diff --git a/test5/pullAtIndex/pullAtIndex.js b/test/pullAtIndex/pullAtIndex.js similarity index 100% rename from test5/pullAtIndex/pullAtIndex.js rename to test/pullAtIndex/pullAtIndex.js diff --git a/test/pullAtIndex/pullAtIndex.test.js b/test/pullAtIndex/pullAtIndex.test.js new file mode 100644 index 000000000..08db4f15d --- /dev/null +++ b/test/pullAtIndex/pullAtIndex.test.js @@ -0,0 +1,13 @@ +const expect = require('expect'); +const pullAtIndex = require('./pullAtIndex.js'); + + + test('pullAtIndex is a Function', () => { + expect(pullAtIndex).toBeInstanceOf(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'); + + diff --git a/test5/pullAtValue/pullAtValue.js b/test/pullAtValue/pullAtValue.js similarity index 100% rename from test5/pullAtValue/pullAtValue.js rename to test/pullAtValue/pullAtValue.js diff --git a/test/pullAtValue/pullAtValue.test.js b/test/pullAtValue/pullAtValue.test.js new file mode 100644 index 000000000..bbf850ca8 --- /dev/null +++ b/test/pullAtValue/pullAtValue.test.js @@ -0,0 +1,13 @@ +const expect = require('expect'); +const pullAtValue = require('./pullAtValue.js'); + + + test('pullAtValue is a Function', () => { + expect(pullAtValue).toBeInstanceOf(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'); + + diff --git a/test5/pullBy/pullBy.js b/test/pullBy/pullBy.js similarity index 100% rename from test5/pullBy/pullBy.js rename to test/pullBy/pullBy.js diff --git a/test/pullBy/pullBy.test.js b/test/pullBy/pullBy.test.js new file mode 100644 index 000000000..f01205590 --- /dev/null +++ b/test/pullBy/pullBy.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const pullBy = require('./pullBy.js'); + + + 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); + t.deepEqual(myArray, [{ x: 2 }], 'Pulls the specified values'); + + diff --git a/test5/quickSort/quickSort.js b/test/quickSort/quickSort.js similarity index 100% rename from test5/quickSort/quickSort.js rename to test/quickSort/quickSort.js diff --git a/test/quickSort/quickSort.test.js b/test/quickSort/quickSort.test.js new file mode 100644 index 000000000..693eb3da0 --- /dev/null +++ b/test/quickSort/quickSort.test.js @@ -0,0 +1,24 @@ +const expect = require('expect'); +const quickSort = require('./quickSort.js'); + + + test('quickSort is a Function', () => { + expect(quickSort).toBeInstanceOf(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(); + 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/test5/radsToDegrees/radsToDegrees.js b/test/radsToDegrees/radsToDegrees.js similarity index 100% rename from test5/radsToDegrees/radsToDegrees.js rename to test/radsToDegrees/radsToDegrees.js diff --git a/test/radsToDegrees/radsToDegrees.test.js b/test/radsToDegrees/radsToDegrees.test.js new file mode 100644 index 000000000..2a65a6c78 --- /dev/null +++ b/test/radsToDegrees/radsToDegrees.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const radsToDegrees = require('./radsToDegrees.js'); + + + test('radsToDegrees is a Function', () => { + expect(radsToDegrees).toBeInstanceOf(Function); +}); + t.equal(radsToDegrees(Math.PI / 2), 90, 'Returns the appropriate value'); + + diff --git a/test5/randomHexColorCode/randomHexColorCode.js b/test/randomHexColorCode/randomHexColorCode.js similarity index 100% rename from test5/randomHexColorCode/randomHexColorCode.js rename to test/randomHexColorCode/randomHexColorCode.js diff --git a/test/randomHexColorCode/randomHexColorCode.test.js b/test/randomHexColorCode/randomHexColorCode.test.js new file mode 100644 index 000000000..8d75773ab --- /dev/null +++ b/test/randomHexColorCode/randomHexColorCode.test.js @@ -0,0 +1,16 @@ +const expect = require('expect'); +const randomHexColorCode = require('./randomHexColorCode.js'); + + + test('randomHexColorCode is a Function', () => { + expect(randomHexColorCode).toBeInstanceOf(Function); +}); + t.equal(randomHexColorCode().length, 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/test5/randomIntArrayInRange/randomIntArrayInRange.js b/test/randomIntArrayInRange/randomIntArrayInRange.js similarity index 100% rename from test5/randomIntArrayInRange/randomIntArrayInRange.js rename to test/randomIntArrayInRange/randomIntArrayInRange.js diff --git a/test5/randomIntArrayInRange/randomIntArrayInRange.test.js b/test/randomIntArrayInRange/randomIntArrayInRange.test.js similarity index 54% rename from test5/randomIntArrayInRange/randomIntArrayInRange.test.js rename to test/randomIntArrayInRange/randomIntArrayInRange.test.js index cff9657e5..40b0635ef 100644 --- a/test5/randomIntArrayInRange/randomIntArrayInRange.test.js +++ b/test/randomIntArrayInRange/randomIntArrayInRange.test.js @@ -1,14 +1,19 @@ const expect = require('expect'); const randomIntArrayInRange = require('./randomIntArrayInRange.js'); -test('Testing randomIntArrayInRange', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof randomIntArrayInRange === 'function').toBeTruthy(); + + 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(); - expect(arr.length).toBe(10); +}); + t.equal(arr.length, 10, 'The returned array has the proper length'); + 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/test5/randomIntegerInRange/randomIntegerInRange.js b/test/randomIntegerInRange/randomIntegerInRange.js similarity index 100% rename from test5/randomIntegerInRange/randomIntegerInRange.js rename to test/randomIntegerInRange/randomIntegerInRange.js diff --git a/test5/randomIntegerInRange/randomIntegerInRange.test.js b/test/randomIntegerInRange/randomIntegerInRange.test.js similarity index 62% rename from test5/randomIntegerInRange/randomIntegerInRange.test.js rename to test/randomIntegerInRange/randomIntegerInRange.test.js index 04ebd1d4f..0394b74e8 100644 --- a/test5/randomIntegerInRange/randomIntegerInRange.test.js +++ b/test/randomIntegerInRange/randomIntegerInRange.test.js @@ -1,13 +1,18 @@ const expect = require('expect'); const randomIntegerInRange = require('./randomIntegerInRange.js'); -test('Testing randomIntegerInRange', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof randomIntegerInRange === 'function').toBeTruthy(); + + 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/test5/randomNumberInRange/randomNumberInRange.js b/test/randomNumberInRange/randomNumberInRange.js similarity index 100% rename from test5/randomNumberInRange/randomNumberInRange.js rename to test/randomNumberInRange/randomNumberInRange.js diff --git a/test5/randomNumberInRange/randomNumberInRange.test.js b/test/randomNumberInRange/randomNumberInRange.test.js similarity index 63% rename from test5/randomNumberInRange/randomNumberInRange.test.js rename to test/randomNumberInRange/randomNumberInRange.test.js index 646322ce8..24b7419c0 100644 --- a/test5/randomNumberInRange/randomNumberInRange.test.js +++ b/test/randomNumberInRange/randomNumberInRange.test.js @@ -1,13 +1,18 @@ const expect = require('expect'); const randomNumberInRange = require('./randomNumberInRange.js'); -test('Testing randomNumberInRange', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof randomNumberInRange === 'function').toBeTruthy(); + + 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/test5/readFileLines/readFileLines.js b/test/readFileLines/readFileLines.js similarity index 100% rename from test5/readFileLines/readFileLines.js rename to test/readFileLines/readFileLines.js diff --git a/test/readFileLines/readFileLines.test.js b/test/readFileLines/readFileLines.test.js new file mode 100644 index 000000000..1590f08c0 --- /dev/null +++ b/test/readFileLines/readFileLines.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const readFileLines = require('./readFileLines.js'); + + + test('readFileLines is a Function', () => { + expect(readFileLines).toBeInstanceOf(Function); +}); + t.pass('Tested on 09/02/2018 by @chalarangelo'); + + diff --git a/test5/rearg/rearg.js b/test/rearg/rearg.js similarity index 100% rename from test5/rearg/rearg.js rename to test/rearg/rearg.js diff --git a/test/rearg/rearg.test.js b/test/rearg/rearg.test.js new file mode 100644 index 000000000..a15e44b93 --- /dev/null +++ b/test/rearg/rearg.test.js @@ -0,0 +1,16 @@ +const expect = require('expect'); +const rearg = require('./rearg.js'); + + + test('rearg is a Function', () => { + expect(rearg).toBeInstanceOf(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'); + + diff --git a/test5/recordAnimationFrames/recordAnimationFrames.js b/test/recordAnimationFrames/recordAnimationFrames.js similarity index 98% rename from test5/recordAnimationFrames/recordAnimationFrames.js rename to test/recordAnimationFrames/recordAnimationFrames.js index 7e7ca9004..4408e0d77 100644 --- a/test5/recordAnimationFrames/recordAnimationFrames.js +++ b/test/recordAnimationFrames/recordAnimationFrames.js @@ -13,7 +13,7 @@ const run = () => { raf = requestAnimationFrame(() => { callback(); if (running) run(); -}); + }; if (autoStart) start(); return { start, stop }; diff --git a/test/recordAnimationFrames/recordAnimationFrames.test.js b/test/recordAnimationFrames/recordAnimationFrames.test.js new file mode 100644 index 000000000..5c6af20dc --- /dev/null +++ b/test/recordAnimationFrames/recordAnimationFrames.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const recordAnimationFrames = require('./recordAnimationFrames.js'); + + + test('recordAnimationFrames is a Function', () => { + expect(recordAnimationFrames).toBeInstanceOf(Function); +}); + diff --git a/test5/redirect/redirect.js b/test/redirect/redirect.js similarity index 100% rename from test5/redirect/redirect.js rename to test/redirect/redirect.js diff --git a/test/redirect/redirect.test.js b/test/redirect/redirect.test.js new file mode 100644 index 000000000..680d23ec5 --- /dev/null +++ b/test/redirect/redirect.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const redirect = require('./redirect.js'); + + + test('redirect is a Function', () => { + expect(redirect).toBeInstanceOf(Function); +}); + t.pass('Tested on 09/02/2018 by @chalarangelo'); + + diff --git a/test5/reduceSuccessive/reduceSuccessive.js b/test/reduceSuccessive/reduceSuccessive.js similarity index 100% rename from test5/reduceSuccessive/reduceSuccessive.js rename to test/reduceSuccessive/reduceSuccessive.js diff --git a/test/reduceSuccessive/reduceSuccessive.test.js b/test/reduceSuccessive/reduceSuccessive.test.js new file mode 100644 index 000000000..d78e659d6 --- /dev/null +++ b/test/reduceSuccessive/reduceSuccessive.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const reduceSuccessive = require('./reduceSuccessive.js'); + + + test('reduceSuccessive is a Function', () => { + expect(reduceSuccessive).toBeInstanceOf(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'); + + diff --git a/test5/reduceWhich/reduceWhich.js b/test/reduceWhich/reduceWhich.js similarity index 100% rename from test5/reduceWhich/reduceWhich.js rename to test/reduceWhich/reduceWhich.js diff --git a/test/reduceWhich/reduceWhich.test.js b/test/reduceWhich/reduceWhich.test.js new file mode 100644 index 000000000..4d6929507 --- /dev/null +++ b/test/reduceWhich/reduceWhich.test.js @@ -0,0 +1,15 @@ +const expect = require('expect'); +const reduceWhich = require('./reduceWhich.js'); + + + test('reduceWhich is a Function', () => { + expect(reduceWhich).toBeInstanceOf(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( + [{ 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'); + + diff --git a/test5/reducedFilter/reducedFilter.js b/test/reducedFilter/reducedFilter.js similarity index 100% rename from test5/reducedFilter/reducedFilter.js rename to test/reducedFilter/reducedFilter.js diff --git a/test/reducedFilter/reducedFilter.test.js b/test/reducedFilter/reducedFilter.test.js new file mode 100644 index 000000000..5fce9e4cb --- /dev/null +++ b/test/reducedFilter/reducedFilter.test.js @@ -0,0 +1,21 @@ +const expect = require('expect'); +const reducedFilter = require('./reducedFilter.js'); + + + test('reducedFilter is a Function', () => { + expect(reducedFilter).toBeInstanceOf(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."); + diff --git a/test5/reject/reject.js b/test/reject/reject.js similarity index 100% rename from test5/reject/reject.js rename to test/reject/reject.js diff --git a/test/reject/reject.test.js b/test/reject/reject.test.js new file mode 100644 index 000000000..270e9b8f5 --- /dev/null +++ b/test/reject/reject.test.js @@ -0,0 +1,24 @@ +const expect = require('expect'); +const reject = require('./reject.js'); + + + test('reject is a Function', () => { + expect(reject).toBeInstanceOf(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']); + + + diff --git a/test5/remove/remove.js b/test/remove/remove.js similarity index 100% rename from test5/remove/remove.js rename to test/remove/remove.js diff --git a/test/remove/remove.test.js b/test/remove/remove.test.js new file mode 100644 index 000000000..bae377e4e --- /dev/null +++ b/test/remove/remove.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const remove = require('./remove.js'); + + + test('remove is a Function', () => { + expect(remove).toBeInstanceOf(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"); + + diff --git a/test5/removeNonASCII/removeNonASCII.js b/test/removeNonASCII/removeNonASCII.js similarity index 100% rename from test5/removeNonASCII/removeNonASCII.js rename to test/removeNonASCII/removeNonASCII.js diff --git a/test/removeNonASCII/removeNonASCII.test.js b/test/removeNonASCII/removeNonASCII.test.js new file mode 100644 index 000000000..a33c12a00 --- /dev/null +++ b/test/removeNonASCII/removeNonASCII.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const removeNonASCII = require('./removeNonASCII.js'); + + + test('removeNonASCII is a Function', () => { + expect(removeNonASCII).toBeInstanceOf(Function); +}); + t.equal(removeNonASCII('äÄçÇéÉêlorem-ipsumöÖÐþúÚ'), 'lorem-ipsum', 'Removes non-ASCII characters'); + + diff --git a/test5/removeVowels/removeVowels.js b/test/removeVowels/removeVowels.js similarity index 100% rename from test5/removeVowels/removeVowels.js rename to test/removeVowels/removeVowels.js diff --git a/test/removeVowels/removeVowels.test.js b/test/removeVowels/removeVowels.test.js new file mode 100644 index 000000000..36afe09c2 --- /dev/null +++ b/test/removeVowels/removeVowels.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const removeVowels = require('./removeVowels.js'); + + + test('removeVowels is a Function', () => { + expect(removeVowels).toBeInstanceOf(Function); +}); + diff --git a/test5/renameKeys/renameKeys.js b/test/renameKeys/renameKeys.js similarity index 100% rename from test5/renameKeys/renameKeys.js rename to test/renameKeys/renameKeys.js diff --git a/test/renameKeys/renameKeys.test.js b/test/renameKeys/renameKeys.test.js new file mode 100644 index 000000000..de0438f0c --- /dev/null +++ b/test/renameKeys/renameKeys.test.js @@ -0,0 +1,15 @@ +const expect = require('expect'); +const renameKeys = require('./renameKeys.js'); + + + 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); + + t.deepEqual(renamedObj, { firstName: 'Bobo', passion: 'Front-End Master', shoeSize: 100 + + + diff --git a/test5/reverseString/reverseString.js b/test/reverseString/reverseString.js similarity index 100% rename from test5/reverseString/reverseString.js rename to test/reverseString/reverseString.js diff --git a/test/reverseString/reverseString.test.js b/test/reverseString/reverseString.test.js new file mode 100644 index 000000000..176f122c1 --- /dev/null +++ b/test/reverseString/reverseString.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const reverseString = require('./reverseString.js'); + + + test('reverseString is a Function', () => { + expect(reverseString).toBeInstanceOf(Function); +}); + t.equal(reverseString('foobar'), 'raboof', "Reverses a string."); + diff --git a/test5/round/round.js b/test/round/round.js similarity index 100% rename from test5/round/round.js rename to test/round/round.js diff --git a/test/round/round.test.js b/test/round/round.test.js new file mode 100644 index 000000000..8d9cc9318 --- /dev/null +++ b/test/round/round.test.js @@ -0,0 +1,35 @@ +const expect = require('expect'); +const round = require('./round.js'); + + + test('round is a Function', () => { + expect(round).toBeInstanceOf(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"); + 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/test6/runAsync/runAsync.js b/test/runAsync/runAsync.js similarity index 98% rename from test6/runAsync/runAsync.js rename to test/runAsync/runAsync.js index e049e49f0..046dc1b35 100644 --- a/test6/runAsync/runAsync.js +++ b/test/runAsync/runAsync.js @@ -11,6 +11,6 @@ res(data), worker.terminate(); worker.onerror = err => { rej(err), worker.terminate(); }; -}); + }; module.exports = runAsync; \ No newline at end of file diff --git a/test/runAsync/runAsync.test.js b/test/runAsync/runAsync.test.js new file mode 100644 index 000000000..7606a8cfb --- /dev/null +++ b/test/runAsync/runAsync.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const runAsync = require('./runAsync.js'); + + + test('runAsync is a Function', () => { + expect(runAsync).toBeInstanceOf(Function); +}); + t.pass('Tested on 09/02/2018 by @chalarangelo'); + + diff --git a/test6/runPromisesInSeries/runPromisesInSeries.js b/test/runPromisesInSeries/runPromisesInSeries.js similarity index 100% rename from test6/runPromisesInSeries/runPromisesInSeries.js rename to test/runPromisesInSeries/runPromisesInSeries.js diff --git a/test/runPromisesInSeries/runPromisesInSeries.test.js b/test/runPromisesInSeries/runPromisesInSeries.test.js new file mode 100644 index 000000000..646172e0e --- /dev/null +++ b/test/runPromisesInSeries/runPromisesInSeries.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const runPromisesInSeries = require('./runPromisesInSeries.js'); + + + test('runPromisesInSeries is a Function', () => { + expect(runPromisesInSeries).toBeInstanceOf(Function); +}); + const delay = d => new Promise(r => setTimeout(r, d)); + runPromisesInSeries([() => delay(100), () => delay(200).then(() => t.pass('Runs promises in series'))]); + + diff --git a/test6/sample/sample.js b/test/sample/sample.js similarity index 100% rename from test6/sample/sample.js rename to test/sample/sample.js diff --git a/test/sample/sample.test.js b/test/sample/sample.test.js new file mode 100644 index 000000000..caf8ccd45 --- /dev/null +++ b/test/sample/sample.test.js @@ -0,0 +1,15 @@ +const expect = require('expect'); +const sample = require('./sample.js'); + + + 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(); +}); + t.equal(sample([1]), 1, 'Works for single-element arrays'); + t.equal(sample([]), undefined, 'Returns undefined for empty array'); + + diff --git a/test6/sampleSize/sampleSize.js b/test/sampleSize/sampleSize.js similarity index 100% rename from test6/sampleSize/sampleSize.js rename to test/sampleSize/sampleSize.js diff --git a/test/sampleSize/sampleSize.test.js b/test/sampleSize/sampleSize.test.js new file mode 100644 index 000000000..f56f1b5cb --- /dev/null +++ b/test/sampleSize/sampleSize.test.js @@ -0,0 +1,17 @@ +const expect = require('expect'); +const sampleSize = require('./sampleSize.js'); + + + test('sampleSize is a Function', () => { + expect(sampleSize).toBeInstanceOf(Function); +}); + const arr = [3,7,9,11]; + t.equal(sampleSize(arr).length, 1, 'Returns a single element without n specified'); + test('Returns a random sample of specified size from an array', () => { + expect(sampleSize(arr, 2).every(x => arr.includes(x))).toBeTruthy(); +}); + 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'); + + diff --git a/test6/scrollToTop/scrollToTop.js b/test/scrollToTop/scrollToTop.js similarity index 100% rename from test6/scrollToTop/scrollToTop.js rename to test/scrollToTop/scrollToTop.js diff --git a/test/scrollToTop/scrollToTop.test.js b/test/scrollToTop/scrollToTop.test.js new file mode 100644 index 000000000..37afc3739 --- /dev/null +++ b/test/scrollToTop/scrollToTop.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const scrollToTop = require('./scrollToTop.js'); + + + test('scrollToTop is a Function', () => { + expect(scrollToTop).toBeInstanceOf(Function); +}); + t.pass('Tested on 09/02/2018 by @chalarangelo'); + + diff --git a/test6/sdbm/sdbm.js b/test/sdbm/sdbm.js similarity index 100% rename from test6/sdbm/sdbm.js rename to test/sdbm/sdbm.js diff --git a/test/sdbm/sdbm.test.js b/test/sdbm/sdbm.test.js new file mode 100644 index 000000000..718fd716a --- /dev/null +++ b/test/sdbm/sdbm.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const sdbm = require('./sdbm.js'); + + + test('sdbm is a Function', () => { + expect(sdbm).toBeInstanceOf(Function); +}); + t.equal(sdbm('name'), -3521204949, "Hashes the input string into a whole number."); + diff --git a/test6/serializeCookie/serializeCookie.js b/test/serializeCookie/serializeCookie.js similarity index 100% rename from test6/serializeCookie/serializeCookie.js rename to test/serializeCookie/serializeCookie.js diff --git a/test/serializeCookie/serializeCookie.test.js b/test/serializeCookie/serializeCookie.test.js new file mode 100644 index 000000000..13e6d57ef --- /dev/null +++ b/test/serializeCookie/serializeCookie.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const serializeCookie = require('./serializeCookie.js'); + + + test('serializeCookie is a Function', () => { + expect(serializeCookie).toBeInstanceOf(Function); +}); + t.equal(serializeCookie('foo', 'bar'), 'foo=bar', 'Serializes the cookie'); + + diff --git a/test6/setStyle/setStyle.js b/test/setStyle/setStyle.js similarity index 100% rename from test6/setStyle/setStyle.js rename to test/setStyle/setStyle.js diff --git a/test/setStyle/setStyle.test.js b/test/setStyle/setStyle.test.js new file mode 100644 index 000000000..5dfb5ba7f --- /dev/null +++ b/test/setStyle/setStyle.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const setStyle = require('./setStyle.js'); + + + test('setStyle is a Function', () => { + expect(setStyle).toBeInstanceOf(Function); +}); + t.pass('Tested by @chalarangelo on 16/02/2018'); + + diff --git a/test6/shallowClone/shallowClone.js b/test/shallowClone/shallowClone.js similarity index 100% rename from test6/shallowClone/shallowClone.js rename to test/shallowClone/shallowClone.js diff --git a/test/shallowClone/shallowClone.test.js b/test/shallowClone/shallowClone.test.js new file mode 100644 index 000000000..5d0caaee8 --- /dev/null +++ b/test/shallowClone/shallowClone.test.js @@ -0,0 +1,13 @@ +const expect = require('expect'); +const shallowClone = require('./shallowClone.js'); + + + test('shallowClone is a Function', () => { + expect(shallowClone).toBeInstanceOf(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'); + + diff --git a/test6/show/show.js b/test/show/show.js similarity index 100% rename from test6/show/show.js rename to test/show/show.js diff --git a/test/show/show.test.js b/test/show/show.test.js new file mode 100644 index 000000000..ae9f97f2e --- /dev/null +++ b/test/show/show.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const show = require('./show.js'); + + + test('show is a Function', () => { + expect(show).toBeInstanceOf(Function); +}); + t.pass('Tested by @chalarangelo on 16/02/2018'); + + diff --git a/test6/shuffle/shuffle.js b/test/shuffle/shuffle.js similarity index 100% rename from test6/shuffle/shuffle.js rename to test/shuffle/shuffle.js diff --git a/test/shuffle/shuffle.test.js b/test/shuffle/shuffle.test.js new file mode 100644 index 000000000..7fa46495a --- /dev/null +++ b/test/shuffle/shuffle.test.js @@ -0,0 +1,16 @@ +const expect = require('expect'); +const shuffle = require('./shuffle.js'); + + + test('shuffle is a Function', () => { + expect(shuffle).toBeInstanceOf(Function); +}); + const arr = [1,2,3,4,5,6]; + t.notEqual(shuffle(arr), arr, 'Shuffles the array'); + test('New array contains all original elements', () => { + expect(shuffle(arr).every(x => arr.includes(x))).toBeTruthy(); +}); + t.deepEqual(shuffle([]),[],'Works for empty arrays'); + t.deepEqual(shuffle([1]),[1],'Works for single-element arrays'); + + diff --git a/test6/similarity/similarity.js b/test/similarity/similarity.js similarity index 100% rename from test6/similarity/similarity.js rename to test/similarity/similarity.js diff --git a/test/similarity/similarity.test.js b/test/similarity/similarity.test.js new file mode 100644 index 000000000..480cba7b3 --- /dev/null +++ b/test/similarity/similarity.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const similarity = require('./similarity.js'); + + + test('similarity is a Function', () => { + expect(similarity).toBeInstanceOf(Function); +}); + t.deepEqual(similarity([1, 2, 3], [1, 2, 4]), [1, 2], "Returns an array of elements that appear in both arrays."); + diff --git a/test6/size/size.js b/test/size/size.js similarity index 100% rename from test6/size/size.js rename to test/size/size.js diff --git a/test/size/size.test.js b/test/size/size.test.js new file mode 100644 index 000000000..f47849756 --- /dev/null +++ b/test/size/size.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const size = require('./size.js'); + + + test('size is a Function', () => { + expect(size).toBeInstanceOf(Function); +}); + t.equal(size([1, 2, 3, 4, 5]), 5, "Get size of arrays, objects or strings."); + t.equal(size({ one: 1, two: 2, three: 3 }), 3, "Get size of arrays, objects or strings."); + diff --git a/test6/sleep/sleep.js b/test/sleep/sleep.js similarity index 100% rename from test6/sleep/sleep.js rename to test/sleep/sleep.js diff --git a/test/sleep/sleep.test.js b/test/sleep/sleep.test.js new file mode 100644 index 000000000..af6aca5da --- /dev/null +++ b/test/sleep/sleep.test.js @@ -0,0 +1,13 @@ +const expect = require('expect'); +const sleep = require('./sleep.js'); + + + test('sleep is a Function', () => { + expect(sleep).toBeInstanceOf(Function); +}); + async function sleepyWork() { + await sleep(1000); + t.pass('Works as expected'); + } + + diff --git a/test6/smoothScroll/smoothScroll.js b/test/smoothScroll/smoothScroll.js similarity index 97% rename from test6/smoothScroll/smoothScroll.js rename to test/smoothScroll/smoothScroll.js index 6d4ff2a1c..925223bef 100644 --- a/test6/smoothScroll/smoothScroll.js +++ b/test/smoothScroll/smoothScroll.js @@ -1,5 +1,5 @@ const smoothScroll = element => document.querySelector(element).scrollIntoView({ behavior: 'smooth' -}); + module.exports = smoothScroll; \ No newline at end of file diff --git a/test/smoothScroll/smoothScroll.test.js b/test/smoothScroll/smoothScroll.test.js new file mode 100644 index 000000000..86f93a396 --- /dev/null +++ b/test/smoothScroll/smoothScroll.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const smoothScroll = require('./smoothScroll.js'); + + + test('smoothScroll is a Function', () => { + expect(smoothScroll).toBeInstanceOf(Function); +}); + diff --git a/test6/solveRPN/solveRPN.js b/test/solveRPN/solveRPN.js similarity index 99% rename from test6/solveRPN/solveRPN.js rename to test/solveRPN/solveRPN.js index ac84c4a3d..a144db5ab 100644 --- a/test6/solveRPN/solveRPN.js +++ b/test/solveRPN/solveRPN.js @@ -22,7 +22,7 @@ stack.push(OPERATORS[symbol](parseFloat(b), parseFloat(a))); } else { throw `${symbol} is not a recognized symbol`; } -}); + if (stack.length === 1) return stack.pop(); else throw `${rpn} is not a proper RPN. Please check it and try again`; }; diff --git a/test/solveRPN/solveRPN.test.js b/test/solveRPN/solveRPN.test.js new file mode 100644 index 000000000..ce1e02dc1 --- /dev/null +++ b/test/solveRPN/solveRPN.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const solveRPN = require('./solveRPN.js'); + + + test('solveRPN is a Function', () => { + expect(solveRPN).toBeInstanceOf(Function); +}); + diff --git a/test6/sortCharactersInString/sortCharactersInString.js b/test/sortCharactersInString/sortCharactersInString.js similarity index 100% rename from test6/sortCharactersInString/sortCharactersInString.js rename to test/sortCharactersInString/sortCharactersInString.js diff --git a/test/sortCharactersInString/sortCharactersInString.test.js b/test/sortCharactersInString/sortCharactersInString.test.js new file mode 100644 index 000000000..92a055f4d --- /dev/null +++ b/test/sortCharactersInString/sortCharactersInString.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const sortCharactersInString = require('./sortCharactersInString.js'); + + + test('sortCharactersInString is a Function', () => { + expect(sortCharactersInString).toBeInstanceOf(Function); +}); + t.equal(sortCharactersInString('cabbage'), 'aabbceg', "Alphabetically sorts the characters in a string."); + diff --git a/test6/sortedIndex/sortedIndex.js b/test/sortedIndex/sortedIndex.js similarity index 100% rename from test6/sortedIndex/sortedIndex.js rename to test/sortedIndex/sortedIndex.js diff --git a/test/sortedIndex/sortedIndex.test.js b/test/sortedIndex/sortedIndex.test.js new file mode 100644 index 000000000..903b2534f --- /dev/null +++ b/test/sortedIndex/sortedIndex.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const sortedIndex = require('./sortedIndex.js'); + + + test('sortedIndex is a Function', () => { + expect(sortedIndex).toBeInstanceOf(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."); + diff --git a/test6/sortedIndexBy/sortedIndexBy.js b/test/sortedIndexBy/sortedIndexBy.js similarity index 100% rename from test6/sortedIndexBy/sortedIndexBy.js rename to test/sortedIndexBy/sortedIndexBy.js diff --git a/test/sortedIndexBy/sortedIndexBy.test.js b/test/sortedIndexBy/sortedIndexBy.test.js new file mode 100644 index 000000000..49d9d7d60 --- /dev/null +++ b/test/sortedIndexBy/sortedIndexBy.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const sortedIndexBy = require('./sortedIndexBy.js'); + + + test('sortedIndexBy is a Function', () => { + expect(sortedIndexBy).toBeInstanceOf(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'); + + diff --git a/test6/sortedLastIndex/sortedLastIndex.js b/test/sortedLastIndex/sortedLastIndex.js similarity index 100% rename from test6/sortedLastIndex/sortedLastIndex.js rename to test/sortedLastIndex/sortedLastIndex.js diff --git a/test/sortedLastIndex/sortedLastIndex.test.js b/test/sortedLastIndex/sortedLastIndex.test.js new file mode 100644 index 000000000..4a502f50e --- /dev/null +++ b/test/sortedLastIndex/sortedLastIndex.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const sortedLastIndex = require('./sortedLastIndex.js'); + + + test('sortedLastIndex is a Function', () => { + expect(sortedLastIndex).toBeInstanceOf(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'); + + diff --git a/test6/sortedLastIndexBy/sortedLastIndexBy.js b/test/sortedLastIndexBy/sortedLastIndexBy.js similarity index 100% rename from test6/sortedLastIndexBy/sortedLastIndexBy.js rename to test/sortedLastIndexBy/sortedLastIndexBy.js diff --git a/test/sortedLastIndexBy/sortedLastIndexBy.test.js b/test/sortedLastIndexBy/sortedLastIndexBy.test.js new file mode 100644 index 000000000..228e00249 --- /dev/null +++ b/test/sortedLastIndexBy/sortedLastIndexBy.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const sortedLastIndexBy = require('./sortedLastIndexBy.js'); + + + test('sortedLastIndexBy is a Function', () => { + expect(sortedLastIndexBy).toBeInstanceOf(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'); + + diff --git a/test6/speechSynthesis/speechSynthesis.js b/test/speechSynthesis/speechSynthesis.js similarity index 100% rename from test6/speechSynthesis/speechSynthesis.js rename to test/speechSynthesis/speechSynthesis.js diff --git a/test/speechSynthesis/speechSynthesis.test.js b/test/speechSynthesis/speechSynthesis.test.js new file mode 100644 index 000000000..90425aaff --- /dev/null +++ b/test/speechSynthesis/speechSynthesis.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const speechSynthesis = require('./speechSynthesis.js'); + + + test('speechSynthesis is a Function', () => { + expect(speechSynthesis).toBeInstanceOf(Function); +}); + diff --git a/test6/splitLines/splitLines.js b/test/splitLines/splitLines.js similarity index 100% rename from test6/splitLines/splitLines.js rename to test/splitLines/splitLines.js diff --git a/test/splitLines/splitLines.test.js b/test/splitLines/splitLines.test.js new file mode 100644 index 000000000..fcbc7d46a --- /dev/null +++ b/test/splitLines/splitLines.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const splitLines = require('./splitLines.js'); + + + test('splitLines is a Function', () => { + expect(splitLines).toBeInstanceOf(Function); +}); + t.deepEqual(splitLines('This\nis a\nmultiline\nstring.\n'), ['This', 'is a', 'multiline', 'string.' , ''], "Splits a multiline string into an array of lines."); + diff --git a/test6/spreadOver/spreadOver.js b/test/spreadOver/spreadOver.js similarity index 100% rename from test6/spreadOver/spreadOver.js rename to test/spreadOver/spreadOver.js diff --git a/test/spreadOver/spreadOver.test.js b/test/spreadOver/spreadOver.test.js new file mode 100644 index 000000000..df422d8c2 --- /dev/null +++ b/test/spreadOver/spreadOver.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const spreadOver = require('./spreadOver.js'); + + + test('spreadOver is a Function', () => { + expect(spreadOver).toBeInstanceOf(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."); + diff --git a/test6/stableSort/stableSort.js b/test/stableSort/stableSort.js similarity index 100% rename from test6/stableSort/stableSort.js rename to test/stableSort/stableSort.js diff --git a/test/stableSort/stableSort.test.js b/test/stableSort/stableSort.test.js new file mode 100644 index 000000000..2f54e14ee --- /dev/null +++ b/test/stableSort/stableSort.test.js @@ -0,0 +1,13 @@ +const expect = require('expect'); +const stableSort = require('./stableSort.js'); + + + 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; + t.deepEqual(stableSort(arr, compare), arr, 'Array is properly sorted'); + + diff --git a/test6/standardDeviation/standardDeviation.js b/test/standardDeviation/standardDeviation.js similarity index 100% rename from test6/standardDeviation/standardDeviation.js rename to test/standardDeviation/standardDeviation.js diff --git a/test/standardDeviation/standardDeviation.test.js b/test/standardDeviation/standardDeviation.test.js new file mode 100644 index 000000000..9ddfb23d0 --- /dev/null +++ b/test/standardDeviation/standardDeviation.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const standardDeviation = require('./standardDeviation.js'); + + + test('standardDeviation is a Function', () => { + expect(standardDeviation).toBeInstanceOf(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"); + diff --git a/test6/stringPermutations/stringPermutations.js b/test/stringPermutations/stringPermutations.js similarity index 100% rename from test6/stringPermutations/stringPermutations.js rename to test/stringPermutations/stringPermutations.js diff --git a/test/stringPermutations/stringPermutations.test.js b/test/stringPermutations/stringPermutations.test.js new file mode 100644 index 000000000..a99fb7b23 --- /dev/null +++ b/test/stringPermutations/stringPermutations.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const stringPermutations = require('./stringPermutations.js'); + + + test('stringPermutations is a Function', () => { + expect(stringPermutations).toBeInstanceOf(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"); + + diff --git a/test6/stripHTMLTags/stripHTMLTags.js b/test/stripHTMLTags/stripHTMLTags.js similarity index 100% rename from test6/stripHTMLTags/stripHTMLTags.js rename to test/stripHTMLTags/stripHTMLTags.js diff --git a/test/stripHTMLTags/stripHTMLTags.test.js b/test/stripHTMLTags/stripHTMLTags.test.js new file mode 100644 index 000000000..225f18573 --- /dev/null +++ b/test/stripHTMLTags/stripHTMLTags.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const stripHTMLTags = require('./stripHTMLTags.js'); + + + test('stripHTMLTags is a Function', () => { + expect(stripHTMLTags).toBeInstanceOf(Function); +}); + test('Removes HTML tags', () => { + expect(stripHTMLTags('

lorem ipsum


'), 'lorem ipsum').toBe() +}); + + diff --git a/test6/sum/sum.js b/test/sum/sum.js similarity index 100% rename from test6/sum/sum.js rename to test/sum/sum.js diff --git a/test/sum/sum.test.js b/test/sum/sum.test.js new file mode 100644 index 000000000..ed21ad02f --- /dev/null +++ b/test/sum/sum.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const sum = require('./sum.js'); + + + test('sum is a Function', () => { + expect(sum).toBeInstanceOf(Function); +}); + t.equal(sum(...[1, 2, 3, 4]), 10, "Returns the sum of two or more numbers/arrays."); + diff --git a/test6/sumBy/sumBy.js b/test/sumBy/sumBy.js similarity index 100% rename from test6/sumBy/sumBy.js rename to test/sumBy/sumBy.js diff --git a/test/sumBy/sumBy.test.js b/test/sumBy/sumBy.test.js new file mode 100644 index 000000000..a8786d296 --- /dev/null +++ b/test/sumBy/sumBy.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const sumBy = require('./sumBy.js'); + + + test('sumBy is a Function', () => { + expect(sumBy).toBeInstanceOf(Function); +}); + diff --git a/test6/sumPower/sumPower.js b/test/sumPower/sumPower.js similarity index 100% rename from test6/sumPower/sumPower.js rename to test/sumPower/sumPower.js diff --git a/test/sumPower/sumPower.test.js b/test/sumPower/sumPower.test.js new file mode 100644 index 000000000..17f5a1433 --- /dev/null +++ b/test/sumPower/sumPower.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const sumPower = require('./sumPower.js'); + + + test('sumPower is a Function', () => { + expect(sumPower).toBeInstanceOf(Function); +}); + t.equal(sumPower(10), 385, "Returns the sum of the powers of all the numbers from start to end"); + t.equal(sumPower(10, 3), 3025, "Returns the sum of the powers of all the numbers from start to end"); + t.equal(sumPower(10, 3, 5), 2925, "Returns the sum of the powers of all the numbers from start to end"); + diff --git a/test6/symmetricDifference/symmetricDifference.js b/test/symmetricDifference/symmetricDifference.js similarity index 100% rename from test6/symmetricDifference/symmetricDifference.js rename to test/symmetricDifference/symmetricDifference.js diff --git a/test/symmetricDifference/symmetricDifference.test.js b/test/symmetricDifference/symmetricDifference.test.js new file mode 100644 index 000000000..4874b7544 --- /dev/null +++ b/test/symmetricDifference/symmetricDifference.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const symmetricDifference = require('./symmetricDifference.js'); + + + test('symmetricDifference is a Function', () => { + expect(symmetricDifference).toBeInstanceOf(Function); +}); + t.deepEqual(symmetricDifference([1, 2, 3], [1, 2, 4]), [3, 4], "Returns the symmetric difference between two arrays."); + diff --git a/test6/symmetricDifferenceBy/symmetricDifferenceBy.js b/test/symmetricDifferenceBy/symmetricDifferenceBy.js similarity index 100% rename from test6/symmetricDifferenceBy/symmetricDifferenceBy.js rename to test/symmetricDifferenceBy/symmetricDifferenceBy.js diff --git a/test/symmetricDifferenceBy/symmetricDifferenceBy.test.js b/test/symmetricDifferenceBy/symmetricDifferenceBy.test.js new file mode 100644 index 000000000..43e69f13c --- /dev/null +++ b/test/symmetricDifferenceBy/symmetricDifferenceBy.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const symmetricDifferenceBy = require('./symmetricDifferenceBy.js'); + + + test('symmetricDifferenceBy is a Function', () => { + expect(symmetricDifferenceBy).toBeInstanceOf(Function); +}); + t.deepEqual(symmetricDifferenceBy([2.1, 1.2], [2.3, 3.4], Math.floor), [ 1.2, 3.4 ], 'Returns the symmetric difference between two arrays, after applying the provided function to each array element of both'); + + diff --git a/test6/symmetricDifferenceWith/symmetricDifferenceWith.js b/test/symmetricDifferenceWith/symmetricDifferenceWith.js similarity index 100% rename from test6/symmetricDifferenceWith/symmetricDifferenceWith.js rename to test/symmetricDifferenceWith/symmetricDifferenceWith.js diff --git a/test/symmetricDifferenceWith/symmetricDifferenceWith.test.js b/test/symmetricDifferenceWith/symmetricDifferenceWith.test.js new file mode 100644 index 000000000..33f65acae --- /dev/null +++ b/test/symmetricDifferenceWith/symmetricDifferenceWith.test.js @@ -0,0 +1,14 @@ +const expect = require('expect'); +const symmetricDifferenceWith = require('./symmetricDifferenceWith.js'); + + + test('symmetricDifferenceWith is a Function', () => { + expect(symmetricDifferenceWith).toBeInstanceOf(Function); +}); + t.deepEqual(symmetricDifferenceWith( + [1, 1.2, 1.5, 3, 0], + [1.9, 3, 0, 3.9], + (a, b) => Math.round(a) === Math.round(b) +), [1, 1.2, 3.9], 'Returns the symmetric difference between two arrays, using a provided function as a comparator'); + + diff --git a/test6/tail/tail.js b/test/tail/tail.js similarity index 100% rename from test6/tail/tail.js rename to test/tail/tail.js diff --git a/test/tail/tail.test.js b/test/tail/tail.test.js new file mode 100644 index 000000000..df77407cf --- /dev/null +++ b/test/tail/tail.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const tail = require('./tail.js'); + + + test('tail is a Function', () => { + expect(tail).toBeInstanceOf(Function); +}); + t.deepEqual(tail([1, 2, 3]), [2, 3], "Returns tail"); + t.deepEqual(tail([1]), [1], "Returns tail"); + diff --git a/test6/take/take.js b/test/take/take.js similarity index 100% rename from test6/take/take.js rename to test/take/take.js diff --git a/test/take/take.test.js b/test/take/take.test.js new file mode 100644 index 000000000..2a71a1476 --- /dev/null +++ b/test/take/take.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const take = require('./take.js'); + + + test('take is a Function', () => { + expect(take).toBeInstanceOf(Function); +}); + t.deepEqual(take([1, 2, 3], 5), [1, 2, 3], "Returns an array with n elements removed from the beginning."); + t.deepEqual(take([1, 2, 3], 0), [], "Returns an array with n elements removed from the beginning."); + + diff --git a/test6/takeRight/takeRight.js b/test/takeRight/takeRight.js similarity index 100% rename from test6/takeRight/takeRight.js rename to test/takeRight/takeRight.js diff --git a/test/takeRight/takeRight.test.js b/test/takeRight/takeRight.test.js new file mode 100644 index 000000000..ae144bb02 --- /dev/null +++ b/test/takeRight/takeRight.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const takeRight = require('./takeRight.js'); + + + test('takeRight is a Function', () => { + expect(takeRight).toBeInstanceOf(Function); +}); + t.deepEqual(takeRight([1, 2, 3], 2), [2, 3], "Returns an array with n elements removed from the end"); + t.deepEqual(takeRight([1, 2, 3]), [3], "Returns an array with n elements removed from the end"); + diff --git a/test6/takeRightWhile/takeRightWhile.js b/test/takeRightWhile/takeRightWhile.js similarity index 100% rename from test6/takeRightWhile/takeRightWhile.js rename to test/takeRightWhile/takeRightWhile.js diff --git a/test/takeRightWhile/takeRightWhile.test.js b/test/takeRightWhile/takeRightWhile.test.js new file mode 100644 index 000000000..d300b3651 --- /dev/null +++ b/test/takeRightWhile/takeRightWhile.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const takeRightWhile = require('./takeRightWhile.js'); + + + test('takeRightWhile is a Function', () => { + expect(takeRightWhile).toBeInstanceOf(Function); +}); + t.deepEqual(takeRightWhile([1, 2, 3, 4], n => n < 3), [3, 4], 'Removes elements until the function returns true'); + + diff --git a/test6/takeWhile/takeWhile.js b/test/takeWhile/takeWhile.js similarity index 100% rename from test6/takeWhile/takeWhile.js rename to test/takeWhile/takeWhile.js diff --git a/test/takeWhile/takeWhile.test.js b/test/takeWhile/takeWhile.test.js new file mode 100644 index 000000000..a8949edf4 --- /dev/null +++ b/test/takeWhile/takeWhile.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const takeWhile = require('./takeWhile.js'); + + + test('takeWhile is a Function', () => { + expect(takeWhile).toBeInstanceOf(Function); +}); + t.deepEqual(takeWhile([1, 2, 3, 4], n => n >= 3), [1, 2], 'Removes elements until the function returns true'); + + diff --git a/test/testlog b/test/testlog new file mode 100644 index 000000000..790dd2119 --- /dev/null +++ b/test/testlog @@ -0,0 +1,2054 @@ +Test log for: Sun Jun 17 2018 21:26:15 GMT+0000 (Coordinated Universal Time) + +> 30-seconds-of-code@0.0.3 test /home/travis/build/Chalarangelo/30-seconds-of-code +> tape test/**/*.test.js | tap-spec + + + Testing JSONToDate + + ✔ JSONToDate is a Function + + Testing JSONToFile + + ✔ JSONToFile is a Function + ✔ Tested on 09/02/2018 by @chalarangelo + + Testing RGBToHex + + ✔ RGBToHex is a Function + ✔ Converts the values of RGB components to a color code. + + Testing URLJoin + + ✔ URLJoin is a Function + ✔ Returns proper URL + ✔ Returns proper URL + + Testing UUIDGeneratorBrowser + + ✔ UUIDGeneratorBrowser is a Function + ✔ Tested 09/02/2018 by @chalarangelo + + Testing UUIDGeneratorNode + + ✔ UUIDGeneratorNode is a Function + ✔ Contains dashes in the proper places + ✔ Only contains hexadecimal digits + + Testing all + + ✔ all is a Function + ✔ Returns true for arrays with no falsey values + ✔ Returns false for arrays with 0 + ✔ Returns false for arrays with NaN + ✔ Returns false for arrays with undefined + ✔ Returns false for arrays with null + ✔ Returns false for arrays with empty strings + ✔ Returns true with predicate function + ✔ Returns false with a predicate function + + Testing any + + ✔ any is a Function + ✔ Returns true for arrays with at least one truthy value + ✔ Returns false for arrays with no truthy values + ✔ Returns false for arrays with no truthy values + ✔ Returns true with predicate function + ✔ Returns false with a predicate function + + Testing approximatelyEqual + + ✔ approximatelyEqual is a Function + ✔ Works for PI / 2 + ✔ Works for 0.1 + 0.2 === 0.3 + ✔ Works for exactly equal values + ✔ Works for a custom epsilon + + Testing arrayToHtmlList + + ✔ arrayToHtmlList is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing ary + + ✔ ary is a Function + ✔ Discards arguments with index >=n + + Testing atob + + ✔ atob is a Function + ✔ atob("Zm9vYmFy") equals "foobar" + ✔ atob("Z") returns "" + + Testing attempt + + ✔ attempt is a Function + ✔ Returns a value + ✔ Returns an error + + Testing average + + ✔ average is a Function + ✔ average(true) returns 0 + ✔ average(false) returns 1 + ✔ average(9, 1) returns 5 + ✔ average(153, 44, 55, 64, 71, 1122, 322774, 2232, 23423, 234, 3631) returns 32163.909090909092 + ✔ average(1, 2, 3) returns 2 + ✔ average(null) returns 0 + ✔ average(1, 2, 3) returns NaN + ✔ average(String) returns NaN + ✔ average({ a: 123}) returns NaN + ✔ average([undefined, 0, string]) returns NaN + ✔ average([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run + + Testing averageBy + + ✔ averageBy is a Function + ✔ Produces the right result with a function + ✔ Produces the right result with a property name + + Testing bifurcate + + ✔ bifurcate is a Function + ✔ Splits the collection into two groups + + Testing bifurcateBy + + ✔ bifurcateBy is a Function + ✔ Splits the collection into two groups + + Testing binarySearch + + ✔ binarySearch is a Function + ✔ Finds item in array + ✔ Returns -1 when not found + ✔ Works with empty arrays + ✔ Works for one element arrays + + Testing bind + + ✔ bind is a Function + ✔ Binds to an object context + + Testing bindAll + + ✔ bindAll is a Function + ✔ Binds to an object context + + Testing bindKey + + ✔ bindKey is a Function + ✔ Binds function to an object context + + Testing binomialCoefficient + + ✔ binomialCoefficient is a Function + ✔ Returns the appropriate value + ✔ Returns the appropriate value + ✔ Returns the appropriate value + ✔ Returns NaN + ✔ Returns NaN + + Testing bottomVisible + + ✔ bottomVisible is a Function + ✔ Tested on 09/02/2018 by @chalarangelo + + Testing btoa + + ✔ btoa is a Function + ✔ btoa("foobar") equals "Zm9vYmFy" + + Testing byteSize + + ✔ byteSize is a Function + ✔ Works for a single letter + ✔ Works for a common string + ✔ Works for emoji + + Testing call + + ✔ call is a Function + ✔ Calls function on given object + + Testing capitalize + + ✔ capitalize is a Function + ✔ Capitalizes the first letter of a string + ✔ Capitalizes the first letter of a string + ✔ Works with characters + ✔ Works with single character words + + Testing capitalizeEveryWord + + ✔ capitalizeEveryWord is a Function + ✔ Capitalizes the first letter of every word in a string + ✔ Works with characters + ✔ Works with one word string + + Testing castArray + + ✔ castArray is a Function + ✔ Works for single values + ✔ Works for arrays with one value + ✔ Works for arrays with multiple value + ✔ Works for strings + ✔ Works for objects + + Testing chainAsync + + ✔ chainAsync is a Function + ✔ Calls all functions in an array + + Testing chunk + + ✔ chunk is a Function + ✔ chunk([1, 2, 3, 4, 5], 2) returns [[1,2],[3,4],[5]] + ✔ chunk([]) returns [] + ✔ chunk(123) returns [] + ✔ chunk({ a: 123}) returns [] + ✔ chunk(string, 2) returns [ st, ri, ng ] + ✔ chunk() throws an error + ✔ chunk(undefined) throws an error + ✔ chunk(null) throws an error + ✔ chunk(This is a string, 2) takes less than 2s to run + + Testing clampNumber + + ✔ clampNumber is a Function + ✔ Clamps num within the inclusive range specified by the boundary values a and b + + Testing cleanObj + + ✔ cleanObj is a Function + ✔ Removes any properties except the ones specified from a JSON object + + Testing cloneRegExp + + ✔ cloneRegExp is a Function + ✔ Clones regular expressions properly + + Testing coalesce + + ✔ coalesce is a Function + ✔ Returns the first non-null/undefined argument + + Testing coalesceFactory + + ✔ coalesceFactory is a Function + ✔ Returns a customized coalesce function + + Testing collatz + + ✔ collatz is a Function + ✔ When n is even, divide by 2 + ✔ When n is odd, times by 3 and add 1 + ✔ Eventually reaches 1 + + Testing collectInto + + ✔ collectInto is a Function + + Testing colorize + + ✔ colorize is a Function + ✔ Tested on 09/02/2018 by @chalarangelo + + Testing compact + + ✔ compact is a Function + ✔ Removes falsey values from an array + + Testing compose + + ✔ compose is a Function + ✔ Performs right-to-left function composition + + Testing composeRight + + ✔ composeRight is a Function + ✔ Performs left-to-right function composition + + Testing converge + + ✔ converge is a Function + ✔ Produces the average of the array + ✔ Produces the strange concatenation + + Testing copyToClipboard + + ✔ copyToClipboard is a Function + ✔ Tested on 09/02/2018 by @chalarangelo + + Testing countBy + + ✔ countBy is a Function + ✔ Works for functions + ✔ Works for property names + + Testing countOccurrences + + ✔ countOccurrences is a Function + ✔ Counts the occurrences of a value in an array + + Testing countVowels + + ✔ countVowels is a Function + + Testing counter + + ✔ counter is a Function + + Testing createElement + + ✔ createElement is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing createEventHub + + ✔ createEventHub is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing currentURL + + ✔ currentURL is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing curry + + ✔ curry is a Function + ✔ curries a Math.pow + ✔ curries a Math.min + + Testing debounce + + ✔ debounce is a Function + + Testing decapitalize + + ✔ decapitalize is a Function + ✔ Works with default parameter + ✔ Works with second parameter set to true + + Testing deepClone + + ✔ deepClone is a Function + ✔ Shallow cloning works + ✔ Deep cloning works + ✔ Array shallow cloning works + ✔ Array deep cloning works + + Testing deepFlatten + + ✔ deepFlatten is a Function + ✔ Deep flattens an array + + Testing defaults + + ✔ defaults is a Function + ✔ Assigns default values for undefined properties + + Testing defer + + ✔ defer is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing degreesToRads + + ✔ degreesToRads is a Function + ✔ Returns the appropriate value + + Testing delay + + ✔ delay is a Function + + Testing detectDeviceType + + ✔ detectDeviceType is a Function + ✔ Tested on 09/02/2018 by @chalarangelo + + Testing difference + + ✔ difference is a Function + ✔ Returns the difference between two arrays + + Testing differenceBy + + ✔ differenceBy is a Function + ✔ Works using a native function and numbers + ✔ Works with arrow function and objects + + Testing differenceWith + + ✔ differenceWith is a Function + ✔ Filters out all values from an array + + Testing digitize + + ✔ digitize is a Function + ✔ Converts a number to an array of digits + + Testing distance + + ✔ distance is a Function + ✔ Calculates the distance between two points + + Testing drop + + ✔ drop is a Function + ✔ Works without the last argument + ✔ Removes appropriate element count as specified + ✔ Empties array given a count greater than length + + Testing dropRight + + ✔ dropRight is a Function + ✔ Returns a new array with n elements removed from the right + ✔ Returns a new array with n elements removed from the right + ✔ Returns a new array with n elements removed from the right + + Testing dropRightWhile + + ✔ dropRightWhile is a Function + ✔ Removes elements from the end of an array until the passed function returns true. + + Testing dropWhile + + ✔ dropWhile is a Function + ✔ Removes elements in an array until the passed function returns true. + + Testing elementIsVisibleInViewport + + ✔ elementIsVisibleInViewport is a Function + ✔ Tested on 09/02/2018 by @chalarangelo + + Testing elo + + ✔ elo is a Function + ✔ Standard 1v1s + ✔ should be equivalent + ✔ 4 player FFA, all same rank + + Testing equals + + ✔ equals is a Function + ✔ { a: [2, {e: 3}], b: [4], c: 'foo' } is equal to { a: [2, {e: 3}], b: [4], c: 'foo' } + ✔ [1,2,3] is equal to [1,2,3] + ✔ { a: [2, 3], b: [4] } is not equal to { a: [2, 3], b: [6] } + ✔ [1,2,3] is not equal to [1,2,4] + ✔ [1, 2, 3] should be equal to { 0: 1, 1: 2, 2: 3 }) - type is different, but their enumerable properties match. + + Testing escapeHTML + + ✔ escapeHTML is a Function + ✔ Escapes a string for use in HTML + + Testing escapeRegExp + + ✔ escapeRegExp is a Function + ✔ Escapes a string to use in a regular expression + + Testing everyNth + + ✔ everyNth is a Function + ✔ Returns every nth element in an array + + Testing extendHex + + ✔ extendHex is a Function + ✔ Extends a 3-digit color code to a 6-digit color code + ✔ Extends a 3-digit color code to a 6-digit color code + + Testing factorial + + ✔ factorial is a Function + ✔ Calculates the factorial of 720 + ✔ Calculates the factorial of 0 + ✔ Calculates the factorial of 1 + ✔ Calculates the factorial of 4 + ✔ Calculates the factorial of 10 + + Testing factors + + ✔ factors is a Function + + Testing fibonacci + + ✔ fibonacci is a Function + ✔ Generates an array, containing the Fibonacci sequence + + Testing fibonacciCountUntilNum + + ✔ fibonacciCountUntilNum is a Function + + Testing fibonacciUntilNum + + ✔ fibonacciUntilNum is a Function + + Testing filterNonUnique + + ✔ filterNonUnique is a Function + ✔ Filters out the non-unique values in an array + + Testing findKey + + ✔ findKey is a Function + ✔ Returns the appropriate key + + Testing findLast + + ✔ findLast is a Function + ✔ Finds last element for which the given function returns true + + Testing findLastIndex + + ✔ findLastIndex is a Function + ✔ Finds last index for which the given function returns true + + Testing findLastKey + + ✔ findLastKey is a Function + ✔ Returns the appropriate key + + Testing flatten + + ✔ flatten is a Function + ✔ Flattens an array + ✔ Flattens an array + + Testing flattenObject + + ✔ flattenObject is a Function + ✔ Flattens an object with the paths for keys + ✔ Works with arrays + + Testing flip + + ✔ flip is a Function + ✔ Flips argument order + + Testing forEachRight + + ✔ forEachRight is a Function + ✔ Iterates over the array in reverse + + Testing forOwn + + ✔ forOwn is a Function + ✔ Iterates over an element's key-value pairs + + Testing forOwnRight + + ✔ forOwnRight is a Function + ✔ Iterates over an element's key-value pairs in reverse + + Testing formatDuration + + ✔ formatDuration is a Function + ✔ Returns the human readable format of the given number of milliseconds + ✔ Returns the human readable format of the given number of milliseconds + + Testing fromCamelCase + + ✔ fromCamelCase is a Function + ✔ Converts a string from camelcase + ✔ Converts a string from camelcase + ✔ Converts a string from camelcase + + Testing functionName + + ✔ functionName is a Function + ✔ Works for native functions + ✔ Works for functions + ✔ Works for arrow functions + + Testing functions + + ✔ functions is a Function + ✔ Returns own methods + ✔ Returns own and inherited methods + + Testing gcd + + ✔ gcd is a Function + ✔ Calculates the greatest common divisor between two or more numbers/arrays + ✔ Calculates the greatest common divisor between two or more numbers/arrays + + Testing geometricProgression + + ✔ geometricProgression is a Function + ✔ Initializes an array containing the numbers in the specified range + ✔ Initializes an array containing the numbers in the specified range + ✔ Initializes an array containing the numbers in the specified range + + Testing get + + ✔ get is a Function + ✔ Retrieve a property indicated by the selector from an object. + + Testing getColonTimeFromDate + + ✔ getColonTimeFromDate is a Function + + Testing getDaysDiffBetweenDates + + ✔ getDaysDiffBetweenDates is a Function + ✔ Returns the difference in days between two dates + + Testing getMeridiemSuffixOfInteger + + ✔ getMeridiemSuffixOfInteger is a Function + + Testing getScrollPosition + + ✔ getScrollPosition is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing getStyle + + ✔ getStyle is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing getType + + ✔ getType is a Function + ✔ Returns the native type of a value + + Testing getURLParameters + + ✔ getURLParameters is a Function + ✔ Returns an object containing the parameters of the current URL + + Testing groupBy + + ✔ groupBy is a Function + ✔ Groups the elements of an array based on the given function + ✔ Groups the elements of an array based on the given function + + Testing hammingDistance + + ✔ hammingDistance is a Function + ✔ retuns hamming disance between 2 values + + Testing hasClass + + ✔ hasClass is a Function + + Testing hasFlags + + ✔ hasFlags is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing hashBrowser + + ✔ hashBrowser is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing hashNode + + ✔ hashNode is a Function + + Testing head + + ✔ head is a Function + ✔ head({ a: 1234}) returns undefined + ✔ head([1, 2, 3]) returns 1 + ✔ head({ 0: false}) returns false + ✔ head(String) returns S + ✔ head(null) throws an Error + ✔ head(undefined) throws an Error + ✔ head() throws an Error + ✔ head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run + + Testing hexToRGB + + ✔ hexToRGB is a Function + ✔ Converts a color code to a rgb() or rgba() string + ✔ Converts a color code to a rgb() or rgba() string + ✔ Converts a color code to a rgb() or rgba() string + + Testing hide + + ✔ hide is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing howManyTimes + + ✔ howManyTimes is a Function + + Testing httpDelete + + ✔ httpDelete is a Function + + Testing httpGet + + ✔ httpGet is a Function + + Testing httpPost + + ✔ httpPost is a Function + + Testing httpPut + + ✔ httpPut is a Function + + Testing httpsRedirect + + ✔ httpsRedirect is a Function + ✔ Tested on 09/02/2018 by @chalarangelo + + Testing hz + + ✔ hz is a Function + + Testing inRange + + ✔ inRange is a Function + ✔ The given number falls within the given range + ✔ The given number falls within the given range + ✔ The given number does not falls within the given range + ✔ The given number does not falls within the given range + + Testing indexOfAll + + ✔ indexOfAll is a Function + ✔ Returns all indices of val in an array + ✔ Returns all indices of val in an array + + Testing initial + + ✔ initial is a Function + ✔ Returns all the elements of an array except the last one + + Testing initialize2DArray + + ✔ initialize2DArray is a Function + ✔ Initializes a 2D array of given width and height and value + + Testing initializeArrayWithRange + + ✔ initializeArrayWithRange is a Function + ✔ Initializes an array containing the numbers in the specified range + + Testing initializeArrayWithRangeRight + + ✔ initializeArrayWithRangeRight is a Function + + Testing initializeArrayWithValues + + ✔ initializeArrayWithValues is a Function + ✔ Initializes and fills an array with the specified values + + Testing initializeNDArray + + ✔ initializeNDArray is a Function + + Testing intersection + + ✔ intersection is a Function + ✔ Returns a list of elements that exist in both arrays + + Testing intersectionBy + + ✔ intersectionBy is a Function + ✔ Returns a list of elements that exist in both arrays, after applying the provided function to each array element of both + + Testing intersectionWith + + ✔ intersectionWith is a Function + ✔ Returns a list of elements that exist in both arrays, using a provided comparator function + + Testing invertKeyValues + + ✔ invertKeyValues is a Function + ✔ invertKeyValues({ a: 1, b: 2, c: 1 }) returns { 1: [ 'a', 'c' ], 2: [ 'b' ] } + ✔ invertKeyValues({ a: 1, b: 2, c: 1 }, value => 'group' + value) returns { group1: [ 'a', 'c' ], group2: [ 'b' ] } + + Testing is + + ✔ is is a Function + ✔ Works for arrays with data + ✔ Works for empty arrays + ✔ Works for arrays, not objects + ✔ Works for objects + ✔ Works for maps + ✔ Works for regular expressions + ✔ Works for sets + ✔ Works for weak maps + ✔ Works for weak sets + ✔ Works for strings - returns true for primitive + ✔ Works for strings - returns true when using constructor + ✔ Works for numbers - returns true for primitive + ✔ Works for numbers - returns true when using constructor + ✔ Works for booleans - returns true for primitive + ✔ Works for booleans - returns true when using constructor + ✔ Works for functions + + Testing isAbsoluteURL + + ✔ isAbsoluteURL is a Function + ✔ Given string is an absolute URL + ✔ Given string is an absolute URL + ✔ Given string is not an absolute URL + + Testing isAnagram + + ✔ isAnagram is a Function + ✔ Checks valid anagram + ✔ Works with spaces + ✔ Ignores case + ✔ Ignores special characters + + Testing isArmstrongNumber + + ✔ isArmstrongNumber is a Function + + Testing isArray + + ✔ isArray is a Function + ✔ passed value is an array + ✔ passed value is not an array + + Testing isArrayBuffer + + ✔ isArrayBuffer is a Function + + Testing isArrayLike + + ✔ isArrayLike is a Function + ✔ Returns true for a string + ✔ Returns true for an array + ✔ Returns false for null + + Testing isBoolean + + ✔ isBoolean is a Function + ✔ passed value is not a boolean + ✔ passed value is not a boolean + + Testing isBrowser + + ✔ isBrowser is a Function + + Testing isBrowserTabFocused + + ✔ isBrowserTabFocused is a Function + + Testing isDivisible + + ✔ isDivisible is a Function + ✔ The number 6 is divisible by 3 + + Testing isEmpty + + ✔ isEmpty is a Function + ✔ Returns true for empty Map + ✔ Returns true for empty Set + ✔ Returns true for empty array + ✔ Returns true for empty object + ✔ Returns true for empty string + ✔ Returns false for non-empty array + ✔ Returns false for non-empty object + ✔ Returns false for non-empty string + ✔ Returns true - type is not considered a collection + ✔ Returns true - type is not considered a collection + + Testing isEven + + ✔ isEven is a Function + ✔ 4 is even number + ✔ undefined + + Testing isFunction + + ✔ isFunction is a Function + ✔ passed value is a function + ✔ passed value is not a function + + Testing isLowerCase + + ✔ isLowerCase is a Function + ✔ passed string is a lowercase + ✔ passed string is a lowercase + ✔ passed value is not a lowercase + + Testing isMap + + ✔ isMap is a Function + + Testing isNil + + ✔ isNil is a Function + ✔ Returns true for null + ✔ Returns true for undefined + ✔ Returns false for an empty string + + Testing isNull + + ✔ isNull is a Function + ✔ passed argument is a null + ✔ passed argument is a null + + Testing isNumber + + ✔ isNumber is a Function + ✔ passed argument is a number + ✔ passed argument is not a number + + Testing isObject + + ✔ isObject is a Function + ✔ isObject([1, 2, 3, 4]) is a object + ✔ isObject([]) is a object + ✔ isObject({ a:1 }) is a object + ✔ isObject(true) is not a object + + Testing isObjectLike + + ✔ isObjectLike is a Function + ✔ Returns true for an object + ✔ Returns true for an array + ✔ Returns false for a function + ✔ Returns false for null + + Testing isPlainObject + + ✔ isPlainObject is a Function + ✔ Returns true for a plain object + ✔ Returns false for a Map (example of non-plain object) + + Testing isPrime + + ✔ isPrime is a Function + ✔ passed number is a prime + + Testing isPrimitive + + ✔ isPrimitive is a Function + ✔ isPrimitive(null) is primitive + ✔ isPrimitive(undefined) is primitive + ✔ isPrimitive(string) is primitive + ✔ isPrimitive(true) is primitive + ✔ isPrimitive(50) is primitive + ✔ isPrimitive('Hello') is primitive + ✔ isPrimitive(false) is primitive + ✔ isPrimitive(Symbol()) is primitive + ✔ isPrimitive([1, 2, 3]) is not primitive + ✔ isPrimitive({ a: 123 }) is not primitive + ✔ isPrimitive({ a: 123 }) takes less than 2s to run + + Testing isPromiseLike + + ✔ isPromiseLike is a Function + ✔ Returns true for a promise-like object + ✔ Returns false for null + ✔ Returns false for an empty object + + Testing isRegExp + + ✔ isRegExp is a Function + + Testing isSet + + ✔ isSet is a Function + + Testing isSimilar + + ✔ isSimilar is a Function + + Testing isSorted + + ✔ isSorted is a Function + ✔ Array is sorted in ascending order + ✔ Array is sorted in ascending order + ✔ Array is sorted in ascending order + ✔ Array is sorted in ascending order + ✔ Array is sorted in descending order + ✔ Array is sorted in descending order + ✔ Array is sorted in descending order + ✔ Array is sorted in descending order + ✔ Array is empty + ✔ Array is not sorted, direction changed in array + ✔ Array is not sorted, direction changed in array + + Testing isString + + ✔ isString is a Function + ✔ foo is a string + ✔ "10" is a string + ✔ Empty string is a string + ✔ 10 is not a string + ✔ true is not string + + Testing isSymbol + + ✔ isSymbol is a Function + ✔ Checks if the given argument is a symbol + + Testing isTravisCI + + ✔ isTravisCI is a Function + ✔ Running on Travis, correctly evaluates + + Testing isTypedArray + + ✔ isTypedArray is a Function + + Testing isUndefined + + ✔ isUndefined is a Function + ✔ Returns true for undefined + + Testing isUpperCase + + ✔ isUpperCase is a Function + ✔ ABC is all upper case + ✔ abc is not all upper case + ✔ A3@$ is all uppercase + + Testing isValidJSON + + ✔ isValidJSON is a Function + ✔ {"name":"Adam","age":20} is a valid JSON + ✔ {"name":"Adam",age:"20"} is not a valid JSON + ✔ null is a valid JSON + + Testing isWeakMap + + ✔ isWeakMap is a Function + + Testing isWeakSet + + ✔ isWeakSet is a Function + + Testing join + + ✔ join is a Function + ✔ Joins all elements of an array into a string and returns this string + ✔ Joins all elements of an array into a string and returns this string + ✔ Joins all elements of an array into a string and returns this string + + Testing last + + ✔ last is a Function + ✔ last({ a: 1234}) returns undefined + ✔ last([1, 2, 3]) returns 3 + ✔ last({ 0: false}) returns undefined + ✔ last(String) returns g + ✔ last(null) throws an Error + ✔ last(undefined) throws an Error + ✔ last() throws an Error + ✔ last([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run + + Testing lcm + + ✔ lcm is a Function + ✔ Returns the least common multiple of two or more numbers. + ✔ Returns the least common multiple of two or more numbers. + + Testing levenshteinDistance + + ✔ levenshteinDistance is a Function + + Testing longestItem + + ✔ longestItem is a Function + ✔ Returns the longest object + + Testing lowercaseKeys + + ✔ lowercaseKeys is a Function + ✔ Lowercases object keys + ✔ Does not mutate original object + + Testing luhnCheck + + ✔ luhnCheck is a Function + ✔ validates identification number + ✔ validates identification number + ✔ validates identification number + + Testing mapKeys + + ✔ mapKeys is a Function + ✔ Maps keys + + Testing mapObject + + ✔ mapObject is a Function + ✔ mapObject([1, 2, 3], a => a * a) returns { 1: 1, 2: 4, 3: 9 } + ✔ mapObject([1, 2, 3, 4], (a, b) => b - a) returns { 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 } + + Testing mapValues + + ✔ mapValues is a Function + ✔ Maps values + + Testing mask + + ✔ mask is a Function + ✔ Replaces all but the last num of characters with the specified mask character + ✔ Replaces all but the last num of characters with the specified mask character + ✔ Replaces all but the last num of characters with the specified mask character + + Testing matches + + ✔ matches is a Function + ✔ Matches returns true for two similar objects + ✔ Matches returns false for two non-similar objects + + Testing matchesWith + + ✔ matchesWith is a Function + ✔ Returns true for two objects with similar values, based on the provided function + + Testing maxBy + + ✔ maxBy is a Function + ✔ Produces the right result with a function + ✔ Produces the right result with a property name + + Testing maxN + + ✔ maxN is a Function + ✔ Returns the n maximum elements from the provided array + ✔ Returns the n maximum elements from the provided array + + Testing median + + ✔ median is a Function + ✔ Returns the median of an array of numbers + ✔ Returns the median of an array of numbers + + Testing memoize + + ✔ memoize is a Function + ✔ Function works properly + ✔ Function works properly + ✔ Cache stores values + + Testing merge + + ✔ merge is a Function + ✔ Merges two objects + + Testing minBy + + ✔ minBy is a Function + ✔ Produces the right result with a function + ✔ Produces the right result with a property name + + Testing minN + + ✔ minN is a Function + ✔ Returns the n minimum elements from the provided array + ✔ Returns the n minimum elements from the provided array + + Testing mostPerformant + + ✔ mostPerformant is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing negate + + ✔ negate is a Function + ✔ Negates a predicate function + + Testing nest + + ✔ nest is a Function + + Testing nodeListToArray + + ✔ nodeListToArray is a Function + + Testing none + + ✔ none is a Function + ✔ Returns true for arrays with no truthy values + ✔ Returns false for arrays with at least one truthy value + ✔ Returns true with a predicate function + ✔ Returns false with predicate function + + Testing nthArg + + ✔ nthArg is a Function + ✔ Returns the nth argument + ✔ Returns undefined if arguments too few + ✔ Works for negative values + + Testing nthElement + + ✔ nthElement is a Function + ✔ Returns the nth element of an array. + ✔ Returns the nth element of an array. + + Testing objectFromPairs + + ✔ objectFromPairs is a Function + ✔ Creates an object from the given key-value pairs. + + Testing objectToPairs + + ✔ objectToPairs is a Function + ✔ Creates an array of key-value pair arrays from an object. + + Testing observeMutations + + ✔ observeMutations is a Function + ✔ Tested on 09/02/2018 by @chalarangelo + + Testing off + + ✔ off is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing offset + + ✔ offset is a Function + ✔ Offset of 0 returns the same array. + ✔ Offset > 0 returns the offsetted array. + ✔ Offset < 0 returns the reverse offsetted array. + ✔ Offset greater than the length of the array returns the same array. + ✔ Offset less than the negative length of the array returns the same array. + ✔ Offsetting empty array returns an empty array. + + Testing omit + + ✔ omit is a Function + ✔ Omits the key-value pairs corresponding to the given keys from an object + + Testing omitBy + + ✔ omitBy is a Function + ✔ Creates an object composed of the properties the given function returns falsey for + + Testing on + + ✔ on is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing onUserInputChange + + ✔ onUserInputChange is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing once + + ✔ once is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing orderBy + + ✔ orderBy is a Function + ✔ Returns a sorted array of objects ordered by properties and orders. + ✔ Returns a sorted array of objects ordered by properties and orders. + + Testing over + + ✔ over is a Function + ✔ Applies given functions over multiple arguments + + Testing overArgs + + ✔ overArgs is a Function + ✔ Invokes the provided function with its arguments transformed + + Testing pad + + ✔ pad is a Function + ✔ cat is padded on both sides + ✔ length of string is 8 + ✔ pads 42 with "0" + ✔ does not truncates if string exceeds length + + Testing palindrome + + ✔ palindrome is a Function + ✔ Given string is a palindrome + ✔ Given string is not a palindrome + + Testing parseCookie + + ✔ parseCookie is a Function + ✔ Parses the cookie + + Testing partial + + ✔ partial is a Function + ✔ Prepends arguments + + Testing partialRight + + ✔ partialRight is a Function + ✔ Appends arguments + + Testing partition + + ✔ partition is a Function + ✔ Groups the elements into two arrays, depending on the provided function's truthiness for each element. + + Testing percentile + + ✔ percentile is a Function + ✔ Uses the percentile formula to calculate how many numbers in the given array are less or equal to the given value. + + Testing permutations + + ✔ permutations is a Function + ✔ Generates all permutations of an array + + Testing pick + + ✔ pick is a Function + ✔ Picks the key-value pairs corresponding to the given keys from an object. + + Testing pickBy + + ✔ pickBy is a Function + ✔ Creates an object composed of the properties the given function returns truthy for. + + Testing pipeAsyncFunctions + + ✔ pipeAsyncFunctions is a Function + ✔ Produces the appropriate hash + ✔ pipeAsyncFunctions result should be 15 + + Testing pipeFunctions + + ✔ pipeFunctions is a Function + ✔ Performs left-to-right function composition + + Testing pluralize + + ✔ pluralize is a Function + ✔ Produces the plural of the word + ✔ Produces the singular of the word + ✔ Produces the plural of the word + ✔ Prodices the defined plural of the word + ✔ Works with a dictionary + + Testing powerset + + ✔ powerset is a Function + ✔ Returns the powerset of a given array of numbers. + + Testing prefix + + ✔ prefix is a Function + + Testing prettyBytes + + ✔ prettyBytes is a Function + ✔ Converts a number in bytes to a human-readable string. + ✔ Converts a number in bytes to a human-readable string. + ✔ Converts a number in bytes to a human-readable string. + + Testing primes + + ✔ primes is a Function + ✔ Generates primes up to a given number, using the Sieve of Eratosthenes. + + Testing promisify + + ✔ promisify is a Function + ✔ Returns a promise + + Testing pull + + ✔ pull is a Function + ✔ Pulls the specified values + + Testing pullAtIndex + + ✔ pullAtIndex is a Function + ✔ Pulls the given values + ✔ Pulls the given values + + Testing pullAtValue + + ✔ pullAtValue is a Function + ✔ Pulls the specified values + ✔ Pulls the specified values + + Testing pullBy + + ✔ pullBy is a Function + ✔ Pulls the specified values + + Testing quickSort + + ✔ quickSort is a Function + ✔ quickSort([5, 6, 4, 3, 1, 2]) returns [1, 2, 3, 4, 5, 6] + ✔ quickSort([-1, 0, -2]) returns [-2, -1, 0] + ✔ quickSort() throws an error + ✔ quickSort(123) throws an error + ✔ quickSort({ 234: string}) throws an error + ✔ quickSort(null) throws an error + ✔ quickSort(undefined) throws an error + ✔ quickSort([11, 1, 324, 23232, -1, 53, 2, 524, 32, 13, 156, 133, 62, 12, 4]) takes less than 2s to run + + Testing radsToDegrees + + ✔ radsToDegrees is a Function + ✔ Returns the appropriate value + + Testing randomHexColorCode + + ✔ randomHexColorCode is a Function + ✔ should be equal + ✔ The color code starts with "#" + ✔ The color code contains only valid hex-digits + + Testing randomIntArrayInRange + + ✔ randomIntArrayInRange is a Function + ✔ The returned array contains only integers + ✔ The returned array has the proper length + ✔ The returned array's values lie between provided lowerLimit and upperLimit (both inclusive). + + Testing randomIntegerInRange + + ✔ randomIntegerInRange is a Function + ✔ The returned value is an integer + ✔ The returned value lies between provided lowerLimit and upperLimit (both inclusive). + + Testing randomNumberInRange + + ✔ randomNumberInRange is a Function + ✔ The returned value is a number + ✔ The returned value lies between provided lowerLimit and upperLimit (both inclusive). + + Testing readFileLines + + ✔ readFileLines is a Function + ✔ Tested on 09/02/2018 by @chalarangelo + + Testing rearg + + ✔ rearg is a Function + ✔ Reorders arguments in invoked function + + Testing recordAnimationFrames + + ✔ recordAnimationFrames is a Function + + Testing redirect + + ✔ redirect is a Function + ✔ Tested on 09/02/2018 by @chalarangelo + + Testing reduceSuccessive + + ✔ reduceSuccessive is a Function + ✔ Returns the array of successively reduced values + + Testing reduceWhich + + ✔ reduceWhich is a Function + ✔ Returns the minimum of an array + ✔ Returns the maximum of an array + ✔ Returns the object with the minimum specified value in an array + + Testing reducedFilter + + ✔ reducedFilter is a Function + ✔ Filter an array of objects based on a condition while also filtering out unspecified keys. + + Testing reject + + ✔ reject is a Function + ✔ should be equivalent + ✔ should be equivalent + + Testing remove + + ✔ remove is a Function + ✔ Removes elements from an array for which the given function returns false + + Testing removeNonASCII + + ✔ removeNonASCII is a Function + ✔ Removes non-ASCII characters + + Testing removeVowels + + ✔ removeVowels is a Function + + Testing renameKeys + + ✔ renameKeys is a Function + ✔ should be equivalent + + Testing reverseString + + ✔ reverseString is a Function + ✔ Reverses a string. + + Testing round + + ✔ round is a Function + ✔ round(1.005, 2) returns 1.01 + ✔ round(123.3423345345345345344, 11) returns 123.34233453453 + ✔ round(3.342, 11) returns 3.342 + ✔ round(1.005) returns 1 + ✔ round([1.005, 2]) returns NaN + ✔ round(string) returns NaN + ✔ round() returns NaN + ✔ round(132, 413, 4134) returns NaN + ✔ round({a: 132}, 413) returns NaN + ✔ round(123.3423345345345345344, 11) takes less than 2s to run + + Testing runAsync + + ✔ runAsync is a Function + ✔ Tested on 09/02/2018 by @chalarangelo + + Testing runPromisesInSeries + + ✔ runPromisesInSeries is a Function + + Testing sample + + ✔ sample is a Function + ✔ Returns a random element from the array + ✔ Works for single-element arrays + ✔ Returns undefined for empty array + + Testing sampleSize + + ✔ sampleSize is a Function + ✔ Returns a single element without n specified + ✔ Returns a random sample of specified size from an array + ✔ Returns all elements in an array if n >= length + ✔ Returns an empty array if original array is empty + ✔ Returns an empty array if n = 0 + + Testing scrollToTop + + ✔ scrollToTop is a Function + ✔ Tested on 09/02/2018 by @chalarangelo + + Testing sdbm + + ✔ sdbm is a Function + ✔ Hashes the input string into a whole number. + + Testing serializeCookie + + ✔ serializeCookie is a Function + ✔ Serializes the cookie + + Testing setStyle + + ✔ setStyle is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing shallowClone + + ✔ shallowClone is a Function + ✔ Shallow cloning works + ✔ Does not clone deeply + + Testing show + + ✔ show is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing shuffle + + ✔ shuffle is a Function + ✔ Shuffles the array + ✔ New array contains all original elements + ✔ Works for empty arrays + ✔ Works for single-element arrays + + Testing similarity + + ✔ similarity is a Function + ✔ Returns an array of elements that appear in both arrays. + + Testing size + + ✔ size is a Function + ✔ Get size of arrays, objects or strings. + ✔ Get size of arrays, objects or strings. + + Testing sleep + + ✔ sleep is a Function + + Testing smoothScroll + + ✔ smoothScroll is a Function + + Testing solveRPN + + ✔ solveRPN is a Function + + Testing sortCharactersInString + + ✔ sortCharactersInString is a Function + ✔ Alphabetically sorts the characters in a string. + + Testing sortedIndex + + ✔ sortedIndex is a Function + ✔ Returns the lowest index at which value should be inserted into array in order to maintain its sort order. + ✔ Returns the lowest index at which value should be inserted into array in order to maintain its sort order. + + Testing sortedIndexBy + + ✔ sortedIndexBy is a Function + ✔ Returns the lowest index to insert the element without messing up the list order + + Testing sortedLastIndex + + ✔ sortedLastIndex is a Function + ✔ Returns the highest index to insert the element without messing up the list order + + Testing sortedLastIndexBy + + ✔ sortedLastIndexBy is a Function + ✔ Returns the highest index to insert the element without messing up the list order + + Testing speechSynthesis + + ✔ speechSynthesis is a Function + + Testing splitLines + + ✔ splitLines is a Function + ✔ Splits a multiline string into an array of lines. + + Testing spreadOver + + ✔ spreadOver is a Function + ✔ Takes a variadic function and returns a closure that accepts an array of arguments to map to the inputs of the function. + + Testing stableSort + + ✔ stableSort is a Function + ✔ Array is properly sorted + + Testing standardDeviation + + ✔ standardDeviation is a Function + ✔ Returns the standard deviation of an array of numbers + ✔ Returns the standard deviation of an array of numbers + + Testing stringPermutations + + ✔ stringPermutations is a Function + ✔ Generates all stringPermutations of a string + ✔ Works for single-letter strings + ✔ Works for empty strings + + Testing stripHTMLTags + + ✔ stripHTMLTags is a Function + ✔ Removes HTML tags + + Testing sum + + ✔ sum is a Function + ✔ Returns the sum of two or more numbers/arrays. + + Testing sumBy + + ✔ sumBy is a Function + + Testing sumPower + + ✔ sumPower is a Function + ✔ Returns the sum of the powers of all the numbers from start to end + ✔ Returns the sum of the powers of all the numbers from start to end + ✔ Returns the sum of the powers of all the numbers from start to end + + Testing symmetricDifference + + ✔ symmetricDifference is a Function + ✔ Returns the symmetric difference between two arrays. + + Testing symmetricDifferenceBy + + ✔ symmetricDifferenceBy is a Function + ✔ Returns the symmetric difference between two arrays, after applying the provided function to each array element of both + + Testing symmetricDifferenceWith + + ✔ symmetricDifferenceWith is a Function + ✔ Returns the symmetric difference between two arrays, using a provided function as a comparator + + Testing tail + + ✔ tail is a Function + ✔ Returns tail + ✔ Returns tail + + Testing take + + ✔ take is a Function + ✔ Returns an array with n elements removed from the beginning. + ✔ Returns an array with n elements removed from the beginning. + + Testing takeRight + + ✔ takeRight is a Function + ✔ Returns an array with n elements removed from the end + ✔ Returns an array with n elements removed from the end + + Testing takeRightWhile + + ✔ takeRightWhile is a Function + ✔ Removes elements until the function returns true + + Testing takeWhile + + ✔ takeWhile is a Function + ✔ Removes elements until the function returns true + + Testing throttle + + ✔ throttle is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing timeTaken + + ✔ timeTaken is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing times + + ✔ times is a Function + ✔ Runs a function the specified amount of times + + Testing toCamelCase + + ✔ toCamelCase is a Function + ✔ toCamelCase('some_database_field_name') returns someDatabaseFieldName + ✔ toCamelCase('Some label that needs to be camelized') returns someLabelThatNeedsToBeCamelized + ✔ toCamelCase('some-javascript-property') return someJavascriptProperty + ✔ toCamelCase('some-mixed_string with spaces_underscores-and-hyphens') returns someMixedStringWithSpacesUnderscoresAndHyphens + ✔ toCamelCase() throws a error + ✔ toCamelCase([]) throws a error + ✔ toCamelCase({}) throws a error + ✔ toCamelCase(123) throws a error + ✔ toCamelCase(some-mixed_string with spaces_underscores-and-hyphens) takes less than 2s to run + + Testing toCurrency + + ✔ toCurrency is a Function + + ✖ currency: Euro | currencyLangFormat: Local + --------------------------------------------- + operator: equal + expected: '€ 123,456.79' + actual: '€123,456.79' + at: Test.test (/home/travis/build/Chalarangelo/30-seconds-of-code/test/toCurrency/toCurrency.test.js:8:5) + stack: |- + + ✔ currency: US Dollar | currencyLangFormat: English (United States) + + ✖ currency: Japanese Yen | currencyLangFormat: Local + ----------------------------------------------------- + operator: equal + expected: 'JP¥ 322,342,436,423' + actual: '¥322,342,436,423' + at: Test.test (/home/travis/build/Chalarangelo/30-seconds-of-code/test/toCurrency/toCurrency.test.js:11:5) + stack: |- + + + Testing toDecimalMark + + ✔ toDecimalMark is a Function + ✔ convert a float-point arithmetic to the Decimal mark form + + Testing toHash + + ✔ toHash is a Function + + Testing toKebabCase + + ✔ toKebabCase is a Function + ✔ toKebabCase('camelCase') returns camel-case + ✔ toKebabCase('some text') returns some-text + ✔ toKebabCase('some-mixed-string With spaces-underscores-and-hyphens') returns some-mixed-string-with-spaces-underscores-and-hyphens + ✔ toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html + ✔ toKebabCase() return undefined + ✔ toKebabCase([]) throws an error + ✔ toKebabCase({}) throws an error + ✔ toKebabCase(123) throws an error + ✔ toKebabCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run + + Testing toOrdinalSuffix + + ✔ toOrdinalSuffix is a Function + ✔ Adds an ordinal suffix to a number + ✔ Adds an ordinal suffix to a number + ✔ Adds an ordinal suffix to a number + ✔ Adds an ordinal suffix to a number + + Testing toSafeInteger + + ✔ toSafeInteger is a Function + ✔ Number(toSafeInteger(3.2)) is a number + ✔ Converts a value to a safe integer + ✔ toSafeInteger('4.2') returns 4 + ✔ toSafeInteger(4.6) returns 5 + ✔ toSafeInteger([]) returns 0 + ✔ isNaN(toSafeInteger([1.5, 3124])) is true + ✔ isNaN(toSafeInteger('string')) is true + ✔ isNaN(toSafeInteger({})) is true + ✔ isNaN(toSafeInteger()) is true + ✔ toSafeInteger(Infinity) returns 9007199254740991 + ✔ toSafeInteger(3.2) takes less than 2s to run + + Testing toSnakeCase + + ✔ toSnakeCase is a Function + ✔ toSnakeCase('camelCase') returns camel_case + ✔ toSnakeCase('some text') returns some_text + ✔ toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens') returns some_mixed_string_with_spaces_underscores_and_hyphens + ✔ toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html + ✔ toSnakeCase() returns undefined + ✔ toSnakeCase([]) throws an error + ✔ toSnakeCase({}) throws an error + ✔ toSnakeCase(123) throws an error + ✔ toSnakeCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run + + Testing toggleClass + + ✔ toggleClass is a Function + ✔ Tested by @chalarangelo on 16/02/2018 + + Testing tomorrow + + ✔ tomorrow is a Function + ✔ Returns the correct year + ✔ Returns the correct month + ✔ Returns the correct date + + Testing transform + + ✔ transform is a Function + ✔ Transforms an object + + Testing truncateString + + ✔ truncateString is a Function + ✔ Truncates a "boomerang" up to a specified length. + + Testing truthCheckCollection + + ✔ truthCheckCollection is a Function + ✔ second argument is truthy on all elements of a collection + + Testing unary + + ✔ unary is a Function + ✔ Discards arguments after the first one + + Testing uncurry + + ✔ uncurry is a Function + ✔ Works without a provided value for n + ✔ Works without n = 2 + ✔ Works withoutn = 3 + + Testing unescapeHTML + + ✔ unescapeHTML is a Function + ✔ Unescapes escaped HTML characters. + + Testing unflattenObject + + ✔ unflattenObject is a Function + ✔ Unflattens an object with the paths for keys + + Testing unfold + + ✔ unfold is a Function + ✔ Works with a given function, producing an array + + Testing union + + ✔ union is a Function + ✔ union([1, 2, 3], [4, 3, 2]) returns [1, 2, 3, 4] + ✔ union('str', 'asd') returns [ 's', 't', 'r', 'a', 'd' ] + ✔ union([[], {}], [1, 2, 3]) returns [[], {}, 1, 2, 3] + ✔ union([], []) returns [] + ✔ union() throws an error + ✔ union(true, str) throws an error + ✔ union(false, true) throws an error + ✔ union(123, {}) throws an error + ✔ union([], {}) throws an error + ✔ union(undefined, null) throws an error + ✔ union([1, 2, 3], [4, 3, 2]) takes less than 2s to run + + Testing unionBy + + ✔ unionBy is a Function + ✔ Produces the appropriate results + + Testing unionWith + + ✔ unionWith is a Function + ✔ Produces the appropriate results + + Testing uniqueElements + + ✔ uniqueElements is a Function + ✔ uniqueElements([1, 2, 2, 3, 4, 4, 5]) returns [1,2,3,4,5] + ✔ uniqueElements([1, 23, 53]) returns [1, 23, 53] + ✔ uniqueElements([true, 0, 1, false, false, undefined, null, '']) returns [true, 0, 1, false, false, undefined, null, ''] + ✔ uniqueElements() returns [] + ✔ uniqueElements(null) returns [] + ✔ uniqueElements(undefined) returns [] + ✔ uniqueElements('strt') returns ['s', 't', 'r'] + ✔ uniqueElements(1, 1, 2543, 534, 5) throws an error + ✔ uniqueElements({}) throws an error + ✔ uniqueElements(true) throws an error + ✔ uniqueElements(false) throws an error + ✔ uniqueElements([true, 0, 1, false, false, undefined, null]) takes less than 2s to run + + Testing untildify + + ✔ untildify is a Function + ✔ Contains no tildes + ✔ Does not alter the rest of the path + ✔ Does not alter paths without tildes + + Testing unzip + + ✔ unzip is a Function + ✔ unzip([['a', 1, true], ['b', 2, false]]) equals [['a', 'b'], [1, 2], [true, false]] + ✔ unzip([['a', 1, true], ['b', 2]]) equals [['a', 'b'], [1, 2], [true]] + + Testing unzipWith + + ✔ unzipWith is a Function + ✔ unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)) equals [3, 30, 300] + + Testing validateNumber + + ✔ validateNumber is a Function + ✔ validateNumber(9) returns true + ✔ validateNumber(234asd.slice(0, 2)) returns true + ✔ validateNumber(1232) returns true + ✔ validateNumber(1232 + 13423) returns true + ✔ validateNumber(1232 * 2342 * 123) returns true + ✔ validateNumber(1232.23423536) returns true + ✔ validateNumber(234asd) returns false + ✔ validateNumber(e234d) returns false + ✔ validateNumber(false) returns false + ✔ validateNumber(true) returns false + ✔ validateNumber(null) returns false + ✔ validateNumber(123 * asd) returns false + + Testing when + + ✔ when is a Function + ✔ should be truthy + ✔ should be truthy + + Testing without + + ✔ without is a Function + ✔ without([2, 1, 2, 3], 1, 2) returns [3] + ✔ without([]) returns [] + ✔ without([3, 1, true, '3', true], '3', true) returns [3, 1] + ✔ without('string'.split(''), 's', 't', 'g') returns ['r', 'i', 'n'] + ✔ without() throws an error + ✔ without(null) throws an error + ✔ without(undefined) throws an error + ✔ without() throws an error + ✔ without({}) throws an error + + Testing words + + ✔ words is a Function + ✔ words('I love javaScript!!') returns [I, love, javaScript] + ✔ words('python, javaScript & coffee') returns [python, javaScript, coffee] + ✔ words(I love javaScript!!) returns an array + ✔ words() throws a error + ✔ words(null) throws a error + ✔ words(undefined) throws a error + ✔ words({}) throws a error + ✔ words([]) throws a error + ✔ words(1234) throws a error + + Testing xProd + + ✔ xProd is a Function + ✔ xProd([1, 2], ['a', 'b']) returns [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']] + + Testing yesNo + + ✔ yesNo is a Function + ✔ yesNo(Y) returns true + ✔ yesNo(yes) returns true + ✔ yesNo(foo, true) returns true + ✔ yesNo(No) returns false + ✔ yesNo() returns false + ✔ yesNo(null) returns false + ✔ yesNo(undefined) returns false + ✔ yesNo([123, null]) returns false + ✔ yesNo([Yes, No]) returns false + ✔ yesNo({ 2: Yes }) returns false + ✔ yesNo([Yes, No], true) returns true + ✔ yesNo({ 2: Yes }, true) returns true + + Testing zip + + ✔ zip is a Function + ✔ zip([a, b], [1, 2], [true, false]) returns [[a, 1, true], [b, 2, false]] + ✔ zip([a], [1, 2], [true, false]) returns [[a, 1, true], [undefined, 2, false]] + ✔ zip([]) returns [] + ✔ zip(123) returns [] + ✔ zip([a, b], [1, 2], [true, false]) returns an Array + ✔ zip([a], [1, 2], [true, false]) returns an Array + ✔ zip(null) throws an error + ✔ zip(undefined) throws an error + + Testing zipObject + + ✔ zipObject is a Function + ✔ zipObject([a, b, c], [1, 2]) returns {a: 1, b: 2, c: undefined} + ✔ zipObject([a, b], [1, 2, 3]) returns {a: 1, b: 2} + ✔ zipObject([a, b, c], string) returns { a: s, b: t, c: r } + ✔ zipObject([a], string) returns { a: s } + ✔ zipObject() throws an error + ✔ zipObject([string], null) throws an error + ✔ zipObject(null, [1]) throws an error + ✔ zipObject(string) throws an error + ✔ zipObject(test, string) throws an error + + Testing zipWith + + ✔ zipWith is a Function + ✔ Sends a GET request + ✔ Sends a POST request + ✔ Runs the function provided + ✔ Runs promises in series + ✔ Works as expecting, passing arguments properly + ✔ Works with multiple promises + + + + Failed Tests: There were 2 failures + + Testing toCurrency + + ✖ currency: Euro | currencyLangFormat: Local + ✖ currency: Japanese Yen | currencyLangFormat: Local + + + total: 1022 + passing: 1020 + failing: 2 + duration: 2.4s + + +undefined \ No newline at end of file diff --git a/test6/throttle/throttle.js b/test/throttle/throttle.js similarity index 100% rename from test6/throttle/throttle.js rename to test/throttle/throttle.js diff --git a/test/throttle/throttle.test.js b/test/throttle/throttle.test.js new file mode 100644 index 000000000..5e3436417 --- /dev/null +++ b/test/throttle/throttle.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const throttle = require('./throttle.js'); + + + test('throttle is a Function', () => { + expect(throttle).toBeInstanceOf(Function); +}); + t.pass('Tested by @chalarangelo on 16/02/2018'); + + diff --git a/test6/timeTaken/timeTaken.js b/test/timeTaken/timeTaken.js similarity index 100% rename from test6/timeTaken/timeTaken.js rename to test/timeTaken/timeTaken.js diff --git a/test/timeTaken/timeTaken.test.js b/test/timeTaken/timeTaken.test.js new file mode 100644 index 000000000..58755e045 --- /dev/null +++ b/test/timeTaken/timeTaken.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const timeTaken = require('./timeTaken.js'); + + + test('timeTaken is a Function', () => { + expect(timeTaken).toBeInstanceOf(Function); +}); + t.pass('Tested by @chalarangelo on 16/02/2018'); + + diff --git a/test6/times/times.js b/test/times/times.js similarity index 100% rename from test6/times/times.js rename to test/times/times.js diff --git a/test/times/times.test.js b/test/times/times.test.js new file mode 100644 index 000000000..6197b7cee --- /dev/null +++ b/test/times/times.test.js @@ -0,0 +1,14 @@ +const expect = require('expect'); +const times = require('./times.js'); + + + test('times is a Function', () => { + expect(times).toBeInstanceOf(Function); +}); + var output = ''; + times(5, i => (output += i)); + test('Runs a function the specified amount of times', () => { + expect(output, '01234').toBe() +}); + + diff --git a/test6/toCamelCase/toCamelCase.js b/test/toCamelCase/toCamelCase.js similarity index 100% rename from test6/toCamelCase/toCamelCase.js rename to test/toCamelCase/toCamelCase.js diff --git a/test/toCamelCase/toCamelCase.test.js b/test/toCamelCase/toCamelCase.test.js new file mode 100644 index 000000000..5577464d9 --- /dev/null +++ b/test/toCamelCase/toCamelCase.test.js @@ -0,0 +1,24 @@ +const expect = require('expect'); +const toCamelCase = require('./toCamelCase.js'); + + + test('toCamelCase is a Function', () => { + expect(toCamelCase).toBeInstanceOf(Function); +}); + t.equal(toCamelCase('some_database_field_name'), 'someDatabaseFieldName', "toCamelCase('some_database_field_name') returns someDatabaseFieldName"); + t.equal(toCamelCase('Some label that needs to be camelized'), 'someLabelThatNeedsToBeCamelized', "toCamelCase('Some label that needs to be camelized') returns someLabelThatNeedsToBeCamelized"); + t.equal(toCamelCase('some-javascript-property'), 'someJavascriptProperty', "toCamelCase('some-javascript-property') return someJavascriptProperty"); + t.equal(toCamelCase('some-mixed_string with spaces_underscores-and-hyphens'), 'someMixedStringWithSpacesUnderscoresAndHyphens', "toCamelCase('some-mixed_string with spaces_underscores-and-hyphens') returns someMixedStringWithSpacesUnderscoresAndHyphens"); + t.throws(() => toCamelCase(), 'toCamelCase() throws a error'); + t.throws(() => toCamelCase([]), 'toCamelCase([]) throws a error'); + t.throws(() => toCamelCase({}), 'toCamelCase({}) throws a error'); + t.throws(() => toCamelCase(123), 'toCamelCase(123) throws a error'); + + let start = new Date().getTime(); + toCamelCase('some-mixed_string with spaces_underscores-and-hyphens'); + let end = new Date().getTime(); + test('toCamelCase(some-mixed_string with spaces_underscores-and-hyphens) takes less than 2s to run', () => { + expect((end - start) < 2000).toBeTruthy(); +}); + + diff --git a/test6/toCurrency/toCurrency.js b/test/toCurrency/toCurrency.js similarity index 100% rename from test6/toCurrency/toCurrency.js rename to test/toCurrency/toCurrency.js diff --git a/test/toCurrency/toCurrency.test.js b/test/toCurrency/toCurrency.test.js new file mode 100644 index 000000000..b06368eb9 --- /dev/null +++ b/test/toCurrency/toCurrency.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const toCurrency = require('./toCurrency.js'); + + + test('toCurrency is a Function', () => { + expect(toCurrency).toBeInstanceOf(Function); +}); + t.equal(toCurrency(123456.789, 'EUR'), '€ 123,456.79', 'currency: Euro | currencyLangFormat: Local'); + t.equal(toCurrency(123456.789, 'USD', 'en-us'), '$123,456.79', ' currency: US Dollar | currencyLangFormat: English (United States)'); + t.equal(toCurrency(322342436423.2435, 'JPY'), 'JP¥ 322,342,436,423', 'currency: Japanese Yen | currencyLangFormat: Local'); + + diff --git a/test6/toDecimalMark/toDecimalMark.js b/test/toDecimalMark/toDecimalMark.js similarity index 100% rename from test6/toDecimalMark/toDecimalMark.js rename to test/toDecimalMark/toDecimalMark.js diff --git a/test/toDecimalMark/toDecimalMark.test.js b/test/toDecimalMark/toDecimalMark.test.js new file mode 100644 index 000000000..c35a4ade8 --- /dev/null +++ b/test/toDecimalMark/toDecimalMark.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const toDecimalMark = require('./toDecimalMark.js'); + + + test('toDecimalMark is a Function', () => { + expect(toDecimalMark).toBeInstanceOf(Function); +}); + t.equal(toDecimalMark(12305030388.9087), "12,305,030,388.909", "convert a float-point arithmetic to the Decimal mark form"); + diff --git a/test6/toHash/toHash.js b/test/toHash/toHash.js similarity index 100% rename from test6/toHash/toHash.js rename to test/toHash/toHash.js diff --git a/test/toHash/toHash.test.js b/test/toHash/toHash.test.js new file mode 100644 index 000000000..662177031 --- /dev/null +++ b/test/toHash/toHash.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const toHash = require('./toHash.js'); + + + test('toHash is a Function', () => { + expect(toHash).toBeInstanceOf(Function); +}); + diff --git a/test6/toKebabCase/toKebabCase.js b/test/toKebabCase/toKebabCase.js similarity index 100% rename from test6/toKebabCase/toKebabCase.js rename to test/toKebabCase/toKebabCase.js diff --git a/test/toKebabCase/toKebabCase.test.js b/test/toKebabCase/toKebabCase.test.js new file mode 100644 index 000000000..8773f6228 --- /dev/null +++ b/test/toKebabCase/toKebabCase.test.js @@ -0,0 +1,24 @@ +const expect = require('expect'); +const toKebabCase = require('./toKebabCase.js'); + + + test('toKebabCase is a Function', () => { + expect(toKebabCase).toBeInstanceOf(Function); +}); + t.equal(toKebabCase('camelCase'), 'camel-case', "toKebabCase('camelCase') returns camel-case"); + t.equal(toKebabCase('some text'), 'some-text', "toKebabCase('some text') returns some-text"); + t.equal(toKebabCase('some-mixed-string With spaces-underscores-and-hyphens'), 'some-mixed-string-with-spaces-underscores-and-hyphens', "toKebabCase('some-mixed-string With spaces-underscores-and-hyphens') returns some-mixed-string-with-spaces-underscores-and-hyphens"); + t.equal(toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML'), 'i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html', "toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html"); + t.equal(toKebabCase(), undefined, 'toKebabCase() return undefined'); + t.throws(() => toKebabCase([]), 'toKebabCase([]) throws an error'); + t.throws(() => toKebabCase({}), 'toKebabCase({}) throws an error'); + t.throws(() => toKebabCase(123), 'toKebabCase(123) throws an error'); + + let start = new Date().getTime(); + toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML'); + let end = new Date().getTime(); + test('toKebabCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run', () => { + expect((end - start) < 2000).toBeTruthy(); +}); + + diff --git a/test6/toOrdinalSuffix/toOrdinalSuffix.js b/test/toOrdinalSuffix/toOrdinalSuffix.js similarity index 100% rename from test6/toOrdinalSuffix/toOrdinalSuffix.js rename to test/toOrdinalSuffix/toOrdinalSuffix.js diff --git a/test/toOrdinalSuffix/toOrdinalSuffix.test.js b/test/toOrdinalSuffix/toOrdinalSuffix.test.js new file mode 100644 index 000000000..6d6fc41eb --- /dev/null +++ b/test/toOrdinalSuffix/toOrdinalSuffix.test.js @@ -0,0 +1,12 @@ +const expect = require('expect'); +const toOrdinalSuffix = require('./toOrdinalSuffix.js'); + + + test('toOrdinalSuffix is a Function', () => { + expect(toOrdinalSuffix).toBeInstanceOf(Function); +}); + t.equal(toOrdinalSuffix('123'), '123rd', 'Adds an ordinal suffix to a number'); + t.equal(toOrdinalSuffix(5), '5th', 'Adds an ordinal suffix to a number'); + t.equal(toOrdinalSuffix(1), '1st', 'Adds an ordinal suffix to a number'); + t.equal(toOrdinalSuffix(0), '0th', 'Adds an ordinal suffix to a number'); + diff --git a/test6/toSafeInteger/toSafeInteger.js b/test/toSafeInteger/toSafeInteger.js similarity index 100% rename from test6/toSafeInteger/toSafeInteger.js rename to test/toSafeInteger/toSafeInteger.js diff --git a/test/toSafeInteger/toSafeInteger.test.js b/test/toSafeInteger/toSafeInteger.test.js new file mode 100644 index 000000000..2676a9b09 --- /dev/null +++ b/test/toSafeInteger/toSafeInteger.test.js @@ -0,0 +1,28 @@ +const expect = require('expect'); +const toSafeInteger = require('./toSafeInteger.js'); + + + test('toSafeInteger is a Function', () => { + expect(toSafeInteger).toBeInstanceOf(Function); +}); + test('Number(toSafeInteger(3.2)) is a number', () => { + expect(Number(toSafeInteger(3.2))).toBeTruthy(); +}); + t.equal(toSafeInteger(3.2), 3, "Converts a value to a safe integer"); + t.equal(toSafeInteger('4.2'), 4, "toSafeInteger('4.2') returns 4"); + t.equal(toSafeInteger(4.6), 5, "toSafeInteger(4.6) returns 5"); + t.equal(toSafeInteger([]), 0, "toSafeInteger([]) returns 0"); + t.true(isNaN(toSafeInteger([1.5, 3124])), "isNaN(toSafeInteger([1.5, 3124])) is true"); + t.true(isNaN(toSafeInteger('string')), "isNaN(toSafeInteger('string')) is true"); + t.true(isNaN(toSafeInteger({})), "isNaN(toSafeInteger({})) is true"); + t.true(isNaN(toSafeInteger()), "isNaN(toSafeInteger()) is true"); + t.equal(toSafeInteger(Infinity), 9007199254740991, "toSafeInteger(Infinity) returns 9007199254740991"); + + let start = new Date().getTime(); + toSafeInteger(3.2); + let end = new Date().getTime(); + test('toSafeInteger(3.2) takes less than 2s to run', () => { + expect((end - start) < 2000).toBeTruthy(); +}); + + diff --git a/test6/toSnakeCase/toSnakeCase.js b/test/toSnakeCase/toSnakeCase.js similarity index 100% rename from test6/toSnakeCase/toSnakeCase.js rename to test/toSnakeCase/toSnakeCase.js diff --git a/test/toSnakeCase/toSnakeCase.test.js b/test/toSnakeCase/toSnakeCase.test.js new file mode 100644 index 000000000..bf472bbae --- /dev/null +++ b/test/toSnakeCase/toSnakeCase.test.js @@ -0,0 +1,24 @@ +const expect = require('expect'); +const toSnakeCase = require('./toSnakeCase.js'); + + + test('toSnakeCase is a Function', () => { + expect(toSnakeCase).toBeInstanceOf(Function); +}); + t.equal(toSnakeCase('camelCase'), 'camel_case', "toSnakeCase('camelCase') returns camel_case"); + t.equal(toSnakeCase('some text'), 'some_text', "toSnakeCase('some text') returns some_text"); + t.equal(toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens'), 'some_mixed_string_with_spaces_underscores_and_hyphens', "toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens') returns some_mixed_string_with_spaces_underscores_and_hyphens"); + t.equal(toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML'), 'i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html', "toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html"); + t.equal(toSnakeCase(), undefined, 'toSnakeCase() returns undefined'); + t.throws(() => toSnakeCase([]), 'toSnakeCase([]) throws an error'); + t.throws(() => toSnakeCase({}), 'toSnakeCase({}) throws an error'); + t.throws(() => toSnakeCase(123), 'toSnakeCase(123) throws an error'); + + let start = new Date().getTime(); + toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML'); + let end = new Date().getTime(); + test('toSnakeCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run', () => { + expect((end - start) < 2000).toBeTruthy(); +}); + + diff --git a/test6/toggleClass/toggleClass.js b/test/toggleClass/toggleClass.js similarity index 100% rename from test6/toggleClass/toggleClass.js rename to test/toggleClass/toggleClass.js diff --git a/test/toggleClass/toggleClass.test.js b/test/toggleClass/toggleClass.test.js new file mode 100644 index 000000000..3a4d104ad --- /dev/null +++ b/test/toggleClass/toggleClass.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const toggleClass = require('./toggleClass.js'); + + + test('toggleClass is a Function', () => { + expect(toggleClass).toBeInstanceOf(Function); +}); + t.pass('Tested by @chalarangelo on 16/02/2018'); + + diff --git a/test6/tomorrow/tomorrow.js b/test/tomorrow/tomorrow.js similarity index 100% rename from test6/tomorrow/tomorrow.js rename to test/tomorrow/tomorrow.js diff --git a/test/tomorrow/tomorrow.test.js b/test/tomorrow/tomorrow.test.js new file mode 100644 index 000000000..490e42f42 --- /dev/null +++ b/test/tomorrow/tomorrow.test.js @@ -0,0 +1,14 @@ +const expect = require('expect'); +const tomorrow = require('./tomorrow.js'); + + + test('tomorrow is a Function', () => { + expect(tomorrow).toBeInstanceOf(Function); +}); + const t1 = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate() + 1); + const t2 = new Date(tomorrow()); + t.equal(t1.getFullYear(), t2.getFullYear(), 'Returns the correct year'); + t.equal(t1.getMonth(), t2.getMonth(), 'Returns the correct month'); + t.equal(t1.getDate(), t2.getDate(), 'Returns the correct date'); + + diff --git a/test6/transform/transform.js b/test/transform/transform.js similarity index 100% rename from test6/transform/transform.js rename to test/transform/transform.js diff --git a/test/transform/transform.test.js b/test/transform/transform.test.js new file mode 100644 index 000000000..a2407b0c6 --- /dev/null +++ b/test/transform/transform.test.js @@ -0,0 +1,17 @@ +const expect = require('expect'); +const transform = require('./transform.js'); + + + test('transform is a Function', () => { + expect(transform).toBeInstanceOf(Function); +}); + t.deepEqual(transform( + { a: 1, b: 2, c: 1 }, + (r, v, k) => { + (r[v] || (r[v] = [])).push(k); + return r; + }, + {} +), { '1': ['a', 'c'], '2': ['b'] }, 'Transforms an object'); + + diff --git a/test6/truncateString/truncateString.js b/test/truncateString/truncateString.js similarity index 100% rename from test6/truncateString/truncateString.js rename to test/truncateString/truncateString.js diff --git a/test/truncateString/truncateString.test.js b/test/truncateString/truncateString.test.js new file mode 100644 index 000000000..cfebd7f9a --- /dev/null +++ b/test/truncateString/truncateString.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const truncateString = require('./truncateString.js'); + + + test('truncateString is a Function', () => { + expect(truncateString).toBeInstanceOf(Function); +}); + t.equal(truncateString('boomerang', 7), 'boom...', 'Truncates a "boomerang" up to a specified length.'); + diff --git a/test6/truthCheckCollection/truthCheckCollection.js b/test/truthCheckCollection/truthCheckCollection.js similarity index 100% rename from test6/truthCheckCollection/truthCheckCollection.js rename to test/truthCheckCollection/truthCheckCollection.js diff --git a/test/truthCheckCollection/truthCheckCollection.test.js b/test/truthCheckCollection/truthCheckCollection.test.js new file mode 100644 index 000000000..0a78a68b7 --- /dev/null +++ b/test/truthCheckCollection/truthCheckCollection.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const truthCheckCollection = require('./truthCheckCollection.js'); + + + test('truthCheckCollection is a Function', () => { + expect(truthCheckCollection).toBeInstanceOf(Function); +}); + t.equal(truthCheckCollection([{ user: 'Tinky-Winky', sex: 'male' }, { user: 'Dipsy', sex: 'male' }], 'sex'), true, "second argument is truthy on all elements of a collection"); + diff --git a/test6/unary/unary.js b/test/unary/unary.js similarity index 100% rename from test6/unary/unary.js rename to test/unary/unary.js diff --git a/test/unary/unary.test.js b/test/unary/unary.test.js new file mode 100644 index 000000000..c559cbeaa --- /dev/null +++ b/test/unary/unary.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const unary = require('./unary.js'); + + + test('unary is a Function', () => { + expect(unary).toBeInstanceOf(Function); +}); + t.deepEqual(['6', '8', '10'].map(unary(parseInt)), [6, 8, 10], 'Discards arguments after the first one'); + + diff --git a/test6/uncurry/uncurry.js b/test/uncurry/uncurry.js similarity index 100% rename from test6/uncurry/uncurry.js rename to test/uncurry/uncurry.js diff --git a/test/uncurry/uncurry.test.js b/test/uncurry/uncurry.test.js new file mode 100644 index 000000000..57da1c13b --- /dev/null +++ b/test/uncurry/uncurry.test.js @@ -0,0 +1,16 @@ +const expect = require('expect'); +const uncurry = require('./uncurry.js'); + + + test('uncurry is a Function', () => { + expect(uncurry).toBeInstanceOf(Function); +}); + const add = x => y => z => x + y + z; + const add1 = uncurry(add); + const add2 = uncurry(add, 2); + const add3 = uncurry(add, 3); + t.equal(add1(1)(2)(3), 6, 'Works without a provided value for n'); + t.equal(add2(1,2)(3), 6, 'Works without n = 2'); + t.equal(add3(1,2,3), 6, 'Works withoutn = 3'); + + diff --git a/test6/unescapeHTML/unescapeHTML.js b/test/unescapeHTML/unescapeHTML.js similarity index 100% rename from test6/unescapeHTML/unescapeHTML.js rename to test/unescapeHTML/unescapeHTML.js diff --git a/test/unescapeHTML/unescapeHTML.test.js b/test/unescapeHTML/unescapeHTML.test.js new file mode 100644 index 000000000..a45df3621 --- /dev/null +++ b/test/unescapeHTML/unescapeHTML.test.js @@ -0,0 +1,9 @@ +const expect = require('expect'); +const unescapeHTML = require('./unescapeHTML.js'); + + + test('unescapeHTML is a Function', () => { + expect(unescapeHTML).toBeInstanceOf(Function); +}); + t.equal(unescapeHTML('<a href="#">Me & you</a>'), 'Me & you', 'Unescapes escaped HTML characters.'); + diff --git a/test6/unflattenObject/unflattenObject.js b/test/unflattenObject/unflattenObject.js similarity index 97% rename from test6/unflattenObject/unflattenObject.js rename to test/unflattenObject/unflattenObject.js index b0b4f48ba..e5303a886 100644 --- a/test6/unflattenObject/unflattenObject.js +++ b/test/unflattenObject/unflattenObject.js @@ -13,5 +13,5 @@ obj[k] + ); } else acc[k] = obj[k]; return acc; -}, {}); +}, { module.exports = unflattenObject; \ No newline at end of file diff --git a/test/unflattenObject/unflattenObject.test.js b/test/unflattenObject/unflattenObject.test.js new file mode 100644 index 000000000..67b763ff1 --- /dev/null +++ b/test/unflattenObject/unflattenObject.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const unflattenObject = require('./unflattenObject.js'); + + + test('unflattenObject is a Function', () => { + expect(unflattenObject).toBeInstanceOf(Function); +}); + t.deepEqual(unflattenObject({ 'a.b.c': 1, d: 1 }), { a: { b: { c: 1 } }, d: 1 }, 'Unflattens an object with the paths for keys'); + + diff --git a/test6/unfold/unfold.js b/test/unfold/unfold.js similarity index 100% rename from test6/unfold/unfold.js rename to test/unfold/unfold.js diff --git a/test/unfold/unfold.test.js b/test/unfold/unfold.test.js new file mode 100644 index 000000000..1a053f9e4 --- /dev/null +++ b/test/unfold/unfold.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const unfold = require('./unfold.js'); + + + test('unfold is a Function', () => { + expect(unfold).toBeInstanceOf(Function); +}); + var f = n => (n > 50 ? false : [-n, n + 10]); + t.deepEqual(unfold(f, 10), [-10, -20, -30, -40, -50], 'Works with a given function, producing an array'); + + diff --git a/test6/union/union.js b/test/union/union.js similarity index 100% rename from test6/union/union.js rename to test/union/union.js diff --git a/test/union/union.test.js b/test/union/union.test.js new file mode 100644 index 000000000..5e08864a3 --- /dev/null +++ b/test/union/union.test.js @@ -0,0 +1,26 @@ +const expect = require('expect'); +const union = require('./union.js'); + + + test('union is a Function', () => { + expect(union).toBeInstanceOf(Function); +}); + t.deepEqual(union([1, 2, 3], [4, 3, 2]), [1, 2, 3, 4], "union([1, 2, 3], [4, 3, 2]) returns [1, 2, 3, 4]"); + t.deepEqual(union('str', 'asd'), [ 's', 't', 'r', 'a', 'd' ], "union('str', 'asd') returns [ 's', 't', 'r', 'a', 'd' ]"); + t.deepEqual(union([[], {}], [1, 2, 3]), [[], {}, 1, 2, 3], "union([[], {}], [1, 2, 3]) returns [[], {}, 1, 2, 3]"); + t.deepEqual(union([], []), [], "union([], []) returns []"); + t.throws(() => union(), 'union() throws an error'); + t.throws(() => union(true, 'str'), 'union(true, str) throws an error'); + t.throws(() => union('false', true), 'union(false, true) throws an error'); + t.throws(() => union(123, {}), 'union(123, {}) throws an error'); + t.throws(() => union([], {}), 'union([], {}) throws an error'); + t.throws(() => union(undefined, null), 'union(undefined, null) throws an error'); + + let start = new Date().getTime(); + union([1, 2, 3], [4, 3, 2]); + let end = new Date().getTime(); + test('union([1, 2, 3], [4, 3, 2]) takes less than 2s to run', () => { + expect((end - start) < 2000).toBeTruthy(); +}); + + diff --git a/test6/unionBy/unionBy.js b/test/unionBy/unionBy.js similarity index 100% rename from test6/unionBy/unionBy.js rename to test/unionBy/unionBy.js diff --git a/test/unionBy/unionBy.test.js b/test/unionBy/unionBy.test.js new file mode 100644 index 000000000..a9010b62e --- /dev/null +++ b/test/unionBy/unionBy.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const unionBy = require('./unionBy.js'); + + + test('unionBy is a Function', () => { + expect(unionBy).toBeInstanceOf(Function); +}); + t.deepEqual(unionBy([2.1], [1.2, 2.3], Math.floor), [2.1, 1.2], 'Produces the appropriate results'); + + diff --git a/test6/unionWith/unionWith.js b/test/unionWith/unionWith.js similarity index 100% rename from test6/unionWith/unionWith.js rename to test/unionWith/unionWith.js diff --git a/test/unionWith/unionWith.test.js b/test/unionWith/unionWith.test.js new file mode 100644 index 000000000..4a299689e --- /dev/null +++ b/test/unionWith/unionWith.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const unionWith = require('./unionWith.js'); + + + test('unionWith is a Function', () => { + expect(unionWith).toBeInstanceOf(Function); +}); + t.deepEqual(unionWith([1, 1.2, 1.5, 3, 0], [1.9, 3, 0, 3.9], (a, b) => Math.round(a) === Math.round(b)), [1, 1.2, 1.5, 3, 0, 3.9], 'Produces the appropriate results'); + + diff --git a/test6/uniqueElements/uniqueElements.js b/test/uniqueElements/uniqueElements.js similarity index 100% rename from test6/uniqueElements/uniqueElements.js rename to test/uniqueElements/uniqueElements.js diff --git a/test/uniqueElements/uniqueElements.test.js b/test/uniqueElements/uniqueElements.test.js new file mode 100644 index 000000000..42f5afff6 --- /dev/null +++ b/test/uniqueElements/uniqueElements.test.js @@ -0,0 +1,30 @@ +const expect = require('expect'); +const uniqueElements = require('./uniqueElements.js'); + + + test('uniqueElements is a Function', () => { + expect(uniqueElements).toBeInstanceOf(Function); +}); + t.deepEqual(uniqueElements([1, 2, 2, 3, 4, 4, 5]), [1,2,3,4,5], "uniqueElements([1, 2, 2, 3, 4, 4, 5]) returns [1,2,3,4,5]"); + t.deepEqual(uniqueElements([1, 23, 53]), [1, 23, 53], "uniqueElements([1, 23, 53]) returns [1, 23, 53]"); + t.deepEqual(uniqueElements([true, 0, 1, false, false, undefined, null, '']), [true, 0, 1, false, undefined, null, ''], "uniqueElements([true, 0, 1, false, false, undefined, null, '']) returns [true, 0, 1, false, false, undefined, null, '']"); + t.deepEqual(uniqueElements(), [], "uniqueElements() returns []"); + t.deepEqual(uniqueElements(null), [], "uniqueElements(null) returns []"); + t.deepEqual(uniqueElements(undefined), [], "uniqueElements(undefined) returns []"); + t.deepEqual(uniqueElements('strt'), ['s', 't', 'r'], "uniqueElements('strt') returns ['s', 't', 'r']"); + t.throws(() => uniqueElements(1, 1, 2543, 534, 5), 'uniqueElements(1, 1, 2543, 534, 5) throws an error'); + t.throws(() => uniqueElements({}), 'uniqueElements({}) throws an error'); + t.throws(() => uniqueElements(true), 'uniqueElements(true) throws an error'); + t.throws(() => uniqueElements(false), 'uniqueElements(false) throws an error'); + + let start = new Date().getTime(); + uniqueElements([true, 0, 1, false, false, undefined, null, '']); + let end = new Date().getTime(); + test('uniqueElements([true, 0, 1, false, false, undefined, null]) takes less than 2s to run', () => { + expect((end - start) < 2000).toBeTruthy(); +}); + + + + +uniqueElements([1, 2, 2, '1', 4, 4, 4, 5, true]); diff --git a/test6/untildify/untildify.js b/test/untildify/untildify.js similarity index 100% rename from test6/untildify/untildify.js rename to test/untildify/untildify.js diff --git a/test/untildify/untildify.test.js b/test/untildify/untildify.test.js new file mode 100644 index 000000000..80075903b --- /dev/null +++ b/test/untildify/untildify.test.js @@ -0,0 +1,14 @@ +const expect = require('expect'); +const untildify = require('./untildify.js'); + + + test('untildify is a Function', () => { + expect(untildify).toBeInstanceOf(Function); +}); + test('Contains no tildes', () => { + expect(untildify('~/test/dir/file.f').indexOf('~') === -1).toBeTruthy(); +}); + t.equal(untildify('~/test/dir/file.f').slice(-16), '/test/dir/file.f', 'Does not alter the rest of the path'); + t.equal(untildify('test/dir/file.f'), 'test/dir/file.f', 'Does not alter paths without tildes'); + + diff --git a/test6/unzip/unzip.js b/test/unzip/unzip.js similarity index 100% rename from test6/unzip/unzip.js rename to test/unzip/unzip.js diff --git a/test/unzip/unzip.test.js b/test/unzip/unzip.test.js new file mode 100644 index 000000000..16b125928 --- /dev/null +++ b/test/unzip/unzip.test.js @@ -0,0 +1,11 @@ +const expect = require('expect'); +const unzip = require('./unzip.js'); + + + test('unzip is a Function', () => { + expect(unzip).toBeInstanceOf(Function); +}); + t.deepEqual(unzip([['a', 1, true], ['b', 2, false]]), [['a', 'b'], [1, 2], [true, false]], `unzip([['a', 1, true], ['b', 2, false]]) equals [['a', 'b'], [1, 2], [true, false]]`); + t.deepEqual(unzip([['a', 1, true], ['b', 2]]), [['a', 'b'], [1, 2], [true]], `unzip([['a', 1, true], ['b', 2]]) equals [['a', 'b'], [1, 2], [true]]`); + + diff --git a/test6/unzipWith/unzipWith.js b/test/unzipWith/unzipWith.js similarity index 100% rename from test6/unzipWith/unzipWith.js rename to test/unzipWith/unzipWith.js diff --git a/test/unzipWith/unzipWith.test.js b/test/unzipWith/unzipWith.test.js new file mode 100644 index 000000000..d33b5b86f --- /dev/null +++ b/test/unzipWith/unzipWith.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const unzipWith = require('./unzipWith.js'); + + + test('unzipWith is a Function', () => { + expect(unzipWith).toBeInstanceOf(Function); +}); + t.deepEqual(unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)), [3, 30, 300], `unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)) equals [3, 30, 300]`); + + diff --git a/test6/validateNumber/validateNumber.js b/test/validateNumber/validateNumber.js similarity index 100% rename from test6/validateNumber/validateNumber.js rename to test/validateNumber/validateNumber.js diff --git a/test/validateNumber/validateNumber.test.js b/test/validateNumber/validateNumber.test.js new file mode 100644 index 000000000..3b6d00842 --- /dev/null +++ b/test/validateNumber/validateNumber.test.js @@ -0,0 +1,46 @@ +const expect = require('expect'); +const validateNumber = require('./validateNumber.js'); + + + test('validateNumber is a Function', () => { + expect(validateNumber).toBeInstanceOf(Function); +}); + test('validateNumber(9) returns true', () => { + expect(validateNumber(9)).toBeTruthy(); +}); + test('validateNumber(234asd.slice(0, 2)) returns true', () => { + expect(validateNumber('234asd'.slice(0, 2))).toBeTruthy(); +}); + test('validateNumber(1232) returns true', () => { + expect(validateNumber(1232)).toBeTruthy(); +}); + test('validateNumber(1232 + 13423) returns true', () => { + expect(validateNumber(1232 + 13423)).toBeTruthy(); +}); + test('validateNumber(1232 * 2342 * 123) returns true', () => { + expect(validateNumber(1232 * 2342 * 123)).toBeTruthy(); +}); + test('validateNumber(1232.23423536) returns true', () => { + expect(validateNumber(1232.23423536)).toBeTruthy(); +}); + test('validateNumber(234asd) returns false', () => { + expect(validateNumber('234asd')).toBeFalsy(); +}); + test('validateNumber(e234d) returns false', () => { + expect(validateNumber('e234d')).toBeFalsy(); +}); + test('validateNumber(false) returns false', () => { + expect(validateNumber(false)).toBeFalsy(); +}); + test('validateNumber(true) returns false', () => { + expect(validateNumber(true)).toBeFalsy(); +}); + test('validateNumber(null) returns false', () => { + expect(validateNumber(null)).toBeFalsy(); +}); + test('validateNumber(123 * asd) returns false', () => { + expect(validateNumber(123 * 'asd')).toBeFalsy(); +}); + + + diff --git a/test6/when/when.js b/test/when/when.js similarity index 100% rename from test6/when/when.js rename to test/when/when.js diff --git a/test/when/when.test.js b/test/when/when.test.js new file mode 100644 index 000000000..c736288f8 --- /dev/null +++ b/test/when/when.test.js @@ -0,0 +1,18 @@ +const expect = require('expect'); +const when = require('./when.js'); + + + test('when is a Function', () => { + expect(when).toBeInstanceOf(Function); +}); + + const doubleEvenNumbers = when( + (x) => x % 2 === 0, + (x) => x * 2 + ); + + t.true(doubleEvenNumbers(2) === 4); + t.true(doubleEvenNumbers(1) === 1); + + + diff --git a/test6/without/without.js b/test/without/without.js similarity index 100% rename from test6/without/without.js rename to test/without/without.js diff --git a/test/without/without.test.js b/test/without/without.test.js new file mode 100644 index 000000000..60d7def99 --- /dev/null +++ b/test/without/without.test.js @@ -0,0 +1,19 @@ +const expect = require('expect'); +const without = require('./without.js'); + + + test('without is a Function', () => { + expect(without).toBeInstanceOf(Function); +}); + t.deepEqual(without([2, 1, 2, 3], 1, 2), [3], "without([2, 1, 2, 3], 1, 2) returns [3]"); + t.deepEqual(without([]), [], "without([]) returns []"); + t.deepEqual(without([3, 1, true, '3', true], '3', true), [3, 1], "without([3, 1, true, '3', true], '3', true) returns [3, 1]"); + t.deepEqual(without('string'.split(''), 's', 't', 'g'), ['r', 'i', 'n'], "without('string'.split(''), 's', 't', 'g') returns ['r', 'i', 'n']"); + t.throws(() => without(), 'without() throws an error'); + t.throws(() => without(null), 'without(null) throws an error'); + t.throws(() => without(undefined), 'without(undefined) throws an error'); + t.throws(() => without(123), 'without() throws an error'); + t.throws(() => without({}), 'without({}) throws an error'); + + + diff --git a/test6/words/words.js b/test/words/words.js similarity index 100% rename from test6/words/words.js rename to test/words/words.js diff --git a/test/words/words.test.js b/test/words/words.test.js new file mode 100644 index 000000000..8df2f68da --- /dev/null +++ b/test/words/words.test.js @@ -0,0 +1,21 @@ +const expect = require('expect'); +const words = require('./words.js'); + + + test('words is a Function', () => { + expect(words).toBeInstanceOf(Function); +}); + t.deepEqual(words('I love javaScript!!'), ["I", "love", "javaScript"], "words('I love javaScript!!') returns [I, love, javaScript]"); + t.deepEqual(words('python, javaScript & coffee'), ["python", "javaScript", "coffee"], "words('python, javaScript & coffee') returns [python, javaScript, coffee]"); + test('words(I love javaScript!!) returns an array', () => { + expect(Array.isArray(words('I love javaScript!!'))).toBeTruthy(); +}); + t.throws(() => words(), 'words() throws a error'); + t.throws(() => words(null), 'words(null) throws a error'); + t.throws(() => words(undefined), 'words(undefined) throws a error'); + t.throws(() => words({}), 'words({}) throws a error'); + t.throws(() => words([]), 'words([]) throws a error'); + t.throws(() => words(1234), 'words(1234) throws a error'); + + + diff --git a/test6/xProd/xProd.js b/test/xProd/xProd.js similarity index 100% rename from test6/xProd/xProd.js rename to test/xProd/xProd.js diff --git a/test/xProd/xProd.test.js b/test/xProd/xProd.test.js new file mode 100644 index 000000000..392dcfd47 --- /dev/null +++ b/test/xProd/xProd.test.js @@ -0,0 +1,10 @@ +const expect = require('expect'); +const xProd = require('./xProd.js'); + + + test('xProd is a Function', () => { + expect(xProd).toBeInstanceOf(Function); +}); + t.deepEqual(xProd([1, 2], ['a', 'b']), [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']], `xProd([1, 2], ['a', 'b']) returns [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]`); + + diff --git a/test6/yesNo/yesNo.js b/test/yesNo/yesNo.js similarity index 100% rename from test6/yesNo/yesNo.js rename to test/yesNo/yesNo.js diff --git a/test/yesNo/yesNo.test.js b/test/yesNo/yesNo.test.js new file mode 100644 index 000000000..b3d658754 --- /dev/null +++ b/test/yesNo/yesNo.test.js @@ -0,0 +1,46 @@ +const expect = require('expect'); +const yesNo = require('./yesNo.js'); + + + test('yesNo is a Function', () => { + expect(yesNo).toBeInstanceOf(Function); +}); + test('yesNo(Y) returns true', () => { + expect(yesNo('Y')).toBeTruthy(); +}); + test('yesNo(yes) returns true', () => { + expect(yesNo('yes')).toBeTruthy(); +}); + test('yesNo(foo, true) returns true', () => { + expect(yesNo('foo', true)).toBeTruthy(); +}); + test('yesNo(No) returns false', () => { + expect(yesNo('No')).toBeFalsy(); +}); + test('yesNo() returns false', () => { + expect(yesNo()).toBeFalsy(); +}); + test('yesNo(null) returns false', () => { + expect(yesNo(null)).toBeFalsy(); +}); + test('yesNo(undefined) returns false', () => { + expect(yesNo(undefined)).toBeFalsy(); +}); + test('yesNo([123, null]) returns false', () => { + expect(yesNo([123, null])).toBeFalsy(); +}); + test('yesNo([Yes, No]) returns false', () => { + expect(yesNo(['Yes', 'No'])).toBeFalsy(); +}); + test('yesNo({ 2: Yes }) returns false', () => { + expect(yesNo({ 2: 'Yes' })).toBeFalsy(); +}); + test('yesNo([Yes, No], true) returns true', () => { + expect(yesNo(['Yes', 'No'], true)).toBeTruthy(); +}); + test('yesNo({ 2: Yes }, true) returns true', () => { + expect(yesNo({ 2: 'Yes' }, true)).toBeTruthy(); +}); + + + diff --git a/test6/zip/zip.js b/test/zip/zip.js similarity index 98% rename from test6/zip/zip.js rename to test/zip/zip.js index 54a162bce..aad64ff83 100644 --- a/test6/zip/zip.js +++ b/test/zip/zip.js @@ -2,6 +2,6 @@ const zip = (...arrays) => { const maxLength = Math.max(...arrays.map(x => x.length)); return Array.from({ length: maxLength }).map((_, i) => { return Array.from({ length: arrays.length }, (_, k) => arrays[k][i]); -}); + }; module.exports = zip; \ No newline at end of file diff --git a/test/zip/zip.test.js b/test/zip/zip.test.js new file mode 100644 index 000000000..a0b075e87 --- /dev/null +++ b/test/zip/zip.test.js @@ -0,0 +1,22 @@ +const expect = require('expect'); +const zip = require('./zip.js'); + + + test('zip is a Function', () => { + expect(zip).toBeInstanceOf(Function); +}); + t.deepEqual(zip(['a', 'b'], [1, 2], [true, false]), [['a', 1, true], ['b', 2, false]], 'zip([a, b], [1, 2], [true, false]) returns [[a, 1, true], [b, 2, false]]'); + t.deepEqual(zip(['a'], [1, 2], [true, false]), [['a', 1, true], [undefined, 2, false]], 'zip([a], [1, 2], [true, false]) returns [[a, 1, true], [undefined, 2, false]]'); + t.deepEqual(zip(), [], 'zip([]) returns []'); + t.deepEqual(zip(123), [], 'zip(123) returns []'); + test('zip([a, b], [1, 2], [true, false]) returns an Array', () => { + expect(Array.isArray(zip(['a', 'b'], [1, 2], [true, false]))).toBeTruthy(); +}); + test('zip([a], [1, 2], [true, false]) returns an Array', () => { + expect(Array.isArray(zip(['a'], [1, 2], [true, false]))).toBeTruthy(); +}); + t.throws(() => zip(null), 'zip(null) throws an error'); + t.throws(() => zip(undefined), 'zip(undefined) throws an error'); + + + diff --git a/test6/zipObject/zipObject.js b/test/zipObject/zipObject.js similarity index 91% rename from test6/zipObject/zipObject.js rename to test/zipObject/zipObject.js index c44e95eda..90aeeacf1 100644 --- a/test6/zipObject/zipObject.js +++ b/test/zipObject/zipObject.js @@ -1,3 +1,3 @@ const zipObject = (props, values) => -props.reduce((obj, prop, index) => ((obj[prop] = values[index]), obj), {}); +props.reduce((obj, prop, index) => ((obj[prop] = values[index]), obj), { module.exports = zipObject; \ No newline at end of file diff --git a/test/zipObject/zipObject.test.js b/test/zipObject/zipObject.test.js new file mode 100644 index 000000000..c703b3f68 --- /dev/null +++ b/test/zipObject/zipObject.test.js @@ -0,0 +1,19 @@ +const expect = require('expect'); +const zipObject = require('./zipObject.js'); + + + test('zipObject is a Function', () => { + expect(zipObject).toBeInstanceOf(Function); +}); + t.deepEqual(zipObject(['a', 'b', 'c'], [1, 2]), {a: 1, b: 2, c: undefined}, 'zipObject([a, b, c], [1, 2]) returns {a: 1, b: 2, c: undefined}'); + t.deepEqual(zipObject(['a', 'b'], [1, 2, 3]), {a: 1, b: 2}, 'zipObject([a, b], [1, 2, 3]) returns {a: 1, b: 2}'); + t.deepEqual(zipObject(['a', 'b', 'c'], 'string'), { a: 's', b: 't', c: 'r' }, 'zipObject([a, b, c], string) returns { a: s, b: t, c: r }'); + t.deepEqual(zipObject(['a'], 'string'), { a: 's' }, 'zipObject([a], string) returns { a: s }'); + t.throws(() => zipObject(), 'zipObject() throws an error'); + t.throws(() => zipObject(['string'], null), 'zipObject([string], null) throws an error'); + t.throws(() => zipObject(null, [1]), 'zipObject(null, [1]) throws an error'); + t.throws(() => zipObject('string'), 'zipObject(string) throws an error'); + t.throws(() => zipObject('test', 'string'), 'zipObject(test, string) throws an error'); + + + diff --git a/test6/zipWith/zipWith.js b/test/zipWith/zipWith.js similarity index 100% rename from test6/zipWith/zipWith.js rename to test/zipWith/zipWith.js diff --git a/test/zipWith/zipWith.test.js b/test/zipWith/zipWith.test.js new file mode 100644 index 000000000..f5e60492e --- /dev/null +++ b/test/zipWith/zipWith.test.js @@ -0,0 +1,8 @@ +const expect = require('expect'); +const zipWith = require('./zipWith.js'); + + + test('zipWith is a Function', () => { + expect(zipWith).toBeInstanceOf(Function); +}); + diff --git a/test2/defaults/defaults.test.js b/test2/defaults/defaults.test.js deleted file mode 100644 index 79c5a5472..000000000 --- a/test2/defaults/defaults.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const defaults = require('./defaults.js'); - -test('Testing defaults', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof defaults === 'function').toBeTruthy(); - expect(defaults({ a: 1 }, { b: 2 }, { b: 6 }, { a: 3 })).toEqual({ a: 1, b: 2 }); -}); diff --git a/test2/defer/defer.test.js b/test2/defer/defer.test.js deleted file mode 100644 index c5db044d2..000000000 --- a/test2/defer/defer.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const defer = require('./defer.js'); - -test('Testing defer', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof defer === 'function').toBeTruthy(); -}); diff --git a/test2/degreesToRads/degreesToRads.test.js b/test2/degreesToRads/degreesToRads.test.js deleted file mode 100644 index 742faaad3..000000000 --- a/test2/degreesToRads/degreesToRads.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const degreesToRads = require('./degreesToRads.js'); - -test('Testing degreesToRads', () => { - //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 - expect(typeof degreesToRads === 'function').toBeTruthy(); - expect(approxeq(degreesToRads(90.0), Math.PI / 2)).toBeTruthy(); -}); diff --git a/test2/delay/delay.test.js b/test2/delay/delay.test.js deleted file mode 100644 index 68fc4dd89..000000000 --- a/test2/delay/delay.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const expect = require('expect'); -const delay = require('./delay.js'); - -test('Testing delay', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof delay === 'function').toBeTruthy(); - delay( - function(text) { - expect(text).toBe('test'); - }, - 1000, - 'test' - ); -}); diff --git a/test2/detectDeviceType/detectDeviceType.test.js b/test2/detectDeviceType/detectDeviceType.test.js deleted file mode 100644 index 708f7ebe6..000000000 --- a/test2/detectDeviceType/detectDeviceType.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const detectDeviceType = require('./detectDeviceType.js'); - -test('Testing detectDeviceType', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof detectDeviceType === 'function').toBeTruthy(); -}); diff --git a/test2/difference/difference.test.js b/test2/difference/difference.test.js deleted file mode 100644 index 21e4fac21..000000000 --- a/test2/difference/difference.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const difference = require('./difference.js'); - -test('Testing difference', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof difference === 'function').toBeTruthy(); - expect(difference([1, 2, 3], [1, 2, 4])).toEqual([3]); -}); \ No newline at end of file diff --git a/test2/differenceBy/differenceBy.test.js b/test2/differenceBy/differenceBy.test.js deleted file mode 100644 index 4d7dfe471..000000000 --- a/test2/differenceBy/differenceBy.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const differenceBy = require('./differenceBy.js'); - -test('Testing differenceBy', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof differenceBy === 'function').toBeTruthy(); - expect(differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor)).toEqual([1.2]); - expect(differenceBy([{ x: 2 }, { x: 1 }], [{ x: 1 }], v => v.x)).toEqual([ { x: 2 } ]); -}); diff --git a/test2/differenceWith/differenceWith.test.js b/test2/differenceWith/differenceWith.test.js deleted file mode 100644 index 0e27a4501..000000000 --- a/test2/differenceWith/differenceWith.test.js +++ /dev/null @@ -1,11 +0,0 @@ -const expect = require('expect'); -const differenceWith = require('./differenceWith.js'); - -test('Testing differenceWith', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof differenceWith === 'function').toBeTruthy(); - 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]); -}); \ No newline at end of file diff --git a/test2/digitize/digitize.test.js b/test2/digitize/digitize.test.js deleted file mode 100644 index 75b554e53..000000000 --- a/test2/digitize/digitize.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const digitize = require('./digitize.js'); - -test('Testing digitize', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof digitize === 'function').toBeTruthy(); - expect(digitize(123)).toEqual([1, 2, 3]); -}); \ No newline at end of file diff --git a/test2/distance/distance.test.js b/test2/distance/distance.test.js deleted file mode 100644 index 495cf60c0..000000000 --- a/test2/distance/distance.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const distance = require('./distance.js'); - -test('Testing distance', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof distance === 'function').toBeTruthy(); - expect(distance(1, 1, 2, 3)).toBe(2.23606797749979); -}); diff --git a/test2/drop/drop.test.js b/test2/drop/drop.test.js deleted file mode 100644 index ea9715842..000000000 --- a/test2/drop/drop.test.js +++ /dev/null @@ -1,11 +0,0 @@ -const expect = require('expect'); -const drop = require('./drop.js'); - -test('Testing drop', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof drop === 'function').toBeTruthy(); - expect(drop([1, 2, 3])).toEqual([2,3]); - expect(drop([1, 2, 3], 2)).toEqual([3]); - expect(drop([1, 2, 3], 42)).toEqual([]); -}); diff --git a/test2/dropRight/dropRight.test.js b/test2/dropRight/dropRight.test.js deleted file mode 100644 index ffd46e6d3..000000000 --- a/test2/dropRight/dropRight.test.js +++ /dev/null @@ -1,11 +0,0 @@ -const expect = require('expect'); -const dropRight = require('./dropRight.js'); - -test('Testing dropRight', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof dropRight === 'function').toBeTruthy(); - expect(dropRight([1, 2, 3])).toEqual([1,2]); - expect(dropRight([1, 2, 3], 2)).toEqual([1]); - expect(dropRight([1, 2, 3], 42)).toEqual([]); -}); \ No newline at end of file diff --git a/test2/dropRightWhile/dropRightWhile.test.js b/test2/dropRightWhile/dropRightWhile.test.js deleted file mode 100644 index 1df6588a5..000000000 --- a/test2/dropRightWhile/dropRightWhile.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const dropRightWhile = require('./dropRightWhile.js'); - -test('Testing dropRightWhile', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof dropRightWhile === 'function').toBeTruthy(); - expect(dropRightWhile([1, 2, 3, 4], n => n < 3)).toEqual([1, 2]); -}); diff --git a/test2/dropWhile/dropWhile.test.js b/test2/dropWhile/dropWhile.test.js deleted file mode 100644 index 8a2be7a17..000000000 --- a/test2/dropWhile/dropWhile.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const dropWhile = require('./dropWhile.js'); - -test('Testing dropWhile', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof dropWhile === 'function').toBeTruthy(); - expect(dropWhile([1, 2, 3, 4], n => n >= 3)).toEqual([3,4]); -}); diff --git a/test2/elementIsVisibleInViewport/elementIsVisibleInViewport.test.js b/test2/elementIsVisibleInViewport/elementIsVisibleInViewport.test.js deleted file mode 100644 index 2707cbc4e..000000000 --- a/test2/elementIsVisibleInViewport/elementIsVisibleInViewport.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const elementIsVisibleInViewport = require('./elementIsVisibleInViewport.js'); - -test('Testing elementIsVisibleInViewport', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof elementIsVisibleInViewport === 'function').toBeTruthy(); -}); diff --git a/test2/elo/elo.test.js b/test2/elo/elo.test.js deleted file mode 100644 index a0c483696..000000000 --- a/test2/elo/elo.test.js +++ /dev/null @@ -1,11 +0,0 @@ -const expect = require('expect'); -const elo = require('./elo.js'); - -test('Testing elo', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof elo === 'function').toBeTruthy(); - expect(elo([1200, 1200])).toEqual([1216, 1184]); - expect(elo([1200, 1200], 64)).toEqual([1232, 1168]), "Standard 1v1s"; - expect(elo([1200, 1200, 1200, 1200]).map(Math.round)).toEqual([1246, 1215, 1185, 1154]); -}); \ No newline at end of file diff --git a/test2/equals/equals.test.js b/test2/equals/equals.test.js deleted file mode 100644 index f84987498..000000000 --- a/test2/equals/equals.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const expect = require('expect'); -const equals = require('./equals.js'); - -test('Testing equals', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof equals === 'function').toBeTruthy(); - expect( - equals({ a: [2, {e: 3}], b: [4], c: 'foo' }, { a: [2, {e: 3}], b: [4], c: 'foo' }) - ).toBeTruthy(); - expect(equals([1, 2, 3], [1, 2, 3])).toBeTruthy(); - expect(equals({ a: [2, 3], b: [4] }, { a: [2, 3], b: [6] })).toBeFalsy(); - expect(equals([1, 2, 3], [1, 2, 4])).toBeFalsy(); - expect(equals([1, 2, 3], { 0: 1, 1: 2, 2: 3 })).toBeTruthy(); -}); diff --git a/test2/escapeHTML/escapeHTML.test.js b/test2/escapeHTML/escapeHTML.test.js deleted file mode 100644 index a040ed437..000000000 --- a/test2/escapeHTML/escapeHTML.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const escapeHTML = require('./escapeHTML.js'); - -test('Testing escapeHTML', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof escapeHTML === 'function').toBeTruthy(); - expect(escapeHTML('Me & you')).toBe('<a href="#">Me & you</a>'); -}); \ No newline at end of file diff --git a/test2/escapeRegExp/escapeRegExp.test.js b/test2/escapeRegExp/escapeRegExp.test.js deleted file mode 100644 index 1890779fb..000000000 --- a/test2/escapeRegExp/escapeRegExp.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const escapeRegExp = require('./escapeRegExp.js'); - -test('Testing escapeRegExp', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof escapeRegExp === 'function').toBeTruthy(); - expect(escapeRegExp('(test)')).toBe('\\(test\\)'); -}); \ No newline at end of file diff --git a/test2/everyNth/everyNth.test.js b/test2/everyNth/everyNth.test.js deleted file mode 100644 index 7301eeeed..000000000 --- a/test2/everyNth/everyNth.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const everyNth = require('./everyNth.js'); - -test('Testing everyNth', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof everyNth === 'function').toBeTruthy(); - expect(everyNth([1, 2, 3, 4, 5, 6], 2)).toEqual([ 2, 4, 6 ]); -}); \ No newline at end of file diff --git a/test2/extendHex/extendHex.test.js b/test2/extendHex/extendHex.test.js deleted file mode 100644 index 172c9259e..000000000 --- a/test2/extendHex/extendHex.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const extendHex = require('./extendHex.js'); - -test('Testing extendHex', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof extendHex === 'function').toBeTruthy(); - expect(extendHex('#03f')).toBe('#0033ff'); - expect(extendHex('05a')).toBe('#0055aa'); -}); \ No newline at end of file diff --git a/test2/factorial/factorial.test.js b/test2/factorial/factorial.test.js deleted file mode 100644 index ea04c6b50..000000000 --- a/test2/factorial/factorial.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const expect = require('expect'); -const factorial = require('./factorial.js'); - -test('Testing factorial', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof factorial === 'function').toBeTruthy(); - expect(factorial(6)).toBe(720); - expect(factorial(0)).toBe(1); - expect(factorial(1)).toBe(1); - expect(factorial(4)).toBe(24); - expect(factorial(10)).toBe(3628800); -}); \ No newline at end of file diff --git a/test2/factors/factors.test.js b/test2/factors/factors.test.js deleted file mode 100644 index 458b48f5c..000000000 --- a/test2/factors/factors.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const factors = require('./factors.js'); - -test('Testing factors', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof factors === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test2/fibonacci/fibonacci.test.js b/test2/fibonacci/fibonacci.test.js deleted file mode 100644 index cd3be86df..000000000 --- a/test2/fibonacci/fibonacci.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const fibonacci = require('./fibonacci.js'); - -test('Testing fibonacci', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof fibonacci === 'function').toBeTruthy(); - expect(fibonacci(6)).toEqual([0, 1, 1, 2, 3, 5]); -}); \ No newline at end of file diff --git a/test2/fibonacciCountUntilNum/fibonacciCountUntilNum.test.js b/test2/fibonacciCountUntilNum/fibonacciCountUntilNum.test.js deleted file mode 100644 index b54b33bf5..000000000 --- a/test2/fibonacciCountUntilNum/fibonacciCountUntilNum.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const fibonacciCountUntilNum = require('./fibonacciCountUntilNum.js'); - -test('Testing fibonacciCountUntilNum', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof fibonacciCountUntilNum === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test2/fibonacciUntilNum/fibonacciUntilNum.test.js b/test2/fibonacciUntilNum/fibonacciUntilNum.test.js deleted file mode 100644 index 77d6970ae..000000000 --- a/test2/fibonacciUntilNum/fibonacciUntilNum.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const fibonacciUntilNum = require('./fibonacciUntilNum.js'); - -test('Testing fibonacciUntilNum', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof fibonacciUntilNum === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test2/filterNonUnique/filterNonUnique.test.js b/test2/filterNonUnique/filterNonUnique.test.js deleted file mode 100644 index 05009e044..000000000 --- a/test2/filterNonUnique/filterNonUnique.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const filterNonUnique = require('./filterNonUnique.js'); - -test('Testing filterNonUnique', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof filterNonUnique === 'function').toBeTruthy(); - expect(filterNonUnique([1, 2, 2, 3, 4, 4, 5])).toEqual([1,3,5]); -}); \ No newline at end of file diff --git a/test2/findKey/findKey.test.js b/test2/findKey/findKey.test.js deleted file mode 100644 index 9c3e354a4..000000000 --- a/test2/findKey/findKey.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const expect = require('expect'); -const findKey = require('./findKey.js'); - -test('Testing findKey', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof findKey === 'function').toBeTruthy(); - expect(findKey( - { - barney: { age: 36, active: true }, - fred: { age: 40, active: false }, - pebbles: { age: 1, active: true } - }, - o => o['active'] -)).toEqual('barney'); -}); diff --git a/test2/findLast/findLast.test.js b/test2/findLast/findLast.test.js deleted file mode 100644 index 69e768dee..000000000 --- a/test2/findLast/findLast.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const findLast = require('./findLast.js'); - -test('Testing findLast', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof findLast === 'function').toBeTruthy(); - expect(findLast([1, 2, 3, 4], n => n % 2 === 1)).toBe(3); -}); diff --git a/test2/findLastIndex/findLastIndex.test.js b/test2/findLastIndex/findLastIndex.test.js deleted file mode 100644 index 2e1c57351..000000000 --- a/test2/findLastIndex/findLastIndex.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const findLastIndex = require('./findLastIndex.js'); - -test('Testing findLastIndex', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof findLastIndex === 'function').toBeTruthy(); - expect(findLastIndex([1, 2, 3, 4], n => n % 2 === 1)).toBe(2); -}); diff --git a/test2/findLastKey/findLastKey.test.js b/test2/findLastKey/findLastKey.test.js deleted file mode 100644 index bbaa493d5..000000000 --- a/test2/findLastKey/findLastKey.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const expect = require('expect'); -const findLastKey = require('./findLastKey.js'); - -test('Testing findLastKey', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof findLastKey === 'function').toBeTruthy(); - expect(findLastKey( - { - barney: { age: 36, active: true }, - fred: { age: 40, active: false }, - pebbles: { age: 1, active: true } - }, - o => o['active'] -)).toBe('pebbles'); -}); diff --git a/test2/flatten/flatten.test.js b/test2/flatten/flatten.test.js deleted file mode 100644 index 24da6650b..000000000 --- a/test2/flatten/flatten.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const flatten = require('./flatten.js'); - -test('Testing flatten', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof flatten === 'function').toBeTruthy(); - expect(flatten([1, [2], 3, 4])).toEqual([1, 2, 3, 4]); - expect(flatten([1, [2, [3, [4, 5], 6], 7], 8], 2)).toEqual([1, 2, 3, [4, 5], 6, 7, 8]); -}); \ No newline at end of file diff --git a/test2/flattenObject/flattenObject.test.js b/test2/flattenObject/flattenObject.test.js deleted file mode 100644 index cc864ba37..000000000 --- a/test2/flattenObject/flattenObject.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const flattenObject = require('./flattenObject.js'); - -test('Testing flattenObject', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof flattenObject === 'function').toBeTruthy(); - expect(flattenObject({ a: { b: { c: 1 } }, d: 1 })).toEqual({ 'a.b.c': 1, d: 1 }); - expect(flattenObject([0,1,[2,[1]],1])).toEqual({ 0: 0, 1: 1, 3: 1, '2.0': 2, '2.1.0': 1 }); -}); diff --git a/test2/flip/flip.test.js b/test2/flip/flip.test.js deleted file mode 100644 index 6227b2f44..000000000 --- a/test2/flip/flip.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const expect = require('expect'); -const flip = require('./flip.js'); - -test('Testing flip', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof flip === 'function').toBeTruthy(); - let a = { name: 'John Smith' }; - let b = {}; - const mergeFrom = flip(Object.assign); - let mergePerson = mergeFrom.bind(null, a); - expect(mergePerson(b)).toEqual(a); -}); diff --git a/test2/forEachRight/forEachRight.test.js b/test2/forEachRight/forEachRight.test.js deleted file mode 100644 index b64188386..000000000 --- a/test2/forEachRight/forEachRight.test.js +++ /dev/null @@ -1,11 +0,0 @@ -const expect = require('expect'); -const forEachRight = require('./forEachRight.js'); - -test('Testing forEachRight', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof forEachRight === 'function').toBeTruthy(); - let output = ''; - forEachRight([1, 2, 3, 4], val => output+=val); - expect(output).toBe('4321'); -}); diff --git a/test2/forOwn/forOwn.test.js b/test2/forOwn/forOwn.test.js deleted file mode 100644 index 85553ad3f..000000000 --- a/test2/forOwn/forOwn.test.js +++ /dev/null @@ -1,11 +0,0 @@ -const expect = require('expect'); -const forOwn = require('./forOwn.js'); - -test('Testing forOwn', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof forOwn === 'function').toBeTruthy(); - let output = []; - forOwn({ foo: 'bar', a: 1 }, v => output.push(v)); // 'bar', 1 - expect(output).toEqual(['bar', 1]); -}); diff --git a/test2/forOwnRight/forOwnRight.test.js b/test2/forOwnRight/forOwnRight.test.js deleted file mode 100644 index db6008220..000000000 --- a/test2/forOwnRight/forOwnRight.test.js +++ /dev/null @@ -1,11 +0,0 @@ -const expect = require('expect'); -const forOwnRight = require('./forOwnRight.js'); - -test('Testing forOwnRight', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof forOwnRight === 'function').toBeTruthy(); - let output = []; - forOwnRight({ foo: 'bar', a: 1 }, v => output.push(v)); // 'bar', 1 - expect(output).toEqual([1, 'bar']); -}); diff --git a/test2/formatDuration/formatDuration.test.js b/test2/formatDuration/formatDuration.test.js deleted file mode 100644 index ebe26a0bd..000000000 --- a/test2/formatDuration/formatDuration.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const formatDuration = require('./formatDuration.js'); - -test('Testing formatDuration', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof formatDuration === 'function').toBeTruthy(); - expect(formatDuration(1001)).toBe('1 second, 1 millisecond'); - expect(formatDuration(34325055574)).toBe('397 days, 6 hours, 44 minutes, 15 seconds, 574 milliseconds'); -}); \ No newline at end of file diff --git a/test2/fromCamelCase/fromCamelCase.test.js b/test2/fromCamelCase/fromCamelCase.test.js deleted file mode 100644 index 5ab939e12..000000000 --- a/test2/fromCamelCase/fromCamelCase.test.js +++ /dev/null @@ -1,11 +0,0 @@ -const expect = require('expect'); -const fromCamelCase = require('./fromCamelCase.js'); - -test('Testing fromCamelCase', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof fromCamelCase === 'function').toBeTruthy(); - expect(fromCamelCase('someDatabaseFieldName', ' ')).toBe('some database field name'); - expect(fromCamelCase('someLabelThatNeedsToBeCamelized', '-')).toBe('some-label-that-needs-to-be-camelized'); - expect(fromCamelCase('someJavascriptProperty', '_')).toBe('some_javascript_property'); -}); \ No newline at end of file diff --git a/test2/functionName/functionName.test.js b/test2/functionName/functionName.test.js deleted file mode 100644 index 8d00a5278..000000000 --- a/test2/functionName/functionName.test.js +++ /dev/null @@ -1,19 +0,0 @@ -import expect from 'expect'; -let output = ''; -const console = {}; -console.debug = (x) => output = x; -// Override for testing -const functionName = fn => (console.debug(fn.name), fn); -test('Testing functionName', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof functionName === 'function').toBeTruthy(); - functionName(Math.max); - expect(output).toBe('max'); - function fun(x) {return x;} - functionName(fun); - expect(output).toBe('fun'); - const fn = x => x; - functionName(fn); - expect(output).toBe('fn'); -}); diff --git a/test2/functions/functions.test.js b/test2/functions/functions.test.js deleted file mode 100644 index c6f94fc8c..000000000 --- a/test2/functions/functions.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const expect = require('expect'); -const functions = require('./functions.js'); - -test('Testing functions', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof functions === 'function').toBeTruthy(); - function Foo() { - this.a = () => 1; - this.b = () => 2; - } - Foo.prototype.c = () => 3; - expect(functions(new Foo())).toEqual(['a', 'b']); - expect(functions(new Foo(), true)).toEqual(['a', 'b', 'c']); -}); diff --git a/test2/gcd/gcd.test.js b/test2/gcd/gcd.test.js deleted file mode 100644 index a96a20050..000000000 --- a/test2/gcd/gcd.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const gcd = require('./gcd.js'); - -test('Testing gcd', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof gcd === 'function').toBeTruthy(); - expect(gcd(8, 36)).toBe(4); - expect(gcd(...[12, 8, 32])).toEqual(4); -}); \ No newline at end of file diff --git a/test2/geometricProgression/geometricProgression.test.js b/test2/geometricProgression/geometricProgression.test.js deleted file mode 100644 index d1cd39d4c..000000000 --- a/test2/geometricProgression/geometricProgression.test.js +++ /dev/null @@ -1,11 +0,0 @@ -const expect = require('expect'); -const geometricProgression = require('./geometricProgression.js'); - -test('Testing geometricProgression', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof geometricProgression === 'function').toBeTruthy(); - expect(geometricProgression(256)).toEqual([1, 2, 4, 8, 16, 32, 64, 128, 256]); - expect(geometricProgression(256, 3)).toEqual([3, 6, 12, 24, 48, 96, 192]); - expect(geometricProgression(256, 1, 4)).toEqual([1, 4, 16, 64, 256]); -}); \ No newline at end of file diff --git a/test2/get/get.test.js b/test2/get/get.test.js deleted file mode 100644 index 358f50b85..000000000 --- a/test2/get/get.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const get = require('./get.js'); - -test('Testing get', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof get === 'function').toBeTruthy(); - const obj = { selector: { to: { val: 'val to get' } } }; - expect(get(obj, 'selector.to.val')).toEqual(['val to get']); -}); diff --git a/test2/getColonTimeFromDate/getColonTimeFromDate.test.js b/test2/getColonTimeFromDate/getColonTimeFromDate.test.js deleted file mode 100644 index 6336f0a1e..000000000 --- a/test2/getColonTimeFromDate/getColonTimeFromDate.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const getColonTimeFromDate = require('./getColonTimeFromDate.js'); - -test('Testing getColonTimeFromDate', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof getColonTimeFromDate === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test2/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js b/test2/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js deleted file mode 100644 index c3c9ab2e0..000000000 --- a/test2/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const getDaysDiffBetweenDates = require('./getDaysDiffBetweenDates.js'); - -test('Testing getDaysDiffBetweenDates', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof getDaysDiffBetweenDates === 'function').toBeTruthy(); - expect(getDaysDiffBetweenDates(new Date('2017-12-13'), new Date('2017-12-22'))).toBe(9); -}); \ No newline at end of file diff --git a/test2/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.test.js b/test2/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.test.js deleted file mode 100644 index c265282ef..000000000 --- a/test2/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const getMeridiemSuffixOfInteger = require('./getMeridiemSuffixOfInteger.js'); - -test('Testing getMeridiemSuffixOfInteger', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof getMeridiemSuffixOfInteger === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test2/getScrollPosition/getScrollPosition.test.js b/test2/getScrollPosition/getScrollPosition.test.js deleted file mode 100644 index ca75aec52..000000000 --- a/test2/getScrollPosition/getScrollPosition.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const getScrollPosition = require('./getScrollPosition.js'); - -test('Testing getScrollPosition', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof getScrollPosition === 'function').toBeTruthy(); -}); diff --git a/test2/getStyle/getStyle.test.js b/test2/getStyle/getStyle.test.js deleted file mode 100644 index 1d1fc4e47..000000000 --- a/test2/getStyle/getStyle.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const getStyle = require('./getStyle.js'); - -test('Testing getStyle', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof getStyle === 'function').toBeTruthy(); -}); diff --git a/test2/getType/getType.test.js b/test2/getType/getType.test.js deleted file mode 100644 index 4e7b38e4b..000000000 --- a/test2/getType/getType.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const getType = require('./getType.js'); - -test('Testing getType', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof getType === 'function').toBeTruthy(); - expect(getType(new Set([1, 2, 3]))).toBe('set'); -}); \ No newline at end of file diff --git a/test2/getURLParameters/getURLParameters.test.js b/test2/getURLParameters/getURLParameters.test.js deleted file mode 100644 index 4b93ceca6..000000000 --- a/test2/getURLParameters/getURLParameters.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const getURLParameters = require('./getURLParameters.js'); - -test('Testing getURLParameters', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof getURLParameters === 'function').toBeTruthy(); - expect(getURLParameters('http://url.com/page?name=Adam&surname=Smith')).toEqual({name: 'Adam', surname: 'Smith'}); -}); \ No newline at end of file diff --git a/test3/groupBy/groupBy.test.js b/test3/groupBy/groupBy.test.js deleted file mode 100644 index a639ba073..000000000 --- a/test3/groupBy/groupBy.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const groupBy = require('./groupBy.js'); - -test('Testing groupBy', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof groupBy === 'function').toBeTruthy(); - expect(groupBy([6.1, 4.2, 6.3], Math.floor)).toEqual({4: [4.2], 6: [6.1, 6.3]}); - expect(groupBy(['one', 'two', 'three'], 'length')).toEqual({3: ['one', 'two'], 5: ['three']}); -}); \ No newline at end of file diff --git a/test3/hammingDistance/hammingDistance.test.js b/test3/hammingDistance/hammingDistance.test.js deleted file mode 100644 index 8ec3fef99..000000000 --- a/test3/hammingDistance/hammingDistance.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const hammingDistance = require('./hammingDistance.js'); - -test('Testing hammingDistance', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof hammingDistance === 'function').toBeTruthy(); - expect(hammingDistance(2, 3)).toBe(1); -}); \ No newline at end of file diff --git a/test3/hasClass/hasClass.test.js b/test3/hasClass/hasClass.test.js deleted file mode 100644 index 5b04c1444..000000000 --- a/test3/hasClass/hasClass.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const hasClass = require('./hasClass.js'); - -test('Testing hasClass', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof hasClass === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test3/hasFlags/hasFlags.test.js b/test3/hasFlags/hasFlags.test.js deleted file mode 100644 index 50a922aae..000000000 --- a/test3/hasFlags/hasFlags.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const hasFlags = require('./hasFlags.js'); - -test('Testing hasFlags', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof hasFlags === 'function').toBeTruthy(); -}); diff --git a/test3/hashBrowser/hashBrowser.test.js b/test3/hashBrowser/hashBrowser.test.js deleted file mode 100644 index 103e968b1..000000000 --- a/test3/hashBrowser/hashBrowser.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const hashBrowser = require('./hashBrowser.js'); - -test('Testing hashBrowser', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof hashBrowser === 'function').toBeTruthy(); -}); diff --git a/test3/hashNode/hashNode.test.js b/test3/hashNode/hashNode.test.js deleted file mode 100644 index b594baf55..000000000 --- a/test3/hashNode/hashNode.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const hashNode = require('./hashNode.js'); - -test('Testing hashNode', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof hashNode === 'function').toBeTruthy(); - hashNode(JSON.stringify({ a: 'a', b: [1, 2, 3, 4], foo: { c: 'bar' } })).then(v => expect(v).toBe('04aa106279f5977f59f9067fa9712afc4aedc6f5862a8defc34552d8c7206393')); -}); diff --git a/test3/head/head.test.js b/test3/head/head.test.js deleted file mode 100644 index cb300bfcf..000000000 --- a/test3/head/head.test.js +++ /dev/null @@ -1,20 +0,0 @@ -const expect = require('expect'); -const head = require('./head.js'); - -test('Testing head', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof head === 'function').toBeTruthy(); - expect(head({ a: 1234}) === undefined).toBeTruthy(); - expect(head([1, 2, 3])).toBe(1); - expect(head({ 0: false})).toBe(false); - expect(head('String')).toBe('S'); - expect(() => head(null)).toThrow(); - expect(() => head(undefined)).toThrow(); - 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(); - expect((end - start) < 2000).toBeTruthy(); -}); \ No newline at end of file diff --git a/test3/hexToRGB/hexToRGB.test.js b/test3/hexToRGB/hexToRGB.test.js deleted file mode 100644 index 20e0bdf32..000000000 --- a/test3/hexToRGB/hexToRGB.test.js +++ /dev/null @@ -1,11 +0,0 @@ -const expect = require('expect'); -const hexToRGB = require('./hexToRGB.js'); - -test('Testing hexToRGB', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof hexToRGB === 'function').toBeTruthy(); - expect(hexToRGB('#27ae60ff')).toBe('rgba(39, 174, 96, 255)'); - expect(hexToRGB('27ae60')).toBe('rgb(39, 174, 96)'); - expect(hexToRGB('#fff')).toBe('rgb(255, 255, 255)'); -}); \ No newline at end of file diff --git a/test3/hide/hide.test.js b/test3/hide/hide.test.js deleted file mode 100644 index f011daf95..000000000 --- a/test3/hide/hide.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const hide = require('./hide.js'); - -test('Testing hide', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof hide === 'function').toBeTruthy(); -}); diff --git a/test3/howManyTimes/howManyTimes.test.js b/test3/howManyTimes/howManyTimes.test.js deleted file mode 100644 index daacb5c6d..000000000 --- a/test3/howManyTimes/howManyTimes.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const howManyTimes = require('./howManyTimes.js'); - -test('Testing howManyTimes', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof howManyTimes === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test3/httpDelete/httpDelete.test.js b/test3/httpDelete/httpDelete.test.js deleted file mode 100644 index afc68db92..000000000 --- a/test3/httpDelete/httpDelete.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const httpDelete = require('./httpDelete.js'); - -test('Testing httpDelete', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof httpDelete === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test3/httpPut/httpPut.test.js b/test3/httpPut/httpPut.test.js deleted file mode 100644 index 57cc17100..000000000 --- a/test3/httpPut/httpPut.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const httpPut = require('./httpPut.js'); - -test('Testing httpPut', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof httpPut === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test3/httpsRedirect/httpsRedirect.js b/test3/httpsRedirect/httpsRedirect.js deleted file mode 100644 index 42473e321..000000000 --- a/test3/httpsRedirect/httpsRedirect.js +++ /dev/null @@ -1,4 +0,0 @@ -const httpsRedirect = () => { -if (location.protocol !== 'https:') location.replace('https://' + location.href.split('//')[1]); -}; -module.exports = httpsRedirect; \ No newline at end of file diff --git a/test3/httpsRedirect/httpsRedirect.test.js b/test3/httpsRedirect/httpsRedirect.test.js deleted file mode 100644 index dcea1d1e6..000000000 --- a/test3/httpsRedirect/httpsRedirect.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const httpsRedirect = require('./httpsRedirect.js'); - -test('Testing httpsRedirect', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof httpsRedirect === 'function').toBeTruthy(); -}); diff --git a/test3/hz/hz.test.js b/test3/hz/hz.test.js deleted file mode 100644 index 0181386c2..000000000 --- a/test3/hz/hz.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const hz = require('./hz.js'); - -test('Testing hz', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof hz === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test3/inRange/inRange.test.js b/test3/inRange/inRange.test.js deleted file mode 100644 index dbaa8e096..000000000 --- a/test3/inRange/inRange.test.js +++ /dev/null @@ -1,12 +0,0 @@ -const expect = require('expect'); -const inRange = require('./inRange.js'); - -test('Testing inRange', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof inRange === 'function').toBeTruthy(); - expect(inRange(3, 2, 5)).toBe(true); - expect(inRange(3, 4)).toBe(true); - expect(inRange(2, 3, 5)).toBe(false); - expect(inRange(3, 2)).toBe(false); -}); \ No newline at end of file diff --git a/test3/indexOfAll/indexOfAll.test.js b/test3/indexOfAll/indexOfAll.test.js deleted file mode 100644 index 792cd1f16..000000000 --- a/test3/indexOfAll/indexOfAll.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const indexOfAll = require('./indexOfAll.js'); - -test('Testing indexOfAll', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof indexOfAll === 'function').toBeTruthy(); - expect(indexOfAll([1, 2, 3, 1, 2, 3], 1)).toEqual([0,3]); - expect(indexOfAll([1, 2, 3], 4)).toEqual([]); -}); \ No newline at end of file diff --git a/test3/initial/initial.test.js b/test3/initial/initial.test.js deleted file mode 100644 index c4febca6a..000000000 --- a/test3/initial/initial.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const initial = require('./initial.js'); - -test('Testing initial', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof initial === 'function').toBeTruthy(); - expect(initial([1, 2, 3])).toEqual([1, 2]); -}); \ No newline at end of file diff --git a/test3/initialize2DArray/initialize2DArray.test.js b/test3/initialize2DArray/initialize2DArray.test.js deleted file mode 100644 index c8bbb69cb..000000000 --- a/test3/initialize2DArray/initialize2DArray.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const initialize2DArray = require('./initialize2DArray.js'); - -test('Testing initialize2DArray', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof initialize2DArray === 'function').toBeTruthy(); - expect(initialize2DArray(2, 2, 0)).toEqual([[0,0], [0,0]]); -}); \ No newline at end of file diff --git a/test3/initializeArrayWithRange/initializeArrayWithRange.test.js b/test3/initializeArrayWithRange/initializeArrayWithRange.test.js deleted file mode 100644 index e232928c2..000000000 --- a/test3/initializeArrayWithRange/initializeArrayWithRange.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const initializeArrayWithRange = require('./initializeArrayWithRange.js'); - -test('Testing initializeArrayWithRange', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof initializeArrayWithRange === 'function').toBeTruthy(); - expect(initializeArrayWithRange(5)).toEqual([0, 1, 2, 3, 4, 5]); -}); \ No newline at end of file diff --git a/test3/initializeArrayWithRangeRight/initializeArrayWithRangeRight.test.js b/test3/initializeArrayWithRangeRight/initializeArrayWithRangeRight.test.js deleted file mode 100644 index 462cf1c8b..000000000 --- a/test3/initializeArrayWithRangeRight/initializeArrayWithRangeRight.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const initializeArrayWithRangeRight = require('./initializeArrayWithRangeRight.js'); - -test('Testing initializeArrayWithRangeRight', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof initializeArrayWithRangeRight === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test3/initializeArrayWithValues/initializeArrayWithValues.test.js b/test3/initializeArrayWithValues/initializeArrayWithValues.test.js deleted file mode 100644 index c7b4bbd2f..000000000 --- a/test3/initializeArrayWithValues/initializeArrayWithValues.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const initializeArrayWithValues = require('./initializeArrayWithValues.js'); - -test('Testing initializeArrayWithValues', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof initializeArrayWithValues === 'function').toBeTruthy(); - expect(initializeArrayWithValues(5, 2)).toEqual([2, 2, 2, 2, 2]); -}); \ No newline at end of file diff --git a/test3/initializeNDArray/initializeNDArray.test.js b/test3/initializeNDArray/initializeNDArray.test.js deleted file mode 100644 index c2557c2ce..000000000 --- a/test3/initializeNDArray/initializeNDArray.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const initializeNDArray = require('./initializeNDArray.js'); - -test('Testing initializeNDArray', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof initializeNDArray === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test3/intersection/intersection.test.js b/test3/intersection/intersection.test.js deleted file mode 100644 index 10377e033..000000000 --- a/test3/intersection/intersection.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const intersection = require('./intersection.js'); - -test('Testing intersection', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof intersection === 'function').toBeTruthy(); - expect(intersection([1, 2, 3], [4, 3, 2])).toEqual([2, 3]); -}); \ No newline at end of file diff --git a/test3/intersectionBy/intersectionBy.test.js b/test3/intersectionBy/intersectionBy.test.js deleted file mode 100644 index 903e522ed..000000000 --- a/test3/intersectionBy/intersectionBy.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const intersectionBy = require('./intersectionBy.js'); - -test('Testing intersectionBy', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof intersectionBy === 'function').toBeTruthy(); - expect(intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor)).toEqual([2.1]); -}); diff --git a/test3/intersectionWith/intersectionWith.test.js b/test3/intersectionWith/intersectionWith.test.js deleted file mode 100644 index bf2c4a091..000000000 --- a/test3/intersectionWith/intersectionWith.test.js +++ /dev/null @@ -1,11 +0,0 @@ -const expect = require('expect'); -const intersectionWith = require('./intersectionWith.js'); - -test('Testing intersectionWith', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof intersectionWith === 'function').toBeTruthy(); - 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/test3/invertKeyValues/invertKeyValues.test.js b/test3/invertKeyValues/invertKeyValues.test.js deleted file mode 100644 index 02a21f85e..000000000 --- a/test3/invertKeyValues/invertKeyValues.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const invertKeyValues = require('./invertKeyValues.js'); - -test('Testing invertKeyValues', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof invertKeyValues === 'function').toBeTruthy(); - expect(invertKeyValues({ a: 1, b: 2, c: 1 })).toEqual({ 1: [ 'a', 'c' ], 2: [ 'b' ] }); - expect(invertKeyValues({ a: 1, b: 2, c: 1 }, value => 'group' + value)).toEqual({ group1: [ 'a', 'c' ], group2: [ 'b' ] }); -}); \ No newline at end of file diff --git a/test3/is/is.test.js b/test3/is/is.test.js deleted file mode 100644 index b39b90d11..000000000 --- a/test3/is/is.test.js +++ /dev/null @@ -1,24 +0,0 @@ -const expect = require('expect'); -const is = require('./is.js'); - -test('Testing is', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof is === 'function').toBeTruthy(); - expect(is(Array, [1])).toBeTruthy(); - expect(is(Array, [])).toBeTruthy(); - expect(is(Array, {})).toBeFalsy(); - expect(is(Object, {})).toBeTruthy(); - expect(is(Map, new Map())).toBeTruthy(); - expect(is(RegExp, /./g)).toBeTruthy(); - expect(is(Set, new Set())).toBeTruthy(); - expect(is(WeakMap, new WeakMap())).toBeTruthy(); - expect(is(WeakSet, new WeakSet())).toBeTruthy(); - expect(is(String, '')).toBeTruthy(); - expect(is(String, new String(''))).toBeTruthy(); - expect(is(Number, 1)).toBeTruthy(); - expect(is(Number, new Number('10'))).toBeTruthy(); - expect(is(Boolean, false)).toBeTruthy(); - expect(is(Boolean, new Boolean(false))).toBeTruthy(); - expect(is(Function, () => null)).toBeTruthy(); -}); diff --git a/test3/isAbsoluteURL/isAbsoluteURL.test.js b/test3/isAbsoluteURL/isAbsoluteURL.test.js deleted file mode 100644 index 085b7cf3c..000000000 --- a/test3/isAbsoluteURL/isAbsoluteURL.test.js +++ /dev/null @@ -1,11 +0,0 @@ -const expect = require('expect'); -const isAbsoluteURL = require('./isAbsoluteURL.js'); - -test('Testing isAbsoluteURL', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isAbsoluteURL === 'function').toBeTruthy(); - expect(isAbsoluteURL('https://google.com')).toBe(true); - expect(isAbsoluteURL('ftp://www.myserver.net')).toBe(true); - expect(isAbsoluteURL('/foo/bar')).toBe(false); -}); \ No newline at end of file diff --git a/test3/isArmstrongNumber/isArmstrongNumber.test.js b/test3/isArmstrongNumber/isArmstrongNumber.test.js deleted file mode 100644 index 07c78dd06..000000000 --- a/test3/isArmstrongNumber/isArmstrongNumber.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const isArmstrongNumber = require('./isArmstrongNumber.js'); - -test('Testing isArmstrongNumber', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isArmstrongNumber === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test3/isArray/isArray.test.js b/test3/isArray/isArray.test.js deleted file mode 100644 index 21416f848..000000000 --- a/test3/isArray/isArray.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const isArray = require('./isArray.js'); - -test('Testing isArray', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isArray === 'function').toBeTruthy(); - expect(isArray([1])).toBe(true); - expect(isArray('array')).toBe(false); -}); \ No newline at end of file diff --git a/test3/isArrayBuffer/isArrayBuffer.test.js b/test3/isArrayBuffer/isArrayBuffer.test.js deleted file mode 100644 index 3e9264b89..000000000 --- a/test3/isArrayBuffer/isArrayBuffer.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const isArrayBuffer = require('./isArrayBuffer.js'); - -test('Testing isArrayBuffer', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isArrayBuffer === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test3/isArrayLike/isArrayLike.test.js b/test3/isArrayLike/isArrayLike.test.js deleted file mode 100644 index a11a11186..000000000 --- a/test3/isArrayLike/isArrayLike.test.js +++ /dev/null @@ -1,11 +0,0 @@ -const expect = require('expect'); -const isArrayLike = require('./isArrayLike.js'); - -test('Testing isArrayLike', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isArrayLike === 'function').toBeTruthy(); - expect(isArrayLike('abc')).toBe(true); - expect(isArrayLike([1,2,3])).toBe(true); - expect(isArrayLike(null)).toBe(false); -}); diff --git a/test3/isBoolean/isBoolean.test.js b/test3/isBoolean/isBoolean.test.js deleted file mode 100644 index f5b7ebefd..000000000 --- a/test3/isBoolean/isBoolean.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const isBoolean = require('./isBoolean.js'); - -test('Testing isBoolean', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isBoolean === 'function').toBeTruthy(); - expect(isBoolean(null)).toBe(false); - expect(isBoolean(false)).toBe(true); -}); \ No newline at end of file diff --git a/test3/isBrowser/isBrowser.test.js b/test3/isBrowser/isBrowser.test.js deleted file mode 100644 index bb0a421d5..000000000 --- a/test3/isBrowser/isBrowser.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const isBrowser = require('./isBrowser.js'); - -test('Testing isBrowser', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isBrowser === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test3/isBrowserTabFocused/isBrowserTabFocused.test.js b/test3/isBrowserTabFocused/isBrowserTabFocused.test.js deleted file mode 100644 index 54989d858..000000000 --- a/test3/isBrowserTabFocused/isBrowserTabFocused.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const isBrowserTabFocused = require('./isBrowserTabFocused.js'); - -test('Testing isBrowserTabFocused', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isBrowserTabFocused === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test3/isDivisible/isDivisible.test.js b/test3/isDivisible/isDivisible.test.js deleted file mode 100644 index 637d6b4d5..000000000 --- a/test3/isDivisible/isDivisible.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const isDivisible = require('./isDivisible.js'); - -test('Testing isDivisible', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isDivisible === 'function').toBeTruthy(); - expect(isDivisible(6, 3)).toBe(true); -}); \ No newline at end of file diff --git a/test3/isEmpty/isEmpty.test.js b/test3/isEmpty/isEmpty.test.js deleted file mode 100644 index 70806b461..000000000 --- a/test3/isEmpty/isEmpty.test.js +++ /dev/null @@ -1,18 +0,0 @@ -const expect = require('expect'); -const isEmpty = require('./isEmpty.js'); - -test('Testing isEmpty', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isEmpty === 'function').toBeTruthy(); - expect(isEmpty(new Map())).toBe(true); - expect(isEmpty(new Set())).toBe(true); - expect(isEmpty([])).toBe(true); - expect(isEmpty({})).toBe(true); - expect(isEmpty('')).toBe(true); - expect(isEmpty([1, 2])).toBe(false); - expect(isEmpty({ a: 1, b: 2 })).toBe(false); - expect(isEmpty('text')).toBe(false); - expect(isEmpty(123)).toBe(true); - expect(isEmpty(true)).toBe(true); -}); diff --git a/test3/isEven/isEven.test.js b/test3/isEven/isEven.test.js deleted file mode 100644 index 1babab815..000000000 --- a/test3/isEven/isEven.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const isEven = require('./isEven.js'); - -test('Testing isEven', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isEven === 'function').toBeTruthy(); - expect(isEven(4)).toBe(true); - expect(isEven(5)).toBeFalsy(); -}); \ No newline at end of file diff --git a/test3/isFunction/isFunction.test.js b/test3/isFunction/isFunction.test.js deleted file mode 100644 index 97c8b64f5..000000000 --- a/test3/isFunction/isFunction.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const isFunction = require('./isFunction.js'); - -test('Testing isFunction', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isFunction === 'function').toBeTruthy(); - expect(isFunction(x => x)).toBe(true); - expect(isFunction('x')).toBe(false); -}); \ No newline at end of file diff --git a/test3/isLowerCase/isLowerCase.test.js b/test3/isLowerCase/isLowerCase.test.js deleted file mode 100644 index 624400811..000000000 --- a/test3/isLowerCase/isLowerCase.test.js +++ /dev/null @@ -1,11 +0,0 @@ -const expect = require('expect'); -const isLowerCase = require('./isLowerCase.js'); - -test('Testing isLowerCase', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isLowerCase === 'function').toBeTruthy(); - expect(isLowerCase('abc')).toBe(true); - expect(isLowerCase('a3@$')).toBe(true); - expect(isLowerCase('A3@$')).toBe(false); -}); \ No newline at end of file diff --git a/test3/isMap/isMap.test.js b/test3/isMap/isMap.test.js deleted file mode 100644 index 27a16b4a6..000000000 --- a/test3/isMap/isMap.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const isMap = require('./isMap.js'); - -test('Testing isMap', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isMap === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test3/isNil/isNil.test.js b/test3/isNil/isNil.test.js deleted file mode 100644 index d3412b0fb..000000000 --- a/test3/isNil/isNil.test.js +++ /dev/null @@ -1,11 +0,0 @@ -const expect = require('expect'); -const isNil = require('./isNil.js'); - -test('Testing isNil', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isNil === 'function').toBeTruthy(); - expect(isNil(null)).toBe(true); - expect(isNil(undefined)).toBe(true); - expect(isNil('')).toBe(false); -}); diff --git a/test3/isNull/isNull.test.js b/test3/isNull/isNull.test.js deleted file mode 100644 index d9d6935c0..000000000 --- a/test3/isNull/isNull.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const isNull = require('./isNull.js'); - -test('Testing isNull', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isNull === 'function').toBeTruthy(); - expect(isNull(null)).toBe(true); - expect(isNull(NaN)).toBe(false); -}); \ No newline at end of file diff --git a/test3/isNumber/isNumber.test.js b/test3/isNumber/isNumber.test.js deleted file mode 100644 index c0effd774..000000000 --- a/test3/isNumber/isNumber.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const isNumber = require('./isNumber.js'); - -test('Testing isNumber', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isNumber === 'function').toBeTruthy(); - expect(isNumber(1)).toBe(true); - expect(isNumber('1')).toBe(false); -}); \ No newline at end of file diff --git a/test3/isObject/isObject.test.js b/test3/isObject/isObject.test.js deleted file mode 100644 index 8531462f5..000000000 --- a/test3/isObject/isObject.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const expect = require('expect'); -const isObject = require('./isObject.js'); - -test('Testing isObject', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isObject === 'function').toBeTruthy(); - - expect(isObject([1, 2, 3, 4])).toBeTruthy(); - expect(isObject([])).toBeTruthy(); - expect(isObject({ a:1 })).toBeTruthy(); - expect(isObject(true)).toBeFalsy(); -}); diff --git a/test3/isObjectLike/isObjectLike.test.js b/test3/isObjectLike/isObjectLike.test.js deleted file mode 100644 index 5058fe8b1..000000000 --- a/test3/isObjectLike/isObjectLike.test.js +++ /dev/null @@ -1,12 +0,0 @@ -const expect = require('expect'); -const isObjectLike = require('./isObjectLike.js'); - -test('Testing isObjectLike', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isObjectLike === 'function').toBeTruthy(); - expect(isObjectLike({})).toBe(true); - expect(isObjectLike([1, 2, 3])).toBe(true); - expect(isObjectLike(x => x)).toBe(false); - expect(isObjectLike(null)).toBe(false); -}); diff --git a/test3/isPlainObject/isPlainObject.test.js b/test3/isPlainObject/isPlainObject.test.js deleted file mode 100644 index ce6feaa5b..000000000 --- a/test3/isPlainObject/isPlainObject.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const isPlainObject = require('./isPlainObject.js'); - -test('Testing isPlainObject', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isPlainObject === 'function').toBeTruthy(); - expect(isPlainObject({ a: 1 })).toBe(true); - expect(isPlainObject(new Map())).toBe(false); -}); diff --git a/test4/JSONToDate/JSONToDate.test.js b/test4/JSONToDate/JSONToDate.test.js deleted file mode 100644 index bf3f186c8..000000000 --- a/test4/JSONToDate/JSONToDate.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const JSONToDate = require('./JSONToDate.js'); - -test('Testing JSONToDate', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof JSONToDate === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test4/JSONToFile/JSONToFile.test.js b/test4/JSONToFile/JSONToFile.test.js deleted file mode 100644 index 6a17cb86d..000000000 --- a/test4/JSONToFile/JSONToFile.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const JSONToFile = require('./JSONToFile.js'); - -test('Testing JSONToFile', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof JSONToFile === 'function').toBeTruthy(); -}); diff --git a/test4/isPrime/isPrime.test.js b/test4/isPrime/isPrime.test.js deleted file mode 100644 index 5d17948ef..000000000 --- a/test4/isPrime/isPrime.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const isPrime = require('./isPrime.js'); - -test('Testing isPrime', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isPrime === 'function').toBeTruthy(); - expect(isPrime(11)).toBe(true); -}); \ No newline at end of file diff --git a/test4/isPrimitive/isPrimitive.test.js b/test4/isPrimitive/isPrimitive.test.js deleted file mode 100644 index 0ce6c26b0..000000000 --- a/test4/isPrimitive/isPrimitive.test.js +++ /dev/null @@ -1,23 +0,0 @@ -const expect = require('expect'); -const isPrimitive = require('./isPrimitive.js'); - -test('Testing isPrimitive', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isPrimitive === 'function').toBeTruthy(); - expect(isPrimitive(null)).toBeTruthy(); - expect(isPrimitive(undefined)).toBeTruthy(); - expect(isPrimitive('string')).toBeTruthy(); - expect(isPrimitive(true)).toBeTruthy(); - expect(isPrimitive(50)).toBeTruthy(); - expect(isPrimitive('Hello')).toBeTruthy(); - expect(isPrimitive(false)).toBeTruthy(); - expect(isPrimitive(Symbol())).toBeTruthy(); - expect(isPrimitive([1, 2, 3])).toBeFalsy(); - expect(isPrimitive({ a: 123 })).toBeFalsy(); - - let start = new Date().getTime(); - isPrimitive({ a: 123 }); - let end = new Date().getTime(); - expect((end - start) < 2000).toBeTruthy(); -}); \ No newline at end of file diff --git a/test4/isPromiseLike/isPromiseLike.test.js b/test4/isPromiseLike/isPromiseLike.test.js deleted file mode 100644 index a971c86f0..000000000 --- a/test4/isPromiseLike/isPromiseLike.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const expect = require('expect'); -const isPromiseLike = require('./isPromiseLike.js'); - -test('Testing isPromiseLike', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isPromiseLike === 'function').toBeTruthy(); - expect(isPromiseLike({ - then: function() { - return ''; - } - })).toBe(true); - expect(isPromiseLike(null)).toBe(false); - expect(isPromiseLike({})).toBe(false); -}); diff --git a/test4/isRegExp/isRegExp.test.js b/test4/isRegExp/isRegExp.test.js deleted file mode 100644 index c72df0593..000000000 --- a/test4/isRegExp/isRegExp.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const isRegExp = require('./isRegExp.js'); - -test('Testing isRegExp', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isRegExp === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test4/isSet/isSet.test.js b/test4/isSet/isSet.test.js deleted file mode 100644 index 0cc4d8995..000000000 --- a/test4/isSet/isSet.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const isSet = require('./isSet.js'); - -test('Testing isSet', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isSet === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test4/isSimilar/isSimilar.test.js b/test4/isSimilar/isSimilar.test.js deleted file mode 100644 index 24d4e6abf..000000000 --- a/test4/isSimilar/isSimilar.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const isSimilar = require('./isSimilar.js'); - -test('Testing isSimilar', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isSimilar === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test4/isSorted/isSorted.test.js b/test4/isSorted/isSorted.test.js deleted file mode 100644 index c9f3432d6..000000000 --- a/test4/isSorted/isSorted.test.js +++ /dev/null @@ -1,20 +0,0 @@ -const expect = require('expect'); -const isSorted = require('./isSorted.js'); - -test('Testing isSorted', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isSorted === 'function').toBeTruthy(); - //t.deepEqual(isSorted(args..), 'Expected'); - expect(isSorted([0, 1, 2])).toBe(1); - expect(isSorted([0, 1, 2, 2])).toBe(1); - expect(isSorted([-4, -3, -2])).toBe(1); - expect(isSorted([0, 0, 1, 2])).toBe(1); - expect(isSorted([2, 1, 0])).toBe(-1); - expect(isSorted([2, 2, 1, 0])).toBe(-1); - expect(isSorted([-2, -3, -4])).toBe(-1); - expect(isSorted([2, 1, 0, 0])).toBe(-1); - expect(isSorted([])).toBe(undefined); - expect(isSorted([1])).toBe(0); - expect(isSorted([1, 2, 1])).toBe(0); -}); diff --git a/test4/isString/isString.test.js b/test4/isString/isString.test.js deleted file mode 100644 index be8d629a2..000000000 --- a/test4/isString/isString.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const expect = require('expect'); -const isString = require('./isString.js'); - -test('Testing isString', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isString === 'function').toBeTruthy(); - expect(isString('foo')).toBe(true); - expect(isString('10')).toBe(true); - expect(isString('')).toBe(true); - expect(isString(10)).toBe(false); - expect(isString(true)).toBe(false); -}); \ No newline at end of file diff --git a/test4/isSymbol/isSymbol.test.js b/test4/isSymbol/isSymbol.test.js deleted file mode 100644 index 6eebd3e54..000000000 --- a/test4/isSymbol/isSymbol.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const isSymbol = require('./isSymbol.js'); - -test('Testing isSymbol', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isSymbol === 'function').toBeTruthy(); - expect(isSymbol(Symbol('x'))).toBe(true); -}); \ No newline at end of file diff --git a/test4/isTravisCI/isTravisCI.test.js b/test4/isTravisCI/isTravisCI.test.js deleted file mode 100644 index 58a776d2d..000000000 --- a/test4/isTravisCI/isTravisCI.test.js +++ /dev/null @@ -1,12 +0,0 @@ -const expect = require('expect'); -const isTravisCI = require('./isTravisCI.js'); - -test('Testing isTravisCI', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isTravisCI === 'function').toBeTruthy(); - if(isTravisCI()) - expect(isTravisCI()).toBeTruthy(); - else - expect(isTravisCI()).toBeFalsy(); -}); diff --git a/test4/isTypedArray/isTypedArray.test.js b/test4/isTypedArray/isTypedArray.test.js deleted file mode 100644 index deec79621..000000000 --- a/test4/isTypedArray/isTypedArray.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const isTypedArray = require('./isTypedArray.js'); - -test('Testing isTypedArray', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isTypedArray === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test4/isUndefined/isUndefined.test.js b/test4/isUndefined/isUndefined.test.js deleted file mode 100644 index d345a2f69..000000000 --- a/test4/isUndefined/isUndefined.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const isUndefined = require('./isUndefined.js'); - -test('Testing isUndefined', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isUndefined === 'function').toBeTruthy(); - expect(isUndefined(undefined)).toBeTruthy(); -}); diff --git a/test4/isUpperCase/isUpperCase.test.js b/test4/isUpperCase/isUpperCase.test.js deleted file mode 100644 index 660ad5547..000000000 --- a/test4/isUpperCase/isUpperCase.test.js +++ /dev/null @@ -1,12 +0,0 @@ -const expect = require('expect'); -const isUpperCase = require('./isUpperCase.js'); - -test('Testing isUpperCase', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isUpperCase === 'function').toBeTruthy(); - //t.deepEqual(isUpperCase(args..), 'Expected'); - expect(isUpperCase('ABC')).toBe(true); - expect(isUpperCase('abc')).toBe(false); - expect(isUpperCase('A3@$')).toBe(true); -}); \ No newline at end of file diff --git a/test4/isValidJSON/isValidJSON.test.js b/test4/isValidJSON/isValidJSON.test.js deleted file mode 100644 index 3d3d9a152..000000000 --- a/test4/isValidJSON/isValidJSON.test.js +++ /dev/null @@ -1,11 +0,0 @@ -const expect = require('expect'); -const isValidJSON = require('./isValidJSON.js'); - -test('Testing isValidJSON', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isValidJSON === 'function').toBeTruthy(); - expect(isValidJSON('{"name":"Adam","age":20}')).toBe(true); - expect(isValidJSON('{"name":"Adam",age:"20"}')).toBe(false); - expect(isValidJSON(null)).toBe(true); -}); \ No newline at end of file diff --git a/test4/isWeakMap/isWeakMap.test.js b/test4/isWeakMap/isWeakMap.test.js deleted file mode 100644 index e79e1410a..000000000 --- a/test4/isWeakMap/isWeakMap.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const isWeakMap = require('./isWeakMap.js'); - -test('Testing isWeakMap', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isWeakMap === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test4/isWeakSet/isWeakSet.test.js b/test4/isWeakSet/isWeakSet.test.js deleted file mode 100644 index 7da0fec69..000000000 --- a/test4/isWeakSet/isWeakSet.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const isWeakSet = require('./isWeakSet.js'); - -test('Testing isWeakSet', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof isWeakSet === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test4/join/join.test.js b/test4/join/join.test.js deleted file mode 100644 index 6e173d9fa..000000000 --- a/test4/join/join.test.js +++ /dev/null @@ -1,11 +0,0 @@ -const expect = require('expect'); -const join = require('./join.js'); - -test('Testing join', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof join === 'function').toBeTruthy(); - expect(join(['pen', 'pineapple', 'apple', 'pen'], ',', '&')).toEqual("pen,pineapple,apple&pen"); - expect(join(['pen', 'pineapple', 'apple', 'pen'], ',')).toEqual("pen,pineapple,apple,pen"); - expect(join(['pen', 'pineapple', 'apple', 'pen'])).toEqual("pen,pineapple,apple,pen"); -}); \ No newline at end of file diff --git a/test4/last/last.test.js b/test4/last/last.test.js deleted file mode 100644 index df9817754..000000000 --- a/test4/last/last.test.js +++ /dev/null @@ -1,20 +0,0 @@ -const expect = require('expect'); -const last = require('./last.js'); - -test('Testing last', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof last === 'function').toBeTruthy(); - expect(last({ a: 1234}) === undefined).toBeTruthy(); - expect(last([1, 2, 3])).toBe(3); - expect(last({ 0: false})).toBe(undefined); - expect(last('String')).toBe('g'); - expect(() => last(null)).toThrow(); - expect(() => last(undefined)).toThrow(); - 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(); - expect((end - start) < 2000).toBeTruthy(); -}); \ No newline at end of file diff --git a/test4/lcm/lcm.test.js b/test4/lcm/lcm.test.js deleted file mode 100644 index 76e1cf03d..000000000 --- a/test4/lcm/lcm.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const lcm = require('./lcm.js'); - -test('Testing lcm', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof lcm === 'function').toBeTruthy(); - expect(lcm(12, 7)).toBe(84); - expect(lcm(...[1, 3, 4, 5])).toBe(60); -}); \ No newline at end of file diff --git a/test4/levenshteinDistance/levenshteinDistance.test.js b/test4/levenshteinDistance/levenshteinDistance.test.js deleted file mode 100644 index 01afeb869..000000000 --- a/test4/levenshteinDistance/levenshteinDistance.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const levenshteinDistance = require('./levenshteinDistance.js'); - -test('Testing levenshteinDistance', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof levenshteinDistance === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test4/longestItem/longestItem.test.js b/test4/longestItem/longestItem.test.js deleted file mode 100644 index d4961f009..000000000 --- a/test4/longestItem/longestItem.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const longestItem = require('./longestItem.js'); - -test('Testing longestItem', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof longestItem === 'function').toBeTruthy(); - expect(longestItem('this', 'is', 'a', 'testcase')).toEqual('testcase'); -}); \ No newline at end of file diff --git a/test4/lowercaseKeys/lowercaseKeys.test.js b/test4/lowercaseKeys/lowercaseKeys.test.js deleted file mode 100644 index 537b699a7..000000000 --- a/test4/lowercaseKeys/lowercaseKeys.test.js +++ /dev/null @@ -1,12 +0,0 @@ -const expect = require('expect'); -const lowercaseKeys = require('./lowercaseKeys.js'); - -test('Testing lowercaseKeys', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof lowercaseKeys === 'function').toBeTruthy(); - const myObj = { Name: 'Adam', sUrnAME: 'Smith' }; - const myObjLower = lowercaseKeys(myObj); - expect(myObjLower).toEqual({name: 'Adam', surname: 'Smith'}); - expect(myObj).toEqual({ Name: 'Adam', sUrnAME: 'Smith' }); -}); diff --git a/test4/luhnCheck/luhnCheck.test.js b/test4/luhnCheck/luhnCheck.test.js deleted file mode 100644 index dec48f653..000000000 --- a/test4/luhnCheck/luhnCheck.test.js +++ /dev/null @@ -1,11 +0,0 @@ -const expect = require('expect'); -const luhnCheck = require('./luhnCheck.js'); - -test('Testing luhnCheck', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof luhnCheck === 'function').toBeTruthy(); - expect(luhnCheck(6011329933655299)).toBe(false); - expect(luhnCheck('4485275742308327')).toBe(true); - expect(luhnCheck(123456789)).toBe(false); -}); \ No newline at end of file diff --git a/test4/mapKeys/mapKeys.test.js b/test4/mapKeys/mapKeys.test.js deleted file mode 100644 index 0aa00bf36..000000000 --- a/test4/mapKeys/mapKeys.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const mapKeys = require('./mapKeys.js'); - -test('Testing mapKeys', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof mapKeys === 'function').toBeTruthy(); - expect(mapKeys({ a: 1, b: 2 }, (val, key) => key + val)).toEqual({ a1: 1, b2: 2 }); -}); diff --git a/test4/mapObject/mapObject.test.js b/test4/mapObject/mapObject.test.js deleted file mode 100644 index 80c2295a8..000000000 --- a/test4/mapObject/mapObject.test.js +++ /dev/null @@ -1,11 +0,0 @@ -const expect = require('expect'); -const mapObject = require('./mapObject.js'); - -test('Testing mapObject', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof mapObject === 'function').toBeTruthy(); - expect(mapObject([1, 2, 3], a => a * a)).toEqual({ 1: 1, 2: 4, 3: 9 }); - expect(mapObject([1, 2, 3, 4], (a, b) => b - a)).toEqual({ 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/test4/mapValues/mapValues.test.js b/test4/mapValues/mapValues.test.js deleted file mode 100644 index 862909d71..000000000 --- a/test4/mapValues/mapValues.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const expect = require('expect'); -const mapValues = require('./mapValues.js'); - -test('Testing mapValues', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof mapValues === 'function').toBeTruthy(); - const users = { - fred: { user: 'fred', age: 40 }, - pebbles: { user: 'pebbles', age: 1 } - }; - expect(mapValues(users, u => u.age)).toEqual({ fred: 40, pebbles: 1 }); -}); diff --git a/test4/mask/mask.test.js b/test4/mask/mask.test.js deleted file mode 100644 index a313029c0..000000000 --- a/test4/mask/mask.test.js +++ /dev/null @@ -1,11 +0,0 @@ -const expect = require('expect'); -const mask = require('./mask.js'); - -test('Testing mask', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof mask === 'function').toBeTruthy(); - expect(mask(1234567890)).toBe('******7890'); - expect(mask(1234567890, 3)).toBe('*******890'); - expect(mask(1234567890, -4, '$')).toBe('$$$$567890'); -}); \ No newline at end of file diff --git a/test4/matches/matches.test.js b/test4/matches/matches.test.js deleted file mode 100644 index b8c61f7fb..000000000 --- a/test4/matches/matches.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const expect = require('expect'); -const matches = require('./matches.js'); - -test('Testing matches', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof matches === 'function').toBeTruthy(); - expect( - matches({ age: 25, hair: 'long', beard: true }, { hair: 'long', beard: true }) - ).toBeTruthy(); - expect( - matches({ hair: 'long', beard: true }, { age: 25, hair: 'long', beard: true }) - ).toBeFalsy(); -}); diff --git a/test4/matchesWith/matchesWith.test.js b/test4/matchesWith/matchesWith.test.js deleted file mode 100644 index aef31c802..000000000 --- a/test4/matchesWith/matchesWith.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const expect = require('expect'); -const matchesWith = require('./matchesWith.js'); - -test('Testing matchesWith', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof matchesWith === 'function').toBeTruthy(); - const isGreeting = val => /^h(?:i|ello)$/.test(val); - expect(matchesWith( - { greeting: 'hello' }, - { greeting: 'hi' }, - (oV, sV) => isGreeting(oV) && isGreeting(sV) - )).toBeTruthy(); -}); diff --git a/test4/maxBy/maxBy.test.js b/test4/maxBy/maxBy.test.js deleted file mode 100644 index 041e16d5f..000000000 --- a/test4/maxBy/maxBy.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const maxBy = require('./maxBy.js'); - -test('Testing maxBy', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof maxBy === 'function').toBeTruthy(); - expect(maxBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], o => o.n)).toBe(8); - expect(maxBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], 'n')).toBe(8); -}); diff --git a/test4/maxN/maxN.test.js b/test4/maxN/maxN.test.js deleted file mode 100644 index e714acd04..000000000 --- a/test4/maxN/maxN.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const maxN = require('./maxN.js'); - -test('Testing maxN', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof maxN === 'function').toBeTruthy(); - expect(maxN([1, 2, 3])).toEqual([3]); - expect(maxN([1, 2, 3], 2)).toEqual([3, 2]); -}); \ No newline at end of file diff --git a/test4/median/median.test.js b/test4/median/median.test.js deleted file mode 100644 index d7e14899e..000000000 --- a/test4/median/median.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const median = require('./median.js'); - -test('Testing median', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof median === 'function').toBeTruthy(); - expect(median([5, 6, 50, 1, -5])).toBe(5); - expect(median([1, 2, 3])).toBe(2); -}); \ No newline at end of file diff --git a/test4/memoize/memoize.test.js b/test4/memoize/memoize.test.js deleted file mode 100644 index 29ef30ccb..000000000 --- a/test4/memoize/memoize.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const expect = require('expect'); -const memoize = require('./memoize.js'); - -test('Testing memoize', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof memoize === 'function').toBeTruthy(); - const f = x => x * x; - const square = memoize(f); - expect(square(2)).toBe(4); - expect(square(3)).toBe(9); - expect(Array.from(square.cache)).toEqual([[2,4],[3,9]]); -}); diff --git a/test4/merge/merge.test.js b/test4/merge/merge.test.js deleted file mode 100644 index c3369f320..000000000 --- a/test4/merge/merge.test.js +++ /dev/null @@ -1,18 +0,0 @@ -const expect = require('expect'); -const merge = require('./merge.js'); - -test('Testing merge', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof merge === 'function').toBeTruthy(); - const object = { - a: [{ x: 2 }, { y: 4 }], - b: 1 - }; - const other = { - a: { z: 3 }, - b: [2, 3], - c: 'foo' - }; - expect(merge(object, other)).toEqual({ a: [ { x: 2 }, { y: 4 }, { z: 3 } ], b: [ 1, 2, 3 ], c: 'foo' }); -}); diff --git a/test4/minBy/minBy.test.js b/test4/minBy/minBy.test.js deleted file mode 100644 index 58efee38f..000000000 --- a/test4/minBy/minBy.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const minBy = require('./minBy.js'); - -test('Testing minBy', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof minBy === 'function').toBeTruthy(); - expect(minBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], o => o.n)).toBe(2); - expect(minBy([{ n: 4 }, { n: 2 }, { n: 8 }, { n: 6 }], 'n')).toBe(2); -}); diff --git a/test4/minN/minN.test.js b/test4/minN/minN.test.js deleted file mode 100644 index c10fd200f..000000000 --- a/test4/minN/minN.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const minN = require('./minN.js'); - -test('Testing minN', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof minN === 'function').toBeTruthy(); - expect(minN([1, 2, 3])).toEqual([1]); - expect(minN([1, 2, 3], 2)).toEqual([1, 2]); -}); \ No newline at end of file diff --git a/test4/mostPerformant/mostPerformant.test.js b/test4/mostPerformant/mostPerformant.test.js deleted file mode 100644 index b83d3ff0f..000000000 --- a/test4/mostPerformant/mostPerformant.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const mostPerformant = require('./mostPerformant.js'); - -test('Testing mostPerformant', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof mostPerformant === 'function').toBeTruthy(); -}); diff --git a/test4/negate/negate.test.js b/test4/negate/negate.test.js deleted file mode 100644 index 3a3799bb8..000000000 --- a/test4/negate/negate.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const negate = require('./negate.js'); - -test('Testing negate', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof negate === 'function').toBeTruthy(); - expect([1, 2, 3, 4, 5, 6].filter(negate(n => n % 2 === 0))).toEqual([1, 3, 5]); -}); diff --git a/test4/nest/nest.test.js b/test4/nest/nest.test.js deleted file mode 100644 index 2866537ad..000000000 --- a/test4/nest/nest.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const nest = require('./nest.js'); - -test('Testing nest', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof nest === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test4/nodeListToArray/nodeListToArray.test.js b/test4/nodeListToArray/nodeListToArray.test.js deleted file mode 100644 index cc16b355d..000000000 --- a/test4/nodeListToArray/nodeListToArray.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const nodeListToArray = require('./nodeListToArray.js'); - -test('Testing nodeListToArray', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof nodeListToArray === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test4/none/none.test.js b/test4/none/none.test.js deleted file mode 100644 index fdf7c6bbc..000000000 --- a/test4/none/none.test.js +++ /dev/null @@ -1,12 +0,0 @@ -const expect = require('expect'); -const none = require('./none.js'); - -test('Testing none', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof none === 'function').toBeTruthy(); - expect(none([0,undefined,NaN,null,''])).toBeTruthy(); - expect(none([0,1])).toBeFalsy(); - expect(none([4,1,0,3], x => x < 0)).toBeTruthy(); - expect(none([0,1,2], x => x === 1)).toBeFalsy(); -}); diff --git a/test4/nthArg/nthArg.test.js b/test4/nthArg/nthArg.test.js deleted file mode 100644 index b63828fe4..000000000 --- a/test4/nthArg/nthArg.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const expect = require('expect'); -const nthArg = require('./nthArg.js'); - -test('Testing nthArg', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof nthArg === 'function').toBeTruthy(); - const third = nthArg(2); - expect(third(1, 2, 3)).toBe(3); - expect(third(1, 2)).toBe(undefined); - const last = nthArg(-1); - expect(last(1, 2, 3, 4, 5)).toBe(5); -}); diff --git a/test4/nthElement/nthElement.test.js b/test4/nthElement/nthElement.test.js deleted file mode 100644 index 3ba010c0d..000000000 --- a/test4/nthElement/nthElement.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const nthElement = require('./nthElement.js'); - -test('Testing nthElement', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof nthElement === 'function').toBeTruthy(); - expect(nthElement(['a', 'b', 'c'], 1)).toBe('b'); - expect(nthElement(['a', 'b', 'c'], -3)).toBe('a'); -}); \ No newline at end of file diff --git a/test4/objectFromPairs/objectFromPairs.test.js b/test4/objectFromPairs/objectFromPairs.test.js deleted file mode 100644 index 7497fee6a..000000000 --- a/test4/objectFromPairs/objectFromPairs.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const objectFromPairs = require('./objectFromPairs.js'); - -test('Testing objectFromPairs', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof objectFromPairs === 'function').toBeTruthy(); - expect(objectFromPairs([['a', 1], ['b', 2]])).toEqual({a: 1, b: 2}); -}); \ No newline at end of file diff --git a/test4/objectToPairs/objectToPairs.test.js b/test4/objectToPairs/objectToPairs.test.js deleted file mode 100644 index c274408bd..000000000 --- a/test4/objectToPairs/objectToPairs.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const objectToPairs = require('./objectToPairs.js'); - -test('Testing objectToPairs', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof objectToPairs === 'function').toBeTruthy(); - expect(objectToPairs({ a: 1, b: 2 })).toEqual([['a',1],['b',2]]); -}); \ No newline at end of file diff --git a/test4/observeMutations/observeMutations.test.js b/test4/observeMutations/observeMutations.test.js deleted file mode 100644 index 4cf9349e0..000000000 --- a/test4/observeMutations/observeMutations.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const observeMutations = require('./observeMutations.js'); - -test('Testing observeMutations', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof observeMutations === 'function').toBeTruthy(); -}); diff --git a/test4/off/off.test.js b/test4/off/off.test.js deleted file mode 100644 index 90702b03a..000000000 --- a/test4/off/off.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const off = require('./off.js'); - -test('Testing off', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof off === 'function').toBeTruthy(); -}); diff --git a/test4/offset/offset.test.js b/test4/offset/offset.test.js deleted file mode 100644 index 8cf281e0c..000000000 --- a/test4/offset/offset.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const expect = require('expect'); -const offset = require('./offset.js'); - -test('Testing offset', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof offset === 'function').toBeTruthy(); - expect(offset([1, 2, 3, 4, 5], 0)).toEqual([1, 2, 3, 4, 5]); - expect(offset([1, 2, 3, 4, 5], 2)).toEqual([3, 4, 5, 1, 2]); - expect(offset([1, 2, 3, 4, 5], -2)).toEqual([4, 5, 1, 2, 3]); - expect(offset([1, 2, 3, 4, 5], 6)).toEqual([1, 2, 3, 4, 5]); - expect(offset([1, 2, 3, 4, 5], -6)).toEqual([1, 2, 3, 4, 5]); - expect(offset([], 3)).toEqual([]); -}); diff --git a/test4/omit/omit.test.js b/test4/omit/omit.test.js deleted file mode 100644 index bcb2365ee..000000000 --- a/test4/omit/omit.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const omit = require('./omit.js'); - -test('Testing omit', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof omit === 'function').toBeTruthy(); - expect(omit({ a: 1, b: '2', c: 3 }, ['b'])).toEqual({ 'a': 1, 'c': 3 }); -}); diff --git a/test5/RGBToHex/RGBToHex.test.js b/test5/RGBToHex/RGBToHex.test.js deleted file mode 100644 index d0fc0f92e..000000000 --- a/test5/RGBToHex/RGBToHex.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const RGBToHex = require('./RGBToHex.js'); - -test('Testing RGBToHex', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof RGBToHex === 'function').toBeTruthy(); - expect(RGBToHex(255, 165, 1)).toBe('ffa501'); -}); \ No newline at end of file diff --git a/test5/omitBy/omitBy.test.js b/test5/omitBy/omitBy.test.js deleted file mode 100644 index dce45eea2..000000000 --- a/test5/omitBy/omitBy.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const omitBy = require('./omitBy.js'); - -test('Testing omitBy', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof omitBy === 'function').toBeTruthy(); - expect(omitBy({ a: 1, b: '2', c: 3 }, x => typeof x === 'number')).toEqual({ b: '2' }); -}); diff --git a/test5/on/on.test.js b/test5/on/on.test.js deleted file mode 100644 index 7fbf62c6c..000000000 --- a/test5/on/on.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const on = require('./on.js'); - -test('Testing on', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof on === 'function').toBeTruthy(); -}); diff --git a/test5/onUserInputChange/onUserInputChange.test.js b/test5/onUserInputChange/onUserInputChange.test.js deleted file mode 100644 index 2224a0f2d..000000000 --- a/test5/onUserInputChange/onUserInputChange.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const onUserInputChange = require('./onUserInputChange.js'); - -test('Testing onUserInputChange', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof onUserInputChange === 'function').toBeTruthy(); -}); diff --git a/test5/once/once.test.js b/test5/once/once.test.js deleted file mode 100644 index 0df7c89b2..000000000 --- a/test5/once/once.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const once = require('./once.js'); - -test('Testing once', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof once === 'function').toBeTruthy(); -}); diff --git a/test5/orderBy/orderBy.test.js b/test5/orderBy/orderBy.test.js deleted file mode 100644 index b2f2079a7..000000000 --- a/test5/orderBy/orderBy.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const expect = require('expect'); -const orderBy = require('./orderBy.js'); - -test('Testing orderBy', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof orderBy === 'function').toBeTruthy(); - const users = [{ name: 'fred', age: 48 }, { name: 'barney', age: 36 }, { name: 'fred', age: 40 }]; - expect(orderBy(users, ['name', 'age'], ['asc', 'desc'])).toEqual( - [{name: 'barney', age: 36}, {name: 'fred', age: 48}, {name: 'fred', age: 40}] - ); - expect(orderBy(users, ['name', 'age'])).toEqual( - [{name: 'barney', age: 36}, {name: 'fred', age: 40}, {name: 'fred', age: 48}] - ); -}); \ No newline at end of file diff --git a/test5/over/over.test.js b/test5/over/over.test.js deleted file mode 100644 index 0ecda5749..000000000 --- a/test5/over/over.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const over = require('./over.js'); - -test('Testing over', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof over === 'function').toBeTruthy(); - const minMax = over(Math.min, Math.max); - expect(minMax(1, 2, 3, 4, 5)).toEqual([1,5]); -}); diff --git a/test5/overArgs/overArgs.test.js b/test5/overArgs/overArgs.test.js deleted file mode 100644 index 78c9edfd3..000000000 --- a/test5/overArgs/overArgs.test.js +++ /dev/null @@ -1,12 +0,0 @@ -const expect = require('expect'); -const overArgs = require('./overArgs.js'); - -test('Testing overArgs', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof overArgs === 'function').toBeTruthy(); - const square = n => n * n; - const double = n => n * 2; - const fn = overArgs((x, y) => [x, y], [square, double]); - expect(fn(9, 3)).toEqual([81, 6]); -}); diff --git a/test5/pad/pad.test.js b/test5/pad/pad.test.js deleted file mode 100644 index a2a036ec5..000000000 --- a/test5/pad/pad.test.js +++ /dev/null @@ -1,12 +0,0 @@ -const expect = require('expect'); -const pad = require('./pad.js'); - -test('Testing pad', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof pad === 'function').toBeTruthy(); - expect(pad('cat',8)).toBe(' cat '); - expect(pad('cat',8).length).toBe(8); - expect(pad(String(42), 6, '0')).toBe('004200'); - expect(pad('foobar', 3)).toBe('foobar'); -}); diff --git a/test5/palindrome/palindrome.test.js b/test5/palindrome/palindrome.test.js deleted file mode 100644 index 44d983dc9..000000000 --- a/test5/palindrome/palindrome.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const palindrome = require('./palindrome.js'); - -test('Testing palindrome', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof palindrome === 'function').toBeTruthy(); - expect(palindrome('taco cat')).toBe(true); - expect(palindrome('foobar')).toBe(false); -}); \ No newline at end of file diff --git a/test5/parseCookie/parseCookie.test.js b/test5/parseCookie/parseCookie.test.js deleted file mode 100644 index 84e046a69..000000000 --- a/test5/parseCookie/parseCookie.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const parseCookie = require('./parseCookie.js'); - -test('Testing parseCookie', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof parseCookie === 'function').toBeTruthy(); - expect(parseCookie('foo=bar; equation=E%3Dmc%5E2')).toEqual({ foo: 'bar', equation: 'E=mc^2' }); -}); diff --git a/test5/partial/partial.test.js b/test5/partial/partial.test.js deleted file mode 100644 index 813eef79a..000000000 --- a/test5/partial/partial.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const expect = require('expect'); -const partial = require('./partial.js'); - -test('Testing partial', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof partial === 'function').toBeTruthy(); - function greet(greeting, name) { - return greeting + ' ' + name + '!'; - } - const greetHello = partial(greet, 'Hello'); - expect(greetHello('John')).toBe('Hello John!'); -}); diff --git a/test5/partialRight/partialRight.test.js b/test5/partialRight/partialRight.test.js deleted file mode 100644 index 480ce7ec6..000000000 --- a/test5/partialRight/partialRight.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const expect = require('expect'); -const partialRight = require('./partialRight.js'); - -test('Testing partialRight', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof partialRight === 'function').toBeTruthy(); - function greet(greeting, name) { - return greeting + ' ' + name + '!'; - } - const greetJohn = partialRight(greet, 'John'); - expect(greetJohn('Hello')).toBe('Hello John!'); -}); diff --git a/test5/partition/partition.test.js b/test5/partition/partition.test.js deleted file mode 100644 index 968876650..000000000 --- a/test5/partition/partition.test.js +++ /dev/null @@ -1,12 +0,0 @@ -const expect = require('expect'); -const partition = require('./partition.js'); - -test('Testing partition', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof partition === 'function').toBeTruthy(); - const users = [{ user: 'barney', age: 36, active: false }, { user: 'fred', age: 40, active: true }]; - expect(partition(users, o => o.active)).toEqual( - [[{ 'user': 'fred', 'age': 40, 'active': true }],[{ 'user': 'barney', 'age': 36, 'active': false }]] - ); -}); \ No newline at end of file diff --git a/test5/percentile/percentile.test.js b/test5/percentile/percentile.test.js deleted file mode 100644 index af64d3032..000000000 --- a/test5/percentile/percentile.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const percentile = require('./percentile.js'); - -test('Testing percentile', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof percentile === 'function').toBeTruthy(); - expect(percentile([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 6)).toBe(55); -}); \ No newline at end of file diff --git a/test5/permutations/permutations.test.js b/test5/permutations/permutations.test.js deleted file mode 100644 index 9aa5fa4fb..000000000 --- a/test5/permutations/permutations.test.js +++ /dev/null @@ -1,11 +0,0 @@ -const expect = require('expect'); -const permutations = require('./permutations.js'); - -test('Testing permutations', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof permutations === 'function').toBeTruthy(); - 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/test5/pick/pick.test.js b/test5/pick/pick.test.js deleted file mode 100644 index 20f11cb4d..000000000 --- a/test5/pick/pick.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const pick = require('./pick.js'); - -test('Testing pick', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof pick === 'function').toBeTruthy(); - expect(pick({ a: 1, b: '2', c: 3 }, ['a', 'c'])).toEqual({ 'a': 1, 'c': 3 }); -}); \ No newline at end of file diff --git a/test5/pickBy/pickBy.test.js b/test5/pickBy/pickBy.test.js deleted file mode 100644 index 8c5620d33..000000000 --- a/test5/pickBy/pickBy.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const pickBy = require('./pickBy.js'); - -test('Testing pickBy', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof pickBy === 'function').toBeTruthy(); - expect(pickBy({ a: 1, b: '2', c: 3 }, x => typeof x === 'number')).toEqual({ 'a': 1, 'c': 3 }); -}); diff --git a/test5/pipeAsyncFunctions/pipeAsyncFunctions.test.js b/test5/pipeAsyncFunctions/pipeAsyncFunctions.test.js deleted file mode 100644 index 5724dec11..000000000 --- a/test5/pipeAsyncFunctions/pipeAsyncFunctions.test.js +++ /dev/null @@ -1,19 +0,0 @@ -const expect = require('expect'); -const pipeAsyncFunctions = require('./pipeAsyncFunctions.js'); - -test('Testing pipeAsyncFunctions', async () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof pipeAsyncFunctions === 'function').toBeTruthy(); - //t.deepEqual(pipeAsyncFunctions(args..), 'Expected'); - //t.equal(pipeAsyncFunctions(args..), 'Expected'); - //t.false(pipeAsyncFunctions(args..), 'Expected'); - //t.throws(pipeAsyncFunctions(args..), 'Expected'); - expect(await pipeAsyncFunctions( - (x) => x + 1, - (x) => new Promise((resolve) => setTimeout(() => resolve(x + 2), 0)), - (x) => x + 3, - async (x) => await x + 4, - ) - (5)).toBe(15); -}); \ No newline at end of file diff --git a/test5/pipeFunctions/pipeFunctions.test.js b/test5/pipeFunctions/pipeFunctions.test.js deleted file mode 100644 index b334a71ae..000000000 --- a/test5/pipeFunctions/pipeFunctions.test.js +++ /dev/null @@ -1,12 +0,0 @@ -const expect = require('expect'); -const pipeFunctions = require('./pipeFunctions.js'); - -test('Testing pipeFunctions', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof pipeFunctions === 'function').toBeTruthy(); - const add5 = x => x + 5; - const multiply = (x, y) => x * y; - const multiplyAndAdd5 = pipeFunctions(multiply, add5); - expect(multiplyAndAdd5(5, 2)).toBe(15); -}); diff --git a/test5/pluralize/pluralize.test.js b/test5/pluralize/pluralize.test.js deleted file mode 100644 index 4fafc2f10..000000000 --- a/test5/pluralize/pluralize.test.js +++ /dev/null @@ -1,18 +0,0 @@ -const expect = require('expect'); -const pluralize = require('./pluralize.js'); - -test('Testing pluralize', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof pluralize === 'function').toBeTruthy(); - expect(pluralize(0, 'apple')).toBe('apples'); - expect(pluralize(1, 'apple')).toBe('apple'); - expect(pluralize(2, 'apple')).toBe('apples'); - expect(pluralize(2, 'person', 'people')).toBe('people'); - const PLURALS = { - person: 'people', - radius: 'radii' - }; - const autoPluralize = pluralize(PLURALS); - expect(autoPluralize(2, 'person')).toBe('people'); -}); diff --git a/test5/powerset/powerset.test.js b/test5/powerset/powerset.test.js deleted file mode 100644 index 7413dedb8..000000000 --- a/test5/powerset/powerset.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const powerset = require('./powerset.js'); - -test('Testing powerset', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof powerset === 'function').toBeTruthy(); - expect(powerset([1, 2])).toEqual([[], [1], [2], [2,1]]); -}); \ No newline at end of file diff --git a/test5/prefix/prefix.test.js b/test5/prefix/prefix.test.js deleted file mode 100644 index c4f88eca6..000000000 --- a/test5/prefix/prefix.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const prefix = require('./prefix.js'); - -test('Testing prefix', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof prefix === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test5/prettyBytes/prettyBytes.test.js b/test5/prettyBytes/prettyBytes.test.js deleted file mode 100644 index a2cccd3a6..000000000 --- a/test5/prettyBytes/prettyBytes.test.js +++ /dev/null @@ -1,11 +0,0 @@ -const expect = require('expect'); -const prettyBytes = require('./prettyBytes.js'); - -test('Testing prettyBytes', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof prettyBytes === 'function').toBeTruthy(); - expect(prettyBytes(1000)).toBe('1 KB'); - expect(prettyBytes(-27145424323.5821, 5)).toBe('-27.145 GB'); - expect(prettyBytes(123456789, 3, false)).toBe('123MB'); -}); \ No newline at end of file diff --git a/test5/primes/primes.test.js b/test5/primes/primes.test.js deleted file mode 100644 index d0b4ae15c..000000000 --- a/test5/primes/primes.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const primes = require('./primes.js'); - -test('Testing primes', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof primes === 'function').toBeTruthy(); - expect(primes(10)).toEqual([2, 3, 5, 7]); -}); \ No newline at end of file diff --git a/test5/promisify/promisify.test.js b/test5/promisify/promisify.test.js deleted file mode 100644 index 145a8c004..000000000 --- a/test5/promisify/promisify.test.js +++ /dev/null @@ -1,12 +0,0 @@ -const expect = require('expect'); -const promisify = require('./promisify.js'); - -test('Testing promisify', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof promisify === 'function').toBeTruthy(); - const x = promisify(Math.max); - expect(x() instanceof Promise).toBeTruthy(); - const delay = promisify((d, cb) => setTimeout(cb, d)); - delay(200).then(() => ); -}); diff --git a/test5/pull/pull.test.js b/test5/pull/pull.test.js deleted file mode 100644 index f38d1c0bf..000000000 --- a/test5/pull/pull.test.js +++ /dev/null @@ -1,11 +0,0 @@ -const expect = require('expect'); -const pull = require('./pull.js'); - -test('Testing pull', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof pull === 'function').toBeTruthy(); - let myArray = ['a', 'b', 'c', 'a', 'b', 'c']; - pull(myArray, 'a', 'c'); - expect(myArray).toEqual(['b','b']); -}); diff --git a/test5/pullAtIndex/pullAtIndex.test.js b/test5/pullAtIndex/pullAtIndex.test.js deleted file mode 100644 index 9715d6c95..000000000 --- a/test5/pullAtIndex/pullAtIndex.test.js +++ /dev/null @@ -1,12 +0,0 @@ -const expect = require('expect'); -const pullAtIndex = require('./pullAtIndex.js'); - -test('Testing pullAtIndex', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof pullAtIndex === 'function').toBeTruthy(); - let myArray = ['a', 'b', 'c', 'd']; - let pulled = pullAtIndex(myArray, [1, 3]); - expect(myArray).toEqual([ 'a', 'c' ]); - expect(pulled).toEqual([ 'b', 'd' ]); -}); diff --git a/test5/pullAtValue/pullAtValue.test.js b/test5/pullAtValue/pullAtValue.test.js deleted file mode 100644 index b15a3baa4..000000000 --- a/test5/pullAtValue/pullAtValue.test.js +++ /dev/null @@ -1,12 +0,0 @@ -const expect = require('expect'); -const pullAtValue = require('./pullAtValue.js'); - -test('Testing pullAtValue', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof pullAtValue === 'function').toBeTruthy(); - let myArray = ['a', 'b', 'c', 'd']; - let pulled = pullAtValue(myArray, ['b', 'd']); - expect(myArray).toEqual([ 'a', 'c' ]); - expect(pulled).toEqual([ 'b', 'd' ]); -}); diff --git a/test5/pullBy/pullBy.test.js b/test5/pullBy/pullBy.test.js deleted file mode 100644 index 5b6f656d5..000000000 --- a/test5/pullBy/pullBy.test.js +++ /dev/null @@ -1,11 +0,0 @@ -const expect = require('expect'); -const pullBy = require('./pullBy.js'); - -test('Testing pullBy', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof pullBy === 'function').toBeTruthy(); - var myArray = [{ x: 1 }, { x: 2 }, { x: 3 }, { x: 1 }]; - pullBy(myArray, [{ x: 1 }, { x: 3 }], o => o.x); - expect(myArray).toEqual([{ x: 2 }]); -}); diff --git a/test5/quickSort/quickSort.test.js b/test5/quickSort/quickSort.test.js deleted file mode 100644 index 019749405..000000000 --- a/test5/quickSort/quickSort.test.js +++ /dev/null @@ -1,20 +0,0 @@ -const expect = require('expect'); -const quickSort = require('./quickSort.js'); - -test('Testing quickSort', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof quickSort === 'function').toBeTruthy(); - expect(quickSort([5, 6, 4, 3, 1, 2])).toEqual([1, 2, 3, 4, 5, 6]); - expect(quickSort([-1, 0, -2])).toEqual([-2, -1, 0]); - expect(() => quickSort()).toThrow(); - expect(() => quickSort(123)).toThrow(); - expect(() => quickSort({ 234: string})).toThrow(); - expect(() => quickSort(null)).toThrow(); - 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(); - expect((end - start) < 2000).toBeTruthy(); -}); diff --git a/test5/radsToDegrees/radsToDegrees.test.js b/test5/radsToDegrees/radsToDegrees.test.js deleted file mode 100644 index 4b492e176..000000000 --- a/test5/radsToDegrees/radsToDegrees.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const radsToDegrees = require('./radsToDegrees.js'); - -test('Testing radsToDegrees', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof radsToDegrees === 'function').toBeTruthy(); - expect(radsToDegrees(Math.PI / 2)).toBe(90); -}); diff --git a/test5/randomHexColorCode/randomHexColorCode.test.js b/test5/randomHexColorCode/randomHexColorCode.test.js deleted file mode 100644 index c2d92bf7c..000000000 --- a/test5/randomHexColorCode/randomHexColorCode.test.js +++ /dev/null @@ -1,12 +0,0 @@ -const expect = require('expect'); -const randomHexColorCode = require('./randomHexColorCode.js'); - -test('Testing randomHexColorCode', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof randomHexColorCode === 'function').toBeTruthy(); - //t.deepEqual(randomHexColorCode(args..), 'Expected'); - expect(randomHexColorCode().length).toBe(7); - expect(randomHexColorCode().startsWith('#')).toBeTruthy(); - expect(randomHexColorCode().slice(1).match(/[^0123456789abcdef]/i) === null).toBeTruthy(); -}); diff --git a/test5/readFileLines/readFileLines.test.js b/test5/readFileLines/readFileLines.test.js deleted file mode 100644 index 36813c5b5..000000000 --- a/test5/readFileLines/readFileLines.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const readFileLines = require('./readFileLines.js'); - -test('Testing readFileLines', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof readFileLines === 'function').toBeTruthy(); -}); diff --git a/test5/rearg/rearg.test.js b/test5/rearg/rearg.test.js deleted file mode 100644 index ce426c97c..000000000 --- a/test5/rearg/rearg.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const expect = require('expect'); -const rearg = require('./rearg.js'); - -test('Testing rearg', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof rearg === 'function').toBeTruthy(); - var rearged = rearg( - function(a, b, c) { - return [a, b, c]; - }, - [2, 0, 1] - ); - expect(rearged('b', 'c', 'a')).toEqual(['a', 'b', 'c']); -}); diff --git a/test5/recordAnimationFrames/recordAnimationFrames.test.js b/test5/recordAnimationFrames/recordAnimationFrames.test.js deleted file mode 100644 index 9c71212e5..000000000 --- a/test5/recordAnimationFrames/recordAnimationFrames.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const recordAnimationFrames = require('./recordAnimationFrames.js'); - -test('Testing recordAnimationFrames', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof recordAnimationFrames === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test5/redirect/redirect.test.js b/test5/redirect/redirect.test.js deleted file mode 100644 index d468f09ec..000000000 --- a/test5/redirect/redirect.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const redirect = require('./redirect.js'); - -test('Testing redirect', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof redirect === 'function').toBeTruthy(); -}); diff --git a/test5/reduceSuccessive/reduceSuccessive.test.js b/test5/reduceSuccessive/reduceSuccessive.test.js deleted file mode 100644 index 4bb7fada1..000000000 --- a/test5/reduceSuccessive/reduceSuccessive.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const reduceSuccessive = require('./reduceSuccessive.js'); - -test('Testing reduceSuccessive', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof reduceSuccessive === 'function').toBeTruthy(); - expect(reduceSuccessive([1, 2, 3, 4, 5, 6], (acc, val) => acc + val, 0)).toEqual([0, 1, 3, 6, 10, 15, 21]); -}); diff --git a/test5/reduceWhich/reduceWhich.test.js b/test5/reduceWhich/reduceWhich.test.js deleted file mode 100644 index 46b14797e..000000000 --- a/test5/reduceWhich/reduceWhich.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const expect = require('expect'); -const reduceWhich = require('./reduceWhich.js'); - -test('Testing reduceWhich', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof reduceWhich === 'function').toBeTruthy(); - expect(reduceWhich([1, 3, 2])).toBe(1); - expect(reduceWhich([1, 3, 2], (a, b) => b - a)).toBe(3); - expect(reduceWhich( - [{ name: 'Tom', age: 12 }, { name: 'Jack', age: 18 }, { name: 'Lucy', age: 9 }], - (a, b) => a.age - b.age -)).toEqual({name: "Lucy", age: 9}); -}); diff --git a/test5/reducedFilter/reducedFilter.test.js b/test5/reducedFilter/reducedFilter.test.js deleted file mode 100644 index a9f87d3e6..000000000 --- a/test5/reducedFilter/reducedFilter.test.js +++ /dev/null @@ -1,21 +0,0 @@ -const expect = require('expect'); -const reducedFilter = require('./reducedFilter.js'); - -test('Testing reducedFilter', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof reducedFilter === 'function').toBeTruthy(); - const data = [ - { - id: 1, - name: 'john', - age: 24 - }, - { - id: 2, - name: 'mike', - age: 50 - } - ]; - expect(reducedFilter(data, ['id', 'name'], item => item.age > 24)).toEqual([{ id: 2, name: 'mike'}]); -}); \ No newline at end of file diff --git a/test5/reject/reject.test.js b/test5/reject/reject.test.js deleted file mode 100644 index 525aaeab4..000000000 --- a/test5/reject/reject.test.js +++ /dev/null @@ -1,22 +0,0 @@ -const expect = require('expect'); -const reject = require('./reject.js'); - -test('Testing reject', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof reject === 'function').toBeTruthy(); - - const noEvens = reject( - (x) => x % 2 === 0, - [1, 2, 3, 4, 5] - ); - - expect(noEvens).toEqual([1, 3, 5]); - - const fourLettersOrLess = reject( - (word) => word.length > 4, - ['Apple', 'Pear', 'Kiwi', 'Banana'] - ); - - expect(fourLettersOrLess).toEqual(['Pear', 'Kiwi']); -}); diff --git a/test5/remove/remove.test.js b/test5/remove/remove.test.js deleted file mode 100644 index 235ec23ac..000000000 --- a/test5/remove/remove.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const remove = require('./remove.js'); - -test('Testing remove', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof remove === 'function').toBeTruthy(); - expect(remove([1, 2, 3, 4], n => n % 2 === 0)).toEqual([2, 4]); -}); diff --git a/test5/removeNonASCII/removeNonASCII.test.js b/test5/removeNonASCII/removeNonASCII.test.js deleted file mode 100644 index d0d22b435..000000000 --- a/test5/removeNonASCII/removeNonASCII.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const removeNonASCII = require('./removeNonASCII.js'); - -test('Testing removeNonASCII', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof removeNonASCII === 'function').toBeTruthy(); - expect(removeNonASCII('äÄçÇéÉêlorem-ipsumöÖÐþúÚ')).toBe('lorem-ipsum'); -}); diff --git a/test5/removeVowels/removeVowels.test.js b/test5/removeVowels/removeVowels.test.js deleted file mode 100644 index 79896ad4a..000000000 --- a/test5/removeVowels/removeVowels.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const removeVowels = require('./removeVowels.js'); - -test('Testing removeVowels', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof removeVowels === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test5/renameKeys/renameKeys.test.js b/test5/renameKeys/renameKeys.test.js deleted file mode 100644 index 553959820..000000000 --- a/test5/renameKeys/renameKeys.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const expect = require('expect'); -const renameKeys = require('./renameKeys.js'); - -test('Testing renameKeys', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof renameKeys === 'function').toBeTruthy(); - - const obj = { name: 'Bobo', job: 'Front-End Master', shoeSize: 100 }; - const renamedObj = renameKeys({ name: 'firstName', job: 'passion' }, obj); - - expect(renamedObj).toEqual({ firstName: 'Bobo', passion: 'Front-End Master', shoeSize: 100 }); -}); diff --git a/test5/reverseString/reverseString.test.js b/test5/reverseString/reverseString.test.js deleted file mode 100644 index 6891a2ca8..000000000 --- a/test5/reverseString/reverseString.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const reverseString = require('./reverseString.js'); - -test('Testing reverseString', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof reverseString === 'function').toBeTruthy(); - expect(reverseString('foobar')).toBe('raboof'); -}); \ No newline at end of file diff --git a/test5/round/round.test.js b/test5/round/round.test.js deleted file mode 100644 index 3dda04bfe..000000000 --- a/test5/round/round.test.js +++ /dev/null @@ -1,22 +0,0 @@ -const expect = require('expect'); -const round = require('./round.js'); - -test('Testing round', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof round === 'function').toBeTruthy(); - expect(round(1.005, 2)).toBe(1.01); - expect(round(123.3423345345345345344, 11)).toBe(123.34233453453); - expect(round(3.342, 11)).toBe(3.342); - expect(round(1.005)).toBe(1); - expect(isNaN(round([1.005, 2]))).toBeTruthy(); - expect(isNaN(round('string'))).toBeTruthy(); - expect(isNaN(round())).toBeTruthy(); - expect(isNaN(round(132, 413, 4134))).toBeTruthy(); - expect(isNaN(round({a: 132}, 413))).toBeTruthy(); - - let start = new Date().getTime(); - round(123.3423345345345345344, 11); - let end = new Date().getTime(); - expect((end - start) < 2000).toBeTruthy(); -}); diff --git a/test6/URLJoin/URLJoin.test.js b/test6/URLJoin/URLJoin.test.js deleted file mode 100644 index 203e39fa3..000000000 --- a/test6/URLJoin/URLJoin.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const URLJoin = require('./URLJoin.js'); - -test('Testing URLJoin', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof URLJoin === 'function').toBeTruthy(); - 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'); - 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/test6/UUIDGeneratorBrowser/UUIDGeneratorBrowser.test.js b/test6/UUIDGeneratorBrowser/UUIDGeneratorBrowser.test.js deleted file mode 100644 index 95bc482a7..000000000 --- a/test6/UUIDGeneratorBrowser/UUIDGeneratorBrowser.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const UUIDGeneratorBrowser = require('./UUIDGeneratorBrowser.js'); - -test('Testing UUIDGeneratorBrowser', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof UUIDGeneratorBrowser === 'function').toBeTruthy(); -}); diff --git a/test6/UUIDGeneratorNode/UUIDGeneratorNode.test.js b/test6/UUIDGeneratorNode/UUIDGeneratorNode.test.js deleted file mode 100644 index 1be773a7e..000000000 --- a/test6/UUIDGeneratorNode/UUIDGeneratorNode.test.js +++ /dev/null @@ -1,11 +0,0 @@ -const expect = require('expect'); -const UUIDGeneratorNode = require('./UUIDGeneratorNode.js'); - -test('Testing UUIDGeneratorNode', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof UUIDGeneratorNode === 'function').toBeTruthy(); - const uuid = UUIDGeneratorNode(); - expect([uuid[8], uuid[13], uuid[18], uuid[23]]).toEqual(['-', '-', '-', '-']); - expect(/^[0-9A-Fa-f-]+$/.test(uuid)).toBeTruthy(); -}); diff --git a/test6/runAsync/runAsync.test.js b/test6/runAsync/runAsync.test.js deleted file mode 100644 index 703f15186..000000000 --- a/test6/runAsync/runAsync.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const runAsync = require('./runAsync.js'); - -test('Testing runAsync', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof runAsync === 'function').toBeTruthy(); -}); diff --git a/test6/runPromisesInSeries/runPromisesInSeries.test.js b/test6/runPromisesInSeries/runPromisesInSeries.test.js deleted file mode 100644 index 51e937d2d..000000000 --- a/test6/runPromisesInSeries/runPromisesInSeries.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const runPromisesInSeries = require('./runPromisesInSeries.js'); - -test('Testing runPromisesInSeries', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof runPromisesInSeries === 'function').toBeTruthy(); - const delay = d => new Promise(r => setTimeout(r, d)); - runPromisesInSeries([() => delay(100), () => delay(200).then(() => )]); -}); diff --git a/test6/sample/sample.test.js b/test6/sample/sample.test.js deleted file mode 100644 index 11847222f..000000000 --- a/test6/sample/sample.test.js +++ /dev/null @@ -1,12 +0,0 @@ -const expect = require('expect'); -const sample = require('./sample.js'); - -test('Testing sample', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof sample === 'function').toBeTruthy(); - const arr = [3,7,9,11]; - expect(arr.includes(sample(arr))).toBeTruthy(); - expect(sample([1])).toBe(1); - expect(sample([])).toBe(undefined); -}); diff --git a/test6/sampleSize/sampleSize.test.js b/test6/sampleSize/sampleSize.test.js deleted file mode 100644 index e955495cf..000000000 --- a/test6/sampleSize/sampleSize.test.js +++ /dev/null @@ -1,14 +0,0 @@ -const expect = require('expect'); -const sampleSize = require('./sampleSize.js'); - -test('Testing sampleSize', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof sampleSize === 'function').toBeTruthy(); - const arr = [3,7,9,11]; - expect(sampleSize(arr).length).toBe(1); - expect(sampleSize(arr, 2).every(x => arr.includes(x))).toBeTruthy(); - expect(sampleSize(arr, 5).length).toBe(4); - expect(sampleSize([], 2)).toEqual([]); - expect(sampleSize(arr, 0)).toEqual([]); -}); diff --git a/test6/scrollToTop/scrollToTop.test.js b/test6/scrollToTop/scrollToTop.test.js deleted file mode 100644 index 2f0f8ec27..000000000 --- a/test6/scrollToTop/scrollToTop.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const scrollToTop = require('./scrollToTop.js'); - -test('Testing scrollToTop', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof scrollToTop === 'function').toBeTruthy(); -}); diff --git a/test6/sdbm/sdbm.test.js b/test6/sdbm/sdbm.test.js deleted file mode 100644 index 361581a59..000000000 --- a/test6/sdbm/sdbm.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const sdbm = require('./sdbm.js'); - -test('Testing sdbm', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof sdbm === 'function').toBeTruthy(); - expect(sdbm('name')).toBe(-3521204949); -}); \ No newline at end of file diff --git a/test6/serializeCookie/serializeCookie.test.js b/test6/serializeCookie/serializeCookie.test.js deleted file mode 100644 index 181b0d4c1..000000000 --- a/test6/serializeCookie/serializeCookie.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const serializeCookie = require('./serializeCookie.js'); - -test('Testing serializeCookie', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof serializeCookie === 'function').toBeTruthy(); - expect(serializeCookie('foo', 'bar')).toBe('foo=bar'); -}); diff --git a/test6/setStyle/setStyle.test.js b/test6/setStyle/setStyle.test.js deleted file mode 100644 index 395bb5621..000000000 --- a/test6/setStyle/setStyle.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const setStyle = require('./setStyle.js'); - -test('Testing setStyle', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof setStyle === 'function').toBeTruthy(); -}); diff --git a/test6/shallowClone/shallowClone.test.js b/test6/shallowClone/shallowClone.test.js deleted file mode 100644 index 6d6d64666..000000000 --- a/test6/shallowClone/shallowClone.test.js +++ /dev/null @@ -1,12 +0,0 @@ -const expect = require('expect'); -const shallowClone = require('./shallowClone.js'); - -test('Testing shallowClone', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof shallowClone === 'function').toBeTruthy(); - const a = { foo: 'bar', obj: { a: 1, b: 2 } }; - const b = shallowClone(a); - expect(a).not.toBe(b); - expect(a.obj).toBe(b.obj); -}); diff --git a/test6/show/show.test.js b/test6/show/show.test.js deleted file mode 100644 index 11113916a..000000000 --- a/test6/show/show.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const show = require('./show.js'); - -test('Testing show', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof show === 'function').toBeTruthy(); -}); diff --git a/test6/shuffle/shuffle.test.js b/test6/shuffle/shuffle.test.js deleted file mode 100644 index 56c472359..000000000 --- a/test6/shuffle/shuffle.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const expect = require('expect'); -const shuffle = require('./shuffle.js'); - -test('Testing shuffle', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof shuffle === 'function').toBeTruthy(); - const arr = [1,2,3,4,5,6]; - expect(shuffle(arr)).not.toBe(arr); - expect(shuffle(arr).every(x => arr.includes(x))).toBeTruthy(); - expect(shuffle([])).toEqual([]); - expect(shuffle([1])).toEqual([1]); -}); diff --git a/test6/similarity/similarity.test.js b/test6/similarity/similarity.test.js deleted file mode 100644 index 2de50178f..000000000 --- a/test6/similarity/similarity.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const similarity = require('./similarity.js'); - -test('Testing similarity', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof similarity === 'function').toBeTruthy(); - expect(similarity([1, 2, 3], [1, 2, 4])).toEqual([1, 2]); //t.equal(similarity(args..), 'Expected'); -}); \ No newline at end of file diff --git a/test6/size/size.test.js b/test6/size/size.test.js deleted file mode 100644 index b35037e1a..000000000 --- a/test6/size/size.test.js +++ /dev/null @@ -1,11 +0,0 @@ -const expect = require('expect'); -const size = require('./size.js'); - -test('Testing size', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof size === 'function').toBeTruthy(); - expect(size([1, 2, 3, 4, 5])).toBe(5); - // t.equal(size('size'), 4, "Get size of arrays, objects or strings."); DOESN'T WORK IN NODE ENV - expect(size({ one: 1, two: 2, three: 3 })).toBe(3); -}); \ No newline at end of file diff --git a/test6/sleep/sleep.test.js b/test6/sleep/sleep.test.js deleted file mode 100644 index 72c1abf06..000000000 --- a/test6/sleep/sleep.test.js +++ /dev/null @@ -1,11 +0,0 @@ -const expect = require('expect'); -const sleep = require('./sleep.js'); - -test('Testing sleep', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof sleep === 'function').toBeTruthy(); - async function sleepyWork() { - await sleep(1000); - } -}); diff --git a/test6/smoothScroll/smoothScroll.test.js b/test6/smoothScroll/smoothScroll.test.js deleted file mode 100644 index f5475db0e..000000000 --- a/test6/smoothScroll/smoothScroll.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const smoothScroll = require('./smoothScroll.js'); - -test('Testing smoothScroll', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof smoothScroll === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test6/solveRPN/solveRPN.test.js b/test6/solveRPN/solveRPN.test.js deleted file mode 100644 index f2c2420de..000000000 --- a/test6/solveRPN/solveRPN.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const solveRPN = require('./solveRPN.js'); - -test('Testing solveRPN', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof solveRPN === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test6/sortCharactersInString/sortCharactersInString.test.js b/test6/sortCharactersInString/sortCharactersInString.test.js deleted file mode 100644 index ab0ab6e1d..000000000 --- a/test6/sortCharactersInString/sortCharactersInString.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const sortCharactersInString = require('./sortCharactersInString.js'); - -test('Testing sortCharactersInString', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof sortCharactersInString === 'function').toBeTruthy(); - expect(sortCharactersInString('cabbage')).toBe('aabbceg'); -}); \ No newline at end of file diff --git a/test6/sortedIndex/sortedIndex.test.js b/test6/sortedIndex/sortedIndex.test.js deleted file mode 100644 index 06af95ed1..000000000 --- a/test6/sortedIndex/sortedIndex.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const sortedIndex = require('./sortedIndex.js'); - -test('Testing sortedIndex', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof sortedIndex === 'function').toBeTruthy(); - expect(sortedIndex([5, 3, 2, 1], 4)).toBe(1); - expect(sortedIndex([30, 50], 40)).toBe(1); -}); \ No newline at end of file diff --git a/test6/sortedIndexBy/sortedIndexBy.test.js b/test6/sortedIndexBy/sortedIndexBy.test.js deleted file mode 100644 index dede4bfdd..000000000 --- a/test6/sortedIndexBy/sortedIndexBy.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const sortedIndexBy = require('./sortedIndexBy.js'); - -test('Testing sortedIndexBy', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof sortedIndexBy === 'function').toBeTruthy(); - expect(sortedIndexBy([{ x: 4 }, { x: 5 }], { x: 4 }, o => o.x)).toBe(0); -}); diff --git a/test6/sortedLastIndex/sortedLastIndex.test.js b/test6/sortedLastIndex/sortedLastIndex.test.js deleted file mode 100644 index 7ceb05736..000000000 --- a/test6/sortedLastIndex/sortedLastIndex.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const sortedLastIndex = require('./sortedLastIndex.js'); - -test('Testing sortedLastIndex', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof sortedLastIndex === 'function').toBeTruthy(); - expect(sortedLastIndex([10, 20, 30, 30, 40], 30)).toBe(4); -}); diff --git a/test6/sortedLastIndexBy/sortedLastIndexBy.test.js b/test6/sortedLastIndexBy/sortedLastIndexBy.test.js deleted file mode 100644 index ec71c7f4b..000000000 --- a/test6/sortedLastIndexBy/sortedLastIndexBy.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const sortedLastIndexBy = require('./sortedLastIndexBy.js'); - -test('Testing sortedLastIndexBy', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof sortedLastIndexBy === 'function').toBeTruthy(); - expect(sortedLastIndexBy([{ x: 4 }, { x: 5 }], { x: 4 }, o => o.x)).toBe(1); -}); diff --git a/test6/speechSynthesis/speechSynthesis.test.js b/test6/speechSynthesis/speechSynthesis.test.js deleted file mode 100644 index 7546f1972..000000000 --- a/test6/speechSynthesis/speechSynthesis.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const speechSynthesis = require('./speechSynthesis.js'); - -test('Testing speechSynthesis', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof speechSynthesis === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test6/splitLines/splitLines.test.js b/test6/splitLines/splitLines.test.js deleted file mode 100644 index bbeb1c5d8..000000000 --- a/test6/splitLines/splitLines.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const splitLines = require('./splitLines.js'); - -test('Testing splitLines', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof splitLines === 'function').toBeTruthy(); - expect(splitLines('This\nis a\nmultiline\nstring.\n')).toEqual(['This', 'is a', 'multiline', 'string.' , '']); -}); \ No newline at end of file diff --git a/test6/spreadOver/spreadOver.test.js b/test6/spreadOver/spreadOver.test.js deleted file mode 100644 index e198d4c70..000000000 --- a/test6/spreadOver/spreadOver.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const spreadOver = require('./spreadOver.js'); - -test('Testing spreadOver', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof spreadOver === 'function').toBeTruthy(); - const arrayMax = spreadOver(Math.max); - expect(arrayMax([1, 2, 3])).toBe(3); -}); \ No newline at end of file diff --git a/test6/stableSort/stableSort.test.js b/test6/stableSort/stableSort.test.js deleted file mode 100644 index 1915459ea..000000000 --- a/test6/stableSort/stableSort.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const expect = require('expect'); -const stableSort = require('./stableSort.js'); - -test('Testing stableSort', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof stableSort === 'function').toBeTruthy(); - //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; - expect(stableSort(arr, compare)).toEqual(arr); -}); diff --git a/test6/standardDeviation/standardDeviation.test.js b/test6/standardDeviation/standardDeviation.test.js deleted file mode 100644 index 0708aff3a..000000000 --- a/test6/standardDeviation/standardDeviation.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const standardDeviation = require('./standardDeviation.js'); - -test('Testing standardDeviation', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof standardDeviation === 'function').toBeTruthy(); - expect(standardDeviation([10, 2, 38, 23, 38, 23, 21])).toBe(13.284434142114991); - expect(standardDeviation([10, 2, 38, 23, 38, 23, 21], true)).toBe(12.29899614287479); -}); \ No newline at end of file diff --git a/test6/stringPermutations/stringPermutations.test.js b/test6/stringPermutations/stringPermutations.test.js deleted file mode 100644 index 85c645ee3..000000000 --- a/test6/stringPermutations/stringPermutations.test.js +++ /dev/null @@ -1,11 +0,0 @@ -const expect = require('expect'); -const stringPermutations = require('./stringPermutations.js'); - -test('Testing stringPermutations', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof stringPermutations === 'function').toBeTruthy(); - expect(stringPermutations('abc')).toEqual(['abc','acb','bac','bca','cab','cba']); - expect(stringPermutations('a')).toEqual(['a']); - expect(stringPermutations('')).toEqual(['']); -}); diff --git a/test6/stripHTMLTags/stripHTMLTags.test.js b/test6/stripHTMLTags/stripHTMLTags.test.js deleted file mode 100644 index e3c59163f..000000000 --- a/test6/stripHTMLTags/stripHTMLTags.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const stripHTMLTags = require('./stripHTMLTags.js'); - -test('Testing stripHTMLTags', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof stripHTMLTags === 'function').toBeTruthy(); - expect(stripHTMLTags('

lorem ipsum


')).toBe('lorem ipsum'); -}); diff --git a/test6/sum/sum.test.js b/test6/sum/sum.test.js deleted file mode 100644 index 07b5cafc1..000000000 --- a/test6/sum/sum.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const sum = require('./sum.js'); - -test('Testing sum', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof sum === 'function').toBeTruthy(); - expect(sum(...[1, 2, 3, 4])).toBe(10); -}); \ No newline at end of file diff --git a/test6/sumBy/sumBy.test.js b/test6/sumBy/sumBy.test.js deleted file mode 100644 index 390699e6a..000000000 --- a/test6/sumBy/sumBy.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const sumBy = require('./sumBy.js'); - -test('Testing sumBy', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof sumBy === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test6/sumPower/sumPower.test.js b/test6/sumPower/sumPower.test.js deleted file mode 100644 index 684c57bc5..000000000 --- a/test6/sumPower/sumPower.test.js +++ /dev/null @@ -1,11 +0,0 @@ -const expect = require('expect'); -const sumPower = require('./sumPower.js'); - -test('Testing sumPower', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof sumPower === 'function').toBeTruthy(); - expect(sumPower(10)).toBe(385); - expect(sumPower(10, 3)).toBe(3025); - expect(sumPower(10, 3, 5)).toBe(2925); -}); \ No newline at end of file diff --git a/test6/symmetricDifference/symmetricDifference.test.js b/test6/symmetricDifference/symmetricDifference.test.js deleted file mode 100644 index 62c87aed3..000000000 --- a/test6/symmetricDifference/symmetricDifference.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const symmetricDifference = require('./symmetricDifference.js'); - -test('Testing symmetricDifference', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof symmetricDifference === 'function').toBeTruthy(); - expect(symmetricDifference([1, 2, 3], [1, 2, 4])).toEqual([3, 4]); -}); \ No newline at end of file diff --git a/test6/symmetricDifferenceBy/symmetricDifferenceBy.test.js b/test6/symmetricDifferenceBy/symmetricDifferenceBy.test.js deleted file mode 100644 index 537e68858..000000000 --- a/test6/symmetricDifferenceBy/symmetricDifferenceBy.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const symmetricDifferenceBy = require('./symmetricDifferenceBy.js'); - -test('Testing symmetricDifferenceBy', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof symmetricDifferenceBy === 'function').toBeTruthy(); - expect(symmetricDifferenceBy([2.1, 1.2], [2.3, 3.4], Math.floor)).toEqual([ 1.2, 3.4 ]); -}); diff --git a/test6/symmetricDifferenceWith/symmetricDifferenceWith.test.js b/test6/symmetricDifferenceWith/symmetricDifferenceWith.test.js deleted file mode 100644 index db58684a5..000000000 --- a/test6/symmetricDifferenceWith/symmetricDifferenceWith.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const expect = require('expect'); -const symmetricDifferenceWith = require('./symmetricDifferenceWith.js'); - -test('Testing symmetricDifferenceWith', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof symmetricDifferenceWith === 'function').toBeTruthy(); - expect(symmetricDifferenceWith( - [1, 1.2, 1.5, 3, 0], - [1.9, 3, 0, 3.9], - (a, b) => Math.round(a) === Math.round(b) -)).toEqual([1, 1.2, 3.9]); -}); diff --git a/test6/tail/tail.test.js b/test6/tail/tail.test.js deleted file mode 100644 index 198cdd6e9..000000000 --- a/test6/tail/tail.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const tail = require('./tail.js'); - -test('Testing tail', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof tail === 'function').toBeTruthy(); - expect(tail([1, 2, 3])).toEqual([2, 3]); - expect(tail([1])).toEqual([1]); -}); \ No newline at end of file diff --git a/test6/take/take.test.js b/test6/take/take.test.js deleted file mode 100644 index 52938149d..000000000 --- a/test6/take/take.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const take = require('./take.js'); - -test('Testing take', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof take === 'function').toBeTruthy(); - expect(take([1, 2, 3], 5)).toEqual([1, 2, 3]); - expect(take([1, 2, 3], 0)).toEqual([]); -}); diff --git a/test6/takeRight/takeRight.test.js b/test6/takeRight/takeRight.test.js deleted file mode 100644 index 3181ac032..000000000 --- a/test6/takeRight/takeRight.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const takeRight = require('./takeRight.js'); - -test('Testing takeRight', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof takeRight === 'function').toBeTruthy(); - expect(takeRight([1, 2, 3], 2)).toEqual([2, 3]); - expect(takeRight([1, 2, 3])).toEqual([3]); -}); \ No newline at end of file diff --git a/test6/takeRightWhile/takeRightWhile.test.js b/test6/takeRightWhile/takeRightWhile.test.js deleted file mode 100644 index 8adfeba6a..000000000 --- a/test6/takeRightWhile/takeRightWhile.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const takeRightWhile = require('./takeRightWhile.js'); - -test('Testing takeRightWhile', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof takeRightWhile === 'function').toBeTruthy(); - expect(takeRightWhile([1, 2, 3, 4], n => n < 3)).toEqual([3, 4]); -}); diff --git a/test6/takeWhile/takeWhile.test.js b/test6/takeWhile/takeWhile.test.js deleted file mode 100644 index 267e27bc2..000000000 --- a/test6/takeWhile/takeWhile.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const takeWhile = require('./takeWhile.js'); - -test('Testing takeWhile', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof takeWhile === 'function').toBeTruthy(); - expect(takeWhile([1, 2, 3, 4], n => n >= 3)).toEqual([1, 2]); -}); diff --git a/test6/throttle/throttle.test.js b/test6/throttle/throttle.test.js deleted file mode 100644 index 9335ed791..000000000 --- a/test6/throttle/throttle.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const throttle = require('./throttle.js'); - -test('Testing throttle', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof throttle === 'function').toBeTruthy(); -}); diff --git a/test6/timeTaken/timeTaken.test.js b/test6/timeTaken/timeTaken.test.js deleted file mode 100644 index 8105b99e7..000000000 --- a/test6/timeTaken/timeTaken.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const timeTaken = require('./timeTaken.js'); - -test('Testing timeTaken', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof timeTaken === 'function').toBeTruthy(); -}); diff --git a/test6/times/times.test.js b/test6/times/times.test.js deleted file mode 100644 index 0bd27bb8d..000000000 --- a/test6/times/times.test.js +++ /dev/null @@ -1,11 +0,0 @@ -const expect = require('expect'); -const times = require('./times.js'); - -test('Testing times', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof times === 'function').toBeTruthy(); - var output = ''; - times(5, i => (output += i)); - expect(output).toBe('01234'); -}); diff --git a/test6/toCamelCase/toCamelCase.test.js b/test6/toCamelCase/toCamelCase.test.js deleted file mode 100644 index 44ed8eee7..000000000 --- a/test6/toCamelCase/toCamelCase.test.js +++ /dev/null @@ -1,21 +0,0 @@ -const expect = require('expect'); -const toCamelCase = require('./toCamelCase.js'); - -test('Testing toCamelCase', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof toCamelCase === 'function').toBeTruthy(); - expect(toCamelCase('some_database_field_name')).toBe('someDatabaseFieldName'); - expect(toCamelCase('Some label that needs to be camelized')).toBe('someLabelThatNeedsToBeCamelized'); - expect(toCamelCase('some-javascript-property')).toBe('someJavascriptProperty'); - expect(toCamelCase('some-mixed_string with spaces_underscores-and-hyphens')).toBe('someMixedStringWithSpacesUnderscoresAndHyphens'); - expect(() => toCamelCase()).toThrow(); - expect(() => toCamelCase([])).toThrow(); - expect(() => toCamelCase({})).toThrow(); - expect(() => toCamelCase(123)).toThrow(); - - let start = new Date().getTime(); - toCamelCase('some-mixed_string with spaces_underscores-and-hyphens'); - let end = new Date().getTime(); - expect((end - start) < 2000).toBeTruthy(); -}); diff --git a/test6/toCurrency/toCurrency.test.js b/test6/toCurrency/toCurrency.test.js deleted file mode 100644 index 094796e01..000000000 --- a/test6/toCurrency/toCurrency.test.js +++ /dev/null @@ -1,12 +0,0 @@ -const expect = require('expect'); -const toCurrency = require('./toCurrency.js'); - -test('Testing toCurrency', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof toCurrency === 'function').toBeTruthy(); - expect(toCurrency(123456.789, 'EUR')).toBe('€ 123,456.79'); - expect(toCurrency(123456.789, 'USD', 'en-us')).toBe('$123,456.79'); - //t.equal(toCurrency(123456.789, 'USD', 'fa'), '۱۲۳٬۴۵۶٫۷۹ ؜$', 'currency: US Dollar | currencyLangFormat: Farsi'); - These break in node - expect(toCurrency(322342436423.2435, 'JPY')).toBe('JP¥ 322,342,436,423'); -}); diff --git a/test6/toDecimalMark/toDecimalMark.test.js b/test6/toDecimalMark/toDecimalMark.test.js deleted file mode 100644 index ccd255818..000000000 --- a/test6/toDecimalMark/toDecimalMark.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const toDecimalMark = require('./toDecimalMark.js'); - -test('Testing toDecimalMark', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof toDecimalMark === 'function').toBeTruthy(); - expect(toDecimalMark(12305030388.9087)).toBe("12,305,030,388.909"); -}); \ No newline at end of file diff --git a/test6/toHash/toHash.test.js b/test6/toHash/toHash.test.js deleted file mode 100644 index 13d1b12ca..000000000 --- a/test6/toHash/toHash.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const toHash = require('./toHash.js'); - -test('Testing toHash', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof toHash === 'function').toBeTruthy(); -}); \ No newline at end of file diff --git a/test6/toKebabCase/toKebabCase.test.js b/test6/toKebabCase/toKebabCase.test.js deleted file mode 100644 index df6540382..000000000 --- a/test6/toKebabCase/toKebabCase.test.js +++ /dev/null @@ -1,25 +0,0 @@ -const expect = require('expect'); -const toKebabCase = require('./toKebabCase.js'); - -test('Testing toKebabCase', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof toKebabCase === 'function').toBeTruthy(); - expect(toKebabCase('camelCase')).toBe('camel-case'); - expect(toKebabCase('some text')).toBe('some-text'); - expect(toKebabCase('some-mixed-string With spaces-underscores-and-hyphens')).toBe('some-mixed-string-with-spaces-underscores-and-hyphens'); - expect( - toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') - ).toBe( - 'i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html' - ); - expect(toKebabCase()).toBe(undefined); - expect(() => toKebabCase([])).toThrow(); - expect(() => toKebabCase({})).toThrow(); - expect(() => toKebabCase(123)).toThrow(); - - let start = new Date().getTime(); - toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML'); - let end = new Date().getTime(); - expect((end - start) < 2000).toBeTruthy(); -}); diff --git a/test6/toOrdinalSuffix/toOrdinalSuffix.test.js b/test6/toOrdinalSuffix/toOrdinalSuffix.test.js deleted file mode 100644 index 03456a4a1..000000000 --- a/test6/toOrdinalSuffix/toOrdinalSuffix.test.js +++ /dev/null @@ -1,12 +0,0 @@ -const expect = require('expect'); -const toOrdinalSuffix = require('./toOrdinalSuffix.js'); - -test('Testing toOrdinalSuffix', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof toOrdinalSuffix === 'function').toBeTruthy(); - expect(toOrdinalSuffix('123')).toBe('123rd'); - expect(toOrdinalSuffix(5)).toBe('5th'); - expect(toOrdinalSuffix(1)).toBe('1st'); - expect(toOrdinalSuffix(0)).toBe('0th'); -}); \ No newline at end of file diff --git a/test6/toSafeInteger/toSafeInteger.test.js b/test6/toSafeInteger/toSafeInteger.test.js deleted file mode 100644 index 82662b13b..000000000 --- a/test6/toSafeInteger/toSafeInteger.test.js +++ /dev/null @@ -1,23 +0,0 @@ -const expect = require('expect'); -const toSafeInteger = require('./toSafeInteger.js'); - -test('Testing toSafeInteger', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof toSafeInteger === 'function').toBeTruthy(); - expect(Number(toSafeInteger(3.2))).toBeTruthy(); - expect(toSafeInteger(3.2)).toBe(3); - expect(toSafeInteger('4.2')).toBe(4); - expect(toSafeInteger(4.6)).toBe(5); - expect(toSafeInteger([])).toBe(0); - expect(isNaN(toSafeInteger([1.5, 3124]))).toBeTruthy(); - expect(isNaN(toSafeInteger('string'))).toBeTruthy(); - expect(isNaN(toSafeInteger({}))).toBeTruthy(); - expect(isNaN(toSafeInteger())).toBeTruthy(); - expect(toSafeInteger(Infinity)).toBe(9007199254740991); - - let start = new Date().getTime(); - toSafeInteger(3.2); - let end = new Date().getTime(); - expect((end - start) < 2000).toBeTruthy(); -}); diff --git a/test6/toSnakeCase/toSnakeCase.test.js b/test6/toSnakeCase/toSnakeCase.test.js deleted file mode 100644 index 42bd32fe2..000000000 --- a/test6/toSnakeCase/toSnakeCase.test.js +++ /dev/null @@ -1,25 +0,0 @@ -const expect = require('expect'); -const toSnakeCase = require('./toSnakeCase.js'); - -test('Testing toSnakeCase', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof toSnakeCase === 'function').toBeTruthy(); - expect(toSnakeCase('camelCase')).toBe('camel_case'); - expect(toSnakeCase('some text')).toBe('some_text'); - expect(toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens')).toBe('some_mixed_string_with_spaces_underscores_and_hyphens'); - expect( - toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') - ).toBe( - 'i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html' - ); - expect(toSnakeCase()).toBe(undefined); - expect(() => toSnakeCase([])).toThrow(); - expect(() => toSnakeCase({})).toThrow(); - expect(() => toSnakeCase(123)).toThrow(); - - let start = new Date().getTime(); - toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML'); - let end = new Date().getTime(); - expect((end - start) < 2000).toBeTruthy(); -}); diff --git a/test6/toggleClass/toggleClass.test.js b/test6/toggleClass/toggleClass.test.js deleted file mode 100644 index ed3488b5b..000000000 --- a/test6/toggleClass/toggleClass.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const toggleClass = require('./toggleClass.js'); - -test('Testing toggleClass', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof toggleClass === 'function').toBeTruthy(); -}); diff --git a/test6/tomorrow/tomorrow.test.js b/test6/tomorrow/tomorrow.test.js deleted file mode 100644 index ce4b5dddc..000000000 --- a/test6/tomorrow/tomorrow.test.js +++ /dev/null @@ -1,13 +0,0 @@ -const expect = require('expect'); -const tomorrow = require('./tomorrow.js'); - -test('Testing tomorrow', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof tomorrow === 'function').toBeTruthy(); - const t1 = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate() + 1); - const t2 = new Date(tomorrow()); - expect(t1.getFullYear()).toBe(t2.getFullYear()); - expect(t1.getMonth()).toBe(t2.getMonth()); - expect(t1.getDate()).toBe(t2.getDate()); -}); diff --git a/test6/transform/transform.test.js b/test6/transform/transform.test.js deleted file mode 100644 index c53499392..000000000 --- a/test6/transform/transform.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const expect = require('expect'); -const transform = require('./transform.js'); - -test('Testing transform', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof transform === 'function').toBeTruthy(); - expect(transform( - { a: 1, b: 2, c: 1 }, - (r, v, k) => { - (r[v] || (r[v] = [])).push(k); - return r; - }, - {} -)).toEqual({ '1': ['a', 'c'], '2': ['b'] }); -}); diff --git a/test6/truncateString/truncateString.test.js b/test6/truncateString/truncateString.test.js deleted file mode 100644 index fa9506bee..000000000 --- a/test6/truncateString/truncateString.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const truncateString = require('./truncateString.js'); - -test('Testing truncateString', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof truncateString === 'function').toBeTruthy(); - expect(truncateString('boomerang', 7)).toBe('boom...'); -}); \ No newline at end of file diff --git a/test6/truthCheckCollection/truthCheckCollection.test.js b/test6/truthCheckCollection/truthCheckCollection.test.js deleted file mode 100644 index 7df47434b..000000000 --- a/test6/truthCheckCollection/truthCheckCollection.test.js +++ /dev/null @@ -1,11 +0,0 @@ -const expect = require('expect'); -const truthCheckCollection = require('./truthCheckCollection.js'); - -test('Testing truthCheckCollection', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof truthCheckCollection === 'function').toBeTruthy(); - expect( - truthCheckCollection([{ user: 'Tinky-Winky', sex: 'male' }, { user: 'Dipsy', sex: 'male' }], 'sex') - ).toBe(true); -}); \ No newline at end of file diff --git a/test6/unary/unary.test.js b/test6/unary/unary.test.js deleted file mode 100644 index 0b62e983f..000000000 --- a/test6/unary/unary.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const unary = require('./unary.js'); - -test('Testing unary', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof unary === 'function').toBeTruthy(); - expect(['6', '8', '10'].map(unary(parseInt))).toEqual([6, 8, 10]); -}); diff --git a/test6/uncurry/uncurry.test.js b/test6/uncurry/uncurry.test.js deleted file mode 100644 index 72fa6bd80..000000000 --- a/test6/uncurry/uncurry.test.js +++ /dev/null @@ -1,15 +0,0 @@ -const expect = require('expect'); -const uncurry = require('./uncurry.js'); - -test('Testing uncurry', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof uncurry === 'function').toBeTruthy(); - const add = x => y => z => x + y + z; - const add1 = uncurry(add); - const add2 = uncurry(add, 2); - const add3 = uncurry(add, 3); - expect(add1(1)(2)(3)).toBe(6); - expect(add2(1,2)(3)).toBe(6); - expect(add3(1,2,3)).toBe(6); -}); diff --git a/test6/unescapeHTML/unescapeHTML.test.js b/test6/unescapeHTML/unescapeHTML.test.js deleted file mode 100644 index d1c7417a6..000000000 --- a/test6/unescapeHTML/unescapeHTML.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const unescapeHTML = require('./unescapeHTML.js'); - -test('Testing unescapeHTML', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof unescapeHTML === 'function').toBeTruthy(); - expect(unescapeHTML('<a href="#">Me & you</a>')).toBe('Me & you'); -}); \ No newline at end of file diff --git a/test6/unflattenObject/unflattenObject.test.js b/test6/unflattenObject/unflattenObject.test.js deleted file mode 100644 index 48975c4a0..000000000 --- a/test6/unflattenObject/unflattenObject.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const unflattenObject = require('./unflattenObject.js'); - -test('Testing unflattenObject', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof unflattenObject === 'function').toBeTruthy(); - expect(unflattenObject({ 'a.b.c': 1, d: 1 })).toEqual({ a: { b: { c: 1 } }, d: 1 }); -}); diff --git a/test6/unfold/unfold.test.js b/test6/unfold/unfold.test.js deleted file mode 100644 index 08dd245d5..000000000 --- a/test6/unfold/unfold.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const unfold = require('./unfold.js'); - -test('Testing unfold', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof unfold === 'function').toBeTruthy(); - var f = n => (n > 50 ? false : [-n, n + 10]); - expect(unfold(f, 10)).toEqual([-10, -20, -30, -40, -50]); -}); diff --git a/test6/union/union.test.js b/test6/union/union.test.js deleted file mode 100644 index a49ba0af5..000000000 --- a/test6/union/union.test.js +++ /dev/null @@ -1,23 +0,0 @@ -const expect = require('expect'); -const union = require('./union.js'); - -test('Testing union', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof union === 'function').toBeTruthy(); - expect(union([1, 2, 3], [4, 3, 2])).toEqual([1, 2, 3, 4]); - expect(union('str', 'asd')).toEqual([ 's', 't', 'r', 'a', 'd' ]); - expect(union([[], {}], [1, 2, 3])).toEqual([[], {}, 1, 2, 3]); - expect(union([], [])).toEqual([]); - expect(() => union()).toThrow(); - expect(() => union(true, 'str')).toThrow(); - expect(() => union('false', true)).toThrow(); - expect(() => union(123, {})).toThrow(); - expect(() => union([], {})).toThrow(); - expect(() => union(undefined, null)).toThrow(); - - let start = new Date().getTime(); - union([1, 2, 3], [4, 3, 2]); - let end = new Date().getTime(); - expect((end - start) < 2000).toBeTruthy(); -}); diff --git a/test6/unionBy/unionBy.test.js b/test6/unionBy/unionBy.test.js deleted file mode 100644 index 730f9d05a..000000000 --- a/test6/unionBy/unionBy.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const unionBy = require('./unionBy.js'); - -test('Testing unionBy', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof unionBy === 'function').toBeTruthy(); - expect(unionBy([2.1], [1.2, 2.3], Math.floor)).toEqual([2.1, 1.2]); -}); diff --git a/test6/unionWith/unionWith.test.js b/test6/unionWith/unionWith.test.js deleted file mode 100644 index f6d69956e..000000000 --- a/test6/unionWith/unionWith.test.js +++ /dev/null @@ -1,11 +0,0 @@ -const expect = require('expect'); -const unionWith = require('./unionWith.js'); - -test('Testing unionWith', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof unionWith === 'function').toBeTruthy(); - expect( - unionWith([1, 1.2, 1.5, 3, 0], [1.9, 3, 0, 3.9], (a, b) => Math.round(a) === Math.round(b)) - ).toEqual([1, 1.2, 1.5, 3, 0, 3.9]); -}); diff --git a/test6/uniqueElements/uniqueElements.test.js b/test6/uniqueElements/uniqueElements.test.js deleted file mode 100644 index ca9a46bfe..000000000 --- a/test6/uniqueElements/uniqueElements.test.js +++ /dev/null @@ -1,26 +0,0 @@ -const expect = require('expect'); -const uniqueElements = require('./uniqueElements.js'); - -test('Testing uniqueElements', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof uniqueElements === 'function').toBeTruthy(); - expect(uniqueElements([1, 2, 2, 3, 4, 4, 5])).toEqual([1,2,3,4,5]); - expect(uniqueElements([1, 23, 53])).toEqual([1, 23, 53]); - expect(uniqueElements([true, 0, 1, false, false, undefined, null, ''])).toEqual([true, 0, 1, false, undefined, null, '']); - expect(uniqueElements()).toEqual([]); - expect(uniqueElements(null)).toEqual([]); - expect(uniqueElements(undefined)).toEqual([]); - expect(uniqueElements('strt')).toEqual(['s', 't', 'r']); - expect(() => uniqueElements(1, 1, 2543, 534, 5)).toThrow(); - expect(() => uniqueElements({})).toThrow(); - expect(() => uniqueElements(true)).toThrow(); - expect(() => uniqueElements(false)).toThrow(); - - let start = new Date().getTime(); - uniqueElements([true, 0, 1, false, false, undefined, null, '']); - let end = new Date().getTime(); - expect((end - start) < 2000).toBeTruthy(); -}); - -uniqueElements([1, 2, 2, '1', 4, 4, 4, 5, true]); // [1,2,3,4,5] diff --git a/test6/untildify/untildify.test.js b/test6/untildify/untildify.test.js deleted file mode 100644 index cbad74b6b..000000000 --- a/test6/untildify/untildify.test.js +++ /dev/null @@ -1,11 +0,0 @@ -const expect = require('expect'); -const untildify = require('./untildify.js'); - -test('Testing untildify', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof untildify === 'function').toBeTruthy(); - expect(untildify('~/test/dir/file.f').indexOf('~') === -1).toBeTruthy(); - expect(untildify('~/test/dir/file.f').slice(-16)).toBe('/test/dir/file.f'); - expect(untildify('test/dir/file.f')).toBe('test/dir/file.f'); -}); diff --git a/test6/unzip/unzip.test.js b/test6/unzip/unzip.test.js deleted file mode 100644 index e3b88825d..000000000 --- a/test6/unzip/unzip.test.js +++ /dev/null @@ -1,10 +0,0 @@ -const expect = require('expect'); -const unzip = require('./unzip.js'); - -test('Testing unzip', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof unzip === 'function').toBeTruthy(); - expect(unzip([['a', 1, true], ['b', 2, false]])).toEqual([['a', 'b'], [1, 2], [true, false]]); - expect(unzip([['a', 1, true], ['b', 2]])).toEqual([['a', 'b'], [1, 2], [true]]); -}); diff --git a/test6/unzipWith/unzipWith.test.js b/test6/unzipWith/unzipWith.test.js deleted file mode 100644 index 40752b618..000000000 --- a/test6/unzipWith/unzipWith.test.js +++ /dev/null @@ -1,11 +0,0 @@ -const expect = require('expect'); -const unzipWith = require('./unzipWith.js'); - -test('Testing unzipWith', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof unzipWith === 'function').toBeTruthy(); - expect( - unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)) - ).toEqual([3, 30, 300]); -}); diff --git a/test6/validateNumber/validateNumber.test.js b/test6/validateNumber/validateNumber.test.js deleted file mode 100644 index ef31971ae..000000000 --- a/test6/validateNumber/validateNumber.test.js +++ /dev/null @@ -1,20 +0,0 @@ -const expect = require('expect'); -const validateNumber = require('./validateNumber.js'); - -test('Testing validateNumber', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof validateNumber === 'function').toBeTruthy(); - expect(validateNumber(9)).toBeTruthy(); - expect(validateNumber('234asd'.slice(0, 2))).toBeTruthy(); - expect(validateNumber(1232)).toBeTruthy(); - expect(validateNumber(1232 + 13423)).toBeTruthy(); - expect(validateNumber(1232 * 2342 * 123)).toBeTruthy(); - expect(validateNumber(1232.23423536)).toBeTruthy(); - expect(validateNumber('234asd')).toBeFalsy(); - expect(validateNumber('e234d')).toBeFalsy(); - expect(validateNumber(false)).toBeFalsy(); - expect(validateNumber(true)).toBeFalsy(); - expect(validateNumber(null)).toBeFalsy(); - expect(validateNumber(123 * 'asd')).toBeFalsy(); -}); diff --git a/test6/when/when.test.js b/test6/when/when.test.js deleted file mode 100644 index 154c84c4f..000000000 --- a/test6/when/when.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const expect = require('expect'); -const when = require('./when.js'); - -test('Testing when', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof when === 'function').toBeTruthy(); - - const doubleEvenNumbers = when( - (x) => x % 2 === 0, - (x) => x * 2 - ); - - expect(doubleEvenNumbers(2) === 4).toBeTruthy(); - expect(doubleEvenNumbers(1) === 1).toBeTruthy(); -}); diff --git a/test6/without/without.test.js b/test6/without/without.test.js deleted file mode 100644 index 88053f595..000000000 --- a/test6/without/without.test.js +++ /dev/null @@ -1,17 +0,0 @@ -const expect = require('expect'); -const without = require('./without.js'); - -test('Testing without', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof without === 'function').toBeTruthy(); - expect(without([2, 1, 2, 3], 1, 2)).toEqual([3]); - expect(without([])).toEqual([]); - expect(without([3, 1, true, '3', true], '3', true)).toEqual([3, 1]); - expect(without('string'.split(''), 's', 't', 'g')).toEqual(['r', 'i', 'n']); - expect(() => without()).toThrow(); - expect(() => without(null)).toThrow(); - expect(() => without(undefined)).toThrow(); - expect(() => without(123)).toThrow(); - expect(() => without({})).toThrow(); -}); diff --git a/test6/words/words.test.js b/test6/words/words.test.js deleted file mode 100644 index 9d57bdf0e..000000000 --- a/test6/words/words.test.js +++ /dev/null @@ -1,17 +0,0 @@ -const expect = require('expect'); -const words = require('./words.js'); - -test('Testing words', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof words === 'function').toBeTruthy(); - expect(words('I love javaScript!!')).toEqual(["I", "love", "javaScript"]); - expect(words('python, javaScript & coffee')).toEqual(["python", "javaScript", "coffee"]); - expect(Array.isArray(words('I love javaScript!!'))).toBeTruthy(); - expect(() => words()).toThrow(); - expect(() => words(null)).toThrow(); - expect(() => words(undefined)).toThrow(); - expect(() => words({})).toThrow(); - expect(() => words([])).toThrow(); - expect(() => words(1234)).toThrow(); -}); diff --git a/test6/xProd/xProd.test.js b/test6/xProd/xProd.test.js deleted file mode 100644 index 9c94485c4..000000000 --- a/test6/xProd/xProd.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const expect = require('expect'); -const xProd = require('./xProd.js'); - -test('Testing xProd', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof xProd === 'function').toBeTruthy(); - expect(xProd([1, 2], ['a', 'b'])).toEqual([[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]); -}); diff --git a/test6/yesNo/yesNo.test.js b/test6/yesNo/yesNo.test.js deleted file mode 100644 index 6947ca429..000000000 --- a/test6/yesNo/yesNo.test.js +++ /dev/null @@ -1,20 +0,0 @@ -const expect = require('expect'); -const yesNo = require('./yesNo.js'); - -test('Testing yesNo', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof yesNo === 'function').toBeTruthy(); - expect(yesNo('Y')).toBeTruthy(); - expect(yesNo('yes')).toBeTruthy(); - expect(yesNo('foo', true)).toBeTruthy(); - expect(yesNo('No')).toBeFalsy(); - expect(yesNo()).toBeFalsy(); - expect(yesNo(null)).toBeFalsy(); - expect(yesNo(undefined)).toBeFalsy(); - expect(yesNo([123, null])).toBeFalsy(); - expect(yesNo(['Yes', 'No'])).toBeFalsy(); - expect(yesNo({ 2: 'Yes' })).toBeFalsy(); - expect(yesNo(['Yes', 'No'], true)).toBeTruthy(); - expect(yesNo({ 2: 'Yes' }, true)).toBeTruthy(); -}); diff --git a/test6/zip/zip.test.js b/test6/zip/zip.test.js deleted file mode 100644 index 7da9b8d65..000000000 --- a/test6/zip/zip.test.js +++ /dev/null @@ -1,16 +0,0 @@ -const expect = require('expect'); -const zip = require('./zip.js'); - -test('Testing zip', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof zip === 'function').toBeTruthy(); - expect(zip(['a', 'b'], [1, 2], [true, false])).toEqual([['a', 1, true], ['b', 2, false]]); - expect(zip(['a'], [1, 2], [true, false])).toEqual([['a', 1, true], [undefined, 2, false]]); - expect(zip()).toEqual([]); - expect(zip(123)).toEqual([]); - expect(Array.isArray(zip(['a', 'b'], [1, 2], [true, false]))).toBeTruthy(); - expect(Array.isArray(zip(['a'], [1, 2], [true, false]))).toBeTruthy(); - expect(() => zip(null)).toThrow(); - expect(() => zip(undefined)).toThrow(); -}); diff --git a/test6/zipObject/zipObject.test.js b/test6/zipObject/zipObject.test.js deleted file mode 100644 index de895be37..000000000 --- a/test6/zipObject/zipObject.test.js +++ /dev/null @@ -1,17 +0,0 @@ -const expect = require('expect'); -const zipObject = require('./zipObject.js'); - -test('Testing zipObject', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof zipObject === 'function').toBeTruthy(); - expect(zipObject(['a', 'b', 'c'], [1, 2])).toEqual({a: 1, b: 2, c: undefined}); - expect(zipObject(['a', 'b'], [1, 2, 3])).toEqual({a: 1, b: 2}); - expect(zipObject(['a', 'b', 'c'], 'string')).toEqual({ a: 's', b: 't', c: 'r' }); - expect(zipObject(['a'], 'string')).toEqual({ a: 's' }); - expect(() => zipObject()).toThrow(); - expect(() => zipObject(['string'], null)).toThrow(); - expect(() => zipObject(null, [1])).toThrow(); - expect(() => zipObject('string')).toThrow(); - expect(() => zipObject('test', 'string')).toThrow(); -}); diff --git a/test6/zipWith/zipWith.test.js b/test6/zipWith/zipWith.test.js deleted file mode 100644 index 1c6f8199e..000000000 --- a/test6/zipWith/zipWith.test.js +++ /dev/null @@ -1,8 +0,0 @@ -const expect = require('expect'); -const zipWith = require('./zipWith.js'); - -test('Testing zipWith', () => { - //For more information on all the methods supported by tape - //Please go to https://github.com/substack/tape - expect(typeof zipWith === 'function').toBeTruthy(); -}); \ No newline at end of file From d29974ebc9cded325790521f857cfd70cc91acca Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Mon, 18 Jun 2018 15:54:48 +0300 Subject: [PATCH 04/19] Test cleanup and fixes [a-b] --- test/JSONToFile/JSONToFile.test.js | 2 +- .../UUIDGeneratorBrowser.test.js | 2 +- .../UUIDGeneratorNode.test.js | 4 +- .../approximatelyEqual.test.js | 13 +++--- test/arrayToHtmlList/arrayToHtmlList.test.js | 6 +-- test/ary/ary.test.js | 11 ++--- test/atob/atob.test.js | 13 +++--- test/attempt/attempt.test.js | 13 +++--- test/average/average.test.js | 40 ++++++++++------- test/averageBy/averageBy.test.js | 13 +++--- test/bifurcate/bifurcate.test.js | 9 ++-- test/bifurcateBy/bifurcateBy.test.js | 9 ++-- test/binarySearch/binarySearch.test.js | 20 ++++++--- test/bind/bind.test.js | 19 ++++---- test/bindAll/bindAll.test.js | 23 +++++----- test/bindKey/bindKey.test.js | 23 +++++----- .../binomialCoefficient.test.js | 21 +++++---- test/bottomVisible/bottomVisible.test.js | 6 +-- test/btoa/btoa.test.js | 9 ++-- test/byteSize/byteSize.test.js | 16 ++++--- test/castArray/castArray.test.js | 20 ++++++--- test/chainAsync/chainAsync.test.js | 2 +- test/chunk/chunk.test.js | 16 +++++-- test/collatz/collatz.test.js | 10 +++-- test/collectInto/collectInto.test.js | 4 +- test/colorize/colorize.test.js | 2 +- test/converge/converge.test.js | 8 +++- test/copyToClipboard/copyToClipboard.test.js | 2 +- test/countBy/countBy.test.js | 8 +++- test/createElement/createElement.test.js | 2 +- test/createEventHub/createEventHub.test.js | 2 +- test/currentURL/currentURL.test.js | 2 +- test/debounce/debounce.test.js | 2 +- test/decapitalize/decapitalize.test.js | 8 +++- test/defaults/defaults.test.js | 4 +- test/defer/defer.test.js | 2 +- .../detectDeviceType/detectDeviceType.test.js | 2 +- test/differenceBy/differenceBy.test.js | 8 +++- test/drop/drop.test.js | 12 +++-- test/dropRightWhile/dropRightWhile.test.js | 4 +- test/dropWhile/dropWhile.test.js | 4 +- .../elementIsVisibleInViewport.test.js | 2 +- test/findLast/findLast.test.js | 4 +- test/findLastIndex/findLastIndex.test.js | 4 +- test/flattenObject/flattenObject.test.js | 8 +++- test/flip/flip.test.js | 4 +- test/forEachRight/forEachRight.test.js | 4 +- test/forOwn/forOwn.test.js | 4 +- test/forOwnRight/forOwnRight.test.js | 4 +- test/functionName/functionName.test.js | 12 +++-- test/functions/functions.test.js | 8 +++- .../getScrollPosition.test.js | 2 +- test/getStyle/getStyle.test.js | 2 +- test/hasFlags/hasFlags.test.js | 2 +- test/hashBrowser/hashBrowser.test.js | 2 +- test/head/head.test.js | 8 +++- test/hide/hide.test.js | 2 +- test/httpPost/httpPost.test.js | 4 +- test/httpsRedirect/httpsRedirect.test.js | 2 +- test/intersectionBy/intersectionBy.test.js | 4 +- .../intersectionWith/intersectionWith.test.js | 4 +- test/isArrayLike/isArrayLike.test.js | 12 +++-- test/isDivisible/isDivisible.test.js | 4 +- test/isEmpty/isEmpty.test.js | 40 ++++++++++++----- test/isEven/isEven.test.js | 4 +- test/isNil/isNil.test.js | 12 +++-- test/isObjectLike/isObjectLike.test.js | 16 +++++-- test/isPlainObject/isPlainObject.test.js | 8 +++- test/isPromiseLike/isPromiseLike.test.js | 8 +++- test/isSorted/isSorted.test.js | 44 ++++++++++++++----- test/isString/isString.test.js | 20 ++++++--- test/isUpperCase/isUpperCase.test.js | 12 +++-- test/isValidJSON/isValidJSON.test.js | 12 +++-- test/last/last.test.js | 8 +++- test/lowercaseKeys/lowercaseKeys.test.js | 8 +++- test/mapKeys/mapKeys.test.js | 4 +- test/mapObject/mapObject.test.js | 8 +++- test/mapValues/mapValues.test.js | 4 +- test/memoize/memoize.test.js | 12 +++-- test/merge/merge.test.js | 4 +- test/mostPerformant/mostPerformant.test.js | 2 +- test/nthArg/nthArg.test.js | 12 +++-- .../observeMutations/observeMutations.test.js | 2 +- test/off/off.test.js | 2 +- test/offset/offset.test.js | 24 +++++++--- test/omit/omit.test.js | 4 +- test/omitBy/omitBy.test.js | 4 +- test/on/on.test.js | 2 +- .../onUserInputChange.test.js | 2 +- test/once/once.test.js | 2 +- test/over/over.test.js | 4 +- test/overArgs/overArgs.test.js | 4 +- test/pad/pad.test.js | 16 +++++-- test/parseCookie/parseCookie.test.js | 4 +- test/partial/partial.test.js | 4 +- test/partialRight/partialRight.test.js | 4 +- test/permutations/permutations.test.js | 4 +- test/pickBy/pickBy.test.js | 4 +- test/pipeFunctions/pipeFunctions.test.js | 4 +- test/pluralize/pluralize.test.js | 20 ++++++--- test/promisify/promisify.test.js | 2 +- test/pull/pull.test.js | 4 +- test/pullAtIndex/pullAtIndex.test.js | 8 +++- test/pullAtValue/pullAtValue.test.js | 8 +++- test/pullBy/pullBy.test.js | 4 +- test/quickSort/quickSort.test.js | 8 +++- test/radsToDegrees/radsToDegrees.test.js | 4 +- .../randomIntArrayInRange.test.js | 4 +- test/readFileLines/readFileLines.test.js | 2 +- test/rearg/rearg.test.js | 4 +- test/redirect/redirect.test.js | 2 +- .../reduceSuccessive/reduceSuccessive.test.js | 4 +- test/reduceWhich/reduceWhich.test.js | 8 +++- test/removeNonASCII/removeNonASCII.test.js | 4 +- test/runAsync/runAsync.test.js | 2 +- .../runPromisesInSeries.test.js | 2 +- test/sample/sample.test.js | 8 +++- test/sampleSize/sampleSize.test.js | 16 +++++-- test/scrollToTop/scrollToTop.test.js | 2 +- test/serializeCookie/serializeCookie.test.js | 4 +- test/setStyle/setStyle.test.js | 2 +- test/shallowClone/shallowClone.test.js | 4 +- test/show/show.test.js | 2 +- test/shuffle/shuffle.test.js | 8 +++- test/sleep/sleep.test.js | 2 +- test/sortedIndexBy/sortedIndexBy.test.js | 4 +- test/sortedLastIndex/sortedLastIndex.test.js | 4 +- .../sortedLastIndexBy.test.js | 4 +- test/stableSort/stableSort.test.js | 4 +- .../symmetricDifferenceBy.test.js | 4 +- test/takeRightWhile/takeRightWhile.test.js | 4 +- test/takeWhile/takeWhile.test.js | 4 +- test/throttle/throttle.test.js | 2 +- test/timeTaken/timeTaken.test.js | 2 +- test/toCurrency/toCurrency.test.js | 12 +++-- test/toKebabCase/toKebabCase.test.js | 4 +- test/toOrdinalSuffix/toOrdinalSuffix.test.js | 16 +++++-- test/toSnakeCase/toSnakeCase.test.js | 4 +- test/toggleClass/toggleClass.test.js | 2 +- test/tomorrow/tomorrow.test.js | 12 +++-- test/truncateString/truncateString.test.js | 4 +- test/unary/unary.test.js | 4 +- test/uncurry/uncurry.test.js | 12 +++-- test/unescapeHTML/unescapeHTML.test.js | 4 +- test/unflattenObject/unflattenObject.test.js | 4 +- test/unfold/unfold.test.js | 4 +- test/unionBy/unionBy.test.js | 4 +- test/unionWith/unionWith.test.js | 4 +- test/untildify/untildify.test.js | 8 +++- test/zip/zip.test.js | 16 +++++-- test/zipObject/zipObject.test.js | 16 +++++-- 151 files changed, 753 insertions(+), 373 deletions(-) diff --git a/test/JSONToFile/JSONToFile.test.js b/test/JSONToFile/JSONToFile.test.js index cdec2fda6..b46ee2c31 100644 --- a/test/JSONToFile/JSONToFile.test.js +++ b/test/JSONToFile/JSONToFile.test.js @@ -5,6 +5,6 @@ const JSONToFile = require('./JSONToFile.js'); test('JSONToFile is a Function', () => { expect(JSONToFile).toBeInstanceOf(Function); }); - t.pass('Tested on 09/02/2018 by @chalarangelo'); + diff --git a/test/UUIDGeneratorBrowser/UUIDGeneratorBrowser.test.js b/test/UUIDGeneratorBrowser/UUIDGeneratorBrowser.test.js index cf2376860..4448c0449 100644 --- a/test/UUIDGeneratorBrowser/UUIDGeneratorBrowser.test.js +++ b/test/UUIDGeneratorBrowser/UUIDGeneratorBrowser.test.js @@ -5,6 +5,6 @@ const UUIDGeneratorBrowser = require('./UUIDGeneratorBrowser.js'); test('UUIDGeneratorBrowser is a Function', () => { expect(UUIDGeneratorBrowser).toBeInstanceOf(Function); }); - t.pass('Tested 09/02/2018 by @chalarangelo'); + diff --git a/test/UUIDGeneratorNode/UUIDGeneratorNode.test.js b/test/UUIDGeneratorNode/UUIDGeneratorNode.test.js index 85ebf8b53..5aec30a90 100644 --- a/test/UUIDGeneratorNode/UUIDGeneratorNode.test.js +++ b/test/UUIDGeneratorNode/UUIDGeneratorNode.test.js @@ -6,7 +6,9 @@ const UUIDGeneratorNode = require('./UUIDGeneratorNode.js'); expect(UUIDGeneratorNode).toBeInstanceOf(Function); }); const uuid = UUIDGeneratorNode(); - t.deepEqual([uuid[8], uuid[13], uuid[18], uuid[23]], ['-', '-', '-', '-'], 'Contains dashes in the proper places'); + 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/approximatelyEqual/approximatelyEqual.test.js b/test/approximatelyEqual/approximatelyEqual.test.js index 87272be4e..12cd74a82 100644 --- a/test/approximatelyEqual/approximatelyEqual.test.js +++ b/test/approximatelyEqual/approximatelyEqual.test.js @@ -1,21 +1,18 @@ const expect = require('expect'); const approximatelyEqual = require('./approximatelyEqual.js'); - - test('approximatelyEqual is a Function', () => { +test('approximatelyEqual is a Function', () => { expect(approximatelyEqual).toBeInstanceOf(Function); }); - test('Works for PI / 2', () => { +test('Works for PI / 2', () => { expect(approximatelyEqual(Math.PI / 2.0 , 1.5708)).toBeTruthy(); }); - test('Works for 0.1 + 0.2 === 0.3', () => { +test('Works for 0.1 + 0.2 === 0.3', () => { expect(approximatelyEqual(0.1 + 0.2, 0.3)).toBeTruthy(); }); - test('Works for exactly equal values', () => { +test('Works for exactly equal values', () => { expect(approximatelyEqual(0.5, 0.5)).toBeTruthy(); }); - test('Works for a custom epsilon', () => { +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 33ad61cae..07a97dcf8 100644 --- a/test/arrayToHtmlList/arrayToHtmlList.test.js +++ b/test/arrayToHtmlList/arrayToHtmlList.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const arrayToHtmlList = require('./arrayToHtmlList.js'); - - test('arrayToHtmlList is a Function', () => { +test('arrayToHtmlList is a Function', () => { expect(arrayToHtmlList).toBeInstanceOf(Function); }); - t.pass('Tested by @chalarangelo on 16/02/2018'); - - diff --git a/test/ary/ary.test.js b/test/ary/ary.test.js index 45ada26a6..e695ca124 100644 --- a/test/ary/ary.test.js +++ b/test/ary/ary.test.js @@ -1,13 +1,10 @@ const expect = require('expect'); const ary = require('./ary.js'); - - test('ary is a Function', () => { +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)), [6, 8, 10]).toEqual() +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 4032a531a..43c4f1386 100644 --- a/test/atob/atob.test.js +++ b/test/atob/atob.test.js @@ -1,15 +1,12 @@ const expect = require('expect'); const atob = require('./atob.js'); - - test('atob is a Function', () => { +test('atob is a Function', () => { expect(atob).toBeInstanceOf(Function); }); - test('atob("Zm9vYmFy") equals "foobar"', () => { - expect(atob('Zm9vYmFy'), 'foobar').toBe() +test('atob("Zm9vYmFy") equals "foobar"', () => { + expect(atob('Zm9vYmFy')).toBe('foobar'); }); - test('atob("Z") returns ""', () => { - expect(atob('Z'), '').toBe() +test('atob("Z") returns ""', () => { + expect(atob('Z')).toBe(''); }); - - diff --git a/test/attempt/attempt.test.js b/test/attempt/attempt.test.js index 1bd0179da..047cfd4e7 100644 --- a/test/attempt/attempt.test.js +++ b/test/attempt/attempt.test.js @@ -1,15 +1,12 @@ const expect = require('expect'); const attempt = require('./attempt.js'); - - test('attempt is a Function', () => { +test('attempt is a Function', () => { expect(attempt).toBeInstanceOf(Function); }); - test('Returns a value', () => { - expect(attempt(() => 0), 0).toBe() +test('Returns a value', () => { + expect(attempt(() => 0)).toBe(0); }); - test('Returns an error', () => { - expect(attempt(() => {throw new Error();}) instanceof Error).toBeTruthy(); +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 039daaba6..fe042cf36 100644 --- a/test/average/average.test.js +++ b/test/average/average.test.js @@ -1,37 +1,43 @@ const expect = require('expect'); const average = require('./average.js'); - - test('average is a Function', () => { +test('average is a Function', () => { expect(average).toBeInstanceOf(Function); }); - test('average(true) returns 0', () => { +test('average(true) returns 0', () => { expect(average(true) === 1).toBeTruthy(); }); - test('average(false) returns 1', () => { +test('average(false) returns 1', () => { expect(average(false) === 0).toBeTruthy(); }); - 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'); - test('average(1, 2, 3) returns NaN', () => { +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', () => { +test('average(String) returns NaN', () => { expect(isNaN(average('String'))).toBeTruthy(); }); - test('average({ a: 123}) returns NaN', () => { +test('average({ a: 123}) returns NaN', () => { expect(isNaN(average({ a: 123}))).toBeTruthy(); }); - test('average([undefined, 0, string]) returns NaN', () => { +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(); - test('average([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run', () => { +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 1176c7e65..044d407df 100644 --- a/test/averageBy/averageBy.test.js +++ b/test/averageBy/averageBy.test.js @@ -1,15 +1,12 @@ const expect = require('expect'); const averageBy = require('./averageBy.js'); - - test('averageBy is a Function', () => { +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), 5).toBe() +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'), 5).toBe() +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 c7707c710..456d490cb 100644 --- a/test/bifurcate/bifurcate.test.js +++ b/test/bifurcate/bifurcate.test.js @@ -1,10 +1,9 @@ const expect = require('expect'); const bifurcate = require('./bifurcate.js'); - - test('bifurcate is a Function', () => { +test('bifurcate is a Function', () => { expect(bifurcate).toBeInstanceOf(Function); }); - t.deepEqual(bifurcate([ 'beep', 'boop', 'foo', 'bar' ], [ true, true, false, true ]), [ ['beep', 'boop', 'bar'], ['foo'] ], 'Splits the collection into two groups'); - - +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 ca3864909..1b01c76e7 100644 --- a/test/bifurcateBy/bifurcateBy.test.js +++ b/test/bifurcateBy/bifurcateBy.test.js @@ -1,10 +1,9 @@ const expect = require('expect'); const bifurcateBy = require('./bifurcateBy.js'); - - test('bifurcateBy is a Function', () => { +test('bifurcateBy is a Function', () => { expect(bifurcateBy).toBeInstanceOf(Function); }); - t.deepEqual(bifurcateBy([ 'beep', 'boop', 'foo', 'bar' ], x => x[0] === 'b'), [ ['beep', 'boop', 'bar'], ['foo'] ], 'Splits the collection into two groups'); - - +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 7fcee6d01..3f45f7a98 100644 --- a/test/binarySearch/binarySearch.test.js +++ b/test/binarySearch/binarySearch.test.js @@ -1,12 +1,18 @@ const expect = require('expect'); const binarySearch = require('./binarySearch.js'); - - test('binarySearch is a Function', () => { +test('binarySearch is a Function', () => { expect(binarySearch).toBeInstanceOf(Function); }); - 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"); - +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 db56f2d50..423b2b8d9 100644 --- a/test/bind/bind.test.js +++ b/test/bind/bind.test.js @@ -1,17 +1,14 @@ const expect = require('expect'); const bind = require('./bind.js'); - - test('bind is a Function', () => { +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', '!'),'hi fred!').toBe() +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 0e2ddb66d..1b8a88e8d 100644 --- a/test/bindAll/bindAll.test.js +++ b/test/bindAll/bindAll.test.js @@ -1,17 +1,16 @@ const expect = require('expect'); const bindAll = require('./bindAll.js'); - - test('bindAll is a Function', () => { +test('bindAll is a Function', () => { expect(bindAll).toBeInstanceOf(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'); - - +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 d526a79f8..867576d7b 100644 --- a/test/bindKey/bindKey.test.js +++ b/test/bindKey/bindKey.test.js @@ -1,17 +1,16 @@ const expect = require('expect'); const bindKey = require('./bindKey.js'); - - test('bindKey is a Function', () => { +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'); - t.equal(freddyBound('hi', '!'), 'hi fred!', 'Binds function to an object context'); - - +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 74b9f5b2e..e4ca4f3ce 100644 --- a/test/binomialCoefficient/binomialCoefficient.test.js +++ b/test/binomialCoefficient/binomialCoefficient.test.js @@ -1,18 +1,21 @@ const expect = require('expect'); const binomialCoefficient = require('./binomialCoefficient.js'); - - test('binomialCoefficient is a Function', () => { +test('binomialCoefficient is a Function', () => { expect(binomialCoefficient).toBeInstanceOf(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'); - test('Returns NaN', () => { +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', () => { +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 f81b9b59a..6769b3cbd 100644 --- a/test/bottomVisible/bottomVisible.test.js +++ b/test/bottomVisible/bottomVisible.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const bottomVisible = require('./bottomVisible.js'); - - test('bottomVisible is a Function', () => { +test('bottomVisible is a Function', () => { expect(bottomVisible).toBeInstanceOf(Function); }); - t.pass('Tested on 09/02/2018 by @chalarangelo'); - - diff --git a/test/btoa/btoa.test.js b/test/btoa/btoa.test.js index d0d97bb75..36b740293 100644 --- a/test/btoa/btoa.test.js +++ b/test/btoa/btoa.test.js @@ -1,12 +1,9 @@ const expect = require('expect'); const btoa = require('./btoa.js'); - - test('btoa is a Function', () => { +test('btoa is a Function', () => { expect(btoa).toBeInstanceOf(Function); }); - test('btoa("foobar") equals "Zm9vYmFy"', () => { - expect(btoa('foobar'), 'Zm9vYmFy').toBe() +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 2e6bfee63..ad6371480 100644 --- a/test/byteSize/byteSize.test.js +++ b/test/byteSize/byteSize.test.js @@ -8,11 +8,15 @@ const Blob = class{ }; const byteSize = str => new Blob([str]).size; - test('byteSize is a Function', () => { +test('byteSize is a Function', () => { expect(byteSize).toBeInstanceOf(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'); - - +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/castArray/castArray.test.js b/test/castArray/castArray.test.js index 5b849197c..f3883879a 100644 --- a/test/castArray/castArray.test.js +++ b/test/castArray/castArray.test.js @@ -5,10 +5,20 @@ const castArray = require('./castArray.js'); test('castArray is a Function', () => { expect(castArray).toBeInstanceOf(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'); + test('Works for single values', () => { + expect(castArray(1), [1]).toEqual() +}); + test('Works for arrays with one value', () => { + expect(castArray([1]), [1]).toEqual() +}); + test('Works for arrays with multiple value', () => { + expect(castArray([1,2,3]), [1,2,3]).toEqual() +}); + test('Works for strings', () => { + expect(castArray('test'), ['test']).toEqual() +}); + test('Works for objects', () => { + expect(castArray({}), [{}]).toEqual() +}); diff --git a/test/chainAsync/chainAsync.test.js b/test/chainAsync/chainAsync.test.js index 43cd39c4f..8e90219ef 100644 --- a/test/chainAsync/chainAsync.test.js +++ b/test/chainAsync/chainAsync.test.js @@ -15,7 +15,7 @@ const chainAsync = require('./chainAsync.js'); })(); }, next => { - t.pass("Calls all functions in an array"); + } ]); diff --git a/test/chunk/chunk.test.js b/test/chunk/chunk.test.js index 8db6625c8..f257adac8 100644 --- a/test/chunk/chunk.test.js +++ b/test/chunk/chunk.test.js @@ -6,10 +6,18 @@ const chunk = require('./chunk.js'); expect(chunk).toBeInstanceOf(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 ]'); + 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), [ 'st', 'ri', 'ng' ]).toEqual() +}); 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'); diff --git a/test/collatz/collatz.test.js b/test/collatz/collatz.test.js index fa2b6ed25..9598acaa9 100644 --- a/test/collatz/collatz.test.js +++ b/test/collatz/collatz.test.js @@ -5,13 +5,17 @@ const collatz = require('./collatz.js'); test('collatz is a Function', () => { expect(collatz).toBeInstanceOf(Function); }); - 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('When n is even, divide by 2', () => { + expect(collatz(8), 4).toBe() +}); + test('When n is odd, times by 3 and add 1', () => { + expect(collatz(9), 28).toBe() +}); let n = 9; while(true){ if (n === 1){ - t.pass('Eventually reaches 1'); + break; } n = collatz(n); diff --git a/test/collectInto/collectInto.test.js b/test/collectInto/collectInto.test.js index 30e358c50..e2a073af8 100644 --- a/test/collectInto/collectInto.test.js +++ b/test/collectInto/collectInto.test.js @@ -9,6 +9,8 @@ const collectInto = require('./collectInto.js'); 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){ + Pall(p1, p2, p3).then(function(val){ test('Works with multiple promises', () => { + expect(val, [1,2,3]).toEqual() +});}, function(reason){ diff --git a/test/colorize/colorize.test.js b/test/colorize/colorize.test.js index b708096d8..10950ab7f 100644 --- a/test/colorize/colorize.test.js +++ b/test/colorize/colorize.test.js @@ -5,6 +5,6 @@ const colorize = require('./colorize.js'); test('colorize is a Function', () => { expect(colorize).toBeInstanceOf(Function); }); - t.pass('Tested on 09/02/2018 by @chalarangelo'); + diff --git a/test/converge/converge.test.js b/test/converge/converge.test.js index 34c71906d..bd8f4e4bd 100644 --- a/test/converge/converge.test.js +++ b/test/converge/converge.test.js @@ -9,11 +9,15 @@ const converge = require('./converge.js'); 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'); + test('Produces the average of the array', () => { + expect(average([1, 2, 3, 4, 5, 6, 7]), 4).toBe() +}); const strangeConcat = converge((a, b) => a + b, [ x => x.toUpperCase(), x => x.toLowerCase()] ); - t.equal(strangeConcat('Yodel'), "YODELyodel", 'Produces the strange concatenation'); + test('Produces the strange concatenation', () => { + expect(strangeConcat('Yodel'), "YODELyodel").toBe() +}); diff --git a/test/copyToClipboard/copyToClipboard.test.js b/test/copyToClipboard/copyToClipboard.test.js index 9344d6296..66c5cb5bf 100644 --- a/test/copyToClipboard/copyToClipboard.test.js +++ b/test/copyToClipboard/copyToClipboard.test.js @@ -5,6 +5,6 @@ const copyToClipboard = require('./copyToClipboard.js'); test('copyToClipboard is a Function', () => { expect(copyToClipboard).toBeInstanceOf(Function); }); - t.pass('Tested on 09/02/2018 by @chalarangelo'); + diff --git a/test/countBy/countBy.test.js b/test/countBy/countBy.test.js index c73ffa3ac..d013534ee 100644 --- a/test/countBy/countBy.test.js +++ b/test/countBy/countBy.test.js @@ -5,7 +5,11 @@ const countBy = require('./countBy.js'); test('countBy is a Function', () => { expect(countBy).toBeInstanceOf(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'); + test('Works for functions', () => { + expect(countBy([6.1, 4.2, 6.3], Math.floor), {4: 1, 6: 2}).toEqual() +}); + test('Works for property names', () => { + expect(countBy(['one', 'two', 'three'], 'length'), {3: 2, 5: 1}).toEqual() +}); diff --git a/test/createElement/createElement.test.js b/test/createElement/createElement.test.js index 2ad5a2124..d046f62e7 100644 --- a/test/createElement/createElement.test.js +++ b/test/createElement/createElement.test.js @@ -5,6 +5,6 @@ const createElement = require('./createElement.js'); test('createElement is a Function', () => { expect(createElement).toBeInstanceOf(Function); }); - t.pass('Tested by @chalarangelo on 16/02/2018'); + diff --git a/test/createEventHub/createEventHub.test.js b/test/createEventHub/createEventHub.test.js index 179f2c7c1..4a847285e 100644 --- a/test/createEventHub/createEventHub.test.js +++ b/test/createEventHub/createEventHub.test.js @@ -5,6 +5,6 @@ const createEventHub = require('./createEventHub.js'); test('createEventHub is a Function', () => { expect(createEventHub).toBeInstanceOf(Function); }); - t.pass('Tested by @chalarangelo on 16/02/2018'); + diff --git a/test/currentURL/currentURL.test.js b/test/currentURL/currentURL.test.js index 8344c7163..61c3a2fce 100644 --- a/test/currentURL/currentURL.test.js +++ b/test/currentURL/currentURL.test.js @@ -5,6 +5,6 @@ const currentURL = require('./currentURL.js'); test('currentURL is a Function', () => { expect(currentURL).toBeInstanceOf(Function); }); - t.pass('Tested by @chalarangelo on 16/02/2018'); + diff --git a/test/debounce/debounce.test.js b/test/debounce/debounce.test.js index 81e49d2bd..a4f4db6d2 100644 --- a/test/debounce/debounce.test.js +++ b/test/debounce/debounce.test.js @@ -5,6 +5,6 @@ const debounce = require('./debounce.js'); test('debounce is a Function', () => { expect(debounce).toBeInstanceOf(Function); }); - debounce(() => {t.pass('Works as expected');}, 250); + debounce(() => { diff --git a/test/decapitalize/decapitalize.test.js b/test/decapitalize/decapitalize.test.js index 5adbd21a1..866c49271 100644 --- a/test/decapitalize/decapitalize.test.js +++ b/test/decapitalize/decapitalize.test.js @@ -5,7 +5,11 @@ const decapitalize = require('./decapitalize.js'); test('decapitalize is a Function', () => { expect(decapitalize).toBeInstanceOf(Function); }); - t.equal(decapitalize('FooBar'), 'fooBar', 'Works with default parameter'); - t.equal(decapitalize('FooBar', true), 'fOOBAR', 'Works with second parameter set to true'); + test('Works with default parameter', () => { + expect(decapitalize('FooBar'), 'fooBar').toBe() +}); + test('Works with second parameter set to true', () => { + expect(decapitalize('FooBar', true), 'fOOBAR').toBe() +}); diff --git a/test/defaults/defaults.test.js b/test/defaults/defaults.test.js index 41e3224aa..c713eea1b 100644 --- a/test/defaults/defaults.test.js +++ b/test/defaults/defaults.test.js @@ -5,6 +5,8 @@ const defaults = require('./defaults.js'); test('defaults is a Function', () => { expect(defaults).toBeInstanceOf(Function); }); - t.deepEqual(defaults({ a: 1 }, { b: 2 }, { b: 6 }, { a: 3 }), { a: 1, b: 2 }, 'Assigns default values for undefined properties'); + test('Assigns default values for undefined properties', () => { + expect(defaults({ a: 1 }, { b: 2 }, { b: 6 }, { a: 3 }), { a: 1, b: 2 }).toEqual() +}); diff --git a/test/defer/defer.test.js b/test/defer/defer.test.js index 1e05fdb09..46ff55ac6 100644 --- a/test/defer/defer.test.js +++ b/test/defer/defer.test.js @@ -5,6 +5,6 @@ const defer = require('./defer.js'); test('defer is a Function', () => { expect(defer).toBeInstanceOf(Function); }); - t.pass('Tested by @chalarangelo on 16/02/2018'); + diff --git a/test/detectDeviceType/detectDeviceType.test.js b/test/detectDeviceType/detectDeviceType.test.js index 55f89c2e1..124315e80 100644 --- a/test/detectDeviceType/detectDeviceType.test.js +++ b/test/detectDeviceType/detectDeviceType.test.js @@ -5,6 +5,6 @@ const detectDeviceType = require('./detectDeviceType.js'); test('detectDeviceType is a Function', () => { expect(detectDeviceType).toBeInstanceOf(Function); }); - t.pass('Tested on 09/02/2018 by @chalarangelo'); + diff --git a/test/differenceBy/differenceBy.test.js b/test/differenceBy/differenceBy.test.js index dc25227a6..44265c43f 100644 --- a/test/differenceBy/differenceBy.test.js +++ b/test/differenceBy/differenceBy.test.js @@ -5,7 +5,11 @@ const differenceBy = require('./differenceBy.js'); test('differenceBy is a Function', () => { expect(differenceBy).toBeInstanceOf(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'); + test('Works using a native function and numbers', () => { + expect(differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor), [1.2]).toEqual() +}); + test('Works with arrow function and objects', () => { + expect(differenceBy([{ x: 2 }, { x: 1 }], [{ x: 1 }], v => v.x), [ { x: 2 } ]).toEqual() +}); diff --git a/test/drop/drop.test.js b/test/drop/drop.test.js index 679f96926..5c864463e 100644 --- a/test/drop/drop.test.js +++ b/test/drop/drop.test.js @@ -5,8 +5,14 @@ const drop = require('./drop.js'); test('drop is a Function', () => { expect(drop).toBeInstanceOf(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'); + test('Works without the last argument', () => { + expect(drop([1, 2, 3]), [2,3]).toEqual() +}); + test('Removes appropriate element count as specified', () => { + expect(drop([1, 2, 3], 2), [3]).toEqual() +}); + test('Empties array given a count greater than length', () => { + expect(drop([1, 2, 3], 42), []).toEqual() +}); diff --git a/test/dropRightWhile/dropRightWhile.test.js b/test/dropRightWhile/dropRightWhile.test.js index b59d5d0e3..228dea2e3 100644 --- a/test/dropRightWhile/dropRightWhile.test.js +++ b/test/dropRightWhile/dropRightWhile.test.js @@ -5,6 +5,8 @@ const dropRightWhile = require('./dropRightWhile.js'); test('dropRightWhile is a Function', () => { expect(dropRightWhile).toBeInstanceOf(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.'); + test('Removes elements from the end of an array until the passed function returns true.', () => { + expect(dropRightWhile([1, 2, 3, 4], n => n < 3), [1, 2]).toEqual() +}); diff --git a/test/dropWhile/dropWhile.test.js b/test/dropWhile/dropWhile.test.js index 380a55d10..4bff04c43 100644 --- a/test/dropWhile/dropWhile.test.js +++ b/test/dropWhile/dropWhile.test.js @@ -5,6 +5,8 @@ const dropWhile = require('./dropWhile.js'); test('dropWhile is a Function', () => { expect(dropWhile).toBeInstanceOf(Function); }); - t.deepEqual(dropWhile([1, 2, 3, 4], n => n >= 3), [3,4], 'Removes elements in an array until the passed function returns true.'); + test('Removes elements in an array until the passed function returns true.', () => { + expect(dropWhile([1, 2, 3, 4], n => n >= 3), [3,4]).toEqual() +}); diff --git a/test/elementIsVisibleInViewport/elementIsVisibleInViewport.test.js b/test/elementIsVisibleInViewport/elementIsVisibleInViewport.test.js index 0970f53cf..d7bc61cd5 100644 --- a/test/elementIsVisibleInViewport/elementIsVisibleInViewport.test.js +++ b/test/elementIsVisibleInViewport/elementIsVisibleInViewport.test.js @@ -5,6 +5,6 @@ const elementIsVisibleInViewport = require('./elementIsVisibleInViewport.js'); test('elementIsVisibleInViewport is a Function', () => { expect(elementIsVisibleInViewport).toBeInstanceOf(Function); }); - t.pass('Tested on 09/02/2018 by @chalarangelo'); + diff --git a/test/findLast/findLast.test.js b/test/findLast/findLast.test.js index 2435d0b09..3949b7eef 100644 --- a/test/findLast/findLast.test.js +++ b/test/findLast/findLast.test.js @@ -5,6 +5,8 @@ const findLast = require('./findLast.js'); test('findLast is a Function', () => { expect(findLast).toBeInstanceOf(Function); }); - t.equal(findLast([1, 2, 3, 4], n => n % 2 === 1), 3, 'Finds last element for which the given function returns true'); + test('Finds last element for which the given function returns true', () => { + expect(findLast([1, 2, 3, 4], n => n % 2 === 1), 3).toBe() +}); diff --git a/test/findLastIndex/findLastIndex.test.js b/test/findLastIndex/findLastIndex.test.js index 5fc425166..190e2cde8 100644 --- a/test/findLastIndex/findLastIndex.test.js +++ b/test/findLastIndex/findLastIndex.test.js @@ -5,6 +5,8 @@ const findLastIndex = require('./findLastIndex.js'); test('findLastIndex is a Function', () => { expect(findLastIndex).toBeInstanceOf(Function); }); - t.equal(findLastIndex([1, 2, 3, 4], n => n % 2 === 1), 2, 'Finds last index for which the given function returns true'); + test('Finds last index for which the given function returns true', () => { + expect(findLastIndex([1, 2, 3, 4], n => n % 2 === 1), 2).toBe() +}); diff --git a/test/flattenObject/flattenObject.test.js b/test/flattenObject/flattenObject.test.js index 2d3b9a758..eb353fa5f 100644 --- a/test/flattenObject/flattenObject.test.js +++ b/test/flattenObject/flattenObject.test.js @@ -5,7 +5,11 @@ const flattenObject = require('./flattenObject.js'); test('flattenObject is a Function', () => { expect(flattenObject).toBeInstanceOf(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'); + test('Flattens an object with the paths for keys', () => { + expect(flattenObject({ a: { b: { c: 1 } }, d: 1 }), { 'a.b.c': 1, d: 1 }).toEqual() +}); + test('Works with arrays', () => { + expect(flattenObject([0,1,[2,[1]],1]), { 0: 0, 1: 1, 3: 1, '2.0': 2, '2.1.0': 1 }).toEqual() +}); diff --git a/test/flip/flip.test.js b/test/flip/flip.test.js index f5b120b8c..912e91c22 100644 --- a/test/flip/flip.test.js +++ b/test/flip/flip.test.js @@ -9,6 +9,8 @@ const flip = require('./flip.js'); let b = {}; const mergeFrom = flip(Object.assign); let mergePerson = mergeFrom.bind(null, a); - t.deepEqual(mergePerson(b), a, 'Flips argument order'); + test('Flips argument order', () => { + expect(mergePerson(b), a).toEqual() +}); diff --git a/test/forEachRight/forEachRight.test.js b/test/forEachRight/forEachRight.test.js index 69b66df3f..bd42e32f3 100644 --- a/test/forEachRight/forEachRight.test.js +++ b/test/forEachRight/forEachRight.test.js @@ -7,6 +7,8 @@ const forEachRight = require('./forEachRight.js'); }); let output = ''; forEachRight([1, 2, 3, 4], val => output+=val); - t.equal(output, '4321', 'Iterates over the array in reverse'); + test('Iterates over the array in reverse', () => { + expect(output, '4321').toBe() +}); diff --git a/test/forOwn/forOwn.test.js b/test/forOwn/forOwn.test.js index 4b6931628..1b41dfb38 100644 --- a/test/forOwn/forOwn.test.js +++ b/test/forOwn/forOwn.test.js @@ -7,6 +7,8 @@ const forOwn = require('./forOwn.js'); }); let output = []; forOwn({ foo: 'bar', a: 1 }, v => output.push(v)); - t.deepEqual(output, ['bar', 1], 'Iterates over an element\'s key-value pairs'); + test('Iterates over an element\'s key-value pairs', () => { + expect(output, ['bar', 1]).toEqual() +}); diff --git a/test/forOwnRight/forOwnRight.test.js b/test/forOwnRight/forOwnRight.test.js index 9e18b97f7..01ce32b65 100644 --- a/test/forOwnRight/forOwnRight.test.js +++ b/test/forOwnRight/forOwnRight.test.js @@ -7,6 +7,8 @@ const forOwnRight = require('./forOwnRight.js'); }); let output = []; forOwnRight({ foo: 'bar', a: 1 }, v => output.push(v)); - t.deepEqual(output, [1, 'bar'], 'Iterates over an element\'s key-value pairs in reverse'); + test('Iterates over an element\'s key-value pairs in reverse', () => { + expect(output, [1, 'bar']).toEqual() +}); diff --git a/test/functionName/functionName.test.js b/test/functionName/functionName.test.js index e23478794..750c856b1 100644 --- a/test/functionName/functionName.test.js +++ b/test/functionName/functionName.test.js @@ -8,12 +8,18 @@ const functionName = fn => (console.debug(fn.name), fn); expect(functionName).toBeInstanceOf(Function); }); functionName(Math.max); - t.equal(output, 'max', 'Works for native functions'); + test('Works for native functions', () => { + expect(output, 'max').toBe() +}); function fun(x) {return x;} functionName(fun); - t.equal(output, 'fun', 'Works for functions'); + test('Works for functions', () => { + expect(output, 'fun').toBe() +}); const fn = x => x; functionName(fn); - t.equal(output, 'fn', 'Works for arrow functions'); + test('Works for arrow functions', () => { + expect(output, 'fn').toBe() +}); diff --git a/test/functions/functions.test.js b/test/functions/functions.test.js index eb182cbb0..cade171cb 100644 --- a/test/functions/functions.test.js +++ b/test/functions/functions.test.js @@ -10,7 +10,11 @@ const functions = require('./functions.js'); 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'); + test('Returns own methods', () => { + expect(functions(new Foo()), ['a', 'b']).toEqual() +}); + test('Returns own and inherited methods', () => { + expect(functions(new Foo(), true), ['a', 'b', 'c']).toEqual() +}); diff --git a/test/getScrollPosition/getScrollPosition.test.js b/test/getScrollPosition/getScrollPosition.test.js index 24746b482..7e9b12367 100644 --- a/test/getScrollPosition/getScrollPosition.test.js +++ b/test/getScrollPosition/getScrollPosition.test.js @@ -5,6 +5,6 @@ const getScrollPosition = require('./getScrollPosition.js'); test('getScrollPosition is a Function', () => { expect(getScrollPosition).toBeInstanceOf(Function); }); - t.pass('Tested by @chalarangelo on 16/02/2018'); + diff --git a/test/getStyle/getStyle.test.js b/test/getStyle/getStyle.test.js index 0c50ec687..46fa01505 100644 --- a/test/getStyle/getStyle.test.js +++ b/test/getStyle/getStyle.test.js @@ -5,6 +5,6 @@ const getStyle = require('./getStyle.js'); test('getStyle is a Function', () => { expect(getStyle).toBeInstanceOf(Function); }); - t.pass('Tested by @chalarangelo on 16/02/2018'); + diff --git a/test/hasFlags/hasFlags.test.js b/test/hasFlags/hasFlags.test.js index a8eeb0dc3..0278eed8e 100644 --- a/test/hasFlags/hasFlags.test.js +++ b/test/hasFlags/hasFlags.test.js @@ -5,6 +5,6 @@ const hasFlags = require('./hasFlags.js'); test('hasFlags is a Function', () => { expect(hasFlags).toBeInstanceOf(Function); }); - t.pass('Tested by @chalarangelo on 16/02/2018'); + diff --git a/test/hashBrowser/hashBrowser.test.js b/test/hashBrowser/hashBrowser.test.js index 71043e545..f46f2f572 100644 --- a/test/hashBrowser/hashBrowser.test.js +++ b/test/hashBrowser/hashBrowser.test.js @@ -5,6 +5,6 @@ const hashBrowser = require('./hashBrowser.js'); test('hashBrowser is a Function', () => { expect(hashBrowser).toBeInstanceOf(Function); }); - t.pass('Tested by @chalarangelo on 16/02/2018'); + diff --git a/test/head/head.test.js b/test/head/head.test.js index 3a672d76b..fd29c145c 100644 --- a/test/head/head.test.js +++ b/test/head/head.test.js @@ -9,8 +9,12 @@ const head = require('./head.js'); expect(head({ a: 1234}) === undefined).toBeTruthy(); }); 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'); + test('head({ 0: false}) returns false', () => { + expect(head({ 0: false}), false).toBe() +}); + test('head(String) returns S', () => { + expect(head('String'), 'S').toBe() +}); 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'); diff --git a/test/hide/hide.test.js b/test/hide/hide.test.js index e5cf19bdd..ae3a4e4a0 100644 --- a/test/hide/hide.test.js +++ b/test/hide/hide.test.js @@ -5,6 +5,6 @@ const hide = require('./hide.js'); test('hide is a Function', () => { expect(hide).toBeInstanceOf(Function); }); - t.pass('Tested by @chalarangelo on 16/02/2018'); + diff --git a/test/httpPost/httpPost.test.js b/test/httpPost/httpPost.test.js index 876e5a69d..62e65a49c 100644 --- a/test/httpPost/httpPost.test.js +++ b/test/httpPost/httpPost.test.js @@ -17,7 +17,9 @@ const httpPost = (url, data, callback, err = console.error) => { userId: 1 }; httpPost('https: - t.deepEqual(JSON.parse(response).id, 101, 'Sends a POST request'); + test('Sends a POST request', () => { + expect(JSON.parse(response).id, 101).toEqual() +}); diff --git a/test/httpsRedirect/httpsRedirect.test.js b/test/httpsRedirect/httpsRedirect.test.js index 338c0f925..6727278bc 100644 --- a/test/httpsRedirect/httpsRedirect.test.js +++ b/test/httpsRedirect/httpsRedirect.test.js @@ -5,6 +5,6 @@ const httpsRedirect = require('./httpsRedirect.js'); test('httpsRedirect is a Function', () => { expect(httpsRedirect).toBeInstanceOf(Function); }); - t.pass('Tested on 09/02/2018 by @chalarangelo'); + diff --git a/test/intersectionBy/intersectionBy.test.js b/test/intersectionBy/intersectionBy.test.js index f6efdbfae..2c5207f23 100644 --- a/test/intersectionBy/intersectionBy.test.js +++ b/test/intersectionBy/intersectionBy.test.js @@ -5,6 +5,8 @@ const intersectionBy = require('./intersectionBy.js'); test('intersectionBy is a Function', () => { expect(intersectionBy).toBeInstanceOf(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'); + 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), [2.1]).toEqual() +}); diff --git a/test/intersectionWith/intersectionWith.test.js b/test/intersectionWith/intersectionWith.test.js index 28f704a38..09ed1a88e 100644 --- a/test/intersectionWith/intersectionWith.test.js +++ b/test/intersectionWith/intersectionWith.test.js @@ -5,6 +5,8 @@ const intersectionWith = require('./intersectionWith.js'); test('intersectionWith is a Function', () => { expect(intersectionWith).toBeInstanceOf(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'); + 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)), [1.5, 3, 0]).toEqual() +}); diff --git a/test/isArrayLike/isArrayLike.test.js b/test/isArrayLike/isArrayLike.test.js index 253efd87d..a274a66db 100644 --- a/test/isArrayLike/isArrayLike.test.js +++ b/test/isArrayLike/isArrayLike.test.js @@ -5,8 +5,14 @@ const isArrayLike = require('./isArrayLike.js'); test('isArrayLike is a Function', () => { expect(isArrayLike).toBeInstanceOf(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'); + test('Returns true for a string', () => { + expect(isArrayLike('abc'), true).toBe() +}); + test('Returns true for an array', () => { + expect(isArrayLike([1,2,3]), true).toBe() +}); + test('Returns false for null', () => { + expect(isArrayLike(null), false).toBe() +}); diff --git a/test/isDivisible/isDivisible.test.js b/test/isDivisible/isDivisible.test.js index 741dd3f1d..adb867938 100644 --- a/test/isDivisible/isDivisible.test.js +++ b/test/isDivisible/isDivisible.test.js @@ -5,5 +5,7 @@ const isDivisible = require('./isDivisible.js'); test('isDivisible is a Function', () => { expect(isDivisible).toBeInstanceOf(Function); }); - t.equal(isDivisible(6, 3), true, 'The number 6 is divisible by 3'); + test('The number 6 is divisible by 3', () => { + expect(isDivisible(6, 3), true).toBe() +}); diff --git a/test/isEmpty/isEmpty.test.js b/test/isEmpty/isEmpty.test.js index 21e96f65d..0144a4096 100644 --- a/test/isEmpty/isEmpty.test.js +++ b/test/isEmpty/isEmpty.test.js @@ -5,15 +5,35 @@ const isEmpty = require('./isEmpty.js'); test('isEmpty is a Function', () => { expect(isEmpty).toBeInstanceOf(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'); + test('Returns true for empty Map', () => { + expect(isEmpty(new Map()), true).toBe() +}); + test('Returns true for empty Set', () => { + expect(isEmpty(new Set()), true).toBe() +}); + test('Returns true for empty array', () => { + expect(isEmpty([]), true).toBe() +}); + test('Returns true for empty object', () => { + expect(isEmpty({}), true).toBe() +}); + test('Returns true for empty string', () => { + expect(isEmpty(''), true).toBe() +}); + test('Returns false for non-empty array', () => { + expect(isEmpty([1, 2]), false).toBe() +}); + test('Returns false for non-empty object', () => { + expect(isEmpty({ a: 1, b: 2 }), false).toBe() +}); + test('Returns false for non-empty string', () => { + expect(isEmpty('text'), false).toBe() +}); + test('Returns true - type is not considered a collection', () => { + expect(isEmpty(123), true).toBe() +}); + test('Returns true - type is not considered a collection', () => { + expect(isEmpty(true), true).toBe() +}); diff --git a/test/isEven/isEven.test.js b/test/isEven/isEven.test.js index 5065b80c8..3a1136da1 100644 --- a/test/isEven/isEven.test.js +++ b/test/isEven/isEven.test.js @@ -5,7 +5,9 @@ const isEven = require('./isEven.js'); test('isEven is a Function', () => { expect(isEven).toBeInstanceOf(Function); }); - t.equal(isEven(4), true, '4 is even number'); + test('4 is even number', () => { + expect(isEven(4), true).toBe() +}); test('5 is not an even number', () => { expect(isEven(5), false).toBeFalsy(); }); diff --git a/test/isNil/isNil.test.js b/test/isNil/isNil.test.js index 3ee0892a0..e193e8075 100644 --- a/test/isNil/isNil.test.js +++ b/test/isNil/isNil.test.js @@ -5,8 +5,14 @@ const isNil = require('./isNil.js'); test('isNil is a Function', () => { expect(isNil).toBeInstanceOf(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'); + test('Returns true for null', () => { + expect(isNil(null), true).toBe() +}); + test('Returns true for undefined', () => { + expect(isNil(undefined), true).toBe() +}); + test('Returns false for an empty string', () => { + expect(isNil(''), false).toBe() +}); diff --git a/test/isObjectLike/isObjectLike.test.js b/test/isObjectLike/isObjectLike.test.js index 1bf9fe014..ad1f9c263 100644 --- a/test/isObjectLike/isObjectLike.test.js +++ b/test/isObjectLike/isObjectLike.test.js @@ -5,9 +5,17 @@ const isObjectLike = require('./isObjectLike.js'); test('isObjectLike is a Function', () => { expect(isObjectLike).toBeInstanceOf(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'); + test('Returns true for an object', () => { + expect(isObjectLike({}), true).toBe() +}); + test('Returns true for an array', () => { + expect(isObjectLike([1, 2, 3]), true).toBe() +}); + test('Returns false for a function', () => { + expect(isObjectLike(x => x), false).toBe() +}); + test('Returns false for null', () => { + expect(isObjectLike(null), false).toBe() +}); diff --git a/test/isPlainObject/isPlainObject.test.js b/test/isPlainObject/isPlainObject.test.js index 985a1f704..48aea1309 100644 --- a/test/isPlainObject/isPlainObject.test.js +++ b/test/isPlainObject/isPlainObject.test.js @@ -5,7 +5,11 @@ const isPlainObject = require('./isPlainObject.js'); test('isPlainObject is a Function', () => { expect(isPlainObject).toBeInstanceOf(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)'); + test('Returns true for a plain object', () => { + expect(isPlainObject({ a: 1 }), true).toBe() +}); + test('Returns false for a Map (example of non-plain object)', () => { + expect(isPlainObject(new Map()), false).toBe() +}); diff --git a/test/isPromiseLike/isPromiseLike.test.js b/test/isPromiseLike/isPromiseLike.test.js index a87ceb480..1205dab72 100644 --- a/test/isPromiseLike/isPromiseLike.test.js +++ b/test/isPromiseLike/isPromiseLike.test.js @@ -10,7 +10,11 @@ const isPromiseLike = require('./isPromiseLike.js'); 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'); + test('Returns false for null', () => { + expect(isPromiseLike(null), false).toBe() +}); + test('Returns false for an empty object', () => { + expect(isPromiseLike({}), false).toBe() +}); diff --git a/test/isSorted/isSorted.test.js b/test/isSorted/isSorted.test.js index 06c7f459b..d6a3d2716 100644 --- a/test/isSorted/isSorted.test.js +++ b/test/isSorted/isSorted.test.js @@ -5,16 +5,38 @@ const isSorted = require('./isSorted.js'); test('isSorted is a Function', () => { expect(isSorted).toBeInstanceOf(Function); }); - 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'); + test('Array is sorted in ascending order', () => { + expect(isSorted([0, 1, 2]), 1).toBe() +}); + test('Array is sorted in ascending order', () => { + expect(isSorted([0, 1, 2, 2]), 1).toBe() +}); + test('Array is sorted in ascending order', () => { + expect(isSorted([-4, -3, -2]), 1).toBe() +}); + test('Array is sorted in ascending order', () => { + expect(isSorted([0, 0, 1, 2]), 1).toBe() +}); + test('Array is sorted in descending order', () => { + expect(isSorted([2, 1, 0]), -1).toBe() +}); + test('Array is sorted in descending order', () => { + expect(isSorted([2, 2, 1, 0]), -1).toBe() +}); + test('Array is sorted in descending order', () => { + expect(isSorted([-2, -3, -4]), -1).toBe() +}); + test('Array is sorted in descending order', () => { + expect(isSorted([2, 1, 0, 0]), -1).toBe() +}); + test('Array is empty', () => { + expect(isSorted([]), undefined).toBe() +}); + test('Array is not sorted, direction changed in array', () => { + expect(isSorted([1]), 0).toBe() +}); + test('Array is not sorted, direction changed in array', () => { + expect(isSorted([1, 2, 1]), 0).toBe() +}); diff --git a/test/isString/isString.test.js b/test/isString/isString.test.js index ce50d62c7..752346b28 100644 --- a/test/isString/isString.test.js +++ b/test/isString/isString.test.js @@ -5,9 +5,19 @@ const isString = require('./isString.js'); test('isString is a Function', () => { expect(isString).toBeInstanceOf(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'); + test('foo is a string', () => { + expect(isString('foo'), true).toBe() +}); + test('"10" is a string', () => { + expect(isString('10'), true).toBe() +}); + test('Empty string is a string', () => { + expect(isString(''), true).toBe() +}); + test('10 is not a string', () => { + expect(isString(10), false).toBe() +}); + test('true is not string', () => { + expect(isString(true), false).toBe() +}); diff --git a/test/isUpperCase/isUpperCase.test.js b/test/isUpperCase/isUpperCase.test.js index a50c7aa2a..650e0775a 100644 --- a/test/isUpperCase/isUpperCase.test.js +++ b/test/isUpperCase/isUpperCase.test.js @@ -5,7 +5,13 @@ const isUpperCase = require('./isUpperCase.js'); test('isUpperCase is a Function', () => { expect(isUpperCase).toBeInstanceOf(Function); }); - 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'); + test('ABC is all upper case', () => { + expect(isUpperCase('ABC'), true).toBe() +}); + test('abc is not all upper case', () => { + expect(isUpperCase('abc'), false).toBe() +}); + test('A3@$ is all uppercase', () => { + expect(isUpperCase('A3@$'), true).toBe() +}); diff --git a/test/isValidJSON/isValidJSON.test.js b/test/isValidJSON/isValidJSON.test.js index 8ab0fd2fa..499d27685 100644 --- a/test/isValidJSON/isValidJSON.test.js +++ b/test/isValidJSON/isValidJSON.test.js @@ -5,7 +5,13 @@ const isValidJSON = require('./isValidJSON.js'); test('isValidJSON is a Function', () => { expect(isValidJSON).toBeInstanceOf(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'); + test('{"name":"Adam","age":20} is a valid JSON', () => { + expect(isValidJSON('{"name":"Adam","age":20}'), true).toBe() +}); + test('{"name":"Adam",age:"20"} is not a valid JSON', () => { + expect(isValidJSON('{"name":"Adam",age:"20"}'), false).toBe() +}); + test('null is a valid JSON', () => { + expect(isValidJSON(null), true).toBe() +}); diff --git a/test/last/last.test.js b/test/last/last.test.js index f2d4081a1..282177e82 100644 --- a/test/last/last.test.js +++ b/test/last/last.test.js @@ -9,8 +9,12 @@ const last = require('./last.js'); expect(last({ a: 1234}) === undefined).toBeTruthy(); }); 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'); + test('last({ 0: false}) returns undefined', () => { + expect(last({ 0: false}), undefined).toBe() +}); + test('last(String) returns g', () => { + expect(last('String'), 'g').toBe() +}); 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'); diff --git a/test/lowercaseKeys/lowercaseKeys.test.js b/test/lowercaseKeys/lowercaseKeys.test.js index eb0c9bd02..ad8077094 100644 --- a/test/lowercaseKeys/lowercaseKeys.test.js +++ b/test/lowercaseKeys/lowercaseKeys.test.js @@ -7,7 +7,11 @@ const lowercaseKeys = require('./lowercaseKeys.js'); }); 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'); + test('Lowercases object keys', () => { + expect(myObjLower, {name: 'Adam', surname: 'Smith'}).toEqual() +}); + test('Does not mutate original object', () => { + expect(myObj, { Name: 'Adam', sUrnAME: 'Smith' }).toEqual() +}); diff --git a/test/mapKeys/mapKeys.test.js b/test/mapKeys/mapKeys.test.js index 312dadee9..cec228c64 100644 --- a/test/mapKeys/mapKeys.test.js +++ b/test/mapKeys/mapKeys.test.js @@ -5,6 +5,8 @@ const mapKeys = require('./mapKeys.js'); test('mapKeys is a Function', () => { expect(mapKeys).toBeInstanceOf(Function); }); - t.deepEqual(mapKeys({ a: 1, b: 2 }, (val, key) => key + val), { a1: 1, b2: 2 }, 'Maps keys'); + test('Maps keys', () => { + expect(mapKeys({ a: 1, b: 2 }, (val, key) => key + val), { a1: 1, b2: 2 }).toEqual() +}); diff --git a/test/mapObject/mapObject.test.js b/test/mapObject/mapObject.test.js index 2c3b5a01d..2b00337b8 100644 --- a/test/mapObject/mapObject.test.js +++ b/test/mapObject/mapObject.test.js @@ -6,7 +6,11 @@ const mapObject = require('./mapObject.js'); expect(mapObject).toBeInstanceOf(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 }'); + 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), { 1: -1, 2: -1, 3: -1, 4: -1 }).toEqual() +}); + 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), { 1: 1, 2: 1, 3: 1, 4: 1 }).toEqual() +}); diff --git a/test/mapValues/mapValues.test.js b/test/mapValues/mapValues.test.js index 75ab17b96..f8b315256 100644 --- a/test/mapValues/mapValues.test.js +++ b/test/mapValues/mapValues.test.js @@ -9,6 +9,8 @@ const mapValues = require('./mapValues.js'); fred: { user: 'fred', age: 40 }, pebbles: { user: 'pebbles', age: 1 } }; - t.deepEqual(mapValues(users, u => u.age), { fred: 40, pebbles: 1 }, 'Maps values'); + test('Maps values', () => { + expect(mapValues(users, u => u.age), { fred: 40, pebbles: 1 }).toEqual() +}); diff --git a/test/memoize/memoize.test.js b/test/memoize/memoize.test.js index f646ed27a..1d7bf83e1 100644 --- a/test/memoize/memoize.test.js +++ b/test/memoize/memoize.test.js @@ -7,8 +7,14 @@ const memoize = require('./memoize.js'); }); 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'); + test('Function works properly', () => { + expect(square(2), 4).toBe() +}); + test('Function works properly', () => { + expect(square(3), 9).toBe() +}); + test('Cache stores values', () => { + expect(Array.from(square.cache), [[2,4],[3,9]]).toEqual() +}); diff --git a/test/merge/merge.test.js b/test/merge/merge.test.js index 337c466ca..34ebec62f 100644 --- a/test/merge/merge.test.js +++ b/test/merge/merge.test.js @@ -14,6 +14,8 @@ const merge = require('./merge.js'); 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'); + test('Merges two objects', () => { + expect(merge(object, other), { a: [ { x: 2 }, { y: 4 }, { z: 3 } ], b: [ 1, 2, 3 ], c: 'foo' }).toEqual() +}); diff --git a/test/mostPerformant/mostPerformant.test.js b/test/mostPerformant/mostPerformant.test.js index cffb718a6..934e8667b 100644 --- a/test/mostPerformant/mostPerformant.test.js +++ b/test/mostPerformant/mostPerformant.test.js @@ -5,6 +5,6 @@ const mostPerformant = require('./mostPerformant.js'); test('mostPerformant is a Function', () => { expect(mostPerformant).toBeInstanceOf(Function); }); - t.pass('Tested by @chalarangelo on 16/02/2018'); + diff --git a/test/nthArg/nthArg.test.js b/test/nthArg/nthArg.test.js index edbce4300..1fe0d7568 100644 --- a/test/nthArg/nthArg.test.js +++ b/test/nthArg/nthArg.test.js @@ -6,9 +6,15 @@ const nthArg = require('./nthArg.js'); expect(nthArg).toBeInstanceOf(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'); + test('Returns the nth argument', () => { + expect(third(1, 2, 3), 3).toBe() +}); + test('Returns undefined if arguments too few', () => { + expect(third(1, 2), undefined).toBe() +}); const last = nthArg(-1); - t.equal(last(1, 2, 3, 4, 5), 5, 'Works for negative values'); + test('Works for negative values', () => { + expect(last(1, 2, 3, 4, 5), 5).toBe() +}); diff --git a/test/observeMutations/observeMutations.test.js b/test/observeMutations/observeMutations.test.js index 9de9fd425..1b6330663 100644 --- a/test/observeMutations/observeMutations.test.js +++ b/test/observeMutations/observeMutations.test.js @@ -5,6 +5,6 @@ const observeMutations = require('./observeMutations.js'); test('observeMutations is a Function', () => { expect(observeMutations).toBeInstanceOf(Function); }); - t.pass('Tested on 09/02/2018 by @chalarangelo'); + diff --git a/test/off/off.test.js b/test/off/off.test.js index ab48b3167..dc897dfcd 100644 --- a/test/off/off.test.js +++ b/test/off/off.test.js @@ -5,6 +5,6 @@ const off = require('./off.js'); test('off is a Function', () => { expect(off).toBeInstanceOf(Function); }); - t.pass('Tested by @chalarangelo on 16/02/2018'); + diff --git a/test/offset/offset.test.js b/test/offset/offset.test.js index cf2622bf1..089f1ca48 100644 --- a/test/offset/offset.test.js +++ b/test/offset/offset.test.js @@ -5,11 +5,23 @@ const offset = require('./offset.js'); test('offset is a Function', () => { expect(offset).toBeInstanceOf(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.'); + test('Offset of 0 returns the same array.', () => { + expect(offset([1, 2, 3, 4, 5], 0), [1, 2, 3, 4, 5]).toEqual() +}); + test('Offset > 0 returns the offsetted array.', () => { + expect(offset([1, 2, 3, 4, 5], 2), [3, 4, 5, 1, 2]).toEqual() +}); + test('Offset < 0 returns the reverse offsetted array.', () => { + expect(offset([1, 2, 3, 4, 5], -2), [4, 5, 1, 2, 3]).toEqual() +}); + test('Offset greater than the length of the array returns the same array.', () => { + expect(offset([1, 2, 3, 4, 5], 6),[1, 2, 3, 4, 5]).toEqual() +}); + test('Offset less than the negative length of the array returns the same array.', () => { + expect(offset([1, 2, 3, 4, 5], -6), [1, 2, 3, 4, 5]).toEqual() +}); + 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 3629dfc96..eca259073 100644 --- a/test/omit/omit.test.js +++ b/test/omit/omit.test.js @@ -5,6 +5,8 @@ const omit = require('./omit.js'); test('omit is a Function', () => { expect(omit).toBeInstanceOf(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'); + test('Omits the key-value pairs corresponding to the given keys from an object', () => { + expect(omit({ a: 1, b: '2', c: 3 }, ['b']), { 'a': 1, 'c': 3 }).toEqual() +}); diff --git a/test/omitBy/omitBy.test.js b/test/omitBy/omitBy.test.js index 586bbd6b9..8fc3d26d9 100644 --- a/test/omitBy/omitBy.test.js +++ b/test/omitBy/omitBy.test.js @@ -5,6 +5,8 @@ const omitBy = require('./omitBy.js'); test('omitBy is a Function', () => { expect(omitBy).toBeInstanceOf(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'); + 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'), { b: '2' }).toEqual() +}); diff --git a/test/on/on.test.js b/test/on/on.test.js index 8496fd977..d681556c5 100644 --- a/test/on/on.test.js +++ b/test/on/on.test.js @@ -5,6 +5,6 @@ const on = require('./on.js'); test('on is a Function', () => { expect(on).toBeInstanceOf(Function); }); - t.pass('Tested by @chalarangelo on 16/02/2018'); + diff --git a/test/onUserInputChange/onUserInputChange.test.js b/test/onUserInputChange/onUserInputChange.test.js index a31a50a88..8894c8a0c 100644 --- a/test/onUserInputChange/onUserInputChange.test.js +++ b/test/onUserInputChange/onUserInputChange.test.js @@ -5,6 +5,6 @@ const onUserInputChange = require('./onUserInputChange.js'); test('onUserInputChange is a Function', () => { expect(onUserInputChange).toBeInstanceOf(Function); }); - t.pass('Tested by @chalarangelo on 16/02/2018'); + diff --git a/test/once/once.test.js b/test/once/once.test.js index c8ea9c9e9..04d9a77ed 100644 --- a/test/once/once.test.js +++ b/test/once/once.test.js @@ -5,6 +5,6 @@ const once = require('./once.js'); test('once is a Function', () => { expect(once).toBeInstanceOf(Function); }); - t.pass('Tested by @chalarangelo on 16/02/2018'); + diff --git a/test/over/over.test.js b/test/over/over.test.js index 8ed724cfb..7071bf09f 100644 --- a/test/over/over.test.js +++ b/test/over/over.test.js @@ -6,6 +6,8 @@ const over = require('./over.js'); expect(over).toBeInstanceOf(Function); }); const minMax = over(Math.min, Math.max); - t.deepEqual(minMax(1, 2, 3, 4, 5), [1,5], 'Applies given functions over multiple arguments'); + test('Applies given functions over multiple arguments', () => { + expect(minMax(1, 2, 3, 4, 5), [1,5]).toEqual() +}); diff --git a/test/overArgs/overArgs.test.js b/test/overArgs/overArgs.test.js index 19cce2cfa..0127c5993 100644 --- a/test/overArgs/overArgs.test.js +++ b/test/overArgs/overArgs.test.js @@ -8,6 +8,8 @@ const overArgs = require('./overArgs.js'); 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'); + test('Invokes the provided function with its arguments transformed', () => { + expect(fn(9, 3), [81, 6]).toEqual() +}); diff --git a/test/pad/pad.test.js b/test/pad/pad.test.js index f01524b50..1b797df95 100644 --- a/test/pad/pad.test.js +++ b/test/pad/pad.test.js @@ -5,9 +5,17 @@ const pad = require('./pad.js'); test('pad is a Function', () => { expect(pad).toBeInstanceOf(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'); + test('cat is padded on both sides', () => { + expect(pad('cat',8), ' cat ').toBe() +}); + test('length of string is 8', () => { + expect(pad('cat',8).length, 8).toBe() +}); + test('pads 42 with "0"', () => { + expect(pad(String(42), 6, '0'), '004200').toBe() +}); + test('does not truncates if string exceeds length', () => { + expect(pad('foobar', 3), 'foobar').toBe() +}); diff --git a/test/parseCookie/parseCookie.test.js b/test/parseCookie/parseCookie.test.js index b1c64e056..d7494447f 100644 --- a/test/parseCookie/parseCookie.test.js +++ b/test/parseCookie/parseCookie.test.js @@ -5,6 +5,8 @@ const parseCookie = require('./parseCookie.js'); test('parseCookie is a Function', () => { expect(parseCookie).toBeInstanceOf(Function); }); - t.deepEqual(parseCookie('foo=bar; equation=E%3Dmc%5E2'), { foo: 'bar', equation: 'E=mc^2' }, 'Parses the cookie'); + test('Parses the cookie', () => { + expect(parseCookie('foo=bar; equation=E%3Dmc%5E2'), { foo: 'bar', equation: 'E=mc^2' }).toEqual() +}); diff --git a/test/partial/partial.test.js b/test/partial/partial.test.js index d9dc5dbf5..8052974d4 100644 --- a/test/partial/partial.test.js +++ b/test/partial/partial.test.js @@ -9,6 +9,8 @@ const partial = require('./partial.js'); return greeting + ' ' + name + '!'; } const greetHello = partial(greet, 'Hello'); - t.equal(greetHello('John'), 'Hello John!', 'Prepends arguments'); + test('Prepends arguments', () => { + expect(greetHello('John'), 'Hello John!').toBe() +}); diff --git a/test/partialRight/partialRight.test.js b/test/partialRight/partialRight.test.js index d5e29fe1a..ee2006517 100644 --- a/test/partialRight/partialRight.test.js +++ b/test/partialRight/partialRight.test.js @@ -9,6 +9,8 @@ const partialRight = require('./partialRight.js'); return greeting + ' ' + name + '!'; } const greetJohn = partialRight(greet, 'John'); - t.equal(greetJohn('Hello'), 'Hello John!', 'Appends arguments'); + test('Appends arguments', () => { + expect(greetJohn('Hello'), 'Hello John!').toBe() +}); diff --git a/test/permutations/permutations.test.js b/test/permutations/permutations.test.js index 3b1ffac73..9962dc9b8 100644 --- a/test/permutations/permutations.test.js +++ b/test/permutations/permutations.test.js @@ -5,6 +5,8 @@ const permutations = require('./permutations.js'); test('permutations is a Function', () => { expect(permutations).toBeInstanceOf(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'); + test('Generates all permutations of an array', () => { + expect(permutations([1, 33, 5]), [ [ 1, 33, 5 ], [ 1, 5, 33 ], [ 33, 1, 5 ], [ 33, 5, 1 ], [ 5, 1, 33 ], [ 5, 33, 1 ] ]).toEqual() +}); diff --git a/test/pickBy/pickBy.test.js b/test/pickBy/pickBy.test.js index d0e5d9b19..39c1d1420 100644 --- a/test/pickBy/pickBy.test.js +++ b/test/pickBy/pickBy.test.js @@ -5,6 +5,8 @@ const pickBy = require('./pickBy.js'); test('pickBy is a Function', () => { expect(pickBy).toBeInstanceOf(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.'); + 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'), { 'a': 1, 'c': 3 }).toEqual() +}); diff --git a/test/pipeFunctions/pipeFunctions.test.js b/test/pipeFunctions/pipeFunctions.test.js index ddf1a3c0d..1f44b75e1 100644 --- a/test/pipeFunctions/pipeFunctions.test.js +++ b/test/pipeFunctions/pipeFunctions.test.js @@ -8,6 +8,8 @@ const pipeFunctions = require('./pipeFunctions.js'); 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'); + test('Performs left-to-right function composition', () => { + expect(multiplyAndAdd5(5, 2), 15).toBe() +}); diff --git a/test/pluralize/pluralize.test.js b/test/pluralize/pluralize.test.js index 7f2147e2d..570d16520 100644 --- a/test/pluralize/pluralize.test.js +++ b/test/pluralize/pluralize.test.js @@ -5,15 +5,25 @@ const pluralize = require('./pluralize.js'); test('pluralize is a Function', () => { expect(pluralize).toBeInstanceOf(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'); + test('Produces the plural of the word', () => { + expect(pluralize(0, 'apple'), 'apples').toBe() +}); + test('Produces the singular of the word', () => { + expect(pluralize(1, 'apple'), 'apple').toBe() +}); + test('Produces the plural of the word', () => { + expect(pluralize(2, 'apple'), 'apples').toBe() +}); + test('Prodices the defined plural of the word', () => { + expect(pluralize(2, 'person', 'people'), 'people').toBe() +}); const PLURALS = { person: 'people', radius: 'radii' }; const autoPluralize = pluralize(PLURALS); - t.equal(autoPluralize(2, 'person'), 'people', 'Works with a dictionary'); + test('Works with a dictionary', () => { + expect(autoPluralize(2, 'person'), 'people').toBe() +}); diff --git a/test/promisify/promisify.test.js b/test/promisify/promisify.test.js index 53b656aeb..52a4ed876 100644 --- a/test/promisify/promisify.test.js +++ b/test/promisify/promisify.test.js @@ -10,6 +10,6 @@ const promisify = require('./promisify.js'); expect(x() instanceof Promise).toBeTruthy(); }); const delay = promisify((d, cb) => setTimeout(cb, d)); - delay(200).then(() => t.pass('Runs the function provided')); + delay(200).then(() => diff --git a/test/pull/pull.test.js b/test/pull/pull.test.js index c7458e3a2..f68af2f57 100644 --- a/test/pull/pull.test.js +++ b/test/pull/pull.test.js @@ -7,6 +7,8 @@ const pull = require('./pull.js'); }); let myArray = ['a', 'b', 'c', 'a', 'b', 'c']; pull(myArray, 'a', 'c'); - t.deepEqual(myArray, ['b','b'], 'Pulls the specified values'); + test('Pulls the specified values', () => { + expect(myArray, ['b','b']).toEqual() +}); diff --git a/test/pullAtIndex/pullAtIndex.test.js b/test/pullAtIndex/pullAtIndex.test.js index 08db4f15d..a476f9496 100644 --- a/test/pullAtIndex/pullAtIndex.test.js +++ b/test/pullAtIndex/pullAtIndex.test.js @@ -7,7 +7,11 @@ const pullAtIndex = require('./pullAtIndex.js'); }); 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'); + test('Pulls the given values', () => { + expect(myArray, [ 'a', 'c' ]).toEqual() +}); + test('Pulls the given values', () => { + expect(pulled, [ 'b', 'd' ]).toEqual() +}); diff --git a/test/pullAtValue/pullAtValue.test.js b/test/pullAtValue/pullAtValue.test.js index bbf850ca8..26bdf35ea 100644 --- a/test/pullAtValue/pullAtValue.test.js +++ b/test/pullAtValue/pullAtValue.test.js @@ -7,7 +7,11 @@ const pullAtValue = require('./pullAtValue.js'); }); 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'); + test('Pulls the specified values', () => { + expect(myArray, [ 'a', 'c' ]).toEqual() +}); + test('Pulls the specified values', () => { + expect(pulled, [ 'b', 'd' ]).toEqual() +}); diff --git a/test/pullBy/pullBy.test.js b/test/pullBy/pullBy.test.js index f01205590..6a6dc7d8c 100644 --- a/test/pullBy/pullBy.test.js +++ b/test/pullBy/pullBy.test.js @@ -7,6 +7,8 @@ const pullBy = require('./pullBy.js'); }); 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'); + test('Pulls the specified values', () => { + expect(myArray, [{ x: 2 }]).toEqual() +}); diff --git a/test/quickSort/quickSort.test.js b/test/quickSort/quickSort.test.js index 693eb3da0..a9b37e0d5 100644 --- a/test/quickSort/quickSort.test.js +++ b/test/quickSort/quickSort.test.js @@ -5,8 +5,12 @@ const quickSort = require('./quickSort.js'); test('quickSort is a Function', () => { expect(quickSort).toBeInstanceOf(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]'); + test('quickSort([5, 6, 4, 3, 1, 2]) returns [1, 2, 3, 4, 5, 6]', () => { + expect(quickSort([5, 6, 4, 3, 1, 2]), [1, 2, 3, 4, 5, 6]).toEqual() +}); + test('quickSort([-1, 0, -2]) returns [-2, -1, 0]', () => { + expect(quickSort([-1, 0, -2]), [-2, -1, 0]).toEqual() +}); 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'); diff --git a/test/radsToDegrees/radsToDegrees.test.js b/test/radsToDegrees/radsToDegrees.test.js index 2a65a6c78..e8e2cd6dd 100644 --- a/test/radsToDegrees/radsToDegrees.test.js +++ b/test/radsToDegrees/radsToDegrees.test.js @@ -5,6 +5,8 @@ const radsToDegrees = require('./radsToDegrees.js'); test('radsToDegrees is a Function', () => { expect(radsToDegrees).toBeInstanceOf(Function); }); - t.equal(radsToDegrees(Math.PI / 2), 90, 'Returns the appropriate value'); + test('Returns the appropriate value', () => { + expect(radsToDegrees(Math.PI / 2), 90).toBe() +}); diff --git a/test/randomIntArrayInRange/randomIntArrayInRange.test.js b/test/randomIntArrayInRange/randomIntArrayInRange.test.js index 40b0635ef..1a58271fa 100644 --- a/test/randomIntArrayInRange/randomIntArrayInRange.test.js +++ b/test/randomIntArrayInRange/randomIntArrayInRange.test.js @@ -11,7 +11,9 @@ const randomIntArrayInRange = require('./randomIntArrayInRange.js'); test('The returned array contains only integers', () => { expect(arr.every(x => typeof x === 'number')).toBeTruthy(); }); - t.equal(arr.length, 10, 'The returned array has the proper length'); + test('The returned array has the proper length', () => { + expect(arr.length, 10).toBe() +}); 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/readFileLines/readFileLines.test.js b/test/readFileLines/readFileLines.test.js index 1590f08c0..800f0ef4c 100644 --- a/test/readFileLines/readFileLines.test.js +++ b/test/readFileLines/readFileLines.test.js @@ -5,6 +5,6 @@ const readFileLines = require('./readFileLines.js'); test('readFileLines is a Function', () => { expect(readFileLines).toBeInstanceOf(Function); }); - t.pass('Tested on 09/02/2018 by @chalarangelo'); + diff --git a/test/rearg/rearg.test.js b/test/rearg/rearg.test.js index a15e44b93..c2cd186cf 100644 --- a/test/rearg/rearg.test.js +++ b/test/rearg/rearg.test.js @@ -11,6 +11,8 @@ const rearg = require('./rearg.js'); }, [2, 0, 1] ); - t.deepEqual(rearged('b', 'c', 'a'), ['a', 'b', 'c'], 'Reorders arguments in invoked function'); + test('Reorders arguments in invoked function', () => { + expect(rearged('b', 'c', 'a'), ['a', 'b', 'c']).toEqual() +}); diff --git a/test/redirect/redirect.test.js b/test/redirect/redirect.test.js index 680d23ec5..e6d1e43b7 100644 --- a/test/redirect/redirect.test.js +++ b/test/redirect/redirect.test.js @@ -5,6 +5,6 @@ const redirect = require('./redirect.js'); test('redirect is a Function', () => { expect(redirect).toBeInstanceOf(Function); }); - t.pass('Tested on 09/02/2018 by @chalarangelo'); + diff --git a/test/reduceSuccessive/reduceSuccessive.test.js b/test/reduceSuccessive/reduceSuccessive.test.js index d78e659d6..67afd53df 100644 --- a/test/reduceSuccessive/reduceSuccessive.test.js +++ b/test/reduceSuccessive/reduceSuccessive.test.js @@ -5,6 +5,8 @@ const reduceSuccessive = require('./reduceSuccessive.js'); test('reduceSuccessive is a Function', () => { expect(reduceSuccessive).toBeInstanceOf(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'); + test('Returns the array of successively reduced values', () => { + expect(reduceSuccessive([1, 2, 3, 4, 5, 6], (acc, val) => acc + val, 0), [0, 1, 3, 6, 10, 15, 21]).toEqual() +}); diff --git a/test/reduceWhich/reduceWhich.test.js b/test/reduceWhich/reduceWhich.test.js index 4d6929507..832168d05 100644 --- a/test/reduceWhich/reduceWhich.test.js +++ b/test/reduceWhich/reduceWhich.test.js @@ -5,8 +5,12 @@ const reduceWhich = require('./reduceWhich.js'); test('reduceWhich is a Function', () => { expect(reduceWhich).toBeInstanceOf(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'); + test('Returns the minimum of an array', () => { + expect(reduceWhich([1, 3, 2]), 1).toBe() +}); + test('Returns the maximum of an array', () => { + expect(reduceWhich([1, 3, 2], (a, b) => b - a), 3).toBe() +}); t.deepEqual(reduceWhich( [{ name: 'Tom', age: 12 }, { name: 'Jack', age: 18 }, { name: 'Lucy', age: 9 }], (a, b) => a.age - b.age diff --git a/test/removeNonASCII/removeNonASCII.test.js b/test/removeNonASCII/removeNonASCII.test.js index a33c12a00..24b88a86e 100644 --- a/test/removeNonASCII/removeNonASCII.test.js +++ b/test/removeNonASCII/removeNonASCII.test.js @@ -5,6 +5,8 @@ const removeNonASCII = require('./removeNonASCII.js'); test('removeNonASCII is a Function', () => { expect(removeNonASCII).toBeInstanceOf(Function); }); - t.equal(removeNonASCII('äÄçÇéÉêlorem-ipsumöÖÐþúÚ'), 'lorem-ipsum', 'Removes non-ASCII characters'); + test('Removes non-ASCII characters', () => { + expect(removeNonASCII('äÄçÇéÉêlorem-ipsumöÖÐþúÚ'), 'lorem-ipsum').toBe() +}); diff --git a/test/runAsync/runAsync.test.js b/test/runAsync/runAsync.test.js index 7606a8cfb..8528fdb07 100644 --- a/test/runAsync/runAsync.test.js +++ b/test/runAsync/runAsync.test.js @@ -5,6 +5,6 @@ const runAsync = require('./runAsync.js'); test('runAsync is a Function', () => { expect(runAsync).toBeInstanceOf(Function); }); - t.pass('Tested on 09/02/2018 by @chalarangelo'); + diff --git a/test/runPromisesInSeries/runPromisesInSeries.test.js b/test/runPromisesInSeries/runPromisesInSeries.test.js index 646172e0e..88ac6ea82 100644 --- a/test/runPromisesInSeries/runPromisesInSeries.test.js +++ b/test/runPromisesInSeries/runPromisesInSeries.test.js @@ -6,6 +6,6 @@ const runPromisesInSeries = require('./runPromisesInSeries.js'); expect(runPromisesInSeries).toBeInstanceOf(Function); }); const delay = d => new Promise(r => setTimeout(r, d)); - runPromisesInSeries([() => delay(100), () => delay(200).then(() => t.pass('Runs promises in series'))]); + runPromisesInSeries([() => delay(100), () => delay(200).then(() => diff --git a/test/sample/sample.test.js b/test/sample/sample.test.js index caf8ccd45..38902e272 100644 --- a/test/sample/sample.test.js +++ b/test/sample/sample.test.js @@ -9,7 +9,11 @@ const sample = require('./sample.js'); test('Returns a random element from the array', () => { expect(arr.includes(sample(arr))).toBeTruthy(); }); - t.equal(sample([1]), 1, 'Works for single-element arrays'); - t.equal(sample([]), undefined, 'Returns undefined for empty array'); + test('Works for single-element arrays', () => { + expect(sample([1]), 1).toBe() +}); + test('Returns undefined for empty array', () => { + expect(sample([]), undefined).toBe() +}); diff --git a/test/sampleSize/sampleSize.test.js b/test/sampleSize/sampleSize.test.js index f56f1b5cb..9edcd69c6 100644 --- a/test/sampleSize/sampleSize.test.js +++ b/test/sampleSize/sampleSize.test.js @@ -6,12 +6,20 @@ const sampleSize = require('./sampleSize.js'); expect(sampleSize).toBeInstanceOf(Function); }); const arr = [3,7,9,11]; - t.equal(sampleSize(arr).length, 1, 'Returns a single element without n specified'); + test('Returns a single element without n specified', () => { + expect(sampleSize(arr).length, 1).toBe() +}); test('Returns a random sample of specified size from an array', () => { expect(sampleSize(arr, 2).every(x => arr.includes(x))).toBeTruthy(); }); - 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'); + test('Returns all elements in an array if n >= length', () => { + expect(sampleSize(arr, 5).length, 4).toBe() +}); + 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 37afc3739..0c44b1a53 100644 --- a/test/scrollToTop/scrollToTop.test.js +++ b/test/scrollToTop/scrollToTop.test.js @@ -5,6 +5,6 @@ const scrollToTop = require('./scrollToTop.js'); test('scrollToTop is a Function', () => { expect(scrollToTop).toBeInstanceOf(Function); }); - t.pass('Tested on 09/02/2018 by @chalarangelo'); + diff --git a/test/serializeCookie/serializeCookie.test.js b/test/serializeCookie/serializeCookie.test.js index 13e6d57ef..c07abf4d7 100644 --- a/test/serializeCookie/serializeCookie.test.js +++ b/test/serializeCookie/serializeCookie.test.js @@ -5,6 +5,8 @@ const serializeCookie = require('./serializeCookie.js'); test('serializeCookie is a Function', () => { expect(serializeCookie).toBeInstanceOf(Function); }); - t.equal(serializeCookie('foo', 'bar'), 'foo=bar', 'Serializes the cookie'); + test('Serializes the cookie', () => { + expect(serializeCookie('foo', 'bar'), 'foo=bar').toBe() +}); diff --git a/test/setStyle/setStyle.test.js b/test/setStyle/setStyle.test.js index 5dfb5ba7f..97214e8d4 100644 --- a/test/setStyle/setStyle.test.js +++ b/test/setStyle/setStyle.test.js @@ -5,6 +5,6 @@ const setStyle = require('./setStyle.js'); test('setStyle is a Function', () => { expect(setStyle).toBeInstanceOf(Function); }); - t.pass('Tested by @chalarangelo on 16/02/2018'); + diff --git a/test/shallowClone/shallowClone.test.js b/test/shallowClone/shallowClone.test.js index 5d0caaee8..d0806b0e3 100644 --- a/test/shallowClone/shallowClone.test.js +++ b/test/shallowClone/shallowClone.test.js @@ -8,6 +8,8 @@ const shallowClone = require('./shallowClone.js'); 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'); + test('Does not clone deeply', () => { + expect(a.obj, b.obj).toBe() +}); diff --git a/test/show/show.test.js b/test/show/show.test.js index ae9f97f2e..92a94c1fd 100644 --- a/test/show/show.test.js +++ b/test/show/show.test.js @@ -5,6 +5,6 @@ const show = require('./show.js'); test('show is a Function', () => { expect(show).toBeInstanceOf(Function); }); - t.pass('Tested by @chalarangelo on 16/02/2018'); + diff --git a/test/shuffle/shuffle.test.js b/test/shuffle/shuffle.test.js index 7fa46495a..55914b5da 100644 --- a/test/shuffle/shuffle.test.js +++ b/test/shuffle/shuffle.test.js @@ -10,7 +10,11 @@ const shuffle = require('./shuffle.js'); test('New array contains all original elements', () => { expect(shuffle(arr).every(x => arr.includes(x))).toBeTruthy(); }); - t.deepEqual(shuffle([]),[],'Works for empty arrays'); - t.deepEqual(shuffle([1]),[1],'Works for single-element arrays'); + test('Works for empty arrays', () => { + expect(shuffle([]),[]).toEqual() +}); + test('Works for single-element arrays', () => { + expect(shuffle([1]),[1]).toEqual() +}); diff --git a/test/sleep/sleep.test.js b/test/sleep/sleep.test.js index af6aca5da..0996b476e 100644 --- a/test/sleep/sleep.test.js +++ b/test/sleep/sleep.test.js @@ -7,7 +7,7 @@ const sleep = require('./sleep.js'); }); async function sleepyWork() { await sleep(1000); - t.pass('Works as expected'); + } diff --git a/test/sortedIndexBy/sortedIndexBy.test.js b/test/sortedIndexBy/sortedIndexBy.test.js index 49d9d7d60..43972d8f8 100644 --- a/test/sortedIndexBy/sortedIndexBy.test.js +++ b/test/sortedIndexBy/sortedIndexBy.test.js @@ -5,6 +5,8 @@ const sortedIndexBy = require('./sortedIndexBy.js'); test('sortedIndexBy is a Function', () => { expect(sortedIndexBy).toBeInstanceOf(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'); + 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), 0).toBe() +}); diff --git a/test/sortedLastIndex/sortedLastIndex.test.js b/test/sortedLastIndex/sortedLastIndex.test.js index 4a502f50e..d1c4eced1 100644 --- a/test/sortedLastIndex/sortedLastIndex.test.js +++ b/test/sortedLastIndex/sortedLastIndex.test.js @@ -5,6 +5,8 @@ const sortedLastIndex = require('./sortedLastIndex.js'); test('sortedLastIndex is a Function', () => { expect(sortedLastIndex).toBeInstanceOf(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'); + test('Returns the highest index to insert the element without messing up the list order', () => { + expect(sortedLastIndex([10, 20, 30, 30, 40], 30), 4).toBe() +}); diff --git a/test/sortedLastIndexBy/sortedLastIndexBy.test.js b/test/sortedLastIndexBy/sortedLastIndexBy.test.js index 228e00249..9cdaebb51 100644 --- a/test/sortedLastIndexBy/sortedLastIndexBy.test.js +++ b/test/sortedLastIndexBy/sortedLastIndexBy.test.js @@ -5,6 +5,8 @@ const sortedLastIndexBy = require('./sortedLastIndexBy.js'); test('sortedLastIndexBy is a Function', () => { expect(sortedLastIndexBy).toBeInstanceOf(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'); + 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), 1).toBe() +}); diff --git a/test/stableSort/stableSort.test.js b/test/stableSort/stableSort.test.js index 2f54e14ee..975e08e45 100644 --- a/test/stableSort/stableSort.test.js +++ b/test/stableSort/stableSort.test.js @@ -8,6 +8,8 @@ const stableSort = require('./stableSort.js'); 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'); + test('Array is properly sorted', () => { + expect(stableSort(arr, compare), arr).toEqual() +}); diff --git a/test/symmetricDifferenceBy/symmetricDifferenceBy.test.js b/test/symmetricDifferenceBy/symmetricDifferenceBy.test.js index 43e69f13c..4c3e11107 100644 --- a/test/symmetricDifferenceBy/symmetricDifferenceBy.test.js +++ b/test/symmetricDifferenceBy/symmetricDifferenceBy.test.js @@ -5,6 +5,8 @@ const symmetricDifferenceBy = require('./symmetricDifferenceBy.js'); test('symmetricDifferenceBy is a Function', () => { expect(symmetricDifferenceBy).toBeInstanceOf(Function); }); - t.deepEqual(symmetricDifferenceBy([2.1, 1.2], [2.3, 3.4], Math.floor), [ 1.2, 3.4 ], 'Returns the symmetric difference between two arrays, after applying the provided function to each array element of both'); + test('Returns the symmetric difference between two arrays, after applying the provided function to each array element of both', () => { + expect(symmetricDifferenceBy([2.1, 1.2], [2.3, 3.4], Math.floor), [ 1.2, 3.4 ]).toEqual() +}); diff --git a/test/takeRightWhile/takeRightWhile.test.js b/test/takeRightWhile/takeRightWhile.test.js index d300b3651..91bdd6917 100644 --- a/test/takeRightWhile/takeRightWhile.test.js +++ b/test/takeRightWhile/takeRightWhile.test.js @@ -5,6 +5,8 @@ const takeRightWhile = require('./takeRightWhile.js'); test('takeRightWhile is a Function', () => { expect(takeRightWhile).toBeInstanceOf(Function); }); - t.deepEqual(takeRightWhile([1, 2, 3, 4], n => n < 3), [3, 4], 'Removes elements until the function returns true'); + test('Removes elements until the function returns true', () => { + expect(takeRightWhile([1, 2, 3, 4], n => n < 3), [3, 4]).toEqual() +}); diff --git a/test/takeWhile/takeWhile.test.js b/test/takeWhile/takeWhile.test.js index a8949edf4..0a105b25b 100644 --- a/test/takeWhile/takeWhile.test.js +++ b/test/takeWhile/takeWhile.test.js @@ -5,6 +5,8 @@ const takeWhile = require('./takeWhile.js'); test('takeWhile is a Function', () => { expect(takeWhile).toBeInstanceOf(Function); }); - t.deepEqual(takeWhile([1, 2, 3, 4], n => n >= 3), [1, 2], 'Removes elements until the function returns true'); + test('Removes elements until the function returns true', () => { + expect(takeWhile([1, 2, 3, 4], n => n >= 3), [1, 2]).toEqual() +}); diff --git a/test/throttle/throttle.test.js b/test/throttle/throttle.test.js index 5e3436417..31cf950fe 100644 --- a/test/throttle/throttle.test.js +++ b/test/throttle/throttle.test.js @@ -5,6 +5,6 @@ const throttle = require('./throttle.js'); test('throttle is a Function', () => { expect(throttle).toBeInstanceOf(Function); }); - t.pass('Tested by @chalarangelo on 16/02/2018'); + diff --git a/test/timeTaken/timeTaken.test.js b/test/timeTaken/timeTaken.test.js index 58755e045..3782a78ee 100644 --- a/test/timeTaken/timeTaken.test.js +++ b/test/timeTaken/timeTaken.test.js @@ -5,6 +5,6 @@ const timeTaken = require('./timeTaken.js'); test('timeTaken is a Function', () => { expect(timeTaken).toBeInstanceOf(Function); }); - t.pass('Tested by @chalarangelo on 16/02/2018'); + diff --git a/test/toCurrency/toCurrency.test.js b/test/toCurrency/toCurrency.test.js index b06368eb9..c429efcfc 100644 --- a/test/toCurrency/toCurrency.test.js +++ b/test/toCurrency/toCurrency.test.js @@ -5,8 +5,14 @@ const toCurrency = require('./toCurrency.js'); test('toCurrency is a Function', () => { expect(toCurrency).toBeInstanceOf(Function); }); - t.equal(toCurrency(123456.789, 'EUR'), '€ 123,456.79', 'currency: Euro | currencyLangFormat: Local'); - t.equal(toCurrency(123456.789, 'USD', 'en-us'), '$123,456.79', ' currency: US Dollar | currencyLangFormat: English (United States)'); - t.equal(toCurrency(322342436423.2435, 'JPY'), 'JP¥ 322,342,436,423', 'currency: Japanese Yen | currencyLangFormat: Local'); + test('currency: Euro | currencyLangFormat: Local', () => { + expect(toCurrency(123456.789, 'EUR'), '€ 123,456.79').toBe() +}); + test(' currency: US Dollar | currencyLangFormat: English (United States)', () => { + expect(toCurrency(123456.789, 'USD', 'en-us'), '$123,456.79').toBe() +}); + test('currency: Japanese Yen | currencyLangFormat: Local', () => { + expect(toCurrency(322342436423.2435, 'JPY'), 'JP¥ 322,342,436,423').toBe() +}); diff --git a/test/toKebabCase/toKebabCase.test.js b/test/toKebabCase/toKebabCase.test.js index 8773f6228..32e9d81d6 100644 --- a/test/toKebabCase/toKebabCase.test.js +++ b/test/toKebabCase/toKebabCase.test.js @@ -9,7 +9,9 @@ const toKebabCase = require('./toKebabCase.js'); t.equal(toKebabCase('some text'), 'some-text', "toKebabCase('some text') returns some-text"); t.equal(toKebabCase('some-mixed-string With spaces-underscores-and-hyphens'), 'some-mixed-string-with-spaces-underscores-and-hyphens', "toKebabCase('some-mixed-string With spaces-underscores-and-hyphens') returns some-mixed-string-with-spaces-underscores-and-hyphens"); t.equal(toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML'), 'i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html', "toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html"); - t.equal(toKebabCase(), undefined, 'toKebabCase() return undefined'); + test('toKebabCase() return undefined', () => { + expect(toKebabCase(), undefined).toBe() +}); t.throws(() => toKebabCase([]), 'toKebabCase([]) throws an error'); t.throws(() => toKebabCase({}), 'toKebabCase({}) throws an error'); t.throws(() => toKebabCase(123), 'toKebabCase(123) throws an error'); diff --git a/test/toOrdinalSuffix/toOrdinalSuffix.test.js b/test/toOrdinalSuffix/toOrdinalSuffix.test.js index 6d6fc41eb..523191f58 100644 --- a/test/toOrdinalSuffix/toOrdinalSuffix.test.js +++ b/test/toOrdinalSuffix/toOrdinalSuffix.test.js @@ -5,8 +5,16 @@ const toOrdinalSuffix = require('./toOrdinalSuffix.js'); test('toOrdinalSuffix is a Function', () => { expect(toOrdinalSuffix).toBeInstanceOf(Function); }); - t.equal(toOrdinalSuffix('123'), '123rd', 'Adds an ordinal suffix to a number'); - t.equal(toOrdinalSuffix(5), '5th', 'Adds an ordinal suffix to a number'); - t.equal(toOrdinalSuffix(1), '1st', 'Adds an ordinal suffix to a number'); - t.equal(toOrdinalSuffix(0), '0th', 'Adds an ordinal suffix to a number'); + test('Adds an ordinal suffix to a number', () => { + expect(toOrdinalSuffix('123'), '123rd').toBe() +}); + test('Adds an ordinal suffix to a number', () => { + expect(toOrdinalSuffix(5), '5th').toBe() +}); + test('Adds an ordinal suffix to a number', () => { + expect(toOrdinalSuffix(1), '1st').toBe() +}); + test('Adds an ordinal suffix to a number', () => { + expect(toOrdinalSuffix(0), '0th').toBe() +}); diff --git a/test/toSnakeCase/toSnakeCase.test.js b/test/toSnakeCase/toSnakeCase.test.js index bf472bbae..89ad48fe6 100644 --- a/test/toSnakeCase/toSnakeCase.test.js +++ b/test/toSnakeCase/toSnakeCase.test.js @@ -9,7 +9,9 @@ const toSnakeCase = require('./toSnakeCase.js'); t.equal(toSnakeCase('some text'), 'some_text', "toSnakeCase('some text') returns some_text"); t.equal(toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens'), 'some_mixed_string_with_spaces_underscores_and_hyphens', "toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens') returns some_mixed_string_with_spaces_underscores_and_hyphens"); t.equal(toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML'), 'i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html', "toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html"); - t.equal(toSnakeCase(), undefined, 'toSnakeCase() returns undefined'); + test('toSnakeCase() returns undefined', () => { + expect(toSnakeCase(), undefined).toBe() +}); t.throws(() => toSnakeCase([]), 'toSnakeCase([]) throws an error'); t.throws(() => toSnakeCase({}), 'toSnakeCase({}) throws an error'); t.throws(() => toSnakeCase(123), 'toSnakeCase(123) throws an error'); diff --git a/test/toggleClass/toggleClass.test.js b/test/toggleClass/toggleClass.test.js index 3a4d104ad..82a15fff7 100644 --- a/test/toggleClass/toggleClass.test.js +++ b/test/toggleClass/toggleClass.test.js @@ -5,6 +5,6 @@ const toggleClass = require('./toggleClass.js'); test('toggleClass is a Function', () => { expect(toggleClass).toBeInstanceOf(Function); }); - t.pass('Tested by @chalarangelo on 16/02/2018'); + diff --git a/test/tomorrow/tomorrow.test.js b/test/tomorrow/tomorrow.test.js index 490e42f42..fc516576d 100644 --- a/test/tomorrow/tomorrow.test.js +++ b/test/tomorrow/tomorrow.test.js @@ -7,8 +7,14 @@ const tomorrow = require('./tomorrow.js'); }); const t1 = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate() + 1); const t2 = new Date(tomorrow()); - t.equal(t1.getFullYear(), t2.getFullYear(), 'Returns the correct year'); - t.equal(t1.getMonth(), t2.getMonth(), 'Returns the correct month'); - t.equal(t1.getDate(), t2.getDate(), 'Returns the correct date'); + test('Returns the correct year', () => { + expect(t1.getFullYear(), t2.getFullYear()).toBe() +}); + test('Returns the correct month', () => { + expect(t1.getMonth(), t2.getMonth()).toBe() +}); + test('Returns the correct date', () => { + expect(t1.getDate(), t2.getDate()).toBe() +}); diff --git a/test/truncateString/truncateString.test.js b/test/truncateString/truncateString.test.js index cfebd7f9a..c3ec9db4e 100644 --- a/test/truncateString/truncateString.test.js +++ b/test/truncateString/truncateString.test.js @@ -5,5 +5,7 @@ const truncateString = require('./truncateString.js'); test('truncateString is a Function', () => { expect(truncateString).toBeInstanceOf(Function); }); - t.equal(truncateString('boomerang', 7), 'boom...', 'Truncates a "boomerang" up to a specified length.'); + test('Truncates a "boomerang" up to a specified length.', () => { + expect(truncateString('boomerang', 7), 'boom...').toBe() +}); diff --git a/test/unary/unary.test.js b/test/unary/unary.test.js index c559cbeaa..0dc3ee657 100644 --- a/test/unary/unary.test.js +++ b/test/unary/unary.test.js @@ -5,6 +5,8 @@ const unary = require('./unary.js'); test('unary is a Function', () => { expect(unary).toBeInstanceOf(Function); }); - t.deepEqual(['6', '8', '10'].map(unary(parseInt)), [6, 8, 10], 'Discards arguments after the first one'); + test('Discards arguments after the first one', () => { + expect(['6', '8', '10'].map(unary(parseInt)), [6, 8, 10]).toEqual() +}); diff --git a/test/uncurry/uncurry.test.js b/test/uncurry/uncurry.test.js index 57da1c13b..d9e39c581 100644 --- a/test/uncurry/uncurry.test.js +++ b/test/uncurry/uncurry.test.js @@ -9,8 +9,14 @@ const uncurry = require('./uncurry.js'); const add1 = uncurry(add); const add2 = uncurry(add, 2); const add3 = uncurry(add, 3); - t.equal(add1(1)(2)(3), 6, 'Works without a provided value for n'); - t.equal(add2(1,2)(3), 6, 'Works without n = 2'); - t.equal(add3(1,2,3), 6, 'Works withoutn = 3'); + test('Works without a provided value for n', () => { + expect(add1(1)(2)(3), 6).toBe() +}); + test('Works without n = 2', () => { + expect(add2(1,2)(3), 6).toBe() +}); + test('Works withoutn = 3', () => { + expect(add3(1,2,3), 6).toBe() +}); diff --git a/test/unescapeHTML/unescapeHTML.test.js b/test/unescapeHTML/unescapeHTML.test.js index a45df3621..0521796c2 100644 --- a/test/unescapeHTML/unescapeHTML.test.js +++ b/test/unescapeHTML/unescapeHTML.test.js @@ -5,5 +5,7 @@ const unescapeHTML = require('./unescapeHTML.js'); test('unescapeHTML is a Function', () => { expect(unescapeHTML).toBeInstanceOf(Function); }); - t.equal(unescapeHTML('<a href="#">Me & you</a>'), 'Me & you', 'Unescapes escaped HTML characters.'); + test('Unescapes escaped HTML characters.', () => { + expect(unescapeHTML('<a href="#">Me & you</a>'), 'Me & you').toBe() +}); diff --git a/test/unflattenObject/unflattenObject.test.js b/test/unflattenObject/unflattenObject.test.js index 67b763ff1..55fa668b9 100644 --- a/test/unflattenObject/unflattenObject.test.js +++ b/test/unflattenObject/unflattenObject.test.js @@ -5,6 +5,8 @@ const unflattenObject = require('./unflattenObject.js'); test('unflattenObject is a Function', () => { expect(unflattenObject).toBeInstanceOf(Function); }); - t.deepEqual(unflattenObject({ 'a.b.c': 1, d: 1 }), { a: { b: { c: 1 } }, d: 1 }, 'Unflattens an object with the paths for keys'); + test('Unflattens an object with the paths for keys', () => { + expect(unflattenObject({ 'a.b.c': 1, d: 1 }), { a: { b: { c: 1 } }, d: 1 }).toEqual() +}); diff --git a/test/unfold/unfold.test.js b/test/unfold/unfold.test.js index 1a053f9e4..ee36c7572 100644 --- a/test/unfold/unfold.test.js +++ b/test/unfold/unfold.test.js @@ -6,6 +6,8 @@ const unfold = require('./unfold.js'); expect(unfold).toBeInstanceOf(Function); }); var f = n => (n > 50 ? false : [-n, n + 10]); - t.deepEqual(unfold(f, 10), [-10, -20, -30, -40, -50], 'Works with a given function, producing an array'); + test('Works with a given function, producing an array', () => { + expect(unfold(f, 10), [-10, -20, -30, -40, -50]).toEqual() +}); diff --git a/test/unionBy/unionBy.test.js b/test/unionBy/unionBy.test.js index a9010b62e..95c5c870e 100644 --- a/test/unionBy/unionBy.test.js +++ b/test/unionBy/unionBy.test.js @@ -5,6 +5,8 @@ const unionBy = require('./unionBy.js'); test('unionBy is a Function', () => { expect(unionBy).toBeInstanceOf(Function); }); - t.deepEqual(unionBy([2.1], [1.2, 2.3], Math.floor), [2.1, 1.2], 'Produces the appropriate results'); + test('Produces the appropriate results', () => { + expect(unionBy([2.1], [1.2, 2.3], Math.floor), [2.1, 1.2]).toEqual() +}); diff --git a/test/unionWith/unionWith.test.js b/test/unionWith/unionWith.test.js index 4a299689e..c4c0d44cc 100644 --- a/test/unionWith/unionWith.test.js +++ b/test/unionWith/unionWith.test.js @@ -5,6 +5,8 @@ const unionWith = require('./unionWith.js'); test('unionWith is a Function', () => { expect(unionWith).toBeInstanceOf(Function); }); - t.deepEqual(unionWith([1, 1.2, 1.5, 3, 0], [1.9, 3, 0, 3.9], (a, b) => Math.round(a) === Math.round(b)), [1, 1.2, 1.5, 3, 0, 3.9], 'Produces the appropriate results'); + test('Produces the appropriate results', () => { + expect(unionWith([1, 1.2, 1.5, 3, 0], [1.9, 3, 0, 3.9], (a, b) => Math.round(a) === Math.round(b)), [1, 1.2, 1.5, 3, 0, 3.9]).toEqual() +}); diff --git a/test/untildify/untildify.test.js b/test/untildify/untildify.test.js index 80075903b..f020ade98 100644 --- a/test/untildify/untildify.test.js +++ b/test/untildify/untildify.test.js @@ -8,7 +8,11 @@ const untildify = require('./untildify.js'); test('Contains no tildes', () => { expect(untildify('~/test/dir/file.f').indexOf('~') === -1).toBeTruthy(); }); - t.equal(untildify('~/test/dir/file.f').slice(-16), '/test/dir/file.f', 'Does not alter the rest of the path'); - t.equal(untildify('test/dir/file.f'), 'test/dir/file.f', 'Does not alter paths without tildes'); + test('Does not alter the rest of the path', () => { + expect(untildify('~/test/dir/file.f').slice(-16), '/test/dir/file.f').toBe() +}); + test('Does not alter paths without tildes', () => { + expect(untildify('test/dir/file.f'), 'test/dir/file.f').toBe() +}); diff --git a/test/zip/zip.test.js b/test/zip/zip.test.js index a0b075e87..f6af12c43 100644 --- a/test/zip/zip.test.js +++ b/test/zip/zip.test.js @@ -5,10 +5,18 @@ const zip = require('./zip.js'); test('zip is a Function', () => { expect(zip).toBeInstanceOf(Function); }); - t.deepEqual(zip(['a', 'b'], [1, 2], [true, false]), [['a', 1, true], ['b', 2, false]], 'zip([a, b], [1, 2], [true, false]) returns [[a, 1, true], [b, 2, false]]'); - t.deepEqual(zip(['a'], [1, 2], [true, false]), [['a', 1, true], [undefined, 2, false]], 'zip([a], [1, 2], [true, false]) returns [[a, 1, true], [undefined, 2, false]]'); - t.deepEqual(zip(), [], 'zip([]) returns []'); - t.deepEqual(zip(123), [], 'zip(123) returns []'); + test('zip([a, b], [1, 2], [true, false]) returns [[a, 1, true], [b, 2, false]]', () => { + expect(zip(['a', 'b'], [1, 2], [true, false]), [['a', 1, true], ['b', 2, false]]).toEqual() +}); + test('zip([a], [1, 2], [true, false]) returns [[a, 1, true], [undefined, 2, false]]', () => { + expect(zip(['a'], [1, 2], [true, false]), [['a', 1, true], [undefined, 2, false]]).toEqual() +}); + test('zip([]) returns []', () => { + expect(zip(), []).toEqual() +}); + test('zip(123) returns []', () => { + expect(zip(123), []).toEqual() +}); test('zip([a, b], [1, 2], [true, false]) returns an Array', () => { expect(Array.isArray(zip(['a', 'b'], [1, 2], [true, false]))).toBeTruthy(); }); diff --git a/test/zipObject/zipObject.test.js b/test/zipObject/zipObject.test.js index c703b3f68..b0a2b4b76 100644 --- a/test/zipObject/zipObject.test.js +++ b/test/zipObject/zipObject.test.js @@ -5,10 +5,18 @@ const zipObject = require('./zipObject.js'); test('zipObject is a Function', () => { expect(zipObject).toBeInstanceOf(Function); }); - t.deepEqual(zipObject(['a', 'b', 'c'], [1, 2]), {a: 1, b: 2, c: undefined}, 'zipObject([a, b, c], [1, 2]) returns {a: 1, b: 2, c: undefined}'); - t.deepEqual(zipObject(['a', 'b'], [1, 2, 3]), {a: 1, b: 2}, 'zipObject([a, b], [1, 2, 3]) returns {a: 1, b: 2}'); - t.deepEqual(zipObject(['a', 'b', 'c'], 'string'), { a: 's', b: 't', c: 'r' }, 'zipObject([a, b, c], string) returns { a: s, b: t, c: r }'); - t.deepEqual(zipObject(['a'], 'string'), { a: 's' }, 'zipObject([a], string) returns { a: s }'); + test('zipObject([a, b, c], [1, 2]) returns {a: 1, b: 2, c: undefined}', () => { + expect(zipObject(['a', 'b', 'c'], [1, 2]), {a: 1, b: 2, c: undefined}).toEqual() +}); + test('zipObject([a, b], [1, 2, 3]) returns {a: 1, b: 2}', () => { + expect(zipObject(['a', 'b'], [1, 2, 3]), {a: 1, b: 2}).toEqual() +}); + test('zipObject([a, b, c], string) returns { a: s, b: t, c: r }', () => { + expect(zipObject(['a', 'b', 'c'], 'string'), { a: 's', b: 't', c: 'r' }).toEqual() +}); + test('zipObject([a], string) returns { a: s }', () => { + expect(zipObject(['a'], 'string'), { a: 's' }).toEqual() +}); t.throws(() => zipObject(), 'zipObject() throws an error'); t.throws(() => zipObject(['string'], null), 'zipObject([string], null) throws an error'); t.throws(() => zipObject(null, [1]), 'zipObject(null, [1]) throws an error'); From 105185c213f71b9013ba88954f32fe51b083fbd8 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Mon, 18 Jun 2018 16:34:04 +0300 Subject: [PATCH 05/19] Test cleanup and fixes [c-d] --- test/RGBToHex/RGBToHex.test.js | 4 +- test/call/call.test.js | 8 ++-- test/capitalize/capitalize.test.js | 20 +++++--- .../capitalizeEveryWord.test.js | 16 ++++--- test/castArray/castArray.test.js | 25 +++++----- test/chainAsync/chainAsync.test.js | 10 ++-- test/chunk/chunk.test.js | 46 ++++++++++--------- test/clampNumber/clampNumber.test.js | 8 ++-- test/cleanObj/cleanObj.test.js | 10 ++-- test/cloneRegExp/cloneRegExp.test.js | 11 ++--- test/coalesce/coalesce.test.js | 8 ++-- test/coalesceFactory/coalesceFactory.test.js | 10 ++-- test/collatz/collatz.test.js | 18 ++++---- test/collectInto/collectInto.test.js | 19 ++++---- test/colorize/colorize.test.js | 6 +-- test/compact/compact.test.js | 8 ++-- test/compose/compose.test.js | 14 +++--- test/composeRight/composeRight.test.js | 15 +++--- test/converge/converge.test.js | 29 ++++++------ test/copyToClipboard/copyToClipboard.test.js | 6 +-- test/countBy/countBy.test.js | 13 ++---- .../countOccurrences/countOccurrences.test.js | 8 ++-- test/countVowels/countVowels.test.js | 4 +- test/counter/counter.test.js | 4 +- test/createElement/createElement.test.js | 6 +-- test/createEventHub/createEventHub.test.js | 6 +-- test/currentURL/currentURL.test.js | 6 +-- test/curry/curry.test.js | 12 +++-- test/debounce/debounce.test.js | 9 ++-- test/decapitalize/decapitalize.test.js | 13 ++---- test/deepClone/deepClone.test.js | 29 +++++++----- test/deepFlatten/deepFlatten.test.js | 8 ++-- test/defaults/defaults.test.js | 9 ++-- test/defer/defer.test.js | 6 +-- test/degreesToRads/degreesToRads.test.js | 11 ++--- test/delay/delay.test.js | 11 ++--- .../detectDeviceType/detectDeviceType.test.js | 6 +-- test/difference/difference.test.js | 8 ++-- test/differenceBy/differenceBy.test.js | 13 ++---- test/differenceWith/differenceWith.test.js | 8 ++-- test/digitize/digitize.test.js | 8 ++-- test/distance/distance.test.js | 9 ++-- test/drop/drop.test.js | 17 +++---- test/dropRight/dropRight.test.js | 16 ++++--- test/dropRightWhile/dropRightWhile.test.js | 9 ++-- test/dropWhile/dropWhile.test.js | 9 ++-- test/elo/elo.test.js | 8 +++- test/equals/equals.test.js | 4 +- test/escapeHTML/escapeHTML.test.js | 4 +- test/escapeRegExp/escapeRegExp.test.js | 4 +- test/everyNth/everyNth.test.js | 4 +- test/extendHex/extendHex.test.js | 8 +++- test/factorial/factorial.test.js | 20 ++++++-- test/fibonacci/fibonacci.test.js | 4 +- test/filterNonUnique/filterNonUnique.test.js | 4 +- test/flatten/flatten.test.js | 8 +++- test/formatDuration/formatDuration.test.js | 8 +++- test/fromCamelCase/fromCamelCase.test.js | 12 +++-- test/gcd/gcd.test.js | 8 +++- .../geometricProgression.test.js | 12 +++-- test/get/get.test.js | 4 +- .../getDaysDiffBetweenDates.test.js | 4 +- test/getType/getType.test.js | 4 +- test/groupBy/groupBy.test.js | 8 +++- test/hammingDistance/hammingDistance.test.js | 4 +- test/head/head.test.js | 4 +- test/hexToRGB/hexToRGB.test.js | 12 +++-- test/inRange/inRange.test.js | 16 +++++-- test/indexOfAll/indexOfAll.test.js | 8 +++- test/initial/initial.test.js | 4 +- .../initialize2DArray.test.js | 4 +- .../initializeArrayWithRange.test.js | 4 +- .../initializeArrayWithValues.test.js | 4 +- test/intersection/intersection.test.js | 4 +- test/invertKeyValues/invertKeyValues.test.js | 8 +++- test/isAbsoluteURL/isAbsoluteURL.test.js | 4 +- test/isArray/isArray.test.js | 8 +++- test/isBoolean/isBoolean.test.js | 8 +++- test/isFunction/isFunction.test.js | 8 +++- test/isLowerCase/isLowerCase.test.js | 12 +++-- test/isNull/isNull.test.js | 8 +++- test/isNumber/isNumber.test.js | 8 +++- test/isPrime/isPrime.test.js | 4 +- test/isPrimitive/isPrimitive.test.js | 40 ++++++++++++---- test/isSymbol/isSymbol.test.js | 4 +- test/join/join.test.js | 12 +++-- test/last/last.test.js | 4 +- test/lcm/lcm.test.js | 8 +++- test/longestItem/longestItem.test.js | 4 +- test/luhnCheck/luhnCheck.test.js | 12 +++-- test/mapObject/mapObject.test.js | 4 +- test/mask/mask.test.js | 12 +++-- test/maxN/maxN.test.js | 8 +++- test/median/median.test.js | 8 +++- test/minN/minN.test.js | 8 +++- test/negate/negate.test.js | 4 +- test/nthElement/nthElement.test.js | 8 +++- test/objectFromPairs/objectFromPairs.test.js | 4 +- test/objectToPairs/objectToPairs.test.js | 4 +- test/orderBy/orderBy.test.js | 8 +++- test/palindrome/palindrome.test.js | 8 +++- test/partition/partition.test.js | 4 +- test/percentile/percentile.test.js | 4 +- test/pick/pick.test.js | 4 +- test/powerset/powerset.test.js | 4 +- test/prettyBytes/prettyBytes.test.js | 12 +++-- test/primes/primes.test.js | 4 +- test/reducedFilter/reducedFilter.test.js | 4 +- test/remove/remove.test.js | 4 +- test/reverseString/reverseString.test.js | 4 +- test/round/round.test.js | 16 +++++-- test/sdbm/sdbm.test.js | 4 +- test/similarity/similarity.test.js | 4 +- test/size/size.test.js | 8 +++- .../sortCharactersInString.test.js | 4 +- test/sortedIndex/sortedIndex.test.js | 8 +++- test/splitLines/splitLines.test.js | 4 +- test/spreadOver/spreadOver.test.js | 4 +- .../standardDeviation.test.js | 8 +++- .../stringPermutations.test.js | 12 +++-- test/sum/sum.test.js | 4 +- test/sumPower/sumPower.test.js | 12 +++-- .../symmetricDifference.test.js | 4 +- test/tail/tail.test.js | 8 +++- test/take/take.test.js | 8 +++- test/takeRight/takeRight.test.js | 8 +++- test/toCamelCase/toCamelCase.test.js | 16 +++++-- test/toDecimalMark/toDecimalMark.test.js | 4 +- test/toKebabCase/toKebabCase.test.js | 16 +++++-- test/toSafeInteger/toSafeInteger.test.js | 36 +++++++++++---- test/toSnakeCase/toSnakeCase.test.js | 16 +++++-- .../truthCheckCollection.test.js | 4 +- test/union/union.test.js | 16 +++++-- test/uniqueElements/uniqueElements.test.js | 28 ++++++++--- test/without/without.test.js | 16 +++++-- test/words/words.test.js | 8 +++- 136 files changed, 805 insertions(+), 484 deletions(-) diff --git a/test/RGBToHex/RGBToHex.test.js b/test/RGBToHex/RGBToHex.test.js index e290b6bb5..f4bf6d773 100644 --- a/test/RGBToHex/RGBToHex.test.js +++ b/test/RGBToHex/RGBToHex.test.js @@ -5,5 +5,7 @@ const RGBToHex = require('./RGBToHex.js'); test('RGBToHex is a Function', () => { expect(RGBToHex).toBeInstanceOf(Function); }); - t.equal(RGBToHex(255, 165, 1), 'ffa501', "Converts the values of RGB components to a color code."); + test('Converts the values of RGB components to a color code.', () => { + expect(RGBToHex(255, 165, 1)).toBe('ffa501') +}); diff --git a/test/call/call.test.js b/test/call/call.test.js index a4585ac22..d445ab45f 100644 --- a/test/call/call.test.js +++ b/test/call/call.test.js @@ -1,9 +1,9 @@ const expect = require('expect'); const call = require('./call.js'); - - test('call is a Function', () => { +test('call is a Function', () => { expect(call).toBeInstanceOf(Function); }); - t.looseEqual(call('map', x => x * 2)([1, 2, 3]), [2, 4, 6], 'Calls function on given object'); - +test('Calls function on given object', () => { + expect(call('map', x => x * 2)([1, 2, 3])).toBe([2, 4, 6]); +}); diff --git a/test/capitalize/capitalize.test.js b/test/capitalize/capitalize.test.js index c031fedf2..6fb4a1bd8 100644 --- a/test/capitalize/capitalize.test.js +++ b/test/capitalize/capitalize.test.js @@ -1,12 +1,18 @@ const expect = require('expect'); const capitalize = require('./capitalize.js'); - - test('capitalize is a Function', () => { +test('capitalize is a Function', () => { expect(capitalize).toBeInstanceOf(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"); - +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 7da925b9a..39a025b0b 100644 --- a/test/capitalizeEveryWord/capitalizeEveryWord.test.js +++ b/test/capitalizeEveryWord/capitalizeEveryWord.test.js @@ -1,11 +1,15 @@ const expect = require('expect'); const capitalizeEveryWord = require('./capitalizeEveryWord.js'); - - test('capitalizeEveryWord is a Function', () => { +test('capitalizeEveryWord is a Function', () => { expect(capitalizeEveryWord).toBeInstanceOf(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"); - +test('Capitalizes the first letter of every word in a string', () => { + expect(capitalizeEveryWord('hello world!'), 'Hello World!').toBe(); +}); +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 f3883879a..f1c594a70 100644 --- a/test/castArray/castArray.test.js +++ b/test/castArray/castArray.test.js @@ -1,24 +1,21 @@ const expect = require('expect'); const castArray = require('./castArray.js'); - - test('castArray is a Function', () => { +test('castArray is a Function', () => { expect(castArray).toBeInstanceOf(Function); }); - test('Works for single values', () => { - expect(castArray(1), [1]).toEqual() +test('Works for single values', () => { + expect(castArray(1)).toEqual([1]); }); - test('Works for arrays with one value', () => { - expect(castArray([1]), [1]).toEqual() +test('Works for arrays with one value', () => { + expect(castArray([1])).toEqual([1]); }); - test('Works for arrays with multiple value', () => { - expect(castArray([1,2,3]), [1,2,3]).toEqual() +test('Works for arrays with multiple value', () => { + expect(castArray([1,2,3])).toEqual( [1,2,3]); }); - test('Works for strings', () => { - expect(castArray('test'), ['test']).toEqual() +test('Works for strings', () => { + expect(castArray('test')).toEqual(['test']) }); - test('Works for objects', () => { - expect(castArray({}), [{}]).toEqual() +test('Works for objects', () => { + expect(castArray({})).toEqual([{}]) }); - - diff --git a/test/chainAsync/chainAsync.test.js b/test/chainAsync/chainAsync.test.js index 8e90219ef..9d69ef316 100644 --- a/test/chainAsync/chainAsync.test.js +++ b/test/chainAsync/chainAsync.test.js @@ -1,10 +1,11 @@ const expect = require('expect'); const chainAsync = require('./chainAsync.js'); - - test('chainAsync is a Function', () => { +test('chainAsync is a Function', () => { expect(chainAsync).toBeInstanceOf(Function); }); + +test('Calls all functions in an array', () => { chainAsync([ next => { next(); @@ -15,8 +16,7 @@ const chainAsync = require('./chainAsync.js'); })(); }, next => { - + expect(true).toBeTruthy(); } ]); - - +}); diff --git a/test/chunk/chunk.test.js b/test/chunk/chunk.test.js index f257adac8..212ef3c79 100644 --- a/test/chunk/chunk.test.js +++ b/test/chunk/chunk.test.js @@ -1,32 +1,36 @@ const expect = require('expect'); const chunk = require('./chunk.js'); - - test('chunk is a Function', () => { +test('chunk is a Function', () => { expect(chunk).toBeInstanceOf(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]] "); - test('chunk([]) returns []', () => { - expect(chunk([]), []).toEqual() +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(123) returns []', () => { - expect(chunk(123), []).toEqual() +test('chunk([]) returns []', () => { + expect(chunk([])).toEqual([]) }); - test('chunk({ a: 123}) returns []', () => { - expect(chunk({ a: 123}), []).toEqual() +test('chunk(123) returns []', () => { + expect(chunk(123)).toEqual([]) }); - test('chunk(string, 2) returns [ st, ri, ng ]', () => { - expect(chunk('string', 2), [ 'st', 'ri', 'ng' ]).toEqual() +test('chunk({ a: 123}) returns []', () => { + expect(chunk({ a: 123})).toEqual([]) }); - 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(); - test('chunk(This is a string, 2) takes less than 2s to run', () => { +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 9d4cd64b3..9e9d406b6 100644 --- a/test/clampNumber/clampNumber.test.js +++ b/test/clampNumber/clampNumber.test.js @@ -1,9 +1,9 @@ const expect = require('expect'); const clampNumber = require('./clampNumber.js'); - - test('clampNumber is a Function', () => { +test('clampNumber is a Function', () => { expect(clampNumber).toBeInstanceOf(Function); }); - t.equal(clampNumber(2, 3, 5), 3, "Clamps num within the inclusive range specified by the boundary values a and b"); - +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 916281b31..9e221f468 100644 --- a/test/cleanObj/cleanObj.test.js +++ b/test/cleanObj/cleanObj.test.js @@ -1,10 +1,10 @@ const expect = require('expect'); const cleanObj = require('./cleanObj.js'); - - test('cleanObj is a Function', () => { +test('cleanObj is a Function', () => { expect(cleanObj).toBeInstanceOf(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"); - +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 8f6e675c9..e4469ec39 100644 --- a/test/cloneRegExp/cloneRegExp.test.js +++ b/test/cloneRegExp/cloneRegExp.test.js @@ -1,11 +1,10 @@ const expect = require('expect'); const cloneRegExp = require('./cloneRegExp.js'); - - test('cloneRegExp is a Function', () => { +test('cloneRegExp is a Function', () => { expect(cloneRegExp).toBeInstanceOf(Function); }); - const rgTest = /./g; - t.notEqual(cloneRegExp(rgTest), rgTest, 'Clones regular expressions properly'); - - +const rgTest = /./g; +test('Clones regular expressions properly', () => { + expect(cloneRegExp(rgTest).not.toEqual(rgTest); +}); diff --git a/test/coalesce/coalesce.test.js b/test/coalesce/coalesce.test.js index aacedc163..5481b85db 100644 --- a/test/coalesce/coalesce.test.js +++ b/test/coalesce/coalesce.test.js @@ -1,9 +1,9 @@ const expect = require('expect'); const coalesce = require('./coalesce.js'); - - test('coalesce is a Function', () => { +test('coalesce is a Function', () => { expect(coalesce).toBeInstanceOf(Function); }); - t.deepEqual(coalesce(null, undefined, '', NaN, 'Waldo'), '', "Returns the first non-null/undefined argument"); - +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 f6645b692..609ac9b5d 100644 --- a/test/coalesceFactory/coalesceFactory.test.js +++ b/test/coalesceFactory/coalesceFactory.test.js @@ -1,10 +1,10 @@ const expect = require('expect'); const coalesceFactory = require('./coalesceFactory.js'); - - test('coalesceFactory is a Function', () => { +test('coalesceFactory is a Function', () => { expect(coalesceFactory).toBeInstanceOf(Function); }); - const customCoalesce = coalesceFactory(_ => ![null, undefined, '', NaN].includes(_)); - t.deepEqual(customCoalesce(undefined, null, NaN, '', 'Waldo'), 'Waldo', "Returns a customized coalesce 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 9598acaa9..a4bfa2125 100644 --- a/test/collatz/collatz.test.js +++ b/test/collatz/collatz.test.js @@ -1,24 +1,22 @@ const expect = require('expect'); const collatz = require('./collatz.js'); - - test('collatz is a Function', () => { +test('collatz is a Function', () => { expect(collatz).toBeInstanceOf(Function); }); - test('When n is even, divide by 2', () => { - expect(collatz(8), 4).toBe() +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), 28).toBe() +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){ - + expect(n).toBe(1); break; } n = collatz(n); } - - +}); diff --git a/test/collectInto/collectInto.test.js b/test/collectInto/collectInto.test.js index e2a073af8..78b34607f 100644 --- a/test/collectInto/collectInto.test.js +++ b/test/collectInto/collectInto.test.js @@ -1,16 +1,13 @@ const expect = require('expect'); const collectInto = require('./collectInto.js'); - - test('collectInto is a Function', () => { +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)); - Pall(p1, p2, p3).then(function(val){ test('Works with multiple promises', () => { - expect(val, [1,2,3]).toEqual() -});}, function(reason){ - - +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 10950ab7f..73658ae79 100644 --- a/test/colorize/colorize.test.js +++ b/test/colorize/colorize.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const colorize = require('./colorize.js'); - - test('colorize is a Function', () => { +test('colorize is a Function', () => { expect(colorize).toBeInstanceOf(Function); }); - - - diff --git a/test/compact/compact.test.js b/test/compact/compact.test.js index 087340a4c..5fe0ee12e 100644 --- a/test/compact/compact.test.js +++ b/test/compact/compact.test.js @@ -1,9 +1,9 @@ const expect = require('expect'); const compact = require('./compact.js'); - - test('compact is a Function', () => { +test('compact is a Function', () => { expect(compact).toBeInstanceOf(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"); - +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 b5332a0be..5da32630f 100644 --- a/test/compose/compose.test.js +++ b/test/compose/compose.test.js @@ -1,12 +1,12 @@ const expect = require('expect'); const compose = require('./compose.js'); - - test('compose is a Function', () => { +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); - t.equal(multiplyAndAdd5(5, 2), 15, "Performs right-to-left function composition"); - +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 f24024bdd..02cddf187 100644 --- a/test/composeRight/composeRight.test.js +++ b/test/composeRight/composeRight.test.js @@ -1,13 +1,12 @@ const expect = require('expect'); const composeRight = require('./composeRight.js'); - - test('composeRight is a Function', () => { +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); - t.equal(addAndSquare(1, 2), 9, "Performs left-to-right function composition"); - - +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 bd8f4e4bd..67086df48 100644 --- a/test/converge/converge.test.js +++ b/test/converge/converge.test.js @@ -1,23 +1,20 @@ const expect = require('expect'); const converge = require('./converge.js'); - - test('converge is a Function', () => { +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]), 4).toBe() +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'), "YODELyodel").toBe() +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 66c5cb5bf..60c18bbb9 100644 --- a/test/copyToClipboard/copyToClipboard.test.js +++ b/test/copyToClipboard/copyToClipboard.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const copyToClipboard = require('./copyToClipboard.js'); - - test('copyToClipboard is a Function', () => { +test('copyToClipboard is a Function', () => { expect(copyToClipboard).toBeInstanceOf(Function); }); - - - diff --git a/test/countBy/countBy.test.js b/test/countBy/countBy.test.js index d013534ee..a33769895 100644 --- a/test/countBy/countBy.test.js +++ b/test/countBy/countBy.test.js @@ -1,15 +1,12 @@ const expect = require('expect'); const countBy = require('./countBy.js'); - - test('countBy is a Function', () => { +test('countBy is a Function', () => { expect(countBy).toBeInstanceOf(Function); }); - test('Works for functions', () => { - expect(countBy([6.1, 4.2, 6.3], Math.floor), {4: 1, 6: 2}).toEqual() +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'), {3: 2, 5: 1}).toEqual() +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 1b43f1be8..f4cfab9b4 100644 --- a/test/countOccurrences/countOccurrences.test.js +++ b/test/countOccurrences/countOccurrences.test.js @@ -1,9 +1,9 @@ const expect = require('expect'); const countOccurrences = require('./countOccurrences.js'); - - test('countOccurrences is a Function', () => { +test('countOccurrences is a Function', () => { expect(countOccurrences).toBeInstanceOf(Function); }); - t.deepEqual(countOccurrences([1, 1, 2, 1, 2, 3], 1), 3, "Counts the occurrences of a value in an array"); - +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 dc5fc72a7..64a1b0936 100644 --- a/test/countVowels/countVowels.test.js +++ b/test/countVowels/countVowels.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const countVowels = require('./countVowels.js'); - - test('countVowels is a Function', () => { +test('countVowels is a Function', () => { expect(countVowels).toBeInstanceOf(Function); }); - diff --git a/test/counter/counter.test.js b/test/counter/counter.test.js index d7a7e4e91..a80d9c0f8 100644 --- a/test/counter/counter.test.js +++ b/test/counter/counter.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const counter = require('./counter.js'); - - test('counter is a Function', () => { +test('counter is a Function', () => { expect(counter).toBeInstanceOf(Function); }); - diff --git a/test/createElement/createElement.test.js b/test/createElement/createElement.test.js index d046f62e7..096080d8d 100644 --- a/test/createElement/createElement.test.js +++ b/test/createElement/createElement.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const createElement = require('./createElement.js'); - - test('createElement is a Function', () => { +test('createElement is a Function', () => { expect(createElement).toBeInstanceOf(Function); }); - - - diff --git a/test/createEventHub/createEventHub.test.js b/test/createEventHub/createEventHub.test.js index 4a847285e..701572373 100644 --- a/test/createEventHub/createEventHub.test.js +++ b/test/createEventHub/createEventHub.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const createEventHub = require('./createEventHub.js'); - - test('createEventHub is a Function', () => { +test('createEventHub is a Function', () => { expect(createEventHub).toBeInstanceOf(Function); }); - - - diff --git a/test/currentURL/currentURL.test.js b/test/currentURL/currentURL.test.js index 61c3a2fce..779470bde 100644 --- a/test/currentURL/currentURL.test.js +++ b/test/currentURL/currentURL.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const currentURL = require('./currentURL.js'); - - test('currentURL is a Function', () => { +test('currentURL is a Function', () => { expect(currentURL).toBeInstanceOf(Function); }); - - - diff --git a/test/curry/curry.test.js b/test/curry/curry.test.js index f97b6a260..4e7b215f6 100644 --- a/test/curry/curry.test.js +++ b/test/curry/curry.test.js @@ -1,10 +1,12 @@ const expect = require('expect'); const curry = require('./curry.js'); - - test('curry is a Function', () => { +test('curry is a Function', () => { expect(curry).toBeInstanceOf(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"); - +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 a4f4db6d2..b261f5f6d 100644 --- a/test/debounce/debounce.test.js +++ b/test/debounce/debounce.test.js @@ -1,10 +1,9 @@ const expect = require('expect'); const debounce = require('./debounce.js'); - - test('debounce is a Function', () => { +test('debounce is a Function', () => { expect(debounce).toBeInstanceOf(Function); }); - debounce(() => { - - +test('Works as expected', () => { + debounce(() => { expect(true).toBeTruthy(); }); +}); diff --git a/test/decapitalize/decapitalize.test.js b/test/decapitalize/decapitalize.test.js index 866c49271..e7a403388 100644 --- a/test/decapitalize/decapitalize.test.js +++ b/test/decapitalize/decapitalize.test.js @@ -1,15 +1,12 @@ const expect = require('expect'); const decapitalize = require('./decapitalize.js'); - - test('decapitalize is a Function', () => { +test('decapitalize is a Function', () => { expect(decapitalize).toBeInstanceOf(Function); }); - test('Works with default parameter', () => { - expect(decapitalize('FooBar'), 'fooBar').toBe() +test('Works with default parameter', () => { + expect(decapitalize('FooBar')).toBe('fooBar'); }); - test('Works with second parameter set to true', () => { - expect(decapitalize('FooBar', true), 'fOOBAR').toBe() +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 8996449eb..8806fd060 100644 --- a/test/deepClone/deepClone.test.js +++ b/test/deepClone/deepClone.test.js @@ -1,17 +1,22 @@ const expect = require('expect'); const deepClone = require('./deepClone.js'); - - test('deepClone is a Function', () => { +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); - 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"); - - +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.toEqual(b); +}); +test('Deep cloning works', () => { + expect(a.obj).not.toEqual(b.obj); +}); +test('Array shallow cloning works', () => { + expect(c).not.toEqual(d); +}); +test('Array deep cloning works', () => { + expect(c[0]).not.toEqual(d[0]); +}); diff --git a/test/deepFlatten/deepFlatten.test.js b/test/deepFlatten/deepFlatten.test.js index fa77ac6a7..fdaa404cb 100644 --- a/test/deepFlatten/deepFlatten.test.js +++ b/test/deepFlatten/deepFlatten.test.js @@ -1,9 +1,9 @@ const expect = require('expect'); const deepFlatten = require('./deepFlatten.js'); - - test('deepFlatten is a Function', () => { +test('deepFlatten is a Function', () => { expect(deepFlatten).toBeInstanceOf(Function); }); - t.deepEqual(deepFlatten([1, [2], [[3], 4], 5]), [1, 2, 3, 4, 5], "Deep flattens an array"); - +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 c713eea1b..d416fef6a 100644 --- a/test/defaults/defaults.test.js +++ b/test/defaults/defaults.test.js @@ -1,12 +1,9 @@ const expect = require('expect'); const defaults = require('./defaults.js'); - - test('defaults is a Function', () => { +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 }), { a: 1, b: 2 }).toEqual() +test('Assigns default values for undefined properties', () => { + expect(defaults({ a: 1 }, { b: 2 }, { b: 6 }, { a: 3 })).toBe({ a: 1, b: 2 }); }); - - diff --git a/test/defer/defer.test.js b/test/defer/defer.test.js index 46ff55ac6..61f3665f1 100644 --- a/test/defer/defer.test.js +++ b/test/defer/defer.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const defer = require('./defer.js'); - - test('defer is a Function', () => { +test('defer is a Function', () => { expect(defer).toBeInstanceOf(Function); }); - - - diff --git a/test/degreesToRads/degreesToRads.test.js b/test/degreesToRads/degreesToRads.test.js index a434d4bbd..634140d76 100644 --- a/test/degreesToRads/degreesToRads.test.js +++ b/test/degreesToRads/degreesToRads.test.js @@ -1,13 +1,10 @@ const expect = require('expect'); const degreesToRads = require('./degreesToRads.js'); - - const approxeq = (v1,v2, diff = 0.001) => Math.abs(v1 - v2) < diff; - test('degreesToRads is a Function', () => { +// 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(approxeq(degreesToRads(90.0), Math.PI / 2)).toBeTruthy(); +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 afe547b5f..b43e12552 100644 --- a/test/delay/delay.test.js +++ b/test/delay/delay.test.js @@ -1,18 +1,15 @@ const expect = require('expect'); const delay = require('./delay.js'); - - test('delay is a Function', () => { +test('delay is a Function', () => { expect(delay).toBeInstanceOf(Function); }); +test('Works as expecting, passing arguments properly', () => { delay( function(text) { - test('Works as expecting, passing arguments properly', () => { - expect(text, 'test').toBe() -}); + expect(text).toBe('test'); }, 1000, 'test' ); - - +}); diff --git a/test/detectDeviceType/detectDeviceType.test.js b/test/detectDeviceType/detectDeviceType.test.js index 124315e80..695593771 100644 --- a/test/detectDeviceType/detectDeviceType.test.js +++ b/test/detectDeviceType/detectDeviceType.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const detectDeviceType = require('./detectDeviceType.js'); - - test('detectDeviceType is a Function', () => { +test('detectDeviceType is a Function', () => { expect(detectDeviceType).toBeInstanceOf(Function); }); - - - diff --git a/test/difference/difference.test.js b/test/difference/difference.test.js index 6062511a3..657ffe119 100644 --- a/test/difference/difference.test.js +++ b/test/difference/difference.test.js @@ -1,9 +1,9 @@ const expect = require('expect'); const difference = require('./difference.js'); - - test('difference is a Function', () => { +test('difference is a Function', () => { expect(difference).toBeInstanceOf(Function); }); - t.deepEqual(difference([1, 2, 3], [1, 2, 4]), [3], "Returns the difference between two arrays"); - +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 44265c43f..6d312b981 100644 --- a/test/differenceBy/differenceBy.test.js +++ b/test/differenceBy/differenceBy.test.js @@ -1,15 +1,12 @@ const expect = require('expect'); const differenceBy = require('./differenceBy.js'); - - test('differenceBy is a Function', () => { +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), [1.2]).toEqual() +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), [ { x: 2 } ]).toEqual() +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 2d840b5bf..76865cce2 100644 --- a/test/differenceWith/differenceWith.test.js +++ b/test/differenceWith/differenceWith.test.js @@ -1,9 +1,9 @@ const expect = require('expect'); const differenceWith = require('./differenceWith.js'); - - test('differenceWith is a Function', () => { +test('differenceWith is a Function', () => { expect(differenceWith).toBeInstanceOf(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"); - +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 27ef11539..d25668443 100644 --- a/test/digitize/digitize.test.js +++ b/test/digitize/digitize.test.js @@ -1,9 +1,9 @@ const expect = require('expect'); const digitize = require('./digitize.js'); - - test('digitize is a Function', () => { +test('digitize is a Function', () => { expect(digitize).toBeInstanceOf(Function); }); - t.deepEqual(digitize(123), [1, 2, 3], "Converts a number to an array of digits"); - +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 769d128c2..7831be85d 100644 --- a/test/distance/distance.test.js +++ b/test/distance/distance.test.js @@ -1,12 +1,9 @@ const expect = require('expect'); const distance = require('./distance.js'); - - test('distance is a Function', () => { +test('distance is a Function', () => { expect(distance).toBeInstanceOf(Function); }); - test('Calculates the distance between two points', () => { - expect(distance(1, 1, 2, 3), 2.23606797749979).toBe() +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 5c864463e..f9cc2f57b 100644 --- a/test/drop/drop.test.js +++ b/test/drop/drop.test.js @@ -1,18 +1,15 @@ const expect = require('expect'); const drop = require('./drop.js'); - - test('drop is a Function', () => { +test('drop is a Function', () => { expect(drop).toBeInstanceOf(Function); }); - test('Works without the last argument', () => { - expect(drop([1, 2, 3]), [2,3]).toEqual() +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), [3]).toEqual() +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() +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 e5d4523ec..f9927ac4b 100644 --- a/test/dropRight/dropRight.test.js +++ b/test/dropRight/dropRight.test.js @@ -1,11 +1,15 @@ const expect = require('expect'); const dropRight = require('./dropRight.js'); - - test('dropRight is a Function', () => { +test('dropRight is a Function', () => { expect(dropRight).toBeInstanceOf(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"); - +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 228dea2e3..ad39f35f9 100644 --- a/test/dropRightWhile/dropRightWhile.test.js +++ b/test/dropRightWhile/dropRightWhile.test.js @@ -1,12 +1,9 @@ const expect = require('expect'); const dropRightWhile = require('./dropRightWhile.js'); - - test('dropRightWhile is a Function', () => { +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), [1, 2]).toEqual() +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 4bff04c43..75bc3272e 100644 --- a/test/dropWhile/dropWhile.test.js +++ b/test/dropWhile/dropWhile.test.js @@ -1,12 +1,9 @@ const expect = require('expect'); const dropWhile = require('./dropWhile.js'); - - test('dropWhile is a Function', () => { +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), [3,4]).toEqual() +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/elo/elo.test.js b/test/elo/elo.test.js index 28aaf5c5c..2868b5fbc 100644 --- a/test/elo/elo.test.js +++ b/test/elo/elo.test.js @@ -5,7 +5,11 @@ const elo = require('./elo.js'); test('elo is a Function', () => { expect(elo).toBeInstanceOf(Function); }); - t.deepEqual(elo([1200, 1200]), [1216, 1184], "Standard 1v1s"); + test('Standard 1v1s', () => { + expect(elo([1200, 1200]), [1216).toEqual(1184]) +}); 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"); + test('4 player FFA, all same rank', () => { + expect(elo([1200, 1200, 1200, 1200]).map(Math.round), [1246, 1215, 1185).toEqual(1154]) +}); diff --git a/test/equals/equals.test.js b/test/equals/equals.test.js index 4cdb12e39..c6622d169 100644 --- a/test/equals/equals.test.js +++ b/test/equals/equals.test.js @@ -5,7 +5,9 @@ const equals = require('./equals.js'); test('equals is a Function', () => { expect(equals).toBeInstanceOf(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' }"); + 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(); }); diff --git a/test/escapeHTML/escapeHTML.test.js b/test/escapeHTML/escapeHTML.test.js index 8d280f42e..748a10562 100644 --- a/test/escapeHTML/escapeHTML.test.js +++ b/test/escapeHTML/escapeHTML.test.js @@ -5,5 +5,7 @@ const escapeHTML = require('./escapeHTML.js'); test('escapeHTML is a Function', () => { expect(escapeHTML).toBeInstanceOf(Function); }); - t.equal(escapeHTML('Me & you'), '<a href="#">Me & you</a>', "Escapes a string for use in HTML"); + 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 a39ebd21e..8483c0a88 100644 --- a/test/escapeRegExp/escapeRegExp.test.js +++ b/test/escapeRegExp/escapeRegExp.test.js @@ -5,5 +5,7 @@ const escapeRegExp = require('./escapeRegExp.js'); test('escapeRegExp is a Function', () => { expect(escapeRegExp).toBeInstanceOf(Function); }); - t.equal(escapeRegExp('(test)'), '\\(test\\)', "Escapes a string to use in a regular expression"); + 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 4bc7aabea..09918d3e0 100644 --- a/test/everyNth/everyNth.test.js +++ b/test/everyNth/everyNth.test.js @@ -5,5 +5,7 @@ const everyNth = require('./everyNth.js'); test('everyNth is a Function', () => { expect(everyNth).toBeInstanceOf(Function); }); - t.deepEqual(everyNth([1, 2, 3, 4, 5, 6], 2), [ 2, 4, 6 ], "Returns every nth element in an array"); + test('Returns every nth element in an array', () => { + expect(everyNth([1, 2, 3, 4, 5, 6], 2), [ 2, 4).toEqual(6 ]) +}); diff --git a/test/extendHex/extendHex.test.js b/test/extendHex/extendHex.test.js index 798dee0e6..c196899e7 100644 --- a/test/extendHex/extendHex.test.js +++ b/test/extendHex/extendHex.test.js @@ -5,6 +5,10 @@ const extendHex = require('./extendHex.js'); test('extendHex is a Function', () => { expect(extendHex).toBeInstanceOf(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"); + 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 7bf338a83..d13f79f2c 100644 --- a/test/factorial/factorial.test.js +++ b/test/factorial/factorial.test.js @@ -5,9 +5,19 @@ const factorial = require('./factorial.js'); test('factorial is a Function', () => { expect(factorial).toBeInstanceOf(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"); + 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/fibonacci/fibonacci.test.js b/test/fibonacci/fibonacci.test.js index 6db435ec9..5a44cba21 100644 --- a/test/fibonacci/fibonacci.test.js +++ b/test/fibonacci/fibonacci.test.js @@ -5,5 +5,7 @@ const fibonacci = require('./fibonacci.js'); test('fibonacci is a Function', () => { expect(fibonacci).toBeInstanceOf(Function); }); - t.deepEqual(fibonacci(6), [0, 1, 1, 2, 3, 5], "Generates an array, containing the Fibonacci sequence"); + test('Generates an array, containing the Fibonacci sequence', () => { + expect(fibonacci(6), [0, 1, 1, 2, 3).toEqual(5]) +}); diff --git a/test/filterNonUnique/filterNonUnique.test.js b/test/filterNonUnique/filterNonUnique.test.js index 003c26e07..faa135e79 100644 --- a/test/filterNonUnique/filterNonUnique.test.js +++ b/test/filterNonUnique/filterNonUnique.test.js @@ -5,5 +5,7 @@ const filterNonUnique = require('./filterNonUnique.js'); test('filterNonUnique is a Function', () => { expect(filterNonUnique).toBeInstanceOf(Function); }); - t.deepEqual(filterNonUnique([1, 2, 2, 3, 4, 4, 5]), [1,3,5], "Filters out the non-unique values in an array"); + test('Filters out the non-unique values in an array', () => { + expect(filterNonUnique([1, 2, 2, 3, 4, 4, 5]), [1,3).toEqual(5]) +}); diff --git a/test/flatten/flatten.test.js b/test/flatten/flatten.test.js index fa1c01167..a912af451 100644 --- a/test/flatten/flatten.test.js +++ b/test/flatten/flatten.test.js @@ -5,6 +5,10 @@ const flatten = require('./flatten.js'); test('flatten is a Function', () => { expect(flatten).toBeInstanceOf(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"); + test('Flattens an array', () => { + expect(flatten([1, [2], 3, 4]), [1, 2, 3).toEqual(4]) +}); + test('Flattens an array', () => { + expect(flatten([1, [2, [3, [4, 5], 6], 7], 8], 2), [1, 2, 3, [4, 5], 6, 7).toEqual(8]) +}); diff --git a/test/formatDuration/formatDuration.test.js b/test/formatDuration/formatDuration.test.js index c1b9e7306..fbef44981 100644 --- a/test/formatDuration/formatDuration.test.js +++ b/test/formatDuration/formatDuration.test.js @@ -5,6 +5,10 @@ const formatDuration = require('./formatDuration.js'); test('formatDuration is a Function', () => { expect(formatDuration).toBeInstanceOf(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"); + test('Returns the human readable format of the given number of milliseconds', () => { + expect(formatDuration(1001), '1 second).toBe(1 millisecond') +}); + test('Returns the human readable format of the given number of milliseconds', () => { + expect(formatDuration(34325055574), '397 days, 6 hours, 44 minutes, 15 seconds).toBe(574 milliseconds') +}); diff --git a/test/fromCamelCase/fromCamelCase.test.js b/test/fromCamelCase/fromCamelCase.test.js index 5e89f57b6..c20257ab1 100644 --- a/test/fromCamelCase/fromCamelCase.test.js +++ b/test/fromCamelCase/fromCamelCase.test.js @@ -5,7 +5,13 @@ const fromCamelCase = require('./fromCamelCase.js'); test('fromCamelCase is a Function', () => { expect(fromCamelCase).toBeInstanceOf(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"); + 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/gcd/gcd.test.js b/test/gcd/gcd.test.js index 70fa782f5..f95f944a5 100644 --- a/test/gcd/gcd.test.js +++ b/test/gcd/gcd.test.js @@ -5,6 +5,10 @@ const gcd = require('./gcd.js'); test('gcd is a Function', () => { expect(gcd).toBeInstanceOf(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"); + 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 f42e0aafb..50fba67d1 100644 --- a/test/geometricProgression/geometricProgression.test.js +++ b/test/geometricProgression/geometricProgression.test.js @@ -5,7 +5,13 @@ const geometricProgression = require('./geometricProgression.js'); test('geometricProgression is a Function', () => { expect(geometricProgression).toBeInstanceOf(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"); + test('Initializes an array containing the numbers in the specified range', () => { + expect(geometricProgression(256), [1, 2, 4, 8, 16, 32, 64, 128).toEqual(256]) +}); + test('Initializes an array containing the numbers in the specified range', () => { + expect(geometricProgression(256, 3), [3, 6, 12, 24, 48, 96).toEqual(192]) +}); + test('Initializes an array containing the numbers in the specified range', () => { + expect(geometricProgression(256, 1, 4), [1, 4, 16, 64).toEqual(256]) +}); diff --git a/test/get/get.test.js b/test/get/get.test.js index 667f3e104..facab132c 100644 --- a/test/get/get.test.js +++ b/test/get/get.test.js @@ -6,6 +6,8 @@ const get = require('./get.js'); expect(get).toBeInstanceOf(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."); + 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/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js b/test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js index 25052d94d..205eb4298 100644 --- a/test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js +++ b/test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js @@ -5,5 +5,7 @@ const getDaysDiffBetweenDates = require('./getDaysDiffBetweenDates.js'); test('getDaysDiffBetweenDates is a Function', () => { expect(getDaysDiffBetweenDates).toBeInstanceOf(Function); }); - t.equal(getDaysDiffBetweenDates(new Date('2017-12-13'), new Date('2017-12-22')), 9, "Returns the difference in days between two dates"); + 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/getType/getType.test.js b/test/getType/getType.test.js index dedd1d8b5..68222a194 100644 --- a/test/getType/getType.test.js +++ b/test/getType/getType.test.js @@ -5,5 +5,7 @@ const getType = require('./getType.js'); test('getType is a Function', () => { expect(getType).toBeInstanceOf(Function); }); - t.equal(getType(new Set([1, 2, 3])), 'set', "Returns the native type of a value"); + test('Returns the native type of a value', () => { + expect(getType(new Set([1, 2, 3]))).toBe('set') +}); diff --git a/test/groupBy/groupBy.test.js b/test/groupBy/groupBy.test.js index 194886b8d..4e34675e5 100644 --- a/test/groupBy/groupBy.test.js +++ b/test/groupBy/groupBy.test.js @@ -5,6 +5,10 @@ const groupBy = require('./groupBy.js'); test('groupBy is a Function', () => { expect(groupBy).toBeInstanceOf(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"); + test('Groups the elements of an array based on the given function', () => { + expect(groupBy([6.1, 4.2, 6.3], Math.floor), {4: [4.2], 6: [6.1).toEqual(6.3]}) +}); + test('Groups the elements of an array based on the given function', () => { + expect(groupBy(['one', 'two', 'three'], 'length'), {3: ['one', 'two']).toEqual(5: ['three']}) +}); diff --git a/test/hammingDistance/hammingDistance.test.js b/test/hammingDistance/hammingDistance.test.js index f72b78043..913a60018 100644 --- a/test/hammingDistance/hammingDistance.test.js +++ b/test/hammingDistance/hammingDistance.test.js @@ -5,5 +5,7 @@ const hammingDistance = require('./hammingDistance.js'); test('hammingDistance is a Function', () => { expect(hammingDistance).toBeInstanceOf(Function); }); - t.equal(hammingDistance(2, 3), 1, "retuns hamming disance between 2 values"); + test('retuns hamming disance between 2 values', () => { + expect(hammingDistance(2, 3)).toBe(1) +}); diff --git a/test/head/head.test.js b/test/head/head.test.js index fd29c145c..f7644c2a5 100644 --- a/test/head/head.test.js +++ b/test/head/head.test.js @@ -8,7 +8,9 @@ const head = require('./head.js'); test('head({ a: 1234}) returns undefined', () => { expect(head({ a: 1234}) === undefined).toBeTruthy(); }); - t.equal(head([1, 2, 3]), 1, "head([1, 2, 3]) returns 1"); + test('head([1, 2, 3]) returns 1', () => { + expect(head([1, 2, 3])).toBe(1) +}); test('head({ 0: false}) returns false', () => { expect(head({ 0: false}), false).toBe() }); diff --git a/test/hexToRGB/hexToRGB.test.js b/test/hexToRGB/hexToRGB.test.js index a3ffd412c..d470a1803 100644 --- a/test/hexToRGB/hexToRGB.test.js +++ b/test/hexToRGB/hexToRGB.test.js @@ -5,7 +5,13 @@ const hexToRGB = require('./hexToRGB.js'); test('hexToRGB is a Function', () => { expect(hexToRGB).toBeInstanceOf(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"); + test('Converts a color code to a rgb() or rgba() string', () => { + expect(hexToRGB('#27ae60ff'), 'rgba(39, 174, 96).toBe(255)') +}); + test('Converts a color code to a rgb() or rgba() string', () => { + expect(hexToRGB('27ae60'), 'rgb(39, 174).toBe(96)') +}); + test('Converts a color code to a rgb() or rgba() string', () => { + expect(hexToRGB('#fff'), 'rgb(255, 255).toBe(255)') +}); diff --git a/test/inRange/inRange.test.js b/test/inRange/inRange.test.js index 545c3991a..0a61db452 100644 --- a/test/inRange/inRange.test.js +++ b/test/inRange/inRange.test.js @@ -5,8 +5,16 @@ const inRange = require('./inRange.js'); test('inRange is a Function', () => { expect(inRange).toBeInstanceOf(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"); + test('The given number falls within the given range', () => { + expect(inRange(3, 2, 5)).toBe(true) +}); + test('The given number falls within the given range', () => { + expect(inRange(3, 4)).toBe(true) +}); + test('The given number does not falls within the given range', () => { + expect(inRange(2, 3, 5)).toBe(false) +}); + test('The given number does not falls within the given range', () => { + expect(inRange(3, 2)).toBe(false) +}); diff --git a/test/indexOfAll/indexOfAll.test.js b/test/indexOfAll/indexOfAll.test.js index 21fbb0cf3..f694d6a7b 100644 --- a/test/indexOfAll/indexOfAll.test.js +++ b/test/indexOfAll/indexOfAll.test.js @@ -5,6 +5,10 @@ const indexOfAll = require('./indexOfAll.js'); test('indexOfAll is a Function', () => { expect(indexOfAll).toBeInstanceOf(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"); + test('Returns all indices of val in an array', () => { + expect(indexOfAll([1, 2, 3, 1, 2, 3], 1), [0).toEqual(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 7dd301fe4..2659c902b 100644 --- a/test/initial/initial.test.js +++ b/test/initial/initial.test.js @@ -5,5 +5,7 @@ const initial = require('./initial.js'); test('initial is a Function', () => { expect(initial).toBeInstanceOf(Function); }); - t.deepEqual(initial([1, 2, 3]), [1, 2], "Returns all the elements of an array except the last one"); + test('Returns all the elements of an array except the last one', () => { + expect(initial([1, 2, 3]), [1).toEqual(2]) +}); diff --git a/test/initialize2DArray/initialize2DArray.test.js b/test/initialize2DArray/initialize2DArray.test.js index 441c34a4a..ee00d7560 100644 --- a/test/initialize2DArray/initialize2DArray.test.js +++ b/test/initialize2DArray/initialize2DArray.test.js @@ -5,5 +5,7 @@ const initialize2DArray = require('./initialize2DArray.js'); test('initialize2DArray is a Function', () => { expect(initialize2DArray).toBeInstanceOf(Function); }); - t.deepEqual(initialize2DArray(2, 2, 0), [[0,0], [0,0]], "Initializes a 2D array of given width and height and value"); + test('Initializes a 2D array of given width and height and value', () => { + expect(initialize2DArray(2, 2, 0), [[0,0], [0).toEqual(0]]) +}); diff --git a/test/initializeArrayWithRange/initializeArrayWithRange.test.js b/test/initializeArrayWithRange/initializeArrayWithRange.test.js index 18da3a9e4..23fedd17b 100644 --- a/test/initializeArrayWithRange/initializeArrayWithRange.test.js +++ b/test/initializeArrayWithRange/initializeArrayWithRange.test.js @@ -5,5 +5,7 @@ const initializeArrayWithRange = require('./initializeArrayWithRange.js'); test('initializeArrayWithRange is a Function', () => { expect(initializeArrayWithRange).toBeInstanceOf(Function); }); - t.deepEqual(initializeArrayWithRange(5), [0, 1, 2, 3, 4, 5], "Initializes an array containing the numbers in the specified range"); + test('Initializes an array containing the numbers in the specified range', () => { + expect(initializeArrayWithRange(5), [0, 1, 2, 3, 4).toEqual(5]) +}); diff --git a/test/initializeArrayWithValues/initializeArrayWithValues.test.js b/test/initializeArrayWithValues/initializeArrayWithValues.test.js index ee1f5ea89..6b6861f46 100644 --- a/test/initializeArrayWithValues/initializeArrayWithValues.test.js +++ b/test/initializeArrayWithValues/initializeArrayWithValues.test.js @@ -5,5 +5,7 @@ const initializeArrayWithValues = require('./initializeArrayWithValues.js'); test('initializeArrayWithValues is a Function', () => { expect(initializeArrayWithValues).toBeInstanceOf(Function); }); - t.deepEqual(initializeArrayWithValues(5, 2), [2, 2, 2, 2, 2], "Initializes and fills an array with the specified values"); + test('Initializes and fills an array with the specified values', () => { + expect(initializeArrayWithValues(5, 2), [2, 2, 2, 2).toEqual(2]) +}); diff --git a/test/intersection/intersection.test.js b/test/intersection/intersection.test.js index e94b8df5e..72316771f 100644 --- a/test/intersection/intersection.test.js +++ b/test/intersection/intersection.test.js @@ -5,5 +5,7 @@ const intersection = require('./intersection.js'); test('intersection is a Function', () => { expect(intersection).toBeInstanceOf(Function); }); - t.deepEqual(intersection([1, 2, 3], [4, 3, 2]), [2, 3], "Returns a list of elements that exist in both arrays"); + test('Returns a list of elements that exist in both arrays', () => { + expect(intersection([1, 2, 3], [4, 3, 2]), [2).toEqual(3]) +}); diff --git a/test/invertKeyValues/invertKeyValues.test.js b/test/invertKeyValues/invertKeyValues.test.js index 2619e5814..0c036fc66 100644 --- a/test/invertKeyValues/invertKeyValues.test.js +++ b/test/invertKeyValues/invertKeyValues.test.js @@ -5,6 +5,10 @@ const invertKeyValues = require('./invertKeyValues.js'); test('invertKeyValues is a Function', () => { expect(invertKeyValues).toBeInstanceOf(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' ] }"); + test('invertKeyValues({ a: 1, b: 2, c: 1 }) returns { 1: [ 'a', 'c' ], 2: [ 'b' ] }', () => { + expect(invertKeyValues({ a: 1, b: 2, c: 1 }), { 1: [ 'a', 'c' ]).toEqual(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), { group1: [ 'a', 'c' ]).toEqual(group2: [ 'b' ] }) +}); diff --git a/test/isAbsoluteURL/isAbsoluteURL.test.js b/test/isAbsoluteURL/isAbsoluteURL.test.js index 81dfb2539..0ddda8fbb 100644 --- a/test/isAbsoluteURL/isAbsoluteURL.test.js +++ b/test/isAbsoluteURL/isAbsoluteURL.test.js @@ -7,5 +7,7 @@ const isAbsoluteURL = require('./isAbsoluteURL.js'); }); t.equal(isAbsoluteURL('https: t.equal(isAbsoluteURL('ftp: - t.equal(isAbsoluteURL('/foo/bar'), false, "Given string is not an absolute URL"); + test('Given string is not an absolute URL', () => { + expect(isAbsoluteURL('/foo/bar')).toBe(false) +}); diff --git a/test/isArray/isArray.test.js b/test/isArray/isArray.test.js index a14d72e1f..63064f7bd 100644 --- a/test/isArray/isArray.test.js +++ b/test/isArray/isArray.test.js @@ -5,6 +5,10 @@ const isArray = require('./isArray.js'); test('isArray is a Function', () => { expect(isArray).toBeInstanceOf(Function); }); - t.equal(isArray([1]), true, "passed value is an array"); - t.equal(isArray('array'), false, "passed value is not an array"); + test('passed value is an array', () => { + expect(isArray([1])).toBe(true) +}); + test('passed value is not an array', () => { + expect(isArray('array')).toBe(false) +}); diff --git a/test/isBoolean/isBoolean.test.js b/test/isBoolean/isBoolean.test.js index 68b737800..e362c7b3e 100644 --- a/test/isBoolean/isBoolean.test.js +++ b/test/isBoolean/isBoolean.test.js @@ -5,6 +5,10 @@ const isBoolean = require('./isBoolean.js'); test('isBoolean is a Function', () => { expect(isBoolean).toBeInstanceOf(Function); }); - t.equal(isBoolean(null), false, "passed value is not a boolean"); - t.equal(isBoolean(false), true, "passed value is not a boolean"); + test('passed value is not a boolean', () => { + expect(isBoolean(null)).toBe(false) +}); + test('passed value is not a boolean', () => { + expect(isBoolean(false)).toBe(true) +}); diff --git a/test/isFunction/isFunction.test.js b/test/isFunction/isFunction.test.js index 030d4b73f..50d8e7579 100644 --- a/test/isFunction/isFunction.test.js +++ b/test/isFunction/isFunction.test.js @@ -5,6 +5,10 @@ const isFunction = require('./isFunction.js'); test('isFunction is a Function', () => { expect(isFunction).toBeInstanceOf(Function); }); - t.equal(isFunction(x => x), true, "passed value is a function"); - t.equal(isFunction('x'), false, "passed value is not a function"); + test('passed value is a function', () => { + expect(isFunction(x => x)).toBe(true) +}); + test('passed value is not a function', () => { + expect(isFunction('x')).toBe(false) +}); diff --git a/test/isLowerCase/isLowerCase.test.js b/test/isLowerCase/isLowerCase.test.js index 90f795f50..486345594 100644 --- a/test/isLowerCase/isLowerCase.test.js +++ b/test/isLowerCase/isLowerCase.test.js @@ -5,7 +5,13 @@ const isLowerCase = require('./isLowerCase.js'); test('isLowerCase is a Function', () => { expect(isLowerCase).toBeInstanceOf(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"); + test('passed string is a lowercase', () => { + expect(isLowerCase('abc')).toBe(true) +}); + test('passed string is a lowercase', () => { + expect(isLowerCase('a3@$')).toBe(true) +}); + test('passed value is not a lowercase', () => { + expect(isLowerCase('A3@$')).toBe(false) +}); diff --git a/test/isNull/isNull.test.js b/test/isNull/isNull.test.js index 84ffdc594..feb99d1bc 100644 --- a/test/isNull/isNull.test.js +++ b/test/isNull/isNull.test.js @@ -5,6 +5,10 @@ const isNull = require('./isNull.js'); test('isNull is a Function', () => { expect(isNull).toBeInstanceOf(Function); }); - t.equal(isNull(null), true, "passed argument is a null"); - t.equal(isNull(NaN), false, "passed argument is a null"); + test('passed argument is a null', () => { + expect(isNull(null)).toBe(true) +}); + test('passed argument is a null', () => { + expect(isNull(NaN)).toBe(false) +}); diff --git a/test/isNumber/isNumber.test.js b/test/isNumber/isNumber.test.js index 2211dd343..662876c51 100644 --- a/test/isNumber/isNumber.test.js +++ b/test/isNumber/isNumber.test.js @@ -5,6 +5,10 @@ const isNumber = require('./isNumber.js'); test('isNumber is a Function', () => { expect(isNumber).toBeInstanceOf(Function); }); - t.equal(isNumber(1), true, "passed argument is a number"); - t.equal(isNumber('1'), false, "passed argument is not a number"); + test('passed argument is a number', () => { + expect(isNumber(1)).toBe(true) +}); + test('passed argument is not a number', () => { + expect(isNumber('1')).toBe(false) +}); diff --git a/test/isPrime/isPrime.test.js b/test/isPrime/isPrime.test.js index ded341837..1fd824ed7 100644 --- a/test/isPrime/isPrime.test.js +++ b/test/isPrime/isPrime.test.js @@ -5,5 +5,7 @@ const isPrime = require('./isPrime.js'); test('isPrime is a Function', () => { expect(isPrime).toBeInstanceOf(Function); }); - t.equal(isPrime(11), true, "passed number is a prime"); + test('passed number is a prime', () => { + expect(isPrime(11)).toBe(true) +}); diff --git a/test/isPrimitive/isPrimitive.test.js b/test/isPrimitive/isPrimitive.test.js index edd290d1a..0083cd484 100644 --- a/test/isPrimitive/isPrimitive.test.js +++ b/test/isPrimitive/isPrimitive.test.js @@ -5,16 +5,36 @@ const isPrimitive = require('./isPrimitive.js'); test('isPrimitive is a Function', () => { expect(isPrimitive).toBeInstanceOf(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"); + 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 diff --git a/test/isSymbol/isSymbol.test.js b/test/isSymbol/isSymbol.test.js index e779b9500..a0c2a5181 100644 --- a/test/isSymbol/isSymbol.test.js +++ b/test/isSymbol/isSymbol.test.js @@ -5,5 +5,7 @@ const isSymbol = require('./isSymbol.js'); test('isSymbol is a Function', () => { expect(isSymbol).toBeInstanceOf(Function); }); - t.equal(isSymbol(Symbol('x')), true, "Checks if the given argument is a symbol"); + test('Checks if the given argument is a symbol', () => { + expect(isSymbol(Symbol('x'))).toBe(true) +}); diff --git a/test/join/join.test.js b/test/join/join.test.js index 4380658a2..834314e00 100644 --- a/test/join/join.test.js +++ b/test/join/join.test.js @@ -5,7 +5,13 @@ const join = require('./join.js'); test('join is a Function', () => { expect(join).toBeInstanceOf(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"); + test('Joins all elements of an array into a string and returns this string', () => { + expect(join(['pen', 'pineapple', 'apple', 'pen'], ',', '&'), "pen,pineapple).toEqual(apple&pen") +}); + test('Joins all elements of an array into a string and returns this string', () => { + expect(join(['pen', 'pineapple', 'apple', 'pen'], ','), "pen,pineapple,apple).toEqual(pen") +}); + test('Joins all elements of an array into a string and returns this string', () => { + expect(join(['pen', 'pineapple', 'apple', 'pen']), "pen,pineapple,apple).toEqual(pen") +}); diff --git a/test/last/last.test.js b/test/last/last.test.js index 282177e82..ebc9c8281 100644 --- a/test/last/last.test.js +++ b/test/last/last.test.js @@ -8,7 +8,9 @@ const last = require('./last.js'); test('last({ a: 1234}) returns undefined', () => { expect(last({ a: 1234}) === undefined).toBeTruthy(); }); - t.equal(last([1, 2, 3]), 3, "last([1, 2, 3]) returns 3"); + test('last([1, 2, 3]) returns 3', () => { + expect(last([1, 2, 3])).toBe(3) +}); test('last({ 0: false}) returns undefined', () => { expect(last({ 0: false}), undefined).toBe() }); diff --git a/test/lcm/lcm.test.js b/test/lcm/lcm.test.js index cf85e5970..3decb409e 100644 --- a/test/lcm/lcm.test.js +++ b/test/lcm/lcm.test.js @@ -5,6 +5,10 @@ const lcm = require('./lcm.js'); test('lcm is a Function', () => { expect(lcm).toBeInstanceOf(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."); + 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/longestItem/longestItem.test.js b/test/longestItem/longestItem.test.js index 7d2b0b6e2..244babd22 100644 --- a/test/longestItem/longestItem.test.js +++ b/test/longestItem/longestItem.test.js @@ -5,5 +5,7 @@ const longestItem = require('./longestItem.js'); test('longestItem is a Function', () => { expect(longestItem).toBeInstanceOf(Function); }); - t.deepEqual(longestItem('this', 'is', 'a', 'testcase'), 'testcase', "Returns the longest object"); + test('Returns the longest object', () => { + expect(longestItem('this', 'is', 'a', 'testcase')).toEqual('testcase') +}); diff --git a/test/luhnCheck/luhnCheck.test.js b/test/luhnCheck/luhnCheck.test.js index 7c1647865..938060e89 100644 --- a/test/luhnCheck/luhnCheck.test.js +++ b/test/luhnCheck/luhnCheck.test.js @@ -5,7 +5,13 @@ const luhnCheck = require('./luhnCheck.js'); test('luhnCheck is a Function', () => { expect(luhnCheck).toBeInstanceOf(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"); + test('validates identification number', () => { + expect(luhnCheck(6011329933655299)).toBe(false) +}); + test('validates identification number', () => { + expect(luhnCheck('4485275742308327')).toBe(true) +}); + test('validates identification number', () => { + expect(luhnCheck(123456789)).toBe(false) +}); diff --git a/test/mapObject/mapObject.test.js b/test/mapObject/mapObject.test.js index 2b00337b8..ea3d2fd08 100644 --- a/test/mapObject/mapObject.test.js +++ b/test/mapObject/mapObject.test.js @@ -5,7 +5,9 @@ const mapObject = require('./mapObject.js'); test('mapObject is a Function', () => { expect(mapObject).toBeInstanceOf(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 }"); + test('mapObject([1, 2, 3], a => a * a) returns { 1: 1, 2: 4, 3: 9 }', () => { + expect(mapObject([1, 2, 3], a => a * a), { 1: 1, 2: 4).toEqual(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), { 1: -1, 2: -1, 3: -1, 4: -1 }).toEqual() }); diff --git a/test/mask/mask.test.js b/test/mask/mask.test.js index ca1fab4ab..16a590dd5 100644 --- a/test/mask/mask.test.js +++ b/test/mask/mask.test.js @@ -5,7 +5,13 @@ const mask = require('./mask.js'); test('mask is a Function', () => { expect(mask).toBeInstanceOf(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"); + 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/maxN/maxN.test.js b/test/maxN/maxN.test.js index aaad1b7c3..ca4af723c 100644 --- a/test/maxN/maxN.test.js +++ b/test/maxN/maxN.test.js @@ -5,6 +5,10 @@ const maxN = require('./maxN.js'); test('maxN is a Function', () => { expect(maxN).toBeInstanceOf(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"); + 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), [3).toEqual(2]) +}); diff --git a/test/median/median.test.js b/test/median/median.test.js index da38d46cc..0d330d0f0 100644 --- a/test/median/median.test.js +++ b/test/median/median.test.js @@ -5,6 +5,10 @@ const median = require('./median.js'); test('median is a Function', () => { expect(median).toBeInstanceOf(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"); + 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/minN/minN.test.js b/test/minN/minN.test.js index 5f171662d..2475ac45b 100644 --- a/test/minN/minN.test.js +++ b/test/minN/minN.test.js @@ -5,6 +5,10 @@ const minN = require('./minN.js'); test('minN is a Function', () => { expect(minN).toBeInstanceOf(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"); + 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), [1).toEqual(2]) +}); diff --git a/test/negate/negate.test.js b/test/negate/negate.test.js index 1787751a9..8166c7634 100644 --- a/test/negate/negate.test.js +++ b/test/negate/negate.test.js @@ -5,6 +5,8 @@ const negate = require('./negate.js'); test('negate is a Function', () => { expect(negate).toBeInstanceOf(Function); }); - t.deepEqual([1, 2, 3, 4, 5, 6].filter(negate(n => n % 2 === 0)), [1, 3, 5], "Negates a predicate function"); + test('Negates a predicate function', () => { + expect([1, 2, 3, 4, 5, 6].filter(negate(n => n % 2 === 0)), [1, 3).toEqual(5]) +}); diff --git a/test/nthElement/nthElement.test.js b/test/nthElement/nthElement.test.js index 4a0f701b5..67bde724d 100644 --- a/test/nthElement/nthElement.test.js +++ b/test/nthElement/nthElement.test.js @@ -5,6 +5,10 @@ const nthElement = require('./nthElement.js'); test('nthElement is a Function', () => { expect(nthElement).toBeInstanceOf(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."); + 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 f158cd137..a4cb21be0 100644 --- a/test/objectFromPairs/objectFromPairs.test.js +++ b/test/objectFromPairs/objectFromPairs.test.js @@ -5,5 +5,7 @@ const objectFromPairs = require('./objectFromPairs.js'); test('objectFromPairs is a Function', () => { expect(objectFromPairs).toBeInstanceOf(Function); }); - t.deepEqual(objectFromPairs([['a', 1], ['b', 2]]), {a: 1, b: 2}, "Creates an object from the given key-value pairs."); + test('Creates an object from the given key-value pairs.', () => { + expect(objectFromPairs([['a', 1], ['b', 2]]), {a: 1).toEqual(b: 2}) +}); diff --git a/test/objectToPairs/objectToPairs.test.js b/test/objectToPairs/objectToPairs.test.js index cc7b858d5..5937a1ae7 100644 --- a/test/objectToPairs/objectToPairs.test.js +++ b/test/objectToPairs/objectToPairs.test.js @@ -5,5 +5,7 @@ const objectToPairs = require('./objectToPairs.js'); test('objectToPairs is a Function', () => { expect(objectToPairs).toBeInstanceOf(Function); }); - t.deepEqual(objectToPairs({ a: 1, b: 2 }), [['a',1],['b',2]], "Creates an array of key-value pair arrays from an object."); + test('Creates an array of key-value pair arrays from an object.', () => { + expect(objectToPairs({ a: 1, b: 2 }), [['a',1],['b').toEqual(2]]) +}); diff --git a/test/orderBy/orderBy.test.js b/test/orderBy/orderBy.test.js index 82cc69fe2..c5283fed5 100644 --- a/test/orderBy/orderBy.test.js +++ b/test/orderBy/orderBy.test.js @@ -6,6 +6,10 @@ const orderBy = require('./orderBy.js'); expect(orderBy).toBeInstanceOf(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."); + test('Returns a sorted array of objects ordered by properties and orders.', () => { + expect(orderBy(users, ['name', 'age'], ['asc', 'desc']), [{name: 'barney', age: 36}, {name: 'fred', age: 48}, {name: 'fred').toEqual(age: 40}]) +}); + test('Returns a sorted array of objects ordered by properties and orders.', () => { + expect(orderBy(users, ['name', 'age']), [{name: 'barney', age: 36}, {name: 'fred', age: 40}, {name: 'fred').toEqual(age: 48}]) +}); diff --git a/test/palindrome/palindrome.test.js b/test/palindrome/palindrome.test.js index 559ea76b4..1ae5482bd 100644 --- a/test/palindrome/palindrome.test.js +++ b/test/palindrome/palindrome.test.js @@ -5,6 +5,10 @@ const palindrome = require('./palindrome.js'); test('palindrome is a Function', () => { expect(palindrome).toBeInstanceOf(Function); }); - t.equal(palindrome('taco cat'), true, "Given string is a palindrome"); - t.equal(palindrome('foobar'), false, "Given string is not a palindrome"); + test('Given string is a palindrome', () => { + expect(palindrome('taco cat')).toBe(true) +}); + test('Given string is not a palindrome', () => { + expect(palindrome('foobar')).toBe(false) +}); diff --git a/test/partition/partition.test.js b/test/partition/partition.test.js index 958a9786d..9e78206c2 100644 --- a/test/partition/partition.test.js +++ b/test/partition/partition.test.js @@ -6,5 +6,7 @@ const partition = require('./partition.js'); expect(partition).toBeInstanceOf(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."); + test('Groups the elements into two arrays, depending on the provided function's truthiness for each element.', () => { + expect(partition(users, o => o.active), [[{ 'user': 'fred', 'age': 40, 'active': true }],[{ 'user': 'barney', 'age': 36).toEqual('active': false }]]) +}); diff --git a/test/percentile/percentile.test.js b/test/percentile/percentile.test.js index b3288143c..6d5a8b8ec 100644 --- a/test/percentile/percentile.test.js +++ b/test/percentile/percentile.test.js @@ -5,5 +5,7 @@ const percentile = require('./percentile.js'); test('percentile is a Function', () => { expect(percentile).toBeInstanceOf(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."); + 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/pick/pick.test.js b/test/pick/pick.test.js index 418f48d2d..f2bf03f98 100644 --- a/test/pick/pick.test.js +++ b/test/pick/pick.test.js @@ -5,5 +5,7 @@ const pick = require('./pick.js'); test('pick is a Function', () => { expect(pick).toBeInstanceOf(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."); + test('Picks the key-value pairs corresponding to the given keys from an object.', () => { + expect(pick({ a: 1, b: '2', c: 3 }, ['a', 'c']), { 'a': 1).toEqual('c': 3 }) +}); diff --git a/test/powerset/powerset.test.js b/test/powerset/powerset.test.js index 355d18110..0e90083a5 100644 --- a/test/powerset/powerset.test.js +++ b/test/powerset/powerset.test.js @@ -5,5 +5,7 @@ const powerset = require('./powerset.js'); test('powerset is a Function', () => { expect(powerset).toBeInstanceOf(Function); }); - t.deepEqual(powerset([1, 2]), [[], [1], [2], [2,1]], "Returns the powerset of a given array of numbers."); + test('Returns the powerset of a given array of numbers.', () => { + expect(powerset([1, 2]), [[], [1], [2], [2).toEqual(1]]) +}); diff --git a/test/prettyBytes/prettyBytes.test.js b/test/prettyBytes/prettyBytes.test.js index 44e629b2d..4c6ede865 100644 --- a/test/prettyBytes/prettyBytes.test.js +++ b/test/prettyBytes/prettyBytes.test.js @@ -5,7 +5,13 @@ const prettyBytes = require('./prettyBytes.js'); test('prettyBytes is a Function', () => { expect(prettyBytes).toBeInstanceOf(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."); + 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 bc302c481..20ceb463f 100644 --- a/test/primes/primes.test.js +++ b/test/primes/primes.test.js @@ -5,5 +5,7 @@ const primes = require('./primes.js'); test('primes is a Function', () => { expect(primes).toBeInstanceOf(Function); }); - t.deepEqual(primes(10), [2, 3, 5, 7], "Generates primes up to a given number, using the Sieve of Eratosthenes."); + test('Generates primes up to a given number, using the Sieve of Eratosthenes.', () => { + expect(primes(10), [2, 3, 5).toEqual(7]) +}); diff --git a/test/reducedFilter/reducedFilter.test.js b/test/reducedFilter/reducedFilter.test.js index 5fce9e4cb..4d661d7c9 100644 --- a/test/reducedFilter/reducedFilter.test.js +++ b/test/reducedFilter/reducedFilter.test.js @@ -17,5 +17,7 @@ const reducedFilter = require('./reducedFilter.js'); 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."); + 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), [{ id: 2).toEqual(name: 'mike'}]) +}); diff --git a/test/remove/remove.test.js b/test/remove/remove.test.js index bae377e4e..8b94f0aaf 100644 --- a/test/remove/remove.test.js +++ b/test/remove/remove.test.js @@ -5,6 +5,8 @@ const remove = require('./remove.js'); test('remove is a Function', () => { expect(remove).toBeInstanceOf(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"); + test('Removes elements from an array for which the given function returns false', () => { + expect(remove([1, 2, 3, 4], n => n % 2 === 0), [2).toEqual(4]) +}); diff --git a/test/reverseString/reverseString.test.js b/test/reverseString/reverseString.test.js index 176f122c1..08b76cbaf 100644 --- a/test/reverseString/reverseString.test.js +++ b/test/reverseString/reverseString.test.js @@ -5,5 +5,7 @@ const reverseString = require('./reverseString.js'); test('reverseString is a Function', () => { expect(reverseString).toBeInstanceOf(Function); }); - t.equal(reverseString('foobar'), 'raboof', "Reverses a string."); + test('Reverses a string.', () => { + expect(reverseString('foobar')).toBe('raboof') +}); diff --git a/test/round/round.test.js b/test/round/round.test.js index 8d9cc9318..dd4c5f59f 100644 --- a/test/round/round.test.js +++ b/test/round/round.test.js @@ -5,10 +5,18 @@ const round = require('./round.js'); test('round is a Function', () => { expect(round).toBeInstanceOf(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"); + 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(); }); diff --git a/test/sdbm/sdbm.test.js b/test/sdbm/sdbm.test.js index 718fd716a..3b1156ed2 100644 --- a/test/sdbm/sdbm.test.js +++ b/test/sdbm/sdbm.test.js @@ -5,5 +5,7 @@ const sdbm = require('./sdbm.js'); test('sdbm is a Function', () => { expect(sdbm).toBeInstanceOf(Function); }); - t.equal(sdbm('name'), -3521204949, "Hashes the input string into a whole number."); + test('Hashes the input string into a whole number.', () => { + expect(sdbm('name')).toBe(-3521204949) +}); diff --git a/test/similarity/similarity.test.js b/test/similarity/similarity.test.js index 480cba7b3..c737f6a4b 100644 --- a/test/similarity/similarity.test.js +++ b/test/similarity/similarity.test.js @@ -5,5 +5,7 @@ const similarity = require('./similarity.js'); test('similarity is a Function', () => { expect(similarity).toBeInstanceOf(Function); }); - t.deepEqual(similarity([1, 2, 3], [1, 2, 4]), [1, 2], "Returns an array of elements that appear in both arrays."); + test('Returns an array of elements that appear in both arrays.', () => { + expect(similarity([1, 2, 3], [1, 2, 4]), [1).toEqual(2]) +}); diff --git a/test/size/size.test.js b/test/size/size.test.js index f47849756..cb48c5517 100644 --- a/test/size/size.test.js +++ b/test/size/size.test.js @@ -5,6 +5,10 @@ const size = require('./size.js'); test('size is a Function', () => { expect(size).toBeInstanceOf(Function); }); - t.equal(size([1, 2, 3, 4, 5]), 5, "Get size of arrays, objects or strings."); - t.equal(size({ one: 1, two: 2, three: 3 }), 3, "Get size of arrays, objects or strings."); + 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/sortCharactersInString/sortCharactersInString.test.js b/test/sortCharactersInString/sortCharactersInString.test.js index 92a055f4d..00084521f 100644 --- a/test/sortCharactersInString/sortCharactersInString.test.js +++ b/test/sortCharactersInString/sortCharactersInString.test.js @@ -5,5 +5,7 @@ const sortCharactersInString = require('./sortCharactersInString.js'); test('sortCharactersInString is a Function', () => { expect(sortCharactersInString).toBeInstanceOf(Function); }); - t.equal(sortCharactersInString('cabbage'), 'aabbceg', "Alphabetically sorts the characters in a string."); + 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 903b2534f..bdf1500b8 100644 --- a/test/sortedIndex/sortedIndex.test.js +++ b/test/sortedIndex/sortedIndex.test.js @@ -5,6 +5,10 @@ const sortedIndex = require('./sortedIndex.js'); test('sortedIndex is a Function', () => { expect(sortedIndex).toBeInstanceOf(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."); + 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/splitLines/splitLines.test.js b/test/splitLines/splitLines.test.js index fcbc7d46a..a73d52de9 100644 --- a/test/splitLines/splitLines.test.js +++ b/test/splitLines/splitLines.test.js @@ -5,5 +5,7 @@ const splitLines = require('./splitLines.js'); test('splitLines is a Function', () => { expect(splitLines).toBeInstanceOf(Function); }); - t.deepEqual(splitLines('This\nis a\nmultiline\nstring.\n'), ['This', 'is a', 'multiline', 'string.' , ''], "Splits a multiline string into an array of lines."); + test('Splits a multiline string into an array of lines.', () => { + expect(splitLines('This\nis a\nmultiline\nstring.\n'), ['This', 'is a', 'multiline', 'string.' ).toEqual('']) +}); diff --git a/test/spreadOver/spreadOver.test.js b/test/spreadOver/spreadOver.test.js index df422d8c2..79c471dca 100644 --- a/test/spreadOver/spreadOver.test.js +++ b/test/spreadOver/spreadOver.test.js @@ -6,5 +6,7 @@ const spreadOver = require('./spreadOver.js'); expect(spreadOver).toBeInstanceOf(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."); + 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/standardDeviation/standardDeviation.test.js b/test/standardDeviation/standardDeviation.test.js index 9ddfb23d0..431ce662a 100644 --- a/test/standardDeviation/standardDeviation.test.js +++ b/test/standardDeviation/standardDeviation.test.js @@ -5,6 +5,10 @@ const standardDeviation = require('./standardDeviation.js'); test('standardDeviation is a Function', () => { expect(standardDeviation).toBeInstanceOf(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"); + test('Returns the standard deviation of an array of numbers', () => { + expect(standardDeviation([10, 2, 38, 23, 38, 23, 21])).toBe(13.284434142114991) +}); + test('Returns the standard deviation of an array of numbers', () => { + expect(standardDeviation([10, 2, 38, 23, 38, 23, 21], true)).toBe(12.29899614287479) +}); diff --git a/test/stringPermutations/stringPermutations.test.js b/test/stringPermutations/stringPermutations.test.js index a99fb7b23..54bfb0729 100644 --- a/test/stringPermutations/stringPermutations.test.js +++ b/test/stringPermutations/stringPermutations.test.js @@ -5,8 +5,14 @@ const stringPermutations = require('./stringPermutations.js'); test('stringPermutations is a Function', () => { expect(stringPermutations).toBeInstanceOf(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"); + test('Generates all stringPermutations of a string', () => { + expect(stringPermutations('abc'), ['abc','acb','bac','bca','cab').toEqual('cba']) +}); + test('Works for single-letter strings', () => { + expect(stringPermutations('a')).toEqual(['a']) +}); + test('Works for empty strings', () => { + expect(stringPermutations('')).toEqual(['']) +}); diff --git a/test/sum/sum.test.js b/test/sum/sum.test.js index ed21ad02f..ba1ba0785 100644 --- a/test/sum/sum.test.js +++ b/test/sum/sum.test.js @@ -5,5 +5,7 @@ const sum = require('./sum.js'); test('sum is a Function', () => { expect(sum).toBeInstanceOf(Function); }); - t.equal(sum(...[1, 2, 3, 4]), 10, "Returns the sum of two or more numbers/arrays."); + test('Returns the sum of two or more numbers/arrays.', () => { + expect(sum(...[1, 2, 3, 4])).toBe(10) +}); diff --git a/test/sumPower/sumPower.test.js b/test/sumPower/sumPower.test.js index 17f5a1433..aee0cf0a2 100644 --- a/test/sumPower/sumPower.test.js +++ b/test/sumPower/sumPower.test.js @@ -5,7 +5,13 @@ const sumPower = require('./sumPower.js'); test('sumPower is a Function', () => { expect(sumPower).toBeInstanceOf(Function); }); - t.equal(sumPower(10), 385, "Returns the sum of the powers of all the numbers from start to end"); - t.equal(sumPower(10, 3), 3025, "Returns the sum of the powers of all the numbers from start to end"); - t.equal(sumPower(10, 3, 5), 2925, "Returns the sum of the powers of all the numbers from start to end"); + test('Returns the sum of the powers of all the numbers from start to end', () => { + expect(sumPower(10)).toBe(385) +}); + test('Returns the sum of the powers of all the numbers from start to end', () => { + expect(sumPower(10, 3)).toBe(3025) +}); + test('Returns the sum of the powers of all the numbers from start to end', () => { + expect(sumPower(10, 3, 5)).toBe(2925) +}); diff --git a/test/symmetricDifference/symmetricDifference.test.js b/test/symmetricDifference/symmetricDifference.test.js index 4874b7544..4084a5a1d 100644 --- a/test/symmetricDifference/symmetricDifference.test.js +++ b/test/symmetricDifference/symmetricDifference.test.js @@ -5,5 +5,7 @@ const symmetricDifference = require('./symmetricDifference.js'); test('symmetricDifference is a Function', () => { expect(symmetricDifference).toBeInstanceOf(Function); }); - t.deepEqual(symmetricDifference([1, 2, 3], [1, 2, 4]), [3, 4], "Returns the symmetric difference between two arrays."); + test('Returns the symmetric difference between two arrays.', () => { + expect(symmetricDifference([1, 2, 3], [1, 2, 4]), [3).toEqual(4]) +}); diff --git a/test/tail/tail.test.js b/test/tail/tail.test.js index df77407cf..8c8460f64 100644 --- a/test/tail/tail.test.js +++ b/test/tail/tail.test.js @@ -5,6 +5,10 @@ const tail = require('./tail.js'); test('tail is a Function', () => { expect(tail).toBeInstanceOf(Function); }); - t.deepEqual(tail([1, 2, 3]), [2, 3], "Returns tail"); - t.deepEqual(tail([1]), [1], "Returns tail"); + test('Returns tail', () => { + expect(tail([1, 2, 3]), [2).toEqual(3]) +}); + test('Returns tail', () => { + expect(tail([1])).toEqual([1]) +}); diff --git a/test/take/take.test.js b/test/take/take.test.js index 2a71a1476..877c1e64b 100644 --- a/test/take/take.test.js +++ b/test/take/take.test.js @@ -5,7 +5,11 @@ const take = require('./take.js'); test('take is a Function', () => { expect(take).toBeInstanceOf(Function); }); - t.deepEqual(take([1, 2, 3], 5), [1, 2, 3], "Returns an array with n elements removed from the beginning."); - t.deepEqual(take([1, 2, 3], 0), [], "Returns an array with n elements removed from the beginning."); + test('Returns an array with n elements removed from the beginning.', () => { + expect(take([1, 2, 3], 5), [1, 2).toEqual(3]) +}); + test('Returns an array with n elements removed from the beginning.', () => { + expect(take([1, 2, 3], 0)).toEqual([]) +}); diff --git a/test/takeRight/takeRight.test.js b/test/takeRight/takeRight.test.js index ae144bb02..e82d8805c 100644 --- a/test/takeRight/takeRight.test.js +++ b/test/takeRight/takeRight.test.js @@ -5,6 +5,10 @@ const takeRight = require('./takeRight.js'); test('takeRight is a Function', () => { expect(takeRight).toBeInstanceOf(Function); }); - t.deepEqual(takeRight([1, 2, 3], 2), [2, 3], "Returns an array with n elements removed from the end"); - t.deepEqual(takeRight([1, 2, 3]), [3], "Returns an array with n elements removed from the end"); + test('Returns an array with n elements removed from the end', () => { + expect(takeRight([1, 2, 3], 2), [2).toEqual(3]) +}); + test('Returns an array with n elements removed from the end', () => { + expect(takeRight([1, 2, 3])).toEqual([3]) +}); diff --git a/test/toCamelCase/toCamelCase.test.js b/test/toCamelCase/toCamelCase.test.js index 5577464d9..46b8caa2c 100644 --- a/test/toCamelCase/toCamelCase.test.js +++ b/test/toCamelCase/toCamelCase.test.js @@ -5,10 +5,18 @@ const toCamelCase = require('./toCamelCase.js'); test('toCamelCase is a Function', () => { expect(toCamelCase).toBeInstanceOf(Function); }); - t.equal(toCamelCase('some_database_field_name'), 'someDatabaseFieldName', "toCamelCase('some_database_field_name') returns someDatabaseFieldName"); - t.equal(toCamelCase('Some label that needs to be camelized'), 'someLabelThatNeedsToBeCamelized', "toCamelCase('Some label that needs to be camelized') returns someLabelThatNeedsToBeCamelized"); - t.equal(toCamelCase('some-javascript-property'), 'someJavascriptProperty', "toCamelCase('some-javascript-property') return someJavascriptProperty"); - t.equal(toCamelCase('some-mixed_string with spaces_underscores-and-hyphens'), 'someMixedStringWithSpacesUnderscoresAndHyphens', "toCamelCase('some-mixed_string with spaces_underscores-and-hyphens') returns someMixedStringWithSpacesUnderscoresAndHyphens"); + test('toCamelCase('some_database_field_name') returns someDatabaseFieldName', () => { + expect(toCamelCase('some_database_field_name')).toBe('someDatabaseFieldName') +}); + test('toCamelCase('Some label that needs to be camelized') returns someLabelThatNeedsToBeCamelized', () => { + expect(toCamelCase('Some label that needs to be camelized')).toBe('someLabelThatNeedsToBeCamelized') +}); + test('toCamelCase('some-javascript-property') return someJavascriptProperty', () => { + expect(toCamelCase('some-javascript-property')).toBe('someJavascriptProperty') +}); + test('toCamelCase('some-mixed_string with spaces_underscores-and-hyphens') returns someMixedStringWithSpacesUnderscoresAndHyphens', () => { + expect(toCamelCase('some-mixed_string with spaces_underscores-and-hyphens')).toBe('someMixedStringWithSpacesUnderscoresAndHyphens') +}); t.throws(() => toCamelCase(), 'toCamelCase() throws a error'); t.throws(() => toCamelCase([]), 'toCamelCase([]) throws a error'); t.throws(() => toCamelCase({}), 'toCamelCase({}) throws a error'); diff --git a/test/toDecimalMark/toDecimalMark.test.js b/test/toDecimalMark/toDecimalMark.test.js index c35a4ade8..05c4574de 100644 --- a/test/toDecimalMark/toDecimalMark.test.js +++ b/test/toDecimalMark/toDecimalMark.test.js @@ -5,5 +5,7 @@ const toDecimalMark = require('./toDecimalMark.js'); test('toDecimalMark is a Function', () => { expect(toDecimalMark).toBeInstanceOf(Function); }); - t.equal(toDecimalMark(12305030388.9087), "12,305,030,388.909", "convert a float-point arithmetic to the Decimal mark form"); + test('convert a float-point arithmetic to the Decimal mark form', () => { + expect(toDecimalMark(12305030388.9087), "12,305,030).toBe(388.909") +}); diff --git a/test/toKebabCase/toKebabCase.test.js b/test/toKebabCase/toKebabCase.test.js index 32e9d81d6..d59756ca0 100644 --- a/test/toKebabCase/toKebabCase.test.js +++ b/test/toKebabCase/toKebabCase.test.js @@ -5,10 +5,18 @@ const toKebabCase = require('./toKebabCase.js'); test('toKebabCase is a Function', () => { expect(toKebabCase).toBeInstanceOf(Function); }); - t.equal(toKebabCase('camelCase'), 'camel-case', "toKebabCase('camelCase') returns camel-case"); - t.equal(toKebabCase('some text'), 'some-text', "toKebabCase('some text') returns some-text"); - t.equal(toKebabCase('some-mixed-string With spaces-underscores-and-hyphens'), 'some-mixed-string-with-spaces-underscores-and-hyphens', "toKebabCase('some-mixed-string With spaces-underscores-and-hyphens') returns some-mixed-string-with-spaces-underscores-and-hyphens"); - t.equal(toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML'), 'i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html', "toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html"); + test('toKebabCase('camelCase') returns camel-case', () => { + expect(toKebabCase('camelCase')).toBe('camel-case') +}); + test('toKebabCase('some text') returns some-text', () => { + expect(toKebabCase('some text')).toBe('some-text') +}); + test('toKebabCase('some-mixed-string With spaces-underscores-and-hyphens') returns some-mixed-string-with-spaces-underscores-and-hyphens', () => { + expect(toKebabCase('some-mixed-string With spaces-underscores-and-hyphens')).toBe('some-mixed-string-with-spaces-underscores-and-hyphens') +}); + test('toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html', () => { + expect(toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML')).toBe('i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html') +}); test('toKebabCase() return undefined', () => { expect(toKebabCase(), undefined).toBe() }); diff --git a/test/toSafeInteger/toSafeInteger.test.js b/test/toSafeInteger/toSafeInteger.test.js index 2676a9b09..49abc7547 100644 --- a/test/toSafeInteger/toSafeInteger.test.js +++ b/test/toSafeInteger/toSafeInteger.test.js @@ -8,15 +8,33 @@ const toSafeInteger = require('./toSafeInteger.js'); test('Number(toSafeInteger(3.2)) is a number', () => { expect(Number(toSafeInteger(3.2))).toBeTruthy(); }); - t.equal(toSafeInteger(3.2), 3, "Converts a value to a safe integer"); - t.equal(toSafeInteger('4.2'), 4, "toSafeInteger('4.2') returns 4"); - t.equal(toSafeInteger(4.6), 5, "toSafeInteger(4.6) returns 5"); - t.equal(toSafeInteger([]), 0, "toSafeInteger([]) returns 0"); - t.true(isNaN(toSafeInteger([1.5, 3124])), "isNaN(toSafeInteger([1.5, 3124])) is true"); - t.true(isNaN(toSafeInteger('string')), "isNaN(toSafeInteger('string')) is true"); - t.true(isNaN(toSafeInteger({})), "isNaN(toSafeInteger({})) is true"); - t.true(isNaN(toSafeInteger()), "isNaN(toSafeInteger()) is true"); - t.equal(toSafeInteger(Infinity), 9007199254740991, "toSafeInteger(Infinity) returns 9007199254740991"); + test('Converts a value to a safe integer', () => { + expect(toSafeInteger(3.2)).toBe(3) +}); + test('toSafeInteger('4.2') returns 4', () => { + expect(toSafeInteger('4.2')).toBe(4) +}); + test('toSafeInteger(4.6) returns 5', () => { + expect(toSafeInteger(4.6)).toBe(5) +}); + test('toSafeInteger([]) returns 0', () => { + expect(toSafeInteger([])).toBe(0) +}); + test('isNaN(toSafeInteger([1.5, 3124])) is true', () => { + expect(isNaN(toSafeInteger([1.5, 3124]))).toBeTruthy() +}); + test('isNaN(toSafeInteger('string')) is true', () => { + expect(isNaN(toSafeInteger('string'))).toBeTruthy() +}); + test('isNaN(toSafeInteger({})) is true', () => { + expect(isNaN(toSafeInteger({}))).toBeTruthy() +}); + test('isNaN(toSafeInteger()) is true', () => { + expect(isNaN(toSafeInteger())).toBeTruthy() +}); + test('toSafeInteger(Infinity) returns 9007199254740991', () => { + expect(toSafeInteger(Infinity)).toBe(9007199254740991) +}); let start = new Date().getTime(); toSafeInteger(3.2); diff --git a/test/toSnakeCase/toSnakeCase.test.js b/test/toSnakeCase/toSnakeCase.test.js index 89ad48fe6..ff0690f70 100644 --- a/test/toSnakeCase/toSnakeCase.test.js +++ b/test/toSnakeCase/toSnakeCase.test.js @@ -5,10 +5,18 @@ const toSnakeCase = require('./toSnakeCase.js'); test('toSnakeCase is a Function', () => { expect(toSnakeCase).toBeInstanceOf(Function); }); - t.equal(toSnakeCase('camelCase'), 'camel_case', "toSnakeCase('camelCase') returns camel_case"); - t.equal(toSnakeCase('some text'), 'some_text', "toSnakeCase('some text') returns some_text"); - t.equal(toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens'), 'some_mixed_string_with_spaces_underscores_and_hyphens', "toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens') returns some_mixed_string_with_spaces_underscores_and_hyphens"); - t.equal(toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML'), 'i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html', "toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html"); + test('toSnakeCase('camelCase') returns camel_case', () => { + expect(toSnakeCase('camelCase')).toBe('camel_case') +}); + test('toSnakeCase('some text') returns some_text', () => { + expect(toSnakeCase('some text')).toBe('some_text') +}); + test('toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens') returns some_mixed_string_with_spaces_underscores_and_hyphens', () => { + expect(toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens')).toBe('some_mixed_string_with_spaces_underscores_and_hyphens') +}); + test('toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html', () => { + expect(toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML')).toBe('i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html') +}); test('toSnakeCase() returns undefined', () => { expect(toSnakeCase(), undefined).toBe() }); diff --git a/test/truthCheckCollection/truthCheckCollection.test.js b/test/truthCheckCollection/truthCheckCollection.test.js index 0a78a68b7..1c5d1a0ee 100644 --- a/test/truthCheckCollection/truthCheckCollection.test.js +++ b/test/truthCheckCollection/truthCheckCollection.test.js @@ -5,5 +5,7 @@ const truthCheckCollection = require('./truthCheckCollection.js'); test('truthCheckCollection is a Function', () => { expect(truthCheckCollection).toBeInstanceOf(Function); }); - t.equal(truthCheckCollection([{ user: 'Tinky-Winky', sex: 'male' }, { user: 'Dipsy', sex: 'male' }], 'sex'), true, "second argument is truthy on all elements of a collection"); + test('second argument is truthy on all elements of a collection', () => { + expect(truthCheckCollection([{ user: 'Tinky-Winky', sex: 'male' }, { user: 'Dipsy', sex: 'male' }], 'sex')).toBe(true) +}); diff --git a/test/union/union.test.js b/test/union/union.test.js index 5e08864a3..a0a80f846 100644 --- a/test/union/union.test.js +++ b/test/union/union.test.js @@ -5,10 +5,18 @@ const union = require('./union.js'); test('union is a Function', () => { expect(union).toBeInstanceOf(Function); }); - t.deepEqual(union([1, 2, 3], [4, 3, 2]), [1, 2, 3, 4], "union([1, 2, 3], [4, 3, 2]) returns [1, 2, 3, 4]"); - t.deepEqual(union('str', 'asd'), [ 's', 't', 'r', 'a', 'd' ], "union('str', 'asd') returns [ 's', 't', 'r', 'a', 'd' ]"); - t.deepEqual(union([[], {}], [1, 2, 3]), [[], {}, 1, 2, 3], "union([[], {}], [1, 2, 3]) returns [[], {}, 1, 2, 3]"); - t.deepEqual(union([], []), [], "union([], []) returns []"); + test('union([1, 2, 3], [4, 3, 2]) returns [1, 2, 3, 4]', () => { + expect(union([1, 2, 3], [4, 3, 2]), [1, 2, 3).toEqual(4]) +}); + test('union('str', 'asd') returns [ 's', 't', 'r', 'a', 'd' ]', () => { + expect(union('str', 'asd'), [ 's', 't', 'r', 'a').toEqual('d' ]) +}); + test('union([[], {}], [1, 2, 3]) returns [[], {}, 1, 2, 3]', () => { + expect(union([[], {}], [1, 2, 3]), [[], {}, 1, 2).toEqual(3]) +}); + test('union([], []) returns []', () => { + expect(union([], [])).toEqual([]) +}); t.throws(() => union(), 'union() throws an error'); t.throws(() => union(true, 'str'), 'union(true, str) throws an error'); t.throws(() => union('false', true), 'union(false, true) throws an error'); diff --git a/test/uniqueElements/uniqueElements.test.js b/test/uniqueElements/uniqueElements.test.js index 42f5afff6..061c4da8f 100644 --- a/test/uniqueElements/uniqueElements.test.js +++ b/test/uniqueElements/uniqueElements.test.js @@ -5,13 +5,27 @@ const uniqueElements = require('./uniqueElements.js'); test('uniqueElements is a Function', () => { expect(uniqueElements).toBeInstanceOf(Function); }); - t.deepEqual(uniqueElements([1, 2, 2, 3, 4, 4, 5]), [1,2,3,4,5], "uniqueElements([1, 2, 2, 3, 4, 4, 5]) returns [1,2,3,4,5]"); - t.deepEqual(uniqueElements([1, 23, 53]), [1, 23, 53], "uniqueElements([1, 23, 53]) returns [1, 23, 53]"); - t.deepEqual(uniqueElements([true, 0, 1, false, false, undefined, null, '']), [true, 0, 1, false, undefined, null, ''], "uniqueElements([true, 0, 1, false, false, undefined, null, '']) returns [true, 0, 1, false, false, undefined, null, '']"); - t.deepEqual(uniqueElements(), [], "uniqueElements() returns []"); - t.deepEqual(uniqueElements(null), [], "uniqueElements(null) returns []"); - t.deepEqual(uniqueElements(undefined), [], "uniqueElements(undefined) returns []"); - t.deepEqual(uniqueElements('strt'), ['s', 't', 'r'], "uniqueElements('strt') returns ['s', 't', 'r']"); + test('uniqueElements([1, 2, 2, 3, 4, 4, 5]) returns [1,2,3,4,5]', () => { + expect(uniqueElements([1, 2, 2, 3, 4, 4, 5]), [1,2,3,4).toEqual(5]) +}); + test('uniqueElements([1, 23, 53]) returns [1, 23, 53]', () => { + expect(uniqueElements([1, 23, 53]), [1, 23).toEqual(53]) +}); + test('uniqueElements([true, 0, 1, false, false, undefined, null, '']) returns [true, 0, 1, false, false, undefined, null, '']', () => { + expect(uniqueElements([true, 0, 1, false, false, undefined, null, '']), [true, 0, 1, false, undefined, null).toEqual('']) +}); + test('uniqueElements() returns []', () => { + expect(uniqueElements()).toEqual([]) +}); + test('uniqueElements(null) returns []', () => { + expect(uniqueElements(null)).toEqual([]) +}); + test('uniqueElements(undefined) returns []', () => { + expect(uniqueElements(undefined)).toEqual([]) +}); + test('uniqueElements('strt') returns ['s', 't', 'r']', () => { + expect(uniqueElements('strt'), ['s', 't').toEqual('r']) +}); t.throws(() => uniqueElements(1, 1, 2543, 534, 5), 'uniqueElements(1, 1, 2543, 534, 5) throws an error'); t.throws(() => uniqueElements({}), 'uniqueElements({}) throws an error'); t.throws(() => uniqueElements(true), 'uniqueElements(true) throws an error'); diff --git a/test/without/without.test.js b/test/without/without.test.js index 60d7def99..48967d1ce 100644 --- a/test/without/without.test.js +++ b/test/without/without.test.js @@ -5,10 +5,18 @@ const without = require('./without.js'); test('without is a Function', () => { expect(without).toBeInstanceOf(Function); }); - t.deepEqual(without([2, 1, 2, 3], 1, 2), [3], "without([2, 1, 2, 3], 1, 2) returns [3]"); - t.deepEqual(without([]), [], "without([]) returns []"); - t.deepEqual(without([3, 1, true, '3', true], '3', true), [3, 1], "without([3, 1, true, '3', true], '3', true) returns [3, 1]"); - t.deepEqual(without('string'.split(''), 's', 't', 'g'), ['r', 'i', 'n'], "without('string'.split(''), 's', 't', 'g') returns ['r', 'i', 'n']"); + test('without([2, 1, 2, 3], 1, 2) returns [3]', () => { + expect(without([2, 1, 2, 3], 1, 2)).toEqual([3]) +}); + test('without([]) returns []', () => { + expect(without([])).toEqual([]) +}); + test('without([3, 1, true, '3', true], '3', true) returns [3, 1]', () => { + expect(without([3, 1, true, '3', true], '3', true), [3).toEqual(1]) +}); + test('without('string'.split(''), 's', 't', 'g') returns ['r', 'i', 'n']', () => { + expect(without('string'.split(''), 's', 't', 'g'), ['r', 'i').toEqual('n']) +}); t.throws(() => without(), 'without() throws an error'); t.throws(() => without(null), 'without(null) throws an error'); t.throws(() => without(undefined), 'without(undefined) throws an error'); diff --git a/test/words/words.test.js b/test/words/words.test.js index 8df2f68da..ec99f3882 100644 --- a/test/words/words.test.js +++ b/test/words/words.test.js @@ -5,8 +5,12 @@ const words = require('./words.js'); test('words is a Function', () => { expect(words).toBeInstanceOf(Function); }); - t.deepEqual(words('I love javaScript!!'), ["I", "love", "javaScript"], "words('I love javaScript!!') returns [I, love, javaScript]"); - t.deepEqual(words('python, javaScript & coffee'), ["python", "javaScript", "coffee"], "words('python, javaScript & coffee') returns [python, javaScript, coffee]"); + test('words('I love javaScript!!') returns [I, love, javaScript]', () => { + expect(words('I love javaScript!!'), ["I", "love").toEqual("javaScript"]) +}); + test('words('python, javaScript & coffee') returns [python, javaScript, coffee]', () => { + expect(words('python, javaScript & coffee'), ["python", "javaScript").toEqual("coffee"]) +}); test('words(I love javaScript!!) returns an array', () => { expect(Array.isArray(words('I love javaScript!!'))).toBeTruthy(); }); From 382c45285851d78e177a8af88a130758c0fe8bca Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Mon, 18 Jun 2018 16:44:12 +0300 Subject: [PATCH 06/19] Test cleanup and fixes [e-f] --- .../elementIsVisibleInViewport.test.js | 6 +---- test/elo/elo.test.js | 16 ++++++------ test/equals/equals.test.js | 17 +++++------- test/escapeHTML/escapeHTML.test.js | 8 +++--- test/escapeRegExp/escapeRegExp.test.js | 8 +++--- test/everyNth/everyNth.test.js | 8 +++--- test/extendHex/extendHex.test.js | 12 ++++----- test/factorial/factorial.test.js | 24 ++++++++--------- test/factors/factors.test.js | 4 +-- test/fibonacci/fibonacci.test.js | 8 +++--- .../fibonacciCountUntilNum.test.js | 4 +-- .../fibonacciUntilNum.test.js | 4 +-- test/filterNonUnique/filterNonUnique.test.js | 7 +++-- test/findKey/findKey.test.js | 12 ++++----- test/findLast/findLast.test.js | 9 +++---- test/findLastIndex/findLastIndex.test.js | 9 +++---- test/findLastKey/findLastKey.test.js | 12 ++++----- test/flatten/flatten.test.js | 12 ++++----- test/flattenObject/flattenObject.test.js | 13 ++++------ test/flip/flip.test.js | 17 +++++------- test/forEachRight/forEachRight.test.js | 13 ++++------ test/forOwn/forOwn.test.js | 13 ++++------ test/forOwnRight/forOwnRight.test.js | 13 ++++------ test/formatDuration/formatDuration.test.js | 12 ++++----- test/fromCamelCase/fromCamelCase.test.js | 16 +++++------- test/functionName/functionName.test.js | 26 +++++++++---------- test/functions/functions.test.js | 23 +++++++--------- 27 files changed, 132 insertions(+), 194 deletions(-) diff --git a/test/elementIsVisibleInViewport/elementIsVisibleInViewport.test.js b/test/elementIsVisibleInViewport/elementIsVisibleInViewport.test.js index d7bc61cd5..f3d70a2fd 100644 --- a/test/elementIsVisibleInViewport/elementIsVisibleInViewport.test.js +++ b/test/elementIsVisibleInViewport/elementIsVisibleInViewport.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const elementIsVisibleInViewport = require('./elementIsVisibleInViewport.js'); - - test('elementIsVisibleInViewport is a Function', () => { +test('elementIsVisibleInViewport is a Function', () => { expect(elementIsVisibleInViewport).toBeInstanceOf(Function); }); - - - diff --git a/test/elo/elo.test.js b/test/elo/elo.test.js index 2868b5fbc..3690a3425 100644 --- a/test/elo/elo.test.js +++ b/test/elo/elo.test.js @@ -1,15 +1,15 @@ const expect = require('expect'); const elo = require('./elo.js'); - - test('elo is a Function', () => { +test('elo is a Function', () => { expect(elo).toBeInstanceOf(Function); }); - test('Standard 1v1s', () => { - expect(elo([1200, 1200]), [1216).toEqual(1184]) +test('Standard 1v1s', () => { + expect(elo([1200, 1200])).toEqual([1216,1184]); }); - t.deepEqual(elo([1200, 1200], 64), [1232, 1168]), "Standard 1v1s"; - test('4 player FFA, all same rank', () => { - expect(elo([1200, 1200, 1200, 1200]).map(Math.round), [1246, 1215, 1185).toEqual(1154]) +test('Standard 1v1s' ,() => { + expect(elo([1200, 1200], 64)).toBe([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 c6622d169..f43d92336 100644 --- a/test/equals/equals.test.js +++ b/test/equals/equals.test.js @@ -1,24 +1,21 @@ const expect = require('expect'); const equals = require('./equals.js'); - - test('equals is a Function', () => { +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('{ 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]', () => { +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] }', () => { +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]', () => { +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.', () => { +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 748a10562..26f1b0d9f 100644 --- a/test/escapeHTML/escapeHTML.test.js +++ b/test/escapeHTML/escapeHTML.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const escapeHTML = require('./escapeHTML.js'); - - test('escapeHTML is a Function', () => { +test('escapeHTML is a Function', () => { expect(escapeHTML).toBeInstanceOf(Function); }); - test('Escapes a string for use in HTML', () => { +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 8483c0a88..0036bc296 100644 --- a/test/escapeRegExp/escapeRegExp.test.js +++ b/test/escapeRegExp/escapeRegExp.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const escapeRegExp = require('./escapeRegExp.js'); - - test('escapeRegExp is a Function', () => { +test('escapeRegExp is a Function', () => { expect(escapeRegExp).toBeInstanceOf(Function); }); - test('Escapes a string to use in a regular expression', () => { +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 09918d3e0..b54958fc7 100644 --- a/test/everyNth/everyNth.test.js +++ b/test/everyNth/everyNth.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const everyNth = require('./everyNth.js'); - - test('everyNth is a Function', () => { +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), [ 2, 4).toEqual(6 ]) +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 c196899e7..a31a3c6d2 100644 --- a/test/extendHex/extendHex.test.js +++ b/test/extendHex/extendHex.test.js @@ -1,14 +1,12 @@ const expect = require('expect'); const extendHex = require('./extendHex.js'); - - test('extendHex is a Function', () => { +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('#03f')).toBe('#0033ff'); }); - test('Extends a 3-digit color code to a 6-digit color code', () => { - expect(extendHex('05a')).toBe('#0055aa') +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 d13f79f2c..130d39a79 100644 --- a/test/factorial/factorial.test.js +++ b/test/factorial/factorial.test.js @@ -1,23 +1,21 @@ const expect = require('expect'); const factorial = require('./factorial.js'); - - test('factorial is a Function', () => { +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 720', () => { + expect(factorial(6)).toBe(720); }); - test('Calculates the factorial of 0', () => { - expect(factorial(0)).toBe(1) +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 1', () => { + expect(factorial(1)).toBe(1); }); - test('Calculates the factorial of 4', () => { - expect(factorial(4)).toBe(24) +test('Calculates the factorial of 4', () => { + expect(factorial(4)).toBe(24); }); - test('Calculates the factorial of 10', () => { - expect(factorial(10)).toBe(3628800) +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 f25d0073a..961098ef4 100644 --- a/test/factors/factors.test.js +++ b/test/factors/factors.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const factors = require('./factors.js'); - - test('factors is a Function', () => { +test('factors is a Function', () => { expect(factors).toBeInstanceOf(Function); }); - diff --git a/test/fibonacci/fibonacci.test.js b/test/fibonacci/fibonacci.test.js index 5a44cba21..c13d3551b 100644 --- a/test/fibonacci/fibonacci.test.js +++ b/test/fibonacci/fibonacci.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const fibonacci = require('./fibonacci.js'); - - test('fibonacci is a Function', () => { +test('fibonacci is a Function', () => { expect(fibonacci).toBeInstanceOf(Function); }); - test('Generates an array, containing the Fibonacci sequence', () => { - expect(fibonacci(6), [0, 1, 1, 2, 3).toEqual(5]) +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 015094d79..249b4ae48 100644 --- a/test/fibonacciCountUntilNum/fibonacciCountUntilNum.test.js +++ b/test/fibonacciCountUntilNum/fibonacciCountUntilNum.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const fibonacciCountUntilNum = require('./fibonacciCountUntilNum.js'); - - test('fibonacciCountUntilNum is a Function', () => { +test('fibonacciCountUntilNum is a Function', () => { expect(fibonacciCountUntilNum).toBeInstanceOf(Function); }); - diff --git a/test/fibonacciUntilNum/fibonacciUntilNum.test.js b/test/fibonacciUntilNum/fibonacciUntilNum.test.js index 7ad0c0649..a639afad4 100644 --- a/test/fibonacciUntilNum/fibonacciUntilNum.test.js +++ b/test/fibonacciUntilNum/fibonacciUntilNum.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const fibonacciUntilNum = require('./fibonacciUntilNum.js'); - - test('fibonacciUntilNum is a Function', () => { +test('fibonacciUntilNum is a Function', () => { expect(fibonacciUntilNum).toBeInstanceOf(Function); }); - diff --git a/test/filterNonUnique/filterNonUnique.test.js b/test/filterNonUnique/filterNonUnique.test.js index faa135e79..b4ab55867 100644 --- a/test/filterNonUnique/filterNonUnique.test.js +++ b/test/filterNonUnique/filterNonUnique.test.js @@ -1,11 +1,10 @@ const expect = require('expect'); const filterNonUnique = require('./filterNonUnique.js'); - - test('filterNonUnique is a Function', () => { +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]), [1,3).toEqual(5]) +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 44fe47811..ca8b397b0 100644 --- a/test/findKey/findKey.test.js +++ b/test/findKey/findKey.test.js @@ -1,17 +1,15 @@ const expect = require('expect'); const findKey = require('./findKey.js'); - - test('findKey is a Function', () => { +test('findKey is a Function', () => { expect(findKey).toBeInstanceOf(Function); }); - t.deepEqual(findKey( +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'); - - + o => o['active']).toBe('barney'); +}); diff --git a/test/findLast/findLast.test.js b/test/findLast/findLast.test.js index 3949b7eef..34fa06939 100644 --- a/test/findLast/findLast.test.js +++ b/test/findLast/findLast.test.js @@ -1,12 +1,9 @@ const expect = require('expect'); const findLast = require('./findLast.js'); - - test('findLast is a Function', () => { +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), 3).toBe() +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 190e2cde8..6f438daf6 100644 --- a/test/findLastIndex/findLastIndex.test.js +++ b/test/findLastIndex/findLastIndex.test.js @@ -1,12 +1,9 @@ const expect = require('expect'); const findLastIndex = require('./findLastIndex.js'); - - test('findLastIndex is a Function', () => { +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), 2).toBe() +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 3ab1dc4ce..5277755d3 100644 --- a/test/findLastKey/findLastKey.test.js +++ b/test/findLastKey/findLastKey.test.js @@ -1,17 +1,15 @@ const expect = require('expect'); const findLastKey = require('./findLastKey.js'); - - test('findLastKey is a Function', () => { +test('findLastKey is a Function', () => { expect(findLastKey).toBeInstanceOf(Function); }); - t.equal(findLastKey( +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'); - - + o => o['active']).toBe('pebbles'); +}); diff --git a/test/flatten/flatten.test.js b/test/flatten/flatten.test.js index a912af451..536a63637 100644 --- a/test/flatten/flatten.test.js +++ b/test/flatten/flatten.test.js @@ -1,14 +1,12 @@ const expect = require('expect'); const flatten = require('./flatten.js'); - - test('flatten is a Function', () => { +test('flatten is a Function', () => { expect(flatten).toBeInstanceOf(Function); }); - test('Flattens an array', () => { - expect(flatten([1, [2], 3, 4]), [1, 2, 3).toEqual(4]) +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), [1, 2, 3, [4, 5], 6, 7).toEqual(8]) +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 eb353fa5f..8ccafaf3e 100644 --- a/test/flattenObject/flattenObject.test.js +++ b/test/flattenObject/flattenObject.test.js @@ -1,15 +1,12 @@ const expect = require('expect'); const flattenObject = require('./flattenObject.js'); - - test('flattenObject is a Function', () => { +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 }), { 'a.b.c': 1, d: 1 }).toEqual() +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]), { 0: 0, 1: 1, 3: 1, '2.0': 2, '2.1.0': 1 }).toEqual() +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 912e91c22..26ad46f43 100644 --- a/test/flip/flip.test.js +++ b/test/flip/flip.test.js @@ -1,16 +1,13 @@ const expect = require('expect'); const flip = require('./flip.js'); - - test('flip is a Function', () => { +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), a).toEqual() +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 bd42e32f3..75eabf617 100644 --- a/test/forEachRight/forEachRight.test.js +++ b/test/forEachRight/forEachRight.test.js @@ -1,14 +1,11 @@ const expect = require('expect'); const forEachRight = require('./forEachRight.js'); - - test('forEachRight is a Function', () => { +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, '4321').toBe() +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 1b41dfb38..74c408c62 100644 --- a/test/forOwn/forOwn.test.js +++ b/test/forOwn/forOwn.test.js @@ -1,14 +1,11 @@ const expect = require('expect'); const forOwn = require('./forOwn.js'); - - test('forOwn is a Function', () => { +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, ['bar', 1]).toEqual() +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 01ce32b65..781d287fe 100644 --- a/test/forOwnRight/forOwnRight.test.js +++ b/test/forOwnRight/forOwnRight.test.js @@ -1,14 +1,11 @@ const expect = require('expect'); const forOwnRight = require('./forOwnRight.js'); - - test('forOwnRight is a Function', () => { +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, [1, 'bar']).toEqual() +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 fbef44981..780ffae26 100644 --- a/test/formatDuration/formatDuration.test.js +++ b/test/formatDuration/formatDuration.test.js @@ -1,14 +1,12 @@ const expect = require('expect'); const formatDuration = require('./formatDuration.js'); - - test('formatDuration is a Function', () => { +test('formatDuration is a Function', () => { expect(formatDuration).toBeInstanceOf(Function); }); - test('Returns the human readable format of the given number of milliseconds', () => { - expect(formatDuration(1001), '1 second).toBe(1 millisecond') +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), '397 days, 6 hours, 44 minutes, 15 seconds).toBe(574 milliseconds') +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 c20257ab1..5491058ac 100644 --- a/test/fromCamelCase/fromCamelCase.test.js +++ b/test/fromCamelCase/fromCamelCase.test.js @@ -1,17 +1,15 @@ const expect = require('expect'); const fromCamelCase = require('./fromCamelCase.js'); - - test('fromCamelCase is a Function', () => { +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('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('someLabelThatNeedsToBeCamelized', '-')).toBe('some-label-that-needs-to-be-camelized'); }); - test('Converts a string from camelcase', () => { - expect(fromCamelCase('someJavascriptProperty', '_')).toBe('some_javascript_property') +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 750c856b1..a4255180e 100644 --- a/test/functionName/functionName.test.js +++ b/test/functionName/functionName.test.js @@ -4,22 +4,20 @@ const console = {}; console.debug = (x) => output = x; const functionName = fn => (console.debug(fn.name), fn); - test('functionName is a Function', () => { +test('functionName is a Function', () => { expect(functionName).toBeInstanceOf(Function); }); - functionName(Math.max); - test('Works for native functions', () => { - expect(output, 'max').toBe() +functionName(Math.max); +test('Works for native functions', () => { + expect(output).toBe('max'); }); - function fun(x) {return x;} - functionName(fun); - test('Works for functions', () => { - expect(output, 'fun').toBe() +function fun(x) {return x;} +functionName(fun); +test('Works for functions', () => { + expect(output).toBe('fun'); }); - const fn = x => x; - functionName(fn); - test('Works for arrow functions', () => { - expect(output, 'fn').toBe() +const fn = x => x; +functionName(fn); +test('Works for arrow functions', () => { + expect(output).toBe('fn'); }); - - diff --git a/test/functions/functions.test.js b/test/functions/functions.test.js index cade171cb..d8d8ad5fe 100644 --- a/test/functions/functions.test.js +++ b/test/functions/functions.test.js @@ -1,20 +1,17 @@ const expect = require('expect'); const functions = require('./functions.js'); - - test('functions is a Function', () => { +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()), ['a', 'b']).toEqual() +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), ['a', 'b', 'c']).toEqual() +test('Returns own and inherited methods', () => { + expect(functions(new Foo(), true)).toEqual(['a', 'b', 'c']); }); - - From 7e9aae6f138b5a18bfd6aee7c747b716b135dbfb Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Mon, 18 Jun 2018 16:57:55 +0300 Subject: [PATCH 07/19] Test cleanup and fixes [g-h] --- test/gcd/gcd.test.js | 14 +++---- .../geometricProgression.test.js | 16 ++++---- test/get/get.test.js | 9 ++--- .../getColonTimeFromDate.test.js | 4 +- .../getDaysDiffBetweenDates.test.js | 8 ++-- .../getMeridiemSuffixOfInteger.test.js | 4 +- .../getScrollPosition.test.js | 6 +-- test/getStyle/getStyle.test.js | 6 +-- test/getType/getType.test.js | 8 ++-- .../getURLParameters/getURLParameters.test.js | 8 ++-- test/groupBy/groupBy.test.js | 14 +++---- test/hammingDistance/hammingDistance.test.js | 8 ++-- test/hasClass/hasClass.test.js | 6 +-- test/hasFlags/hasFlags.test.js | 6 +-- test/hashBrowser/hashBrowser.test.js | 6 +-- test/hashNode/hashNode.test.js | 9 ++--- test/head/head.test.js | 39 ++++++++++--------- test/hexToRGB/hexToRGB.test.js | 16 ++++---- test/hide/hide.test.js | 6 +-- test/howManyTimes/howManyTimes.test.js | 4 +- test/httpDelete/httpDelete.test.js | 4 +- test/httpGet/httpGet.test.js | 35 ++++++++--------- test/httpPost/httpPost.test.js | 31 +++++++-------- test/httpPut/httpPut.test.js | 4 +- test/httpsRedirect/httpsRedirect.test.js | 6 +-- test/hz/hz.test.js | 4 +- 26 files changed, 113 insertions(+), 168 deletions(-) diff --git a/test/gcd/gcd.test.js b/test/gcd/gcd.test.js index f95f944a5..8657042d6 100644 --- a/test/gcd/gcd.test.js +++ b/test/gcd/gcd.test.js @@ -1,14 +1,12 @@ const expect = require('expect'); const gcd = require('./gcd.js'); - - test('gcd is a Function', () => { +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(8, 36)).toBe(4); }); - test('Calculates the greatest common divisor between two or more numbers/arrays', () => { - expect(gcd(...[12, 8, 32])).toEqual(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 50fba67d1..c673143c1 100644 --- a/test/geometricProgression/geometricProgression.test.js +++ b/test/geometricProgression/geometricProgression.test.js @@ -1,17 +1,15 @@ const expect = require('expect'); const geometricProgression = require('./geometricProgression.js'); - - test('geometricProgression is a Function', () => { +test('geometricProgression is a Function', () => { expect(geometricProgression).toBeInstanceOf(Function); }); - test('Initializes an array containing the numbers in the specified range', () => { - expect(geometricProgression(256), [1, 2, 4, 8, 16, 32, 64, 128).toEqual(256]) +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), [3, 6, 12, 24, 48, 96).toEqual(192]) +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), [1, 4, 16, 64).toEqual(256]) +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 facab132c..526bb5bc6 100644 --- a/test/get/get.test.js +++ b/test/get/get.test.js @@ -1,13 +1,10 @@ const expect = require('expect'); const get = require('./get.js'); - - test('get is a Function', () => { +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.', () => { +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 1f863ae33..e834ac265 100644 --- a/test/getColonTimeFromDate/getColonTimeFromDate.test.js +++ b/test/getColonTimeFromDate/getColonTimeFromDate.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const getColonTimeFromDate = require('./getColonTimeFromDate.js'); - - test('getColonTimeFromDate is a Function', () => { +test('getColonTimeFromDate is a Function', () => { expect(getColonTimeFromDate).toBeInstanceOf(Function); }); - diff --git a/test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js b/test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js index 205eb4298..2128fe077 100644 --- a/test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js +++ b/test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const getDaysDiffBetweenDates = require('./getDaysDiffBetweenDates.js'); - - test('getDaysDiffBetweenDates is a Function', () => { +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) +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 f18244388..936eb3c13 100644 --- a/test/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.test.js +++ b/test/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const getMeridiemSuffixOfInteger = require('./getMeridiemSuffixOfInteger.js'); - - test('getMeridiemSuffixOfInteger is a Function', () => { +test('getMeridiemSuffixOfInteger is a Function', () => { expect(getMeridiemSuffixOfInteger).toBeInstanceOf(Function); }); - diff --git a/test/getScrollPosition/getScrollPosition.test.js b/test/getScrollPosition/getScrollPosition.test.js index 7e9b12367..0137c4eb4 100644 --- a/test/getScrollPosition/getScrollPosition.test.js +++ b/test/getScrollPosition/getScrollPosition.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const getScrollPosition = require('./getScrollPosition.js'); - - test('getScrollPosition is a Function', () => { +test('getScrollPosition is a Function', () => { expect(getScrollPosition).toBeInstanceOf(Function); }); - - - diff --git a/test/getStyle/getStyle.test.js b/test/getStyle/getStyle.test.js index 46fa01505..6f279ab81 100644 --- a/test/getStyle/getStyle.test.js +++ b/test/getStyle/getStyle.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const getStyle = require('./getStyle.js'); - - test('getStyle is a Function', () => { +test('getStyle is a Function', () => { expect(getStyle).toBeInstanceOf(Function); }); - - - diff --git a/test/getType/getType.test.js b/test/getType/getType.test.js index 68222a194..660a7f020 100644 --- a/test/getType/getType.test.js +++ b/test/getType/getType.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const getType = require('./getType.js'); - - test('getType is a Function', () => { +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') +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 e9e75eaa1..3a63c7890 100644 --- a/test/getURLParameters/getURLParameters.test.js +++ b/test/getURLParameters/getURLParameters.test.js @@ -1,9 +1,9 @@ const expect = require('expect'); const getURLParameters = require('./getURLParameters.js'); - - test('getURLParameters is a Function', () => { +test('getURLParameters is a Function', () => { expect(getURLParameters).toBeInstanceOf(Function); }); - t.deepEqual(getURLParameters('http: - +test('Returns an object containing the parameters of the current URL', () => { + expect(getURLParameters(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 4e34675e5..7f1c61eae 100644 --- a/test/groupBy/groupBy.test.js +++ b/test/groupBy/groupBy.test.js @@ -1,14 +1,12 @@ const expect = require('expect'); const groupBy = require('./groupBy.js'); - - test('groupBy is a Function', () => { +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), {4: [4.2], 6: [6.1).toEqual(6.3]}) +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'), {3: ['one', 'two']).toEqual(5: ['three']}) -}); - +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 913a60018..b884b6c89 100644 --- a/test/hammingDistance/hammingDistance.test.js +++ b/test/hammingDistance/hammingDistance.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const hammingDistance = require('./hammingDistance.js'); - - test('hammingDistance is a Function', () => { +test('hammingDistance is a Function', () => { expect(hammingDistance).toBeInstanceOf(Function); }); - test('retuns hamming disance between 2 values', () => { - expect(hammingDistance(2, 3)).toBe(1) +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 34ba77c26..74198e04e 100644 --- a/test/hasClass/hasClass.test.js +++ b/test/hasClass/hasClass.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const hasClass = require('./hasClass.js'); - - test('hasClass is a Function', () => { +test('hasClass is a Function', () => { expect(hasClass).toBeInstanceOf(Function); -}); - +}); diff --git a/test/hasFlags/hasFlags.test.js b/test/hasFlags/hasFlags.test.js index 0278eed8e..b709e53f5 100644 --- a/test/hasFlags/hasFlags.test.js +++ b/test/hasFlags/hasFlags.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const hasFlags = require('./hasFlags.js'); - - test('hasFlags is a Function', () => { +test('hasFlags is a Function', () => { expect(hasFlags).toBeInstanceOf(Function); }); - - - diff --git a/test/hashBrowser/hashBrowser.test.js b/test/hashBrowser/hashBrowser.test.js index f46f2f572..e51fe281c 100644 --- a/test/hashBrowser/hashBrowser.test.js +++ b/test/hashBrowser/hashBrowser.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const hashBrowser = require('./hashBrowser.js'); - - test('hashBrowser is a Function', () => { +test('hashBrowser is a Function', () => { expect(hashBrowser).toBeInstanceOf(Function); }); - - - diff --git a/test/hashNode/hashNode.test.js b/test/hashNode/hashNode.test.js index a66d989e0..250701418 100644 --- a/test/hashNode/hashNode.test.js +++ b/test/hashNode/hashNode.test.js @@ -1,10 +1,9 @@ const expect = require('expect'); const hashNode = require('./hashNode.js'); - - test('hashNode is a Function', () => { +test('hashNode is a Function', () => { expect(hashNode).toBeInstanceOf(Function); }); - hashNode(JSON.stringify({ a: 'a', b: [1, 2, 3, 4], foo: { c: 'bar' } })).then(v => t.equal(v, '04aa106279f5977f59f9067fa9712afc4aedc6f5862a8defc34552d8c7206393', 'Produces the appropriate hash')); - - +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 f7644c2a5..01591d787 100644 --- a/test/head/head.test.js +++ b/test/head/head.test.js @@ -1,30 +1,33 @@ const expect = require('expect'); const head = require('./head.js'); - - test('head is a Function', () => { +test('head is a Function', () => { expect(head).toBeInstanceOf(Function); }); - test('head({ a: 1234}) returns undefined', () => { +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([1, 2, 3]) returns 1', () => { + expect(head([1, 2, 3])).toBe(1); }); - test('head({ 0: false}) returns false', () => { - expect(head({ 0: false}), false).toBe() +test('head({ 0: false}) returns false', () => { + expect(head({ 0: false})).toBeFalsy(); }); - test('head(String) returns S', () => { - expect(head('String'), 'S').toBe() +test('head(String) returns S', () => { + expect(head('String')).toBe('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(); - test('head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run', () => { +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 d470a1803..2f2bf427e 100644 --- a/test/hexToRGB/hexToRGB.test.js +++ b/test/hexToRGB/hexToRGB.test.js @@ -1,17 +1,15 @@ const expect = require('expect'); const hexToRGB = require('./hexToRGB.js'); - - test('hexToRGB is a Function', () => { +test('hexToRGB is a Function', () => { expect(hexToRGB).toBeInstanceOf(Function); }); - test('Converts a color code to a rgb() or rgba() string', () => { - expect(hexToRGB('#27ae60ff'), 'rgba(39, 174, 96).toBe(255)') +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'), 'rgb(39, 174).toBe(96)') +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'), 'rgb(255, 255).toBe(255)') +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 ae3a4e4a0..7cfa1ec53 100644 --- a/test/hide/hide.test.js +++ b/test/hide/hide.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const hide = require('./hide.js'); - - test('hide is a Function', () => { +test('hide is a Function', () => { expect(hide).toBeInstanceOf(Function); }); - - - diff --git a/test/howManyTimes/howManyTimes.test.js b/test/howManyTimes/howManyTimes.test.js index c5b17e44b..e0d7efe30 100644 --- a/test/howManyTimes/howManyTimes.test.js +++ b/test/howManyTimes/howManyTimes.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const howManyTimes = require('./howManyTimes.js'); - - test('howManyTimes is a Function', () => { +test('howManyTimes is a Function', () => { expect(howManyTimes).toBeInstanceOf(Function); }); - diff --git a/test/httpDelete/httpDelete.test.js b/test/httpDelete/httpDelete.test.js index fc67eb414..6603d33bd 100644 --- a/test/httpDelete/httpDelete.test.js +++ b/test/httpDelete/httpDelete.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const httpDelete = require('./httpDelete.js'); - - test('httpDelete is a Function', () => { +test('httpDelete is a Function', () => { expect(httpDelete).toBeInstanceOf(Function); }); - diff --git a/test/httpGet/httpGet.test.js b/test/httpGet/httpGet.test.js index 1270778c7..f5859ff68 100644 --- a/test/httpGet/httpGet.test.js +++ b/test/httpGet/httpGet.test.js @@ -7,21 +7,20 @@ const httpGet = (url, callback, err = console.error) => { request.send(); }; - - test('httpGet is a Function', () => { +test('httpGet is a Function', () => { expect(httpGet).toBeInstanceOf(Function); }); - httpGet('https: - 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'); - - +test('Sends a GET request', () => { +httpGet('https://jsonplaceholder.typicode.com/posts/1', response => { + expect(JSON.parse(response)),toEqual({ + 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', + }); +}); var Url = require("url"); var spawn = require("child_process").spawn; @@ -289,7 +288,7 @@ XMLHttpRequest = function() { self.responseText = data; setState(self.DONE); } - + } else { try { this.responseText = fs.readFileSync(url.pathname, "utf8"); @@ -377,18 +376,18 @@ XMLHttpRequest = function() { if (sendFlag) { setState(self.LOADING); } - + response.on("end", function() { if (sendFlag) { setState(self.DONE); sendFlag = false; } - + response.on("error", function(error) { self.handleError(error); - + }; var errorHandler = function errorHandler(error) { self.handleError(error); @@ -502,7 +501,7 @@ XMLHttpRequest = function() { if (event in listeners) { listeners[event] = listeners[event].filter(function(ev) { return ev !== callback; - + } }; diff --git a/test/httpPost/httpPost.test.js b/test/httpPost/httpPost.test.js index 62e65a49c..84dfe26ff 100644 --- a/test/httpPost/httpPost.test.js +++ b/test/httpPost/httpPost.test.js @@ -8,20 +8,19 @@ const httpPost = (url, data, callback, err = console.error) => { request.send(data); }; - test('httpPost is a Function', () => { +test('httpPost is a Function', () => { expect(httpPost).toBeInstanceOf(Function); }); - const data = { - title: 'foo', - body: 'bar', - userId: 1 - }; - httpPost('https: - test('Sends a POST request', () => { - expect(JSON.parse(response).id, 101).toEqual() +const data = { + title: 'foo', + body: 'bar', + userId: 1 +}; +test('Sends a POST request', () => { + httpPost('https://jsonplaceholder.typicode.com/posts', JSON.stringify(data), response => { + expect(JSON.parse(response).id).toEqual(101); + }); }); - - var Url = require("url"); var spawn = require("child_process").spawn; @@ -289,7 +288,7 @@ XMLHttpRequest = function() { self.responseText = data; setState(self.DONE); } - + } else { try { this.responseText = fs.readFileSync(url.pathname, "utf8"); @@ -377,18 +376,18 @@ XMLHttpRequest = function() { if (sendFlag) { setState(self.LOADING); } - + response.on("end", function() { if (sendFlag) { setState(self.DONE); sendFlag = false; } - + response.on("error", function(error) { self.handleError(error); - + }; var errorHandler = function errorHandler(error) { self.handleError(error); @@ -502,7 +501,7 @@ XMLHttpRequest = function() { if (event in listeners) { listeners[event] = listeners[event].filter(function(ev) { return ev !== callback; - + } }; diff --git a/test/httpPut/httpPut.test.js b/test/httpPut/httpPut.test.js index a9beac9db..d76892baf 100644 --- a/test/httpPut/httpPut.test.js +++ b/test/httpPut/httpPut.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const httpPut = require('./httpPut.js'); - - test('httpPut is a Function', () => { +test('httpPut is a Function', () => { expect(httpPut).toBeInstanceOf(Function); }); - diff --git a/test/httpsRedirect/httpsRedirect.test.js b/test/httpsRedirect/httpsRedirect.test.js index 6727278bc..68dd20f32 100644 --- a/test/httpsRedirect/httpsRedirect.test.js +++ b/test/httpsRedirect/httpsRedirect.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const httpsRedirect = require('./httpsRedirect.js'); - - test('httpsRedirect is a Function', () => { +test('httpsRedirect is a Function', () => { expect(httpsRedirect).toBeInstanceOf(Function); }); - - - diff --git a/test/hz/hz.test.js b/test/hz/hz.test.js index a9ae095f1..58d0b4678 100644 --- a/test/hz/hz.test.js +++ b/test/hz/hz.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const hz = require('./hz.js'); - - test('hz is a Function', () => { +test('hz is a Function', () => { expect(hz).toBeInstanceOf(Function); }); - From 71d768320b65ef3a795fddc03c764c0d3ada22ab Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Mon, 18 Jun 2018 17:31:56 +0300 Subject: [PATCH 08/19] Test cleanup and fixes [i-l] --- test/JSONToDate/JSONToDate.test.js | 4 +- test/JSONToFile/JSONToFile.test.js | 6 +- test/inRange/inRange.test.js | 20 +++--- test/indexOfAll/indexOfAll.test.js | 12 ++-- test/initial/initial.test.js | 8 +-- .../initialize2DArray.test.js | 8 +-- .../initializeArrayWithRange.test.js | 8 +-- .../initializeArrayWithRangeRight.test.js | 4 +- .../initializeArrayWithValues.test.js | 8 +-- .../initializeNDArray.test.js | 4 +- test/intersection/intersection.test.js | 8 +-- test/intersectionBy/intersectionBy.test.js | 9 +-- .../intersectionWith/intersectionWith.test.js | 9 +-- test/invertKeyValues/invertKeyValues.test.js | 12 ++-- test/is/is.test.js | 69 +++++++++++++------ test/isAbsoluteURL/isAbsoluteURL.test.js | 16 +++-- test/isAnagram/isAnagram.test.js | 13 ++-- .../isArmstrongNumber.test.js | 4 +- test/isArray/isArray.test.js | 12 ++-- test/isArrayBuffer/isArrayBuffer.test.js | 4 +- test/isArrayLike/isArrayLike.test.js | 17 ++--- test/isBoolean/isBoolean.test.js | 12 ++-- test/isBrowser/isBrowser.test.js | 4 +- .../isBrowserTabFocused.test.js | 4 +- test/isDivisible/isDivisible.test.js | 7 +- test/isEmpty/isEmpty.test.js | 45 ++++++------ test/isEven/isEven.test.js | 12 ++-- test/isFunction/isFunction.test.js | 11 ++- test/isLowerCase/isLowerCase.test.js | 16 ++--- test/isMap/isMap.test.js | 4 +- test/isNil/isNil.test.js | 17 ++--- test/isNull/isNull.test.js | 12 ++-- test/isNumber/isNumber.test.js | 12 ++-- test/isObject/isObject.test.js | 13 ++-- test/isObjectLike/isObjectLike.test.js | 21 +++--- test/isPlainObject/isPlainObject.test.js | 13 ++-- test/isPrime/isPrime.test.js | 8 +-- test/isPrimitive/isPrimitive.test.js | 53 +++++++------- test/isPromiseLike/isPromiseLike.test.js | 16 ++--- test/isRegExp/isRegExp.test.js | 4 +- test/isSet/isSet.test.js | 4 +- test/isSimilar/isSimilar.test.js | 4 +- test/isSorted/isSorted.test.js | 49 +++++++------ test/isString/isString.test.js | 24 +++---- test/isSymbol/isSymbol.test.js | 8 +-- test/isTravisCI/isTravisCI.test.js | 21 +++--- test/isTypedArray/isTypedArray.test.js | 4 +- test/isUndefined/isUndefined.test.js | 7 +- test/isUpperCase/isUpperCase.test.js | 12 ++-- test/isValidJSON/isValidJSON.test.js | 16 ++--- test/isWeakMap/isWeakMap.test.js | 4 +- test/isWeakSet/isWeakSet.test.js | 4 +- test/join/join.test.js | 18 +++-- test/last/last.test.js | 39 ++++++----- test/lcm/lcm.test.js | 12 ++-- .../levenshteinDistance.test.js | 4 +- test/longestItem/longestItem.test.js | 8 +-- test/lowercaseKeys/lowercaseKeys.test.js | 17 ++--- test/luhnCheck/luhnCheck.test.js | 16 ++--- 59 files changed, 358 insertions(+), 452 deletions(-) diff --git a/test/JSONToDate/JSONToDate.test.js b/test/JSONToDate/JSONToDate.test.js index 9e271ee0c..8a9ca3412 100644 --- a/test/JSONToDate/JSONToDate.test.js +++ b/test/JSONToDate/JSONToDate.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const JSONToDate = require('./JSONToDate.js'); - - test('JSONToDate is a Function', () => { +test('JSONToDate is a Function', () => { expect(JSONToDate).toBeInstanceOf(Function); }); - diff --git a/test/JSONToFile/JSONToFile.test.js b/test/JSONToFile/JSONToFile.test.js index b46ee2c31..325eface8 100644 --- a/test/JSONToFile/JSONToFile.test.js +++ b/test/JSONToFile/JSONToFile.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const JSONToFile = require('./JSONToFile.js'); - - test('JSONToFile is a Function', () => { +test('JSONToFile is a Function', () => { expect(JSONToFile).toBeInstanceOf(Function); }); - - - diff --git a/test/inRange/inRange.test.js b/test/inRange/inRange.test.js index 0a61db452..5825a2f3b 100644 --- a/test/inRange/inRange.test.js +++ b/test/inRange/inRange.test.js @@ -1,20 +1,18 @@ const expect = require('expect'); const inRange = require('./inRange.js'); - - test('inRange is a Function', () => { +test('inRange is a Function', () => { expect(inRange).toBeInstanceOf(Function); }); - test('The given number falls within the given range', () => { - expect(inRange(3, 2, 5)).toBe(true) +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)).toBe(true) +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)).toBe(false) +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)).toBe(false) +test('The given number does not falls within the given range', () => { + expect(inRange(3, 2)).toBeTruthy(); }); - diff --git a/test/indexOfAll/indexOfAll.test.js b/test/indexOfAll/indexOfAll.test.js index f694d6a7b..0747df466 100644 --- a/test/indexOfAll/indexOfAll.test.js +++ b/test/indexOfAll/indexOfAll.test.js @@ -1,14 +1,12 @@ const expect = require('expect'); const indexOfAll = require('./indexOfAll.js'); - - test('indexOfAll is a Function', () => { +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), [0).toEqual(3]) +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([]) +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 2659c902b..13a85b519 100644 --- a/test/initial/initial.test.js +++ b/test/initial/initial.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const initial = require('./initial.js'); - - test('initial is a Function', () => { +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]), [1).toEqual(2]) +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 ee00d7560..c0e33de36 100644 --- a/test/initialize2DArray/initialize2DArray.test.js +++ b/test/initialize2DArray/initialize2DArray.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const initialize2DArray = require('./initialize2DArray.js'); - - test('initialize2DArray is a Function', () => { +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), [[0,0], [0).toEqual(0]]) +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 23fedd17b..8d0febed9 100644 --- a/test/initializeArrayWithRange/initializeArrayWithRange.test.js +++ b/test/initializeArrayWithRange/initializeArrayWithRange.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const initializeArrayWithRange = require('./initializeArrayWithRange.js'); - - test('initializeArrayWithRange is a Function', () => { +test('initializeArrayWithRange is a Function', () => { expect(initializeArrayWithRange).toBeInstanceOf(Function); }); - test('Initializes an array containing the numbers in the specified range', () => { - expect(initializeArrayWithRange(5), [0, 1, 2, 3, 4).toEqual(5]) +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 0bc006ff7..61f60f825 100644 --- a/test/initializeArrayWithRangeRight/initializeArrayWithRangeRight.test.js +++ b/test/initializeArrayWithRangeRight/initializeArrayWithRangeRight.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const initializeArrayWithRangeRight = require('./initializeArrayWithRangeRight.js'); - - test('initializeArrayWithRangeRight is a Function', () => { +test('initializeArrayWithRangeRight is a Function', () => { expect(initializeArrayWithRangeRight).toBeInstanceOf(Function); }); - diff --git a/test/initializeArrayWithValues/initializeArrayWithValues.test.js b/test/initializeArrayWithValues/initializeArrayWithValues.test.js index 6b6861f46..5114c99e8 100644 --- a/test/initializeArrayWithValues/initializeArrayWithValues.test.js +++ b/test/initializeArrayWithValues/initializeArrayWithValues.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const initializeArrayWithValues = require('./initializeArrayWithValues.js'); - - test('initializeArrayWithValues is a Function', () => { +test('initializeArrayWithValues is a Function', () => { expect(initializeArrayWithValues).toBeInstanceOf(Function); }); - test('Initializes and fills an array with the specified values', () => { - expect(initializeArrayWithValues(5, 2), [2, 2, 2, 2).toEqual(2]) +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 52de243ff..df9199213 100644 --- a/test/initializeNDArray/initializeNDArray.test.js +++ b/test/initializeNDArray/initializeNDArray.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const initializeNDArray = require('./initializeNDArray.js'); - - test('initializeNDArray is a Function', () => { +test('initializeNDArray is a Function', () => { expect(initializeNDArray).toBeInstanceOf(Function); }); - diff --git a/test/intersection/intersection.test.js b/test/intersection/intersection.test.js index 72316771f..39186b7bb 100644 --- a/test/intersection/intersection.test.js +++ b/test/intersection/intersection.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const intersection = require('./intersection.js'); - - test('intersection is a Function', () => { +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]), [2).toEqual(3]) +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 2c5207f23..5d69246bd 100644 --- a/test/intersectionBy/intersectionBy.test.js +++ b/test/intersectionBy/intersectionBy.test.js @@ -1,12 +1,9 @@ const expect = require('expect'); const intersectionBy = require('./intersectionBy.js'); - - test('intersectionBy is a Function', () => { +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), [2.1]).toEqual() +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 09ed1a88e..7063575a7 100644 --- a/test/intersectionWith/intersectionWith.test.js +++ b/test/intersectionWith/intersectionWith.test.js @@ -1,12 +1,9 @@ const expect = require('expect'); const intersectionWith = require('./intersectionWith.js'); - - test('intersectionWith is a Function', () => { +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)), [1.5, 3, 0]).toEqual() +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 0c036fc66..5bc005e4e 100644 --- a/test/invertKeyValues/invertKeyValues.test.js +++ b/test/invertKeyValues/invertKeyValues.test.js @@ -1,14 +1,12 @@ const expect = require('expect'); const invertKeyValues = require('./invertKeyValues.js'); - - test('invertKeyValues is a Function', () => { +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 }), { 1: [ 'a', 'c' ]).toEqual(2: [ 'b' ] }) +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), { group1: [ 'a', 'c' ]).toEqual(group2: [ '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 e1fafc039..0ad1f8bc6 100644 --- a/test/is/is.test.js +++ b/test/is/is.test.js @@ -1,25 +1,54 @@ const expect = require('expect'); const is = require('./is.js'); - - test('is is a Function', () => { +test('is is a Function', () => { expect(is).toBeInstanceOf(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`); - - +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 0ddda8fbb..806ac881c 100644 --- a/test/isAbsoluteURL/isAbsoluteURL.test.js +++ b/test/isAbsoluteURL/isAbsoluteURL.test.js @@ -1,13 +1,15 @@ const expect = require('expect'); const isAbsoluteURL = require('./isAbsoluteURL.js'); - - test('isAbsoluteURL is a Function', () => { +test('isAbsoluteURL is a Function', () => { expect(isAbsoluteURL).toBeInstanceOf(Function); }); - t.equal(isAbsoluteURL('https: - t.equal(isAbsoluteURL('ftp: - test('Given string is not an absolute URL', () => { - expect(isAbsoluteURL('/foo/bar')).toBe(false) +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 426050546..6fc0a9cb6 100644 --- a/test/isAnagram/isAnagram.test.js +++ b/test/isAnagram/isAnagram.test.js @@ -1,21 +1,18 @@ const expect = require('expect'); const isAnagram = require('./isAnagram.js'); - - test('isAnagram is a Function', () => { +test('isAnagram is a Function', () => { expect(isAnagram).toBeInstanceOf(Function); }); - test('Checks valid anagram', () => { +test('Checks valid anagram', () => { expect(isAnagram('iceman', 'cinema')).toBeTruthy(); }); - test('Works with spaces', () => { +test('Works with spaces', () => { expect(isAnagram('rail safety', 'fairy tales')).toBeTruthy(); }); - test('Ignores case', () => { +test('Ignores case', () => { expect(isAnagram('roast beef', 'eat for BSE')).toBeTruthy(); }); - test('Ignores special characters', () => { +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 a62809e2a..946cfa76f 100644 --- a/test/isArmstrongNumber/isArmstrongNumber.test.js +++ b/test/isArmstrongNumber/isArmstrongNumber.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const isArmstrongNumber = require('./isArmstrongNumber.js'); - - test('isArmstrongNumber is a Function', () => { +test('isArmstrongNumber is a Function', () => { expect(isArmstrongNumber).toBeInstanceOf(Function); }); - diff --git a/test/isArray/isArray.test.js b/test/isArray/isArray.test.js index 63064f7bd..e9e15dc19 100644 --- a/test/isArray/isArray.test.js +++ b/test/isArray/isArray.test.js @@ -1,14 +1,12 @@ const expect = require('expect'); const isArray = require('./isArray.js'); - - test('isArray is a Function', () => { +test('isArray is a Function', () => { expect(isArray).toBeInstanceOf(Function); }); - test('passed value is an array', () => { - expect(isArray([1])).toBe(true) +test('passed value is an array', () => { + expect(isArray([1])).toBeTruthy() }); - test('passed value is not an array', () => { - expect(isArray('array')).toBe(false) +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 54471ef95..fb65e81de 100644 --- a/test/isArrayBuffer/isArrayBuffer.test.js +++ b/test/isArrayBuffer/isArrayBuffer.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const isArrayBuffer = require('./isArrayBuffer.js'); - - test('isArrayBuffer is a Function', () => { +test('isArrayBuffer is a Function', () => { expect(isArrayBuffer).toBeInstanceOf(Function); }); - diff --git a/test/isArrayLike/isArrayLike.test.js b/test/isArrayLike/isArrayLike.test.js index a274a66db..19fa803cd 100644 --- a/test/isArrayLike/isArrayLike.test.js +++ b/test/isArrayLike/isArrayLike.test.js @@ -1,18 +1,15 @@ const expect = require('expect'); const isArrayLike = require('./isArrayLike.js'); - - test('isArrayLike is a Function', () => { +test('isArrayLike is a Function', () => { expect(isArrayLike).toBeInstanceOf(Function); }); - test('Returns true for a string', () => { - expect(isArrayLike('abc'), true).toBe() +test('Returns true for a string', () => { + expect(isArrayLike('abc')).toBeTruthy() }); - test('Returns true for an array', () => { - expect(isArrayLike([1,2,3]), true).toBe() +test('Returns true for an array', () => { + expect(isArrayLike([1,2,3])).toBeTruthy(); }); - test('Returns false for null', () => { - expect(isArrayLike(null), false).toBe() +test('Returns false for null', () => { + expect(isArrayLike(null)).toBeFalsy(); }); - - diff --git a/test/isBoolean/isBoolean.test.js b/test/isBoolean/isBoolean.test.js index e362c7b3e..31074f1f4 100644 --- a/test/isBoolean/isBoolean.test.js +++ b/test/isBoolean/isBoolean.test.js @@ -1,14 +1,12 @@ const expect = require('expect'); const isBoolean = require('./isBoolean.js'); - - test('isBoolean is a Function', () => { +test('isBoolean is a Function', () => { expect(isBoolean).toBeInstanceOf(Function); }); - test('passed value is not a boolean', () => { - expect(isBoolean(null)).toBe(false) +test('passed value is not a boolean', () => { + expect(isBoolean(null)).toBeFalsy(); }); - test('passed value is not a boolean', () => { - expect(isBoolean(false)).toBe(true) +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 7296ed250..a6c32ee74 100644 --- a/test/isBrowser/isBrowser.test.js +++ b/test/isBrowser/isBrowser.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const isBrowser = require('./isBrowser.js'); - - test('isBrowser is a Function', () => { +test('isBrowser is a Function', () => { expect(isBrowser).toBeInstanceOf(Function); }); - diff --git a/test/isBrowserTabFocused/isBrowserTabFocused.test.js b/test/isBrowserTabFocused/isBrowserTabFocused.test.js index 3ec43b2db..780a52095 100644 --- a/test/isBrowserTabFocused/isBrowserTabFocused.test.js +++ b/test/isBrowserTabFocused/isBrowserTabFocused.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const isBrowserTabFocused = require('./isBrowserTabFocused.js'); - - test('isBrowserTabFocused is a Function', () => { +test('isBrowserTabFocused is a Function', () => { expect(isBrowserTabFocused).toBeInstanceOf(Function); }); - diff --git a/test/isDivisible/isDivisible.test.js b/test/isDivisible/isDivisible.test.js index adb867938..3f71c4f03 100644 --- a/test/isDivisible/isDivisible.test.js +++ b/test/isDivisible/isDivisible.test.js @@ -1,11 +1,10 @@ const expect = require('expect'); const isDivisible = require('./isDivisible.js'); - - test('isDivisible is a Function', () => { +test('isDivisible is a Function', () => { expect(isDivisible).toBeInstanceOf(Function); }); - test('The number 6 is divisible by 3', () => { - expect(isDivisible(6, 3), true).toBe() +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 0144a4096..da27a5581 100644 --- a/test/isEmpty/isEmpty.test.js +++ b/test/isEmpty/isEmpty.test.js @@ -1,39 +1,36 @@ const expect = require('expect'); const isEmpty = require('./isEmpty.js'); - - test('isEmpty is a Function', () => { +test('isEmpty is a Function', () => { expect(isEmpty).toBeInstanceOf(Function); }); - test('Returns true for empty Map', () => { - expect(isEmpty(new Map()), true).toBe() +test('Returns true for empty Map', () => { + expect(isEmpty(new Map())).toBeTruthy(); }); - test('Returns true for empty Set', () => { - expect(isEmpty(new Set()), true).toBe() +test('Returns true for empty Set', () => { + expect(isEmpty(new Set())).toBeTruthy(); }); - test('Returns true for empty array', () => { - expect(isEmpty([]), true).toBe() +test('Returns true for empty array', () => { + expect(isEmpty([])).toBeTruthy(); }); - test('Returns true for empty object', () => { - expect(isEmpty({}), true).toBe() +test('Returns true for empty object', () => { + expect(isEmpty({})).toBeTruthy(); }); - test('Returns true for empty string', () => { - expect(isEmpty(''), true).toBe() +test('Returns true for empty string', () => { + expect(isEmpty('')).toBeTruthy(); }); - test('Returns false for non-empty array', () => { - expect(isEmpty([1, 2]), false).toBe() +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 }), false).toBe() +test('Returns false for non-empty object', () => { + expect(isEmpty({ a: 1, b: 2 })).toBeFalsy(); }); - test('Returns false for non-empty string', () => { - expect(isEmpty('text'), false).toBe() +test('Returns false for non-empty string', () => { + expect(isEmpty('text')).toBeFalsy(); }); - test('Returns true - type is not considered a collection', () => { - expect(isEmpty(123), true).toBe() +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), true).toBe() +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 3a1136da1..906f42b7b 100644 --- a/test/isEven/isEven.test.js +++ b/test/isEven/isEven.test.js @@ -1,14 +1,12 @@ const expect = require('expect'); const isEven = require('./isEven.js'); - - test('isEven is a Function', () => { +test('isEven is a Function', () => { expect(isEven).toBeInstanceOf(Function); }); - test('4 is even number', () => { - expect(isEven(4), true).toBe() +test('4 is even number', () => { + expect(isEven(4)).toBeTruthy(); }); - test('5 is not an even number', () => { - expect(isEven(5), false).toBeFalsy(); +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 50d8e7579..2d6d8db81 100644 --- a/test/isFunction/isFunction.test.js +++ b/test/isFunction/isFunction.test.js @@ -1,14 +1,13 @@ const expect = require('expect'); const isFunction = require('./isFunction.js'); - - test('isFunction is a Function', () => { +test('isFunction is a Function', () => { expect(isFunction).toBeInstanceOf(Function); }); - test('passed value is a function', () => { - expect(isFunction(x => x)).toBe(true) +test('passed value is a function', () => { + expect(isFunction(x => x)).toBeTruthy(); }); - test('passed value is not a function', () => { - expect(isFunction('x')).toBe(false) +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 486345594..9c6542476 100644 --- a/test/isLowerCase/isLowerCase.test.js +++ b/test/isLowerCase/isLowerCase.test.js @@ -1,17 +1,15 @@ const expect = require('expect'); const isLowerCase = require('./isLowerCase.js'); - - test('isLowerCase is a Function', () => { +test('isLowerCase is a Function', () => { expect(isLowerCase).toBeInstanceOf(Function); }); - test('passed string is a lowercase', () => { - expect(isLowerCase('abc')).toBe(true) +test('passed string is a lowercase', () => { + expect(isLowerCase('abc')).toBeTruthy(); }); - test('passed string is a lowercase', () => { - expect(isLowerCase('a3@$')).toBe(true) +test('passed string is a lowercase', () => { + expect(isLowerCase('a3@$')).toBeTruthy(); }); - test('passed value is not a lowercase', () => { - expect(isLowerCase('A3@$')).toBe(false) +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 3be014cbb..e6e434636 100644 --- a/test/isMap/isMap.test.js +++ b/test/isMap/isMap.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const isMap = require('./isMap.js'); - - test('isMap is a Function', () => { +test('isMap is a Function', () => { expect(isMap).toBeInstanceOf(Function); }); - diff --git a/test/isNil/isNil.test.js b/test/isNil/isNil.test.js index e193e8075..be77815a2 100644 --- a/test/isNil/isNil.test.js +++ b/test/isNil/isNil.test.js @@ -1,18 +1,15 @@ const expect = require('expect'); const isNil = require('./isNil.js'); - - test('isNil is a Function', () => { +test('isNil is a Function', () => { expect(isNil).toBeInstanceOf(Function); }); - test('Returns true for null', () => { - expect(isNil(null), true).toBe() +test('Returns true for null', () => { + expect(isNil(null)).toBeTruthy(); }); - test('Returns true for undefined', () => { - expect(isNil(undefined), true).toBe() +test('Returns true for undefined', () => { + expect(isNil(undefined)).toBeTruthy(); }); - test('Returns false for an empty string', () => { - expect(isNil(''), false).toBe() +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 feb99d1bc..fdf97d069 100644 --- a/test/isNull/isNull.test.js +++ b/test/isNull/isNull.test.js @@ -1,14 +1,12 @@ const expect = require('expect'); const isNull = require('./isNull.js'); - - test('isNull is a Function', () => { +test('isNull is a Function', () => { expect(isNull).toBeInstanceOf(Function); }); - test('passed argument is a null', () => { - expect(isNull(null)).toBe(true) +test('passed argument is a null', () => { + expect(isNull(null)).toBeTruthy(); }); - test('passed argument is a null', () => { - expect(isNull(NaN)).toBe(false) +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 662876c51..9b4872778 100644 --- a/test/isNumber/isNumber.test.js +++ b/test/isNumber/isNumber.test.js @@ -1,14 +1,12 @@ const expect = require('expect'); const isNumber = require('./isNumber.js'); - - test('isNumber is a Function', () => { +test('isNumber is a Function', () => { expect(isNumber).toBeInstanceOf(Function); }); - test('passed argument is a number', () => { - expect(isNumber(1)).toBe(true) +test('passed argument is a number', () => { + expect(isNumber(1)).toBeTruthy(); }); - test('passed argument is not a number', () => { - expect(isNumber('1')).toBe(false) +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 a4f79d110..d5e58c496 100644 --- a/test/isObject/isObject.test.js +++ b/test/isObject/isObject.test.js @@ -1,22 +1,19 @@ const expect = require('expect'); const isObject = require('./isObject.js'); - - test('isObject is a Function', () => { +test('isObject is a Function', () => { expect(isObject).toBeInstanceOf(Function); }); - - test('isObject([1, 2, 3, 4]) is a object', () => { +test('isObject([1, 2, 3, 4]) is a object', () => { expect(isObject([1, 2, 3, 4])).toBeTruthy(); }); - test('isObject([]) is a object', () => { +test('isObject([]) is a object', () => { expect(isObject([])).toBeTruthy(); }); - test('isObject({ a:1 }) is a object', () => { +test('isObject({ a:1 }) is a object', () => { expect(isObject({ a:1 })).toBeTruthy(); }); - test('isObject(true) is not a object', () => { +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 ad1f9c263..410878d8e 100644 --- a/test/isObjectLike/isObjectLike.test.js +++ b/test/isObjectLike/isObjectLike.test.js @@ -1,21 +1,18 @@ const expect = require('expect'); const isObjectLike = require('./isObjectLike.js'); - - test('isObjectLike is a Function', () => { +test('isObjectLike is a Function', () => { expect(isObjectLike).toBeInstanceOf(Function); }); - test('Returns true for an object', () => { - expect(isObjectLike({}), true).toBe() +test('Returns true for an object', () => { + expect(isObjectLike({})).toBeTruthy(); }); - test('Returns true for an array', () => { - expect(isObjectLike([1, 2, 3]), true).toBe() +test('Returns true for an array', () => { + expect(isObjectLike([1, 2, 3])).toBeTruthy(); }); - test('Returns false for a function', () => { - expect(isObjectLike(x => x), false).toBe() +test('Returns false for a function', () => { + expect(isObjectLike(x => x)).toBeFalsy(); }); - test('Returns false for null', () => { - expect(isObjectLike(null), false).toBe() +test('Returns false for null', () => { + expect(isObjectLike(null)).toBeFalsy(); }); - - diff --git a/test/isPlainObject/isPlainObject.test.js b/test/isPlainObject/isPlainObject.test.js index 48aea1309..eda33dabc 100644 --- a/test/isPlainObject/isPlainObject.test.js +++ b/test/isPlainObject/isPlainObject.test.js @@ -1,15 +1,12 @@ const expect = require('expect'); const isPlainObject = require('./isPlainObject.js'); - - test('isPlainObject is a Function', () => { +test('isPlainObject is a Function', () => { expect(isPlainObject).toBeInstanceOf(Function); }); - test('Returns true for a plain object', () => { - expect(isPlainObject({ a: 1 }), true).toBe() +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()), false).toBe() +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 1fd824ed7..f6776f687 100644 --- a/test/isPrime/isPrime.test.js +++ b/test/isPrime/isPrime.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const isPrime = require('./isPrime.js'); - - test('isPrime is a Function', () => { +test('isPrime is a Function', () => { expect(isPrime).toBeInstanceOf(Function); }); - test('passed number is a prime', () => { - expect(isPrime(11)).toBe(true) +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 0083cd484..c9652b170 100644 --- a/test/isPrimitive/isPrimitive.test.js +++ b/test/isPrimitive/isPrimitive.test.js @@ -1,45 +1,42 @@ const expect = require('expect'); const isPrimitive = require('./isPrimitive.js'); - - test('isPrimitive is a Function', () => { +test('isPrimitive is a Function', () => { expect(isPrimitive).toBeInstanceOf(Function); }); - test('isPrimitive(null) is primitive', () => { - expect(isPrimitive(null)).toBeTruthy() +test('isPrimitive(null) is primitive', () => { + expect(isPrimitive(null)).toBeTruthy(); }); - test('isPrimitive(undefined) is primitive', () => { - expect(isPrimitive(undefined)).toBeTruthy() +test('isPrimitive(undefined) is primitive', () => { + expect(isPrimitive(undefined)).toBeTruthy(); }); - test('isPrimitive(string) is primitive', () => { - expect(isPrimitive('string')).toBeTruthy() +test('isPrimitive(string) is primitive', () => { + expect(isPrimitive('string')).toBeTruthy(); }); - test('isPrimitive(true) is primitive', () => { - expect(isPrimitive(true)).toBeTruthy() +test('isPrimitive(true) is primitive', () => { + expect(isPrimitive(true)).toBeTruthy(); }); - test('isPrimitive(50) is primitive', () => { - expect(isPrimitive(50)).toBeTruthy() +test('isPrimitive(50) is primitive', () => { + expect(isPrimitive(50)).toBeTruthy(); }); - test('isPrimitive('Hello') is primitive', () => { - expect(isPrimitive('Hello')).toBeTruthy() +test('isPrimitive('Hello') is primitive', () => { + expect(isPrimitive('Hello')).toBeTruthy(); }); - test('isPrimitive(false) is primitive', () => { - expect(isPrimitive(false)).toBeTruthy() +test('isPrimitive(false) is primitive', () => { + expect(isPrimitive(false)).toBeTruthy(); }); - test('isPrimitive(Symbol()) is primitive', () => { - expect(isPrimitive(Symbol())).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([1, 2, 3]) is not primitive', () => { + expect(isPrimitive([1, 2, 3])).toBeFalsy(); }); - test('isPrimitive({ a: 123 }) is not primitive', () => { - expect(isPrimitive({ a: 123 })).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', () => { +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 1205dab72..10877b4ec 100644 --- a/test/isPromiseLike/isPromiseLike.test.js +++ b/test/isPromiseLike/isPromiseLike.test.js @@ -1,20 +1,16 @@ const expect = require('expect'); const isPromiseLike = require('./isPromiseLike.js'); - - test('isPromiseLike is a Function', () => { +test('isPromiseLike is a Function', () => { expect(isPromiseLike).toBeInstanceOf(Function); }); - t.equal(isPromiseLike({ +test('Returns true for a promise-like object', () => { + expect(isPromiseLike({ then: function() { return ''; } - }), true, 'Returns true for a promise-like object'); - test('Returns false for null', () => { - expect(isPromiseLike(null), false).toBe() + })).toBeTruthy(); }); - test('Returns false for an empty object', () => { - expect(isPromiseLike({}), false).toBe() +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 ef99fcdd0..ec565713f 100644 --- a/test/isRegExp/isRegExp.test.js +++ b/test/isRegExp/isRegExp.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const isRegExp = require('./isRegExp.js'); - - test('isRegExp is a Function', () => { +test('isRegExp is a Function', () => { expect(isRegExp).toBeInstanceOf(Function); }); - diff --git a/test/isSet/isSet.test.js b/test/isSet/isSet.test.js index e5e4c3630..559889443 100644 --- a/test/isSet/isSet.test.js +++ b/test/isSet/isSet.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const isSet = require('./isSet.js'); - - test('isSet is a Function', () => { +test('isSet is a Function', () => { expect(isSet).toBeInstanceOf(Function); }); - diff --git a/test/isSimilar/isSimilar.test.js b/test/isSimilar/isSimilar.test.js index f349dc7c9..0a632774e 100644 --- a/test/isSimilar/isSimilar.test.js +++ b/test/isSimilar/isSimilar.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const isSimilar = require('./isSimilar.js'); - - test('isSimilar is a Function', () => { +test('isSimilar is a Function', () => { expect(isSimilar).toBeInstanceOf(Function); }); - diff --git a/test/isSorted/isSorted.test.js b/test/isSorted/isSorted.test.js index d6a3d2716..d1d9fcfd9 100644 --- a/test/isSorted/isSorted.test.js +++ b/test/isSorted/isSorted.test.js @@ -1,42 +1,39 @@ const expect = require('expect'); const isSorted = require('./isSorted.js'); - - test('isSorted is a Function', () => { +test('isSorted is a Function', () => { expect(isSorted).toBeInstanceOf(Function); }); - test('Array is sorted in ascending order', () => { - expect(isSorted([0, 1, 2]), 1).toBe() +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]), 1).toBe() +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]), 1).toBe() +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]), 1).toBe() +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]), -1).toBe() +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]), -1).toBe() +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]), -1).toBe() +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]), -1).toBe() +test('Array is sorted in descending order', () => { + expect(isSorted([2, 1, 0, 0])).toBe(-1); }); - test('Array is empty', () => { - expect(isSorted([]), undefined).toBe() +test('Array is empty', () => { + expect(isSorted([])).toBe(undefined); }); - test('Array is not sorted, direction changed in array', () => { - expect(isSorted([1]), 0).toBe() +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]), 0).toBe() +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 752346b28..d3021b275 100644 --- a/test/isString/isString.test.js +++ b/test/isString/isString.test.js @@ -1,23 +1,21 @@ const expect = require('expect'); const isString = require('./isString.js'); - - test('isString is a Function', () => { +test('isString is a Function', () => { expect(isString).toBeInstanceOf(Function); }); - test('foo is a string', () => { - expect(isString('foo'), true).toBe() +test('foo is a string', () => { + expect(isString('foo')).toBeTruthy(); }); - test('"10" is a string', () => { - expect(isString('10'), true).toBe() +test('"10" is a string', () => { + expect(isString('10')).toBeTruthy(); }); - test('Empty string is a string', () => { - expect(isString(''), true).toBe() +test('Empty string is a string', () => { + expect(isString('')).toBeTruthy(); }); - test('10 is not a string', () => { - expect(isString(10), false).toBe() +test('10 is not a string', () => { + expect(isString(10)).toBeFalsy(); }); - test('true is not string', () => { - expect(isString(true), false).toBe() +test('true is not string', () => { + expect(isString(true)).toBeFalsy(); }); - diff --git a/test/isSymbol/isSymbol.test.js b/test/isSymbol/isSymbol.test.js index a0c2a5181..7b614771b 100644 --- a/test/isSymbol/isSymbol.test.js +++ b/test/isSymbol/isSymbol.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const isSymbol = require('./isSymbol.js'); - - test('isSymbol is a Function', () => { +test('isSymbol is a Function', () => { expect(isSymbol).toBeInstanceOf(Function); }); - test('Checks if the given argument is a symbol', () => { - expect(isSymbol(Symbol('x'))).toBe(true) +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 787d4845f..3417f7776 100644 --- a/test/isTravisCI/isTravisCI.test.js +++ b/test/isTravisCI/isTravisCI.test.js @@ -1,17 +1,14 @@ const expect = require('expect'); const isTravisCI = require('./isTravisCI.js'); - - test('isTravisCI is a Function', () => { +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(); -}); - - +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 cf37182b7..4264f8835 100644 --- a/test/isTypedArray/isTypedArray.test.js +++ b/test/isTypedArray/isTypedArray.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const isTypedArray = require('./isTypedArray.js'); - - test('isTypedArray is a Function', () => { +test('isTypedArray is a Function', () => { expect(isTypedArray).toBeInstanceOf(Function); }); - diff --git a/test/isUndefined/isUndefined.test.js b/test/isUndefined/isUndefined.test.js index 01b7b9095..60a725190 100644 --- a/test/isUndefined/isUndefined.test.js +++ b/test/isUndefined/isUndefined.test.js @@ -1,12 +1,9 @@ const expect = require('expect'); const isUndefined = require('./isUndefined.js'); - - test('isUndefined is a Function', () => { +test('isUndefined is a Function', () => { expect(isUndefined).toBeInstanceOf(Function); }); - test('Returns true for undefined', () => { +test('Returns true for undefined', () => { expect(isUndefined(undefined)).toBeTruthy(); }); - - diff --git a/test/isUpperCase/isUpperCase.test.js b/test/isUpperCase/isUpperCase.test.js index 650e0775a..d094ca53e 100644 --- a/test/isUpperCase/isUpperCase.test.js +++ b/test/isUpperCase/isUpperCase.test.js @@ -1,17 +1,15 @@ const expect = require('expect'); const isUpperCase = require('./isUpperCase.js'); - - test('isUpperCase is a Function', () => { +test('isUpperCase is a Function', () => { expect(isUpperCase).toBeInstanceOf(Function); }); - test('ABC is all upper case', () => { - expect(isUpperCase('ABC'), true).toBe() +test('ABC is all upper case', () => { + expect(isUpperCase('ABC')).toBeTruthy(); }); test('abc is not all upper case', () => { - expect(isUpperCase('abc'), false).toBe() + expect(isUpperCase('abc')).toBeFalsy(); }); test('A3@$ is all uppercase', () => { - expect(isUpperCase('A3@$'), true).toBe() + expect(isUpperCase('A3@$')).toBeTruthy(); }); - diff --git a/test/isValidJSON/isValidJSON.test.js b/test/isValidJSON/isValidJSON.test.js index 499d27685..6426d77ab 100644 --- a/test/isValidJSON/isValidJSON.test.js +++ b/test/isValidJSON/isValidJSON.test.js @@ -1,17 +1,15 @@ const expect = require('expect'); const isValidJSON = require('./isValidJSON.js'); - - test('isValidJSON is a Function', () => { +test('isValidJSON is a Function', () => { expect(isValidJSON).toBeInstanceOf(Function); }); - test('{"name":"Adam","age":20} is a valid JSON', () => { - expect(isValidJSON('{"name":"Adam","age":20}'), true).toBe() +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"}'), false).toBe() +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), true).toBe() +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 6ffa40525..6643677e9 100644 --- a/test/isWeakMap/isWeakMap.test.js +++ b/test/isWeakMap/isWeakMap.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const isWeakMap = require('./isWeakMap.js'); - - test('isWeakMap is a Function', () => { +test('isWeakMap is a Function', () => { expect(isWeakMap).toBeInstanceOf(Function); }); - diff --git a/test/isWeakSet/isWeakSet.test.js b/test/isWeakSet/isWeakSet.test.js index f071c38b3..2466138af 100644 --- a/test/isWeakSet/isWeakSet.test.js +++ b/test/isWeakSet/isWeakSet.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const isWeakSet = require('./isWeakSet.js'); - - test('isWeakSet is a Function', () => { +test('isWeakSet is a Function', () => { expect(isWeakSet).toBeInstanceOf(Function); }); - diff --git a/test/join/join.test.js b/test/join/join.test.js index 834314e00..d9bf08285 100644 --- a/test/join/join.test.js +++ b/test/join/join.test.js @@ -1,17 +1,15 @@ const expect = require('expect'); const join = require('./join.js'); - - test('join is a Function', () => { +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'], ',', '&'), "pen,pineapple).toEqual(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'], ','), "pen,pineapple,apple).toEqual(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']), "pen,pineapple,apple).toEqual(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 ebc9c8281..8da663642 100644 --- a/test/last/last.test.js +++ b/test/last/last.test.js @@ -1,30 +1,33 @@ const expect = require('expect'); const last = require('./last.js'); - - test('last is a Function', () => { +test('last is a Function', () => { expect(last).toBeInstanceOf(Function); }); - test('last({ a: 1234}) returns undefined', () => { +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([1, 2, 3]) returns 3', () => { + expect(last([1, 2, 3])).toBe(3); }); - test('last({ 0: false}) returns undefined', () => { - expect(last({ 0: false}), undefined).toBe() +test('last({ 0: false}) returns undefined', () => { + expect(last({ 0: false})).toBe(undefined); }); - test('last(String) returns g', () => { - expect(last('String'), 'g').toBe() +test('last(String) returns g', () => { + expect(last('String')).toBe('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(); - test('last([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run', () => { +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 3decb409e..dfa340b88 100644 --- a/test/lcm/lcm.test.js +++ b/test/lcm/lcm.test.js @@ -1,14 +1,12 @@ const expect = require('expect'); const lcm = require('./lcm.js'); - - test('lcm is a Function', () => { +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(12, 7)).toBe(84); }); - test('Returns the least common multiple of two or more numbers.', () => { - expect(lcm(...[1, 3, 4, 5])).toBe(60) +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 44ae20d78..c5556114d 100644 --- a/test/levenshteinDistance/levenshteinDistance.test.js +++ b/test/levenshteinDistance/levenshteinDistance.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const levenshteinDistance = require('./levenshteinDistance.js'); - - test('levenshteinDistance is a Function', () => { +test('levenshteinDistance is a Function', () => { expect(levenshteinDistance).toBeInstanceOf(Function); }); - diff --git a/test/longestItem/longestItem.test.js b/test/longestItem/longestItem.test.js index 244babd22..7e8c01357 100644 --- a/test/longestItem/longestItem.test.js +++ b/test/longestItem/longestItem.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const longestItem = require('./longestItem.js'); - - test('longestItem is a Function', () => { +test('longestItem is a Function', () => { expect(longestItem).toBeInstanceOf(Function); }); - test('Returns the longest object', () => { - expect(longestItem('this', 'is', 'a', 'testcase')).toEqual('testcase') +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 ad8077094..37868e338 100644 --- a/test/lowercaseKeys/lowercaseKeys.test.js +++ b/test/lowercaseKeys/lowercaseKeys.test.js @@ -1,17 +1,14 @@ const expect = require('expect'); const lowercaseKeys = require('./lowercaseKeys.js'); - - test('lowercaseKeys is a Function', () => { +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, {name: 'Adam', surname: 'Smith'}).toEqual() +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, { Name: 'Adam', sUrnAME: 'Smith' }).toEqual() +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 938060e89..28d176fe5 100644 --- a/test/luhnCheck/luhnCheck.test.js +++ b/test/luhnCheck/luhnCheck.test.js @@ -1,17 +1,15 @@ const expect = require('expect'); const luhnCheck = require('./luhnCheck.js'); - - test('luhnCheck is a Function', () => { +test('luhnCheck is a Function', () => { expect(luhnCheck).toBeInstanceOf(Function); }); - test('validates identification number', () => { - expect(luhnCheck(6011329933655299)).toBe(false) +test('validates identification number', () => { + expect(luhnCheck(6011329933655299)).toBeFalsy(); }); - test('validates identification number', () => { - expect(luhnCheck('4485275742308327')).toBe(true) +test('validates identification number', () => { + expect(luhnCheck('4485275742308327')).toBeTruthy(); }); - test('validates identification number', () => { - expect(luhnCheck(123456789)).toBe(false) +test('validates identification number', () => { + expect(luhnCheck(123456789)).toBeFalsy(); }); - From 9f95330528ec2213cf814db262ad2cfee069d114 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Mon, 18 Jun 2018 17:40:29 +0300 Subject: [PATCH 09/19] Test cleanup and fixes [m-n] --- test/mapKeys/mapKeys.test.js | 9 +++---- test/mapObject/mapObject.test.js | 17 +++++------- test/mapValues/mapValues.test.js | 17 +++++------- test/mask/mask.test.js | 16 +++++------- test/matches/matches.test.js | 9 +++---- test/matchesWith/matchesWith.test.js | 13 +++++----- test/maxBy/maxBy.test.js | 13 ++++------ test/maxN/maxN.test.js | 12 ++++----- test/median/median.test.js | 8 +++--- test/memoize/memoize.test.js | 21 +++++++-------- test/merge/merge.test.js | 27 +++++++++----------- test/minBy/minBy.test.js | 13 ++++------ test/minN/minN.test.js | 12 ++++----- test/mostPerformant/mostPerformant.test.js | 6 +---- test/negate/negate.test.js | 9 +++---- test/nest/nest.test.js | 4 +-- test/nodeListToArray/nodeListToArray.test.js | 4 +-- test/none/none.test.js | 13 ++++------ test/nthArg/nthArg.test.js | 20 +++++++-------- test/nthElement/nthElement.test.js | 12 ++++----- 20 files changed, 102 insertions(+), 153 deletions(-) diff --git a/test/mapKeys/mapKeys.test.js b/test/mapKeys/mapKeys.test.js index cec228c64..076f1fabe 100644 --- a/test/mapKeys/mapKeys.test.js +++ b/test/mapKeys/mapKeys.test.js @@ -1,12 +1,9 @@ const expect = require('expect'); const mapKeys = require('./mapKeys.js'); - - test('mapKeys is a Function', () => { +test('mapKeys is a Function', () => { expect(mapKeys).toBeInstanceOf(Function); }); - test('Maps keys', () => { - expect(mapKeys({ a: 1, b: 2 }, (val, key) => key + val), { a1: 1, b2: 2 }).toEqual() +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 ea3d2fd08..86d5cf698 100644 --- a/test/mapObject/mapObject.test.js +++ b/test/mapObject/mapObject.test.js @@ -1,18 +1,15 @@ const expect = require('expect'); const mapObject = require('./mapObject.js'); - - test('mapObject is a Function', () => { +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), { 1: 1, 2: 4).toEqual(3: 9 }) +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), { 1: -1, 2: -1, 3: -1, 4: -1 }).toEqual() +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), { 1: 1, 2: 1, 3: 1, 4: 1 }).toEqual() +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 f8b315256..24273703c 100644 --- a/test/mapValues/mapValues.test.js +++ b/test/mapValues/mapValues.test.js @@ -1,16 +1,13 @@ const expect = require('expect'); const mapValues = require('./mapValues.js'); - - test('mapValues is a Function', () => { +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), { fred: 40, pebbles: 1 }).toEqual() +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 16a590dd5..11c8e4cb5 100644 --- a/test/mask/mask.test.js +++ b/test/mask/mask.test.js @@ -1,17 +1,15 @@ const expect = require('expect'); const mask = require('./mask.js'); - - test('mask is a Function', () => { +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)).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, 3)).toBe('*******890'); }); - test('Replaces all but the last num of characters with the specified mask character', () => { - expect(mask(1234567890, -4, '$')).toBe('$$$$567890') +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 e0e33998d..221c9d950 100644 --- a/test/matches/matches.test.js +++ b/test/matches/matches.test.js @@ -1,15 +1,12 @@ const expect = require('expect'); const matches = require('./matches.js'); - - test('matches is a Function', () => { +test('matches is a Function', () => { expect(matches).toBeInstanceOf(Function); }); - test('Matches returns true for two similar objects', () => { +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', () => { +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 d463b7817..5de34f836 100644 --- a/test/matchesWith/matchesWith.test.js +++ b/test/matchesWith/matchesWith.test.js @@ -1,15 +1,14 @@ const expect = require('expect'); const matchesWith = require('./matchesWith.js'); - - test('matchesWith is a Function', () => { +test('matchesWith is a Function', () => { expect(matchesWith).toBeInstanceOf(Function); }); - const isGreeting = val => /^h(?:i|ello)$/.test(val); - t.true(matchesWith( +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'); - - + )).toBeTruthy(); +}); diff --git a/test/maxBy/maxBy.test.js b/test/maxBy/maxBy.test.js index b9866da4b..2cd581553 100644 --- a/test/maxBy/maxBy.test.js +++ b/test/maxBy/maxBy.test.js @@ -1,15 +1,12 @@ const expect = require('expect'); const maxBy = require('./maxBy.js'); - - test('maxBy is a Function', () => { +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), 8).toBe() +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'), 8).toBe() +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 ca4af723c..ab64c28bb 100644 --- a/test/maxN/maxN.test.js +++ b/test/maxN/maxN.test.js @@ -1,14 +1,12 @@ const expect = require('expect'); const maxN = require('./maxN.js'); - - test('maxN is a Function', () => { +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])).toEqual([3])l }); - test('Returns the n maximum elements from the provided array', () => { - expect(maxN([1, 2, 3], 2), [3).toEqual(2]) +test('Returns the n maximum elements from the provided array', () => { + expect(maxN([1, 2, 3], 2)).toEqual([3, 2])l }); - diff --git a/test/median/median.test.js b/test/median/median.test.js index 0d330d0f0..1852a9910 100644 --- a/test/median/median.test.js +++ b/test/median/median.test.js @@ -1,14 +1,12 @@ const expect = require('expect'); const median = require('./median.js'); - - test('median is a Function', () => { +test('median is a Function', () => { expect(median).toBeInstanceOf(Function); }); - test('Returns the median of an array of numbers', () => { +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', () => { +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 1d7bf83e1..ec8b0ca9e 100644 --- a/test/memoize/memoize.test.js +++ b/test/memoize/memoize.test.js @@ -1,20 +1,17 @@ const expect = require('expect'); const memoize = require('./memoize.js'); - - test('memoize is a Function', () => { +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), 4).toBe() +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), 9).toBe() +test('Function works properly', () => { + expect(square(3)).toBe(9); }); - test('Cache stores values', () => { - expect(Array.from(square.cache), [[2,4],[3,9]]).toEqual() +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 34ebec62f..e46ac3b4b 100644 --- a/test/merge/merge.test.js +++ b/test/merge/merge.test.js @@ -1,21 +1,18 @@ const expect = require('expect'); const merge = require('./merge.js'); - - test('merge is a Function', () => { +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), { a: [ { x: 2 }, { y: 4 }, { z: 3 } ], b: [ 1, 2, 3 ], c: 'foo' }).toEqual() +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 dfd8ba57a..82a1beeed 100644 --- a/test/minBy/minBy.test.js +++ b/test/minBy/minBy.test.js @@ -1,15 +1,12 @@ const expect = require('expect'); const minBy = require('./minBy.js'); - - test('minBy is a Function', () => { +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), 2).toBe() +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'), 2).toBe() +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 2475ac45b..dd4269711 100644 --- a/test/minN/minN.test.js +++ b/test/minN/minN.test.js @@ -1,14 +1,12 @@ const expect = require('expect'); const minN = require('./minN.js'); - - test('minN is a Function', () => { +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])).toEqual([1]); }); - test('Returns the n minimum elements from the provided array', () => { - expect(minN([1, 2, 3], 2), [1).toEqual(2]) +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 934e8667b..877fcdfa8 100644 --- a/test/mostPerformant/mostPerformant.test.js +++ b/test/mostPerformant/mostPerformant.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const mostPerformant = require('./mostPerformant.js'); - - test('mostPerformant is a Function', () => { +test('mostPerformant is a Function', () => { expect(mostPerformant).toBeInstanceOf(Function); }); - - - diff --git a/test/negate/negate.test.js b/test/negate/negate.test.js index 8166c7634..7dfd8b080 100644 --- a/test/negate/negate.test.js +++ b/test/negate/negate.test.js @@ -1,12 +1,9 @@ const expect = require('expect'); const negate = require('./negate.js'); - - test('negate is a Function', () => { +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)), [1, 3).toEqual(5]) +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 65649a3c8..894a17001 100644 --- a/test/nest/nest.test.js +++ b/test/nest/nest.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const nest = require('./nest.js'); - - test('nest is a Function', () => { +test('nest is a Function', () => { expect(nest).toBeInstanceOf(Function); }); - diff --git a/test/nodeListToArray/nodeListToArray.test.js b/test/nodeListToArray/nodeListToArray.test.js index 175ce6cc7..414565976 100644 --- a/test/nodeListToArray/nodeListToArray.test.js +++ b/test/nodeListToArray/nodeListToArray.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const nodeListToArray = require('./nodeListToArray.js'); - - test('nodeListToArray is a Function', () => { +test('nodeListToArray is a Function', () => { expect(nodeListToArray).toBeInstanceOf(Function); }); - diff --git a/test/none/none.test.js b/test/none/none.test.js index 89a701c87..f46e207b0 100644 --- a/test/none/none.test.js +++ b/test/none/none.test.js @@ -1,21 +1,18 @@ const expect = require('expect'); const none = require('./none.js'); - - test('none is a Function', () => { +test('none is a Function', () => { expect(none).toBeInstanceOf(Function); }); - test('Returns true for arrays with no truthy values', () => { +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', () => { +test('Returns false for arrays with at least one truthy value', () => { expect(none([0,1])).toBeFalsy(); }); - test('Returns true with a predicate function', () => { +test('Returns true with a predicate function', () => { expect(none([4,1,0,3], x => x < 0)).toBeTruthy(); }); - test('Returns false with predicate function', () => { +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 1fe0d7568..621f91dac 100644 --- a/test/nthArg/nthArg.test.js +++ b/test/nthArg/nthArg.test.js @@ -1,20 +1,18 @@ const expect = require('expect'); const nthArg = require('./nthArg.js'); - - test('nthArg is a Function', () => { +test('nthArg is a Function', () => { expect(nthArg).toBeInstanceOf(Function); }); - const third = nthArg(2); - test('Returns the nth argument', () => { - expect(third(1, 2, 3), 3).toBe() +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), undefined).toBe() +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), 5).toBe() +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 67bde724d..774de6f78 100644 --- a/test/nthElement/nthElement.test.js +++ b/test/nthElement/nthElement.test.js @@ -1,14 +1,12 @@ const expect = require('expect'); const nthElement = require('./nthElement.js'); - - test('nthElement is a Function', () => { +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'], 1)).toBe('b'); }); - test('Returns the nth element of an array.', () => { - expect(nthElement(['a', 'b', 'c'], -3)).toBe('a') +test('Returns the nth element of an array.', () => { + expect(nthElement(['a', 'b', 'c'], -3)).toBe('a'); }); - From 072728dad2ec58a8ef4a97f98b3f41bcdf859e76 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Mon, 18 Jun 2018 18:00:19 +0300 Subject: [PATCH 10/19] Test cleanup and fixes [o-p] --- test/objectFromPairs/objectFromPairs.test.js | 6 ++-- test/objectToPairs/objectToPairs.test.js | 8 ++--- .../observeMutations/observeMutations.test.js | 6 +--- test/off/off.test.js | 6 +--- test/offset/offset.test.js | 29 +++++++-------- test/omit/omit.test.js | 9 ++--- test/omitBy/omitBy.test.js | 9 ++--- test/on/on.test.js | 6 +--- .../onUserInputChange.test.js | 6 +--- test/once/once.test.js | 6 +--- test/orderBy/orderBy.test.js | 14 ++++---- test/over/over.test.js | 11 +++--- test/overArgs/overArgs.test.js | 15 ++++---- test/pad/pad.test.js | 15 ++++---- test/palindrome/palindrome.test.js | 12 +++---- test/parseCookie/parseCookie.test.js | 9 ++--- test/partial/partial.test.js | 17 ++++----- test/partialRight/partialRight.test.js | 17 ++++----- test/partition/partition.test.js | 10 +++--- test/percentile/percentile.test.js | 8 ++--- test/permutations/permutations.test.js | 9 ++--- test/pick/pick.test.js | 8 ++--- test/pickBy/pickBy.test.js | 9 ++--- .../pipeAsyncFunctions.test.js | 24 ++++++------- test/pipeFunctions/pipeFunctions.test.js | 15 ++++---- test/pluralize/pluralize.test.js | 35 +++++++++---------- test/powerset/powerset.test.js | 8 ++--- test/prefix/prefix.test.js | 6 ++-- test/prettyBytes/prettyBytes.test.js | 16 ++++----- test/primes/primes.test.js | 8 ++--- test/promisify/promisify.test.js | 13 ++++--- test/pull/pull.test.js | 13 +++---- test/pullAtIndex/pullAtIndex.test.js | 15 ++++---- test/pullAtValue/pullAtValue.test.js | 15 ++++---- test/pullBy/pullBy.test.js | 13 +++---- 35 files changed, 164 insertions(+), 262 deletions(-) diff --git a/test/objectFromPairs/objectFromPairs.test.js b/test/objectFromPairs/objectFromPairs.test.js index a4cb21be0..d1d4db8f8 100644 --- a/test/objectFromPairs/objectFromPairs.test.js +++ b/test/objectFromPairs/objectFromPairs.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const objectFromPairs = require('./objectFromPairs.js'); - - test('objectFromPairs is a Function', () => { +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]]), {a: 1).toEqual(b: 2}) + 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 5937a1ae7..5db49742a 100644 --- a/test/objectToPairs/objectToPairs.test.js +++ b/test/objectToPairs/objectToPairs.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const objectToPairs = require('./objectToPairs.js'); - - test('objectToPairs is a Function', () => { +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 }), [['a',1],['b').toEqual(2]]) +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 1b6330663..314cdf633 100644 --- a/test/observeMutations/observeMutations.test.js +++ b/test/observeMutations/observeMutations.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const observeMutations = require('./observeMutations.js'); - - test('observeMutations is a Function', () => { +test('observeMutations is a Function', () => { expect(observeMutations).toBeInstanceOf(Function); }); - - - diff --git a/test/off/off.test.js b/test/off/off.test.js index dc897dfcd..59b87132d 100644 --- a/test/off/off.test.js +++ b/test/off/off.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const off = require('./off.js'); - - test('off is a Function', () => { +test('off is a Function', () => { expect(off).toBeInstanceOf(Function); }); - - - diff --git a/test/offset/offset.test.js b/test/offset/offset.test.js index 089f1ca48..73ee2fe04 100644 --- a/test/offset/offset.test.js +++ b/test/offset/offset.test.js @@ -1,27 +1,24 @@ const expect = require('expect'); const offset = require('./offset.js'); - - test('offset is a Function', () => { +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), [1, 2, 3, 4, 5]).toEqual() +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), [3, 4, 5, 1, 2]).toEqual() +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), [4, 5, 1, 2, 3]).toEqual() +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),[1, 2, 3, 4, 5]).toEqual() +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), [1, 2, 3, 4, 5]).toEqual() +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() +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 eca259073..50339eef4 100644 --- a/test/omit/omit.test.js +++ b/test/omit/omit.test.js @@ -1,12 +1,9 @@ const expect = require('expect'); const omit = require('./omit.js'); - - test('omit is a Function', () => { +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']), { 'a': 1, 'c': 3 }).toEqual() +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 8fc3d26d9..b380731b6 100644 --- a/test/omitBy/omitBy.test.js +++ b/test/omitBy/omitBy.test.js @@ -1,12 +1,9 @@ const expect = require('expect'); const omitBy = require('./omitBy.js'); - - test('omitBy is a Function', () => { +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'), { b: '2' }).toEqual() +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 d681556c5..8c1912742 100644 --- a/test/on/on.test.js +++ b/test/on/on.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const on = require('./on.js'); - - test('on is a Function', () => { +test('on is a Function', () => { expect(on).toBeInstanceOf(Function); }); - - - diff --git a/test/onUserInputChange/onUserInputChange.test.js b/test/onUserInputChange/onUserInputChange.test.js index 8894c8a0c..675143979 100644 --- a/test/onUserInputChange/onUserInputChange.test.js +++ b/test/onUserInputChange/onUserInputChange.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const onUserInputChange = require('./onUserInputChange.js'); - - test('onUserInputChange is a Function', () => { +test('onUserInputChange is a Function', () => { expect(onUserInputChange).toBeInstanceOf(Function); }); - - - diff --git a/test/once/once.test.js b/test/once/once.test.js index 04d9a77ed..ecd7ed6f0 100644 --- a/test/once/once.test.js +++ b/test/once/once.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const once = require('./once.js'); - - test('once is a Function', () => { +test('once is a Function', () => { expect(once).toBeInstanceOf(Function); }); - - - diff --git a/test/orderBy/orderBy.test.js b/test/orderBy/orderBy.test.js index c5283fed5..48d838468 100644 --- a/test/orderBy/orderBy.test.js +++ b/test/orderBy/orderBy.test.js @@ -1,15 +1,13 @@ const expect = require('expect'); const orderBy = require('./orderBy.js'); - - test('orderBy is a Function', () => { +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']), [{name: 'barney', age: 36}, {name: 'fred', age: 48}, {name: 'fred').toEqual(age: 40}]) +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']), [{name: 'barney', age: 36}, {name: 'fred', age: 40}, {name: 'fred').toEqual(age: 48}]) +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 7071bf09f..1ca8f5885 100644 --- a/test/over/over.test.js +++ b/test/over/over.test.js @@ -1,13 +1,10 @@ const expect = require('expect'); const over = require('./over.js'); - - test('over is a Function', () => { +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), [1,5]).toEqual() +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 0127c5993..2025c109c 100644 --- a/test/overArgs/overArgs.test.js +++ b/test/overArgs/overArgs.test.js @@ -1,15 +1,12 @@ const expect = require('expect'); const overArgs = require('./overArgs.js'); - - test('overArgs is a Function', () => { +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), [81, 6]).toEqual() +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 1b797df95..a90623980 100644 --- a/test/pad/pad.test.js +++ b/test/pad/pad.test.js @@ -1,21 +1,18 @@ const expect = require('expect'); const pad = require('./pad.js'); - - test('pad is a Function', () => { +test('pad is a Function', () => { expect(pad).toBeInstanceOf(Function); }); - test('cat is padded on both sides', () => { - expect(pad('cat',8), ' cat ').toBe() +test('cat is padded on both sides', () => { + expect(pad('cat',8)).toBe(' cat '); }); test('length of string is 8', () => { - expect(pad('cat',8).length, 8).toBe() + expect(pad('cat',8).length).toBe(8); }); test('pads 42 with "0"', () => { - expect(pad(String(42), 6, '0'), '004200').toBe() + expect(pad(String(42), 6, '0')).toBe('004200'); }); test('does not truncates if string exceeds length', () => { - expect(pad('foobar', 3), 'foobar').toBe() + expect(pad('foobar', 3)).toBe('foobar'); }); - - diff --git a/test/palindrome/palindrome.test.js b/test/palindrome/palindrome.test.js index 1ae5482bd..ae174bbec 100644 --- a/test/palindrome/palindrome.test.js +++ b/test/palindrome/palindrome.test.js @@ -1,14 +1,12 @@ const expect = require('expect'); const palindrome = require('./palindrome.js'); - - test('palindrome is a Function', () => { +test('palindrome is a Function', () => { expect(palindrome).toBeInstanceOf(Function); }); - test('Given string is a palindrome', () => { - expect(palindrome('taco cat')).toBe(true) +test('Given string is a palindrome', () => { + expect(palindrome('taco cat')).toBeTruthy(); }); - test('Given string is not a palindrome', () => { - expect(palindrome('foobar')).toBe(false) +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 d7494447f..42e942538 100644 --- a/test/parseCookie/parseCookie.test.js +++ b/test/parseCookie/parseCookie.test.js @@ -1,12 +1,9 @@ const expect = require('expect'); const parseCookie = require('./parseCookie.js'); - - test('parseCookie is a Function', () => { +test('parseCookie is a Function', () => { expect(parseCookie).toBeInstanceOf(Function); }); - test('Parses the cookie', () => { - expect(parseCookie('foo=bar; equation=E%3Dmc%5E2'), { foo: 'bar', equation: 'E=mc^2' }).toEqual() +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 8052974d4..5b3fd8f2b 100644 --- a/test/partial/partial.test.js +++ b/test/partial/partial.test.js @@ -1,16 +1,13 @@ const expect = require('expect'); const partial = require('./partial.js'); - - test('partial is a Function', () => { +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'), 'Hello John!').toBe() +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 ee2006517..7e04a83ba 100644 --- a/test/partialRight/partialRight.test.js +++ b/test/partialRight/partialRight.test.js @@ -1,16 +1,13 @@ const expect = require('expect'); const partialRight = require('./partialRight.js'); - - test('partialRight is a Function', () => { +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'), 'Hello John!').toBe() +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 9e78206c2..b90671943 100644 --- a/test/partition/partition.test.js +++ b/test/partition/partition.test.js @@ -1,12 +1,10 @@ const expect = require('expect'); const partition = require('./partition.js'); - - test('partition is a Function', () => { +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), [[{ 'user': 'fred', 'age': 40, 'active': true }],[{ 'user': 'barney', 'age': 36).toEqual('active': false }]]) +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 6d5a8b8ec..689c1be26 100644 --- a/test/percentile/percentile.test.js +++ b/test/percentile/percentile.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const percentile = require('./percentile.js'); - - test('percentile is a Function', () => { +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) +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 9962dc9b8..3dee8589c 100644 --- a/test/permutations/permutations.test.js +++ b/test/permutations/permutations.test.js @@ -1,12 +1,9 @@ const expect = require('expect'); const permutations = require('./permutations.js'); - - test('permutations is a Function', () => { +test('permutations is a Function', () => { expect(permutations).toBeInstanceOf(Function); }); - test('Generates all permutations of an array', () => { - expect(permutations([1, 33, 5]), [ [ 1, 33, 5 ], [ 1, 5, 33 ], [ 33, 1, 5 ], [ 33, 5, 1 ], [ 5, 1, 33 ], [ 5, 33, 1 ] ]).toEqual() +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 f2bf03f98..95281c19a 100644 --- a/test/pick/pick.test.js +++ b/test/pick/pick.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const pick = require('./pick.js'); - - test('pick is a Function', () => { +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']), { 'a': 1).toEqual('c': 3 }) +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 39c1d1420..1d302187c 100644 --- a/test/pickBy/pickBy.test.js +++ b/test/pickBy/pickBy.test.js @@ -1,12 +1,9 @@ const expect = require('expect'); const pickBy = require('./pickBy.js'); - - test('pickBy is a Function', () => { +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'), { 'a': 1, 'c': 3 }).toEqual() +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 b70731c9c..725fb196c 100644 --- a/test/pipeAsyncFunctions/pipeAsyncFunctions.test.js +++ b/test/pipeAsyncFunctions/pipeAsyncFunctions.test.js @@ -1,19 +1,15 @@ const expect = require('expect'); const pipeAsyncFunctions = require('./pipeAsyncFunctions.js'); - - test('pipeAsyncFunctions is a Function', () => { +test('pipeAsyncFunctions is a Function', () => { expect(pipeAsyncFunctions).toBeInstanceOf(Function); }); - 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' - ); - +test('pipeAsyncFunctions result should be 15', () => { + expect(await pipeAsyncFunctions( + (x) => x + 1, + (x) => new Promise((resolve) => setTimeout(() => resolve(x + 2), 0)), + (x) => x + 3, + async (x) => await x + 4, + ) + (5)).toBe(15); +}); diff --git a/test/pipeFunctions/pipeFunctions.test.js b/test/pipeFunctions/pipeFunctions.test.js index 1f44b75e1..b121c9612 100644 --- a/test/pipeFunctions/pipeFunctions.test.js +++ b/test/pipeFunctions/pipeFunctions.test.js @@ -1,15 +1,12 @@ const expect = require('expect'); const pipeFunctions = require('./pipeFunctions.js'); - - test('pipeFunctions is a Function', () => { +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), 15).toBe() +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 570d16520..2a61e63b9 100644 --- a/test/pluralize/pluralize.test.js +++ b/test/pluralize/pluralize.test.js @@ -1,29 +1,26 @@ const expect = require('expect'); const pluralize = require('./pluralize.js'); - - test('pluralize is a Function', () => { +test('pluralize is a Function', () => { expect(pluralize).toBeInstanceOf(Function); }); - test('Produces the plural of the word', () => { - expect(pluralize(0, 'apple'), 'apples').toBe() +test('Produces the plural of the word', () => { + expect(pluralize(0, 'apple')).toBe('apples'); }); - test('Produces the singular of the word', () => { - expect(pluralize(1, 'apple'), 'apple').toBe() +test('Produces the singular of the word', () => { + expect(pluralize(1, 'apple')).toBe('apple'); }); - test('Produces the plural of the word', () => { - expect(pluralize(2, 'apple'), 'apples').toBe() +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'), 'people').toBe() +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'), 'people').toBe() +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 0e90083a5..50fd91f89 100644 --- a/test/powerset/powerset.test.js +++ b/test/powerset/powerset.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const powerset = require('./powerset.js'); - - test('powerset is a Function', () => { +test('powerset is a Function', () => { expect(powerset).toBeInstanceOf(Function); }); - test('Returns the powerset of a given array of numbers.', () => { - expect(powerset([1, 2]), [[], [1], [2], [2).toEqual(1]]) +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 0949f258c..4f6e86f19 100644 --- a/test/prefix/prefix.test.js +++ b/test/prefix/prefix.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const prefix = require('./prefix.js'); - - test('prefix is a Function', () => { +test('prefix is a Function', () => { expect(prefix).toBeInstanceOf(Function); -}); - +}); diff --git a/test/prettyBytes/prettyBytes.test.js b/test/prettyBytes/prettyBytes.test.js index 4c6ede865..4bf4e3794 100644 --- a/test/prettyBytes/prettyBytes.test.js +++ b/test/prettyBytes/prettyBytes.test.js @@ -1,17 +1,15 @@ const expect = require('expect'); const prettyBytes = require('./prettyBytes.js'); - - test('prettyBytes is a Function', () => { +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(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(-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') +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 20ceb463f..b0561c953 100644 --- a/test/primes/primes.test.js +++ b/test/primes/primes.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const primes = require('./primes.js'); - - test('primes is a Function', () => { +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), [2, 3, 5).toEqual(7]) +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 52a4ed876..9a65b98fc 100644 --- a/test/promisify/promisify.test.js +++ b/test/promisify/promisify.test.js @@ -1,15 +1,14 @@ const expect = require('expect'); const promisify = require('./promisify.js'); - - test('promisify is a Function', () => { +test('promisify is a Function', () => { expect(promisify).toBeInstanceOf(Function); }); - const x = promisify(Math.max); - test('Returns a promise', () => { +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(() => - - + delay(200).then(() => expect(true).toBeTruthy()); +}); diff --git a/test/pull/pull.test.js b/test/pull/pull.test.js index f68af2f57..f08a416e9 100644 --- a/test/pull/pull.test.js +++ b/test/pull/pull.test.js @@ -1,14 +1,11 @@ const expect = require('expect'); const pull = require('./pull.js'); - - test('pull is a Function', () => { +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, ['b','b']).toEqual() +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 a476f9496..4ebe0b1a5 100644 --- a/test/pullAtIndex/pullAtIndex.test.js +++ b/test/pullAtIndex/pullAtIndex.test.js @@ -1,17 +1,14 @@ const expect = require('expect'); const pullAtIndex = require('./pullAtIndex.js'); - - test('pullAtIndex is a Function', () => { +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, [ 'a', 'c' ]).toEqual() +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, [ 'b', 'd' ]).toEqual() + expect(pulled).toEqual([ 'b', 'd' ]); }); - - diff --git a/test/pullAtValue/pullAtValue.test.js b/test/pullAtValue/pullAtValue.test.js index 26bdf35ea..778f215bc 100644 --- a/test/pullAtValue/pullAtValue.test.js +++ b/test/pullAtValue/pullAtValue.test.js @@ -1,17 +1,14 @@ const expect = require('expect'); const pullAtValue = require('./pullAtValue.js'); - - test('pullAtValue is a Function', () => { +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, [ 'a', 'c' ]).toEqual() +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, [ 'b', 'd' ]).toEqual() + expect(pulled).toEqual([ 'b', 'd' ]); }); - - diff --git a/test/pullBy/pullBy.test.js b/test/pullBy/pullBy.test.js index 6a6dc7d8c..a1a7f1852 100644 --- a/test/pullBy/pullBy.test.js +++ b/test/pullBy/pullBy.test.js @@ -1,14 +1,11 @@ const expect = require('expect'); const pullBy = require('./pullBy.js'); - - test('pullBy is a Function', () => { +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, [{ x: 2 }]).toEqual() +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 }]); }); - - From 9c22d92c345b163f9e239f41d78d4ddb3ab3eb4e Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Mon, 18 Jun 2018 18:13:18 +0300 Subject: [PATCH 11/19] Test cleanup and fixes [q-r] --- test/RGBToHex/RGBToHex.test.js | 8 ++-- test/quickSort/quickSort.test.js | 43 +++++++++++-------- test/radsToDegrees/radsToDegrees.test.js | 9 ++-- .../randomHexColorCode.test.js | 13 +++--- .../randomIntArrayInRange.test.js | 19 ++++---- .../randomIntegerInRange.test.js | 15 +++---- .../randomNumberInRange.test.js | 15 +++---- test/readFileLines/readFileLines.test.js | 6 +-- test/rearg/rearg.test.js | 21 ++++----- .../recordAnimationFrames.test.js | 4 +- test/redirect/redirect.test.js | 6 +-- .../reduceSuccessive/reduceSuccessive.test.js | 9 ++-- test/reduceWhich/reduceWhich.test.js | 19 ++++---- test/reducedFilter/reducedFilter.test.js | 32 +++++++------- test/reject/reject.test.js | 34 +++++++-------- test/remove/remove.test.js | 9 ++-- test/removeNonASCII/removeNonASCII.test.js | 9 ++-- test/removeVowels/removeVowels.test.js | 6 +-- test/renameKeys/renameKeys.test.js | 16 +++---- test/reverseString/reverseString.test.js | 8 ++-- test/round/round.test.js | 32 ++++++-------- test/runAsync/runAsync.test.js | 6 +-- .../runPromisesInSeries.test.js | 10 ++--- 23 files changed, 147 insertions(+), 202 deletions(-) diff --git a/test/RGBToHex/RGBToHex.test.js b/test/RGBToHex/RGBToHex.test.js index f4bf6d773..70892c498 100644 --- a/test/RGBToHex/RGBToHex.test.js +++ b/test/RGBToHex/RGBToHex.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const RGBToHex = require('./RGBToHex.js'); - - test('RGBToHex is a Function', () => { +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') +test('Converts the values of RGB components to a color code.', () => { + expect(RGBToHex(255, 165, 1)).toBe('ffa501'); }); - diff --git a/test/quickSort/quickSort.test.js b/test/quickSort/quickSort.test.js index a9b37e0d5..62ae9806e 100644 --- a/test/quickSort/quickSort.test.js +++ b/test/quickSort/quickSort.test.js @@ -1,28 +1,33 @@ const expect = require('expect'); const quickSort = require('./quickSort.js'); - - test('quickSort is a Function', () => { +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]), [1, 2, 3, 4, 5, 6]).toEqual() +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]), [-2, -1, 0]).toEqual() +test('quickSort([-1, 0, -2]) returns [-2, -1, 0]', () => { + expect(quickSort([-1, 0, -2])).toEqual([-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(); - test('quickSort([11, 1, 324, 23232, -1, 53, 2, 524, 32, 13, 156, 133, 62, 12, 4]) takes less than 2s to run', () => { +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 e8e2cd6dd..5e7bdea5c 100644 --- a/test/radsToDegrees/radsToDegrees.test.js +++ b/test/radsToDegrees/radsToDegrees.test.js @@ -1,12 +1,9 @@ const expect = require('expect'); const radsToDegrees = require('./radsToDegrees.js'); - - test('radsToDegrees is a Function', () => { +test('radsToDegrees is a Function', () => { expect(radsToDegrees).toBeInstanceOf(Function); }); - test('Returns the appropriate value', () => { - expect(radsToDegrees(Math.PI / 2), 90).toBe() +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 8d75773ab..a7ded511b 100644 --- a/test/randomHexColorCode/randomHexColorCode.test.js +++ b/test/randomHexColorCode/randomHexColorCode.test.js @@ -1,16 +1,15 @@ const expect = require('expect'); const randomHexColorCode = require('./randomHexColorCode.js'); - - test('randomHexColorCode is a Function', () => { +test('randomHexColorCode is a Function', () => { expect(randomHexColorCode).toBeInstanceOf(Function); }); - t.equal(randomHexColorCode().length, 7); - test('The color code starts with "#"', () => { +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', () => { +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 1a58271fa..9a2c1acb3 100644 --- a/test/randomIntArrayInRange/randomIntArrayInRange.test.js +++ b/test/randomIntArrayInRange/randomIntArrayInRange.test.js @@ -1,21 +1,18 @@ const expect = require('expect'); const randomIntArrayInRange = require('./randomIntArrayInRange.js'); - - test('randomIntArrayInRange is a Function', () => { +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', () => { +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, 10).toBe() +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).', () => { +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 0394b74e8..ff19ca7f9 100644 --- a/test/randomIntegerInRange/randomIntegerInRange.test.js +++ b/test/randomIntegerInRange/randomIntegerInRange.test.js @@ -1,18 +1,15 @@ const expect = require('expect'); const randomIntegerInRange = require('./randomIntegerInRange.js'); - - test('randomIntegerInRange is a Function', () => { +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', () => { +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).', () => { +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 24b7419c0..b688cf3fe 100644 --- a/test/randomNumberInRange/randomNumberInRange.test.js +++ b/test/randomNumberInRange/randomNumberInRange.test.js @@ -1,18 +1,15 @@ const expect = require('expect'); const randomNumberInRange = require('./randomNumberInRange.js'); - - test('randomNumberInRange is a Function', () => { +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', () => { +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).', () => { +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 800f0ef4c..604c87d79 100644 --- a/test/readFileLines/readFileLines.test.js +++ b/test/readFileLines/readFileLines.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const readFileLines = require('./readFileLines.js'); - - test('readFileLines is a Function', () => { +test('readFileLines is a Function', () => { expect(readFileLines).toBeInstanceOf(Function); }); - - - diff --git a/test/rearg/rearg.test.js b/test/rearg/rearg.test.js index c2cd186cf..28a589db3 100644 --- a/test/rearg/rearg.test.js +++ b/test/rearg/rearg.test.js @@ -1,18 +1,15 @@ const expect = require('expect'); const rearg = require('./rearg.js'); - - test('rearg is a Function', () => { +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'), ['a', 'b', 'c']).toEqual() +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 5c6af20dc..7c95d8452 100644 --- a/test/recordAnimationFrames/recordAnimationFrames.test.js +++ b/test/recordAnimationFrames/recordAnimationFrames.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const recordAnimationFrames = require('./recordAnimationFrames.js'); - - test('recordAnimationFrames is a Function', () => { +test('recordAnimationFrames is a Function', () => { expect(recordAnimationFrames).toBeInstanceOf(Function); }); - diff --git a/test/redirect/redirect.test.js b/test/redirect/redirect.test.js index e6d1e43b7..831a1d75d 100644 --- a/test/redirect/redirect.test.js +++ b/test/redirect/redirect.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const redirect = require('./redirect.js'); - - test('redirect is a Function', () => { +test('redirect is a Function', () => { expect(redirect).toBeInstanceOf(Function); }); - - - diff --git a/test/reduceSuccessive/reduceSuccessive.test.js b/test/reduceSuccessive/reduceSuccessive.test.js index 67afd53df..5045bed01 100644 --- a/test/reduceSuccessive/reduceSuccessive.test.js +++ b/test/reduceSuccessive/reduceSuccessive.test.js @@ -1,12 +1,9 @@ const expect = require('expect'); const reduceSuccessive = require('./reduceSuccessive.js'); - - test('reduceSuccessive is a Function', () => { +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), [0, 1, 3, 6, 10, 15, 21]).toEqual() +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 832168d05..dc9625699 100644 --- a/test/reduceWhich/reduceWhich.test.js +++ b/test/reduceWhich/reduceWhich.test.js @@ -1,19 +1,18 @@ const expect = require('expect'); const reduceWhich = require('./reduceWhich.js'); - - test('reduceWhich is a Function', () => { +test('reduceWhich is a Function', () => { expect(reduceWhich).toBeInstanceOf(Function); }); - test('Returns the minimum of an array', () => { - expect(reduceWhich([1, 3, 2]), 1).toBe() +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), 3).toBe() +test('Returns the maximum of an array', () => { + expect(reduceWhich([1, 3, 2], (a, b) => b - a)).toBe(3); }); - t.deepEqual(reduceWhich( +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'); - - +)).toEqual({name: "Lucy", age: 9}); +}); diff --git a/test/reducedFilter/reducedFilter.test.js b/test/reducedFilter/reducedFilter.test.js index 4d661d7c9..8c9536462 100644 --- a/test/reducedFilter/reducedFilter.test.js +++ b/test/reducedFilter/reducedFilter.test.js @@ -1,23 +1,21 @@ const expect = require('expect'); const reducedFilter = require('./reducedFilter.js'); - - test('reducedFilter is a Function', () => { +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), [{ id: 2).toEqual(name: 'mike'}]) +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 270e9b8f5..f14e41299 100644 --- a/test/reject/reject.test.js +++ b/test/reject/reject.test.js @@ -1,24 +1,20 @@ const expect = require('expect'); const reject = require('./reject.js'); - - test('reject is a Function', () => { +test('reject is a Function', () => { expect(reject).toBeInstanceOf(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']); - - - +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 8b94f0aaf..efafcc3da 100644 --- a/test/remove/remove.test.js +++ b/test/remove/remove.test.js @@ -1,12 +1,9 @@ const expect = require('expect'); const remove = require('./remove.js'); - - test('remove is a Function', () => { +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), [2).toEqual(4]) +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 24b88a86e..4e8f6f7bd 100644 --- a/test/removeNonASCII/removeNonASCII.test.js +++ b/test/removeNonASCII/removeNonASCII.test.js @@ -1,12 +1,9 @@ const expect = require('expect'); const removeNonASCII = require('./removeNonASCII.js'); - - test('removeNonASCII is a Function', () => { +test('removeNonASCII is a Function', () => { expect(removeNonASCII).toBeInstanceOf(Function); }); - test('Removes non-ASCII characters', () => { - expect(removeNonASCII('äÄçÇéÉêlorem-ipsumöÖÐþúÚ'), 'lorem-ipsum').toBe() +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 36afe09c2..437f32157 100644 --- a/test/removeVowels/removeVowels.test.js +++ b/test/removeVowels/removeVowels.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const removeVowels = require('./removeVowels.js'); - - test('removeVowels is a Function', () => { +test('removeVowels is a Function', () => { expect(removeVowels).toBeInstanceOf(Function); -}); - +}); diff --git a/test/renameKeys/renameKeys.test.js b/test/renameKeys/renameKeys.test.js index de0438f0c..574c18289 100644 --- a/test/renameKeys/renameKeys.test.js +++ b/test/renameKeys/renameKeys.test.js @@ -1,15 +1,11 @@ const expect = require('expect'); const renameKeys = require('./renameKeys.js'); - - test('renameKeys is a Function', () => { +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); - - t.deepEqual(renamedObj, { firstName: 'Bobo', passion: 'Front-End Master', shoeSize: 100 - - - +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 08b76cbaf..8eef925d7 100644 --- a/test/reverseString/reverseString.test.js +++ b/test/reverseString/reverseString.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const reverseString = require('./reverseString.js'); - - test('reverseString is a Function', () => { +test('reverseString is a Function', () => { expect(reverseString).toBeInstanceOf(Function); }); - test('Reverses a string.', () => { - expect(reverseString('foobar')).toBe('raboof') +test('Reverses a string.', () => { + expect(reverseString('foobar')).toBe('raboof'); }); - diff --git a/test/round/round.test.js b/test/round/round.test.js index dd4c5f59f..c72bb69c9 100644 --- a/test/round/round.test.js +++ b/test/round/round.test.js @@ -1,23 +1,22 @@ const expect = require('expect'); const round = require('./round.js'); - - test('round is a Function', () => { +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(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(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(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) returns 1', () => { + expect(round(1.005)).toBe(1); }); - test('round([1.005, 2]) returns NaN', () => { +test('round([1.005, 2]) returns NaN', () => { expect(isNaN(round([1.005, 2]))).toBeTruthy(); }); test('round(string) returns NaN', () => { @@ -32,12 +31,9 @@ const round = require('./round.js'); 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', () => { +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 8528fdb07..fb2806ed4 100644 --- a/test/runAsync/runAsync.test.js +++ b/test/runAsync/runAsync.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const runAsync = require('./runAsync.js'); - - test('runAsync is a Function', () => { +test('runAsync is a Function', () => { expect(runAsync).toBeInstanceOf(Function); }); - - - diff --git a/test/runPromisesInSeries/runPromisesInSeries.test.js b/test/runPromisesInSeries/runPromisesInSeries.test.js index 88ac6ea82..df3814da4 100644 --- a/test/runPromisesInSeries/runPromisesInSeries.test.js +++ b/test/runPromisesInSeries/runPromisesInSeries.test.js @@ -2,10 +2,10 @@ const expect = require('expect'); const runPromisesInSeries = require('./runPromisesInSeries.js'); - test('runPromisesInSeries is a Function', () => { +test('runPromisesInSeries is a Function', () => { expect(runPromisesInSeries).toBeInstanceOf(Function); }); - const delay = d => new Promise(r => setTimeout(r, d)); - runPromisesInSeries([() => delay(100), () => delay(200).then(() => - - +const delay = d => new Promise(r => setTimeout(r, d)); +test('Runs promises in series', () => { + runPromisesInSeries([() => delay(100), () => delay(200).then(() => expect(true).toBeTruthy())); +}); From 46ad6c08b98ca4db4314600ecae5f9f0503b7be4 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Mon, 18 Jun 2018 18:37:35 +0300 Subject: [PATCH 12/19] Test cleanup and fixes [s-t] --- test/sample/sample.test.js | 17 +++--- test/sampleSize/sampleSize.test.js | 25 ++++----- test/scrollToTop/scrollToTop.test.js | 6 +-- test/sdbm/sdbm.test.js | 8 ++- test/serializeCookie/serializeCookie.test.js | 9 ++-- test/setStyle/setStyle.test.js | 8 +-- test/shallowClone/shallowClone.test.js | 15 +++--- test/show/show.test.js | 6 +-- test/shuffle/shuffle.test.js | 21 ++++---- test/similarity/similarity.test.js | 8 ++- test/size/size.test.js | 12 ++--- test/sleep/sleep.test.js | 9 ++-- test/smoothScroll/smoothScroll.test.js | 4 +- test/solveRPN/solveRPN.test.js | 4 +- .../sortCharactersInString.test.js | 8 ++- test/sortedIndex/sortedIndex.test.js | 12 ++--- test/sortedIndexBy/sortedIndexBy.test.js | 9 ++-- test/sortedLastIndex/sortedLastIndex.test.js | 9 ++-- .../sortedLastIndexBy.test.js | 9 ++-- test/speechSynthesis/speechSynthesis.test.js | 4 +- test/splitLines/splitLines.test.js | 8 ++- test/spreadOver/spreadOver.test.js | 10 ++-- test/stableSort/stableSort.test.js | 14 ++--- .../standardDeviation.test.js | 12 ++--- .../stringPermutations.test.js | 17 +++--- test/stripHTMLTags/stripHTMLTags.test.js | 9 ++-- test/sum/sum.test.js | 8 ++- test/sumBy/sumBy.test.js | 4 +- test/sumPower/sumPower.test.js | 16 +++--- .../symmetricDifference.test.js | 8 ++- .../symmetricDifferenceBy.test.js | 9 ++-- .../symmetricDifferenceWith.test.js | 12 ++--- test/tail/tail.test.js | 12 ++--- test/take/take.test.js | 9 ++-- test/takeRight/takeRight.test.js | 10 ++-- test/takeRightWhile/takeRightWhile.test.js | 9 ++-- test/takeWhile/takeWhile.test.js | 9 ++-- test/throttle/throttle.test.js | 6 +-- test/timeTaken/timeTaken.test.js | 6 +-- test/times/times.test.js | 13 ++--- test/toCamelCase/toCamelCase.test.js | 46 ++++++++-------- test/toCurrency/toCurrency.test.js | 17 +++--- test/toDecimalMark/toDecimalMark.test.js | 8 ++- test/toHash/toHash.test.js | 4 +- test/toKebabCase/toKebabCase.test.js | 44 ++++++++-------- test/toOrdinalSuffix/toOrdinalSuffix.test.js | 20 ++++--- test/toSafeInteger/toSafeInteger.test.js | 52 +++++++++---------- test/toSnakeCase/toSnakeCase.test.js | 44 ++++++++-------- test/toggleClass/toggleClass.test.js | 6 +-- test/tomorrow/tomorrow.test.js | 21 ++++---- test/transform/transform.test.js | 13 ++--- test/truncateString/truncateString.test.js | 8 ++- .../truthCheckCollection.test.js | 8 ++- 53 files changed, 286 insertions(+), 409 deletions(-) diff --git a/test/sample/sample.test.js b/test/sample/sample.test.js index 38902e272..199f8504b 100644 --- a/test/sample/sample.test.js +++ b/test/sample/sample.test.js @@ -1,19 +1,16 @@ const expect = require('expect'); const sample = require('./sample.js'); - - test('sample is a Function', () => { +test('sample is a Function', () => { expect(sample).toBeInstanceOf(Function); }); - const arr = [3,7,9,11]; - test('Returns a random element from the array', () => { +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]), 1).toBe() +test('Works for single-element arrays', () => { + expect(sample([1])).toBe(1); }); - test('Returns undefined for empty array', () => { - expect(sample([]), undefined).toBe() +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 9edcd69c6..cebef527f 100644 --- a/test/sampleSize/sampleSize.test.js +++ b/test/sampleSize/sampleSize.test.js @@ -1,25 +1,22 @@ const expect = require('expect'); const sampleSize = require('./sampleSize.js'); - - test('sampleSize is a Function', () => { +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, 1).toBe() +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', () => { +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, 4).toBe() +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 original array is empty', () => { + expect(sampleSize([], 2)).toEqual([]); }); - test('Returns an empty array if n = 0', () => { - expect(sampleSize(arr, 0), []).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 0c44b1a53..c92677b1b 100644 --- a/test/scrollToTop/scrollToTop.test.js +++ b/test/scrollToTop/scrollToTop.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const scrollToTop = require('./scrollToTop.js'); - - test('scrollToTop is a Function', () => { +test('scrollToTop is a Function', () => { expect(scrollToTop).toBeInstanceOf(Function); }); - - - diff --git a/test/sdbm/sdbm.test.js b/test/sdbm/sdbm.test.js index 3b1156ed2..58567bc40 100644 --- a/test/sdbm/sdbm.test.js +++ b/test/sdbm/sdbm.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const sdbm = require('./sdbm.js'); - - test('sdbm is a Function', () => { +test('sdbm is a Function', () => { expect(sdbm).toBeInstanceOf(Function); }); - test('Hashes the input string into a whole number.', () => { - expect(sdbm('name')).toBe(-3521204949) +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 c07abf4d7..211ca7c21 100644 --- a/test/serializeCookie/serializeCookie.test.js +++ b/test/serializeCookie/serializeCookie.test.js @@ -1,12 +1,9 @@ const expect = require('expect'); const serializeCookie = require('./serializeCookie.js'); - - test('serializeCookie is a Function', () => { +test('serializeCookie is a Function', () => { expect(serializeCookie).toBeInstanceOf(Function); }); - test('Serializes the cookie', () => { - expect(serializeCookie('foo', 'bar'), 'foo=bar').toBe() +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 97214e8d4..92be89a6e 100644 --- a/test/setStyle/setStyle.test.js +++ b/test/setStyle/setStyle.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const setStyle = require('./setStyle.js'); - - test('setStyle is a Function', () => { +test('setStyle is a Function', () => { expect(setStyle).toBeInstanceOf(Function); -}); - - - +}); diff --git a/test/shallowClone/shallowClone.test.js b/test/shallowClone/shallowClone.test.js index d0806b0e3..fd08a3395 100644 --- a/test/shallowClone/shallowClone.test.js +++ b/test/shallowClone/shallowClone.test.js @@ -1,15 +1,12 @@ const expect = require('expect'); const shallowClone = require('./shallowClone.js'); - - test('shallowClone is a Function', () => { +test('shallowClone is a Function', () => { expect(shallowClone).toBeInstanceOf(Function); }); - const a = { foo: 'bar', obj: { a: 1, b: 2 } }; - const b = shallowClone(a); - t.notEqual(a, b, 'Shallow cloning works'); - test('Does not clone deeply', () => { - expect(a.obj, b.obj).toBe() +const a = { foo: 'bar', obj: { a: 1, b: 2 } }; +const b = shallowClone(a); +t.notEqual(a, b, 'Shallow cloning works'); +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 92a94c1fd..81c5ea492 100644 --- a/test/show/show.test.js +++ b/test/show/show.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const show = require('./show.js'); - - test('show is a Function', () => { +test('show is a Function', () => { expect(show).toBeInstanceOf(Function); }); - - - diff --git a/test/shuffle/shuffle.test.js b/test/shuffle/shuffle.test.js index 55914b5da..ae6630c2f 100644 --- a/test/shuffle/shuffle.test.js +++ b/test/shuffle/shuffle.test.js @@ -1,20 +1,19 @@ const expect = require('expect'); const shuffle = require('./shuffle.js'); - - test('shuffle is a Function', () => { +test('shuffle is a Function', () => { expect(shuffle).toBeInstanceOf(Function); }); - const arr = [1,2,3,4,5,6]; - t.notEqual(shuffle(arr), arr, 'Shuffles the array'); - test('New array contains all original elements', () => { +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 empty arrays', () => { + expect(shuffle([])).toEqual([]); }); - test('Works for single-element arrays', () => { - expect(shuffle([1]),[1]).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 c737f6a4b..479c64b9c 100644 --- a/test/similarity/similarity.test.js +++ b/test/similarity/similarity.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const similarity = require('./similarity.js'); - - test('similarity is a Function', () => { +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]), [1).toEqual(2]) +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 cb48c5517..54622aa01 100644 --- a/test/size/size.test.js +++ b/test/size/size.test.js @@ -1,14 +1,12 @@ const expect = require('expect'); const size = require('./size.js'); - - test('size is a Function', () => { +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([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) +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 0996b476e..faff7c0f2 100644 --- a/test/sleep/sleep.test.js +++ b/test/sleep/sleep.test.js @@ -1,13 +1,12 @@ const expect = require('expect'); const sleep = require('./sleep.js'); - - test('sleep is a Function', () => { +test('sleep is a Function', () => { expect(sleep).toBeInstanceOf(Function); }); +test('Works as expected', () => { async function sleepyWork() { await sleep(1000); - + expect(true).toBeTruthy(); } - - +}); diff --git a/test/smoothScroll/smoothScroll.test.js b/test/smoothScroll/smoothScroll.test.js index 86f93a396..269e7252c 100644 --- a/test/smoothScroll/smoothScroll.test.js +++ b/test/smoothScroll/smoothScroll.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const smoothScroll = require('./smoothScroll.js'); - - test('smoothScroll is a Function', () => { +test('smoothScroll is a Function', () => { expect(smoothScroll).toBeInstanceOf(Function); }); - diff --git a/test/solveRPN/solveRPN.test.js b/test/solveRPN/solveRPN.test.js index ce1e02dc1..c6a2fee8b 100644 --- a/test/solveRPN/solveRPN.test.js +++ b/test/solveRPN/solveRPN.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const solveRPN = require('./solveRPN.js'); - - test('solveRPN is a Function', () => { +test('solveRPN is a Function', () => { expect(solveRPN).toBeInstanceOf(Function); }); - diff --git a/test/sortCharactersInString/sortCharactersInString.test.js b/test/sortCharactersInString/sortCharactersInString.test.js index 00084521f..8979fe2b7 100644 --- a/test/sortCharactersInString/sortCharactersInString.test.js +++ b/test/sortCharactersInString/sortCharactersInString.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const sortCharactersInString = require('./sortCharactersInString.js'); - - test('sortCharactersInString is a Function', () => { +test('sortCharactersInString is a Function', () => { expect(sortCharactersInString).toBeInstanceOf(Function); }); - test('Alphabetically sorts the characters in a string.', () => { - expect(sortCharactersInString('cabbage')).toBe('aabbceg') +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 bdf1500b8..0bfe6ff39 100644 --- a/test/sortedIndex/sortedIndex.test.js +++ b/test/sortedIndex/sortedIndex.test.js @@ -1,14 +1,12 @@ const expect = require('expect'); const sortedIndex = require('./sortedIndex.js'); - - test('sortedIndex is a Function', () => { +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([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) +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 43972d8f8..6e02b36a4 100644 --- a/test/sortedIndexBy/sortedIndexBy.test.js +++ b/test/sortedIndexBy/sortedIndexBy.test.js @@ -1,12 +1,9 @@ const expect = require('expect'); const sortedIndexBy = require('./sortedIndexBy.js'); - - test('sortedIndexBy is a Function', () => { +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), 0).toBe() +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 d1c4eced1..84a9ff63a 100644 --- a/test/sortedLastIndex/sortedLastIndex.test.js +++ b/test/sortedLastIndex/sortedLastIndex.test.js @@ -1,12 +1,9 @@ const expect = require('expect'); const sortedLastIndex = require('./sortedLastIndex.js'); - - test('sortedLastIndex is a Function', () => { +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), 4).toBe() +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 9cdaebb51..ad0bfc718 100644 --- a/test/sortedLastIndexBy/sortedLastIndexBy.test.js +++ b/test/sortedLastIndexBy/sortedLastIndexBy.test.js @@ -1,12 +1,9 @@ const expect = require('expect'); const sortedLastIndexBy = require('./sortedLastIndexBy.js'); - - test('sortedLastIndexBy is a Function', () => { +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), 1).toBe() +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 90425aaff..9981924c8 100644 --- a/test/speechSynthesis/speechSynthesis.test.js +++ b/test/speechSynthesis/speechSynthesis.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const speechSynthesis = require('./speechSynthesis.js'); - - test('speechSynthesis is a Function', () => { +test('speechSynthesis is a Function', () => { expect(speechSynthesis).toBeInstanceOf(Function); }); - diff --git a/test/splitLines/splitLines.test.js b/test/splitLines/splitLines.test.js index a73d52de9..18a591ba3 100644 --- a/test/splitLines/splitLines.test.js +++ b/test/splitLines/splitLines.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const splitLines = require('./splitLines.js'); - - test('splitLines is a Function', () => { +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'), ['This', 'is a', 'multiline', 'string.' ).toEqual('']) +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 79c471dca..7f101c1d9 100644 --- a/test/spreadOver/spreadOver.test.js +++ b/test/spreadOver/spreadOver.test.js @@ -1,12 +1,10 @@ const expect = require('expect'); const spreadOver = require('./spreadOver.js'); - - test('spreadOver is a Function', () => { +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) +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 975e08e45..4c2f3a37b 100644 --- a/test/stableSort/stableSort.test.js +++ b/test/stableSort/stableSort.test.js @@ -1,15 +1,11 @@ const expect = require('expect'); const stableSort = require('./stableSort.js'); - - test('stableSort is a Function', () => { +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), arr).toEqual() +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 431ce662a..0bf680689 100644 --- a/test/standardDeviation/standardDeviation.test.js +++ b/test/standardDeviation/standardDeviation.test.js @@ -1,14 +1,12 @@ const expect = require('expect'); const standardDeviation = require('./standardDeviation.js'); - - test('standardDeviation is a Function', () => { +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])).toBe(13.284434142114991) +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)).toBe(12.29899614287479) +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 54bfb0729..f58224879 100644 --- a/test/stringPermutations/stringPermutations.test.js +++ b/test/stringPermutations/stringPermutations.test.js @@ -1,18 +1,15 @@ const expect = require('expect'); const stringPermutations = require('./stringPermutations.js'); - - test('stringPermutations is a Function', () => { +test('stringPermutations is a Function', () => { expect(stringPermutations).toBeInstanceOf(Function); }); - test('Generates all stringPermutations of a string', () => { - expect(stringPermutations('abc'), ['abc','acb','bac','bca','cab').toEqual('cba']) +test('Generates all stringPermutations of a string', () => { + expect(stringPermutations('abc'), ['abc','acb','bac','bca','cab').toEqual('cba']); }); - test('Works for single-letter strings', () => { - expect(stringPermutations('a')).toEqual(['a']) +test('Works for single-letter strings', () => { + expect(stringPermutations('a')).toEqual(['a']); }); - test('Works for empty strings', () => { - expect(stringPermutations('')).toEqual(['']) +test('Works for empty strings', () => { + expect(stringPermutations('')).toEqual(['']); }); - - diff --git a/test/stripHTMLTags/stripHTMLTags.test.js b/test/stripHTMLTags/stripHTMLTags.test.js index 225f18573..fe434e44f 100644 --- a/test/stripHTMLTags/stripHTMLTags.test.js +++ b/test/stripHTMLTags/stripHTMLTags.test.js @@ -1,12 +1,9 @@ const expect = require('expect'); const stripHTMLTags = require('./stripHTMLTags.js'); - - test('stripHTMLTags is a Function', () => { +test('stripHTMLTags is a Function', () => { expect(stripHTMLTags).toBeInstanceOf(Function); }); - test('Removes HTML tags', () => { - expect(stripHTMLTags('

lorem ipsum


'), 'lorem ipsum').toBe() +test('Removes HTML tags', () => { + expect(stripHTMLTags('

lorem ipsum


')).toBe('lorem ipsum'); }); - - diff --git a/test/sum/sum.test.js b/test/sum/sum.test.js index ba1ba0785..ac94b8891 100644 --- a/test/sum/sum.test.js +++ b/test/sum/sum.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const sum = require('./sum.js'); - - test('sum is a Function', () => { +test('sum is a Function', () => { expect(sum).toBeInstanceOf(Function); }); - test('Returns the sum of two or more numbers/arrays.', () => { - expect(sum(...[1, 2, 3, 4])).toBe(10) +test('Returns the sum of two or more numbers/arrays.', () => { + expect(sum(...[1, 2, 3, 4])).toBe(10); }); - diff --git a/test/sumBy/sumBy.test.js b/test/sumBy/sumBy.test.js index a8786d296..07e8c2b17 100644 --- a/test/sumBy/sumBy.test.js +++ b/test/sumBy/sumBy.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const sumBy = require('./sumBy.js'); - - test('sumBy is a Function', () => { +test('sumBy is a Function', () => { expect(sumBy).toBeInstanceOf(Function); }); - diff --git a/test/sumPower/sumPower.test.js b/test/sumPower/sumPower.test.js index aee0cf0a2..b655fe974 100644 --- a/test/sumPower/sumPower.test.js +++ b/test/sumPower/sumPower.test.js @@ -1,17 +1,15 @@ const expect = require('expect'); const sumPower = require('./sumPower.js'); - - test('sumPower is a Function', () => { +test('sumPower is a Function', () => { expect(sumPower).toBeInstanceOf(Function); }); - test('Returns the sum of the powers of all the numbers from start to end', () => { - expect(sumPower(10)).toBe(385) +test('Returns the sum of the powers of all the numbers from start to end', () => { + expect(sumPower(10)).toBe(385); }); - test('Returns the sum of the powers of all the numbers from start to end', () => { - expect(sumPower(10, 3)).toBe(3025) +test('Returns the sum of the powers of all the numbers from start to end', () => { + expect(sumPower(10, 3)).toBe(3025); }); - test('Returns the sum of the powers of all the numbers from start to end', () => { - expect(sumPower(10, 3, 5)).toBe(2925) +test('Returns the sum of the powers of all the numbers from start to end', () => { + expect(sumPower(10, 3, 5)).toBe(2925); }); - diff --git a/test/symmetricDifference/symmetricDifference.test.js b/test/symmetricDifference/symmetricDifference.test.js index 4084a5a1d..7fc364488 100644 --- a/test/symmetricDifference/symmetricDifference.test.js +++ b/test/symmetricDifference/symmetricDifference.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const symmetricDifference = require('./symmetricDifference.js'); - - test('symmetricDifference is a Function', () => { +test('symmetricDifference is a Function', () => { expect(symmetricDifference).toBeInstanceOf(Function); }); - test('Returns the symmetric difference between two arrays.', () => { - expect(symmetricDifference([1, 2, 3], [1, 2, 4]), [3).toEqual(4]) +test('Returns the symmetric difference between two arrays.', () => { + expect(symmetricDifference([1, 2, 3], [1, 2, 4])).toEqual([3, 4]); }); - diff --git a/test/symmetricDifferenceBy/symmetricDifferenceBy.test.js b/test/symmetricDifferenceBy/symmetricDifferenceBy.test.js index 4c3e11107..320cd8905 100644 --- a/test/symmetricDifferenceBy/symmetricDifferenceBy.test.js +++ b/test/symmetricDifferenceBy/symmetricDifferenceBy.test.js @@ -1,12 +1,9 @@ const expect = require('expect'); const symmetricDifferenceBy = require('./symmetricDifferenceBy.js'); - - test('symmetricDifferenceBy is a Function', () => { +test('symmetricDifferenceBy is a Function', () => { expect(symmetricDifferenceBy).toBeInstanceOf(Function); }); - test('Returns the symmetric difference between two arrays, after applying the provided function to each array element of both', () => { - expect(symmetricDifferenceBy([2.1, 1.2], [2.3, 3.4], Math.floor), [ 1.2, 3.4 ]).toEqual() +test('Returns the symmetric difference between two arrays, after applying the provided function to each array element of both', () => { + expect(symmetricDifferenceBy([2.1, 1.2], [2.3, 3.4], Math.floor)).toEqual([ 1.2, 3.4 ]); }); - - diff --git a/test/symmetricDifferenceWith/symmetricDifferenceWith.test.js b/test/symmetricDifferenceWith/symmetricDifferenceWith.test.js index 33f65acae..ca4920797 100644 --- a/test/symmetricDifferenceWith/symmetricDifferenceWith.test.js +++ b/test/symmetricDifferenceWith/symmetricDifferenceWith.test.js @@ -1,14 +1,12 @@ const expect = require('expect'); const symmetricDifferenceWith = require('./symmetricDifferenceWith.js'); - - test('symmetricDifferenceWith is a Function', () => { +test('symmetricDifferenceWith is a Function', () => { expect(symmetricDifferenceWith).toBeInstanceOf(Function); }); - t.deepEqual(symmetricDifferenceWith( +test('Returns the symmetric difference between two arrays, using a provided function as a comparator', () => { + expect(symmetricDifferenceWith( [1, 1.2, 1.5, 3, 0], [1.9, 3, 0, 3.9], - (a, b) => Math.round(a) === Math.round(b) -), [1, 1.2, 3.9], 'Returns the symmetric difference between two arrays, using a provided function as a comparator'); - - + (a, b) => Math.round(a) === Math.round(b))).toEqual([1, 1.2, 3.9]); +}); diff --git a/test/tail/tail.test.js b/test/tail/tail.test.js index 8c8460f64..6ed96e45c 100644 --- a/test/tail/tail.test.js +++ b/test/tail/tail.test.js @@ -1,14 +1,12 @@ const expect = require('expect'); const tail = require('./tail.js'); - - test('tail is a Function', () => { +test('tail is a Function', () => { expect(tail).toBeInstanceOf(Function); }); - test('Returns tail', () => { - expect(tail([1, 2, 3]), [2).toEqual(3]) +test('Returns tail', () => { + expect(tail([1, 2, 3]), [2).toEqual(3]); }); - test('Returns tail', () => { - expect(tail([1])).toEqual([1]) +test('Returns tail', () => { + expect(tail([1])).toEqual([1]); }); - diff --git a/test/take/take.test.js b/test/take/take.test.js index 877c1e64b..966e0ca7a 100644 --- a/test/take/take.test.js +++ b/test/take/take.test.js @@ -1,15 +1,12 @@ const expect = require('expect'); const take = require('./take.js'); - - test('take is a Function', () => { +test('take is a Function', () => { expect(take).toBeInstanceOf(Function); }); - test('Returns an array with n elements removed from the beginning.', () => { +test('Returns an array with n elements removed from the beginning.', () => { expect(take([1, 2, 3], 5), [1, 2).toEqual(3]) }); - test('Returns an array with n elements removed from the beginning.', () => { +test('Returns an array with n elements removed from the beginning.', () => { expect(take([1, 2, 3], 0)).toEqual([]) }); - - diff --git a/test/takeRight/takeRight.test.js b/test/takeRight/takeRight.test.js index e82d8805c..2e5c1b55a 100644 --- a/test/takeRight/takeRight.test.js +++ b/test/takeRight/takeRight.test.js @@ -1,14 +1,12 @@ const expect = require('expect'); const takeRight = require('./takeRight.js'); - - test('takeRight is a Function', () => { +test('takeRight is a Function', () => { expect(takeRight).toBeInstanceOf(Function); }); - test('Returns an array with n elements removed from the end', () => { - expect(takeRight([1, 2, 3], 2), [2).toEqual(3]) +test('Returns an array with n elements removed from the end', () => { + expect(takeRight([1, 2, 3], 2)).toEqual([2, 3]); }); - test('Returns an array with n elements removed from the end', () => { +test('Returns an array with n elements removed from the end', () => { expect(takeRight([1, 2, 3])).toEqual([3]) }); - diff --git a/test/takeRightWhile/takeRightWhile.test.js b/test/takeRightWhile/takeRightWhile.test.js index 91bdd6917..9730677d9 100644 --- a/test/takeRightWhile/takeRightWhile.test.js +++ b/test/takeRightWhile/takeRightWhile.test.js @@ -1,12 +1,9 @@ const expect = require('expect'); const takeRightWhile = require('./takeRightWhile.js'); - - test('takeRightWhile is a Function', () => { +test('takeRightWhile is a Function', () => { expect(takeRightWhile).toBeInstanceOf(Function); }); - test('Removes elements until the function returns true', () => { - expect(takeRightWhile([1, 2, 3, 4], n => n < 3), [3, 4]).toEqual() +test('Removes elements until the function returns true', () => { + expect(takeRightWhile([1, 2, 3, 4], n => n < 3)).toEqual([3, 4]); }); - - diff --git a/test/takeWhile/takeWhile.test.js b/test/takeWhile/takeWhile.test.js index 0a105b25b..bdc14c586 100644 --- a/test/takeWhile/takeWhile.test.js +++ b/test/takeWhile/takeWhile.test.js @@ -1,12 +1,9 @@ const expect = require('expect'); const takeWhile = require('./takeWhile.js'); - - test('takeWhile is a Function', () => { +test('takeWhile is a Function', () => { expect(takeWhile).toBeInstanceOf(Function); }); - test('Removes elements until the function returns true', () => { - expect(takeWhile([1, 2, 3, 4], n => n >= 3), [1, 2]).toEqual() +test('Removes elements until the function returns true', () => { + expect(takeWhile([1, 2, 3, 4], n => n >= 3)).toEqual([1, 2]); }); - - diff --git a/test/throttle/throttle.test.js b/test/throttle/throttle.test.js index 31cf950fe..6f73087c6 100644 --- a/test/throttle/throttle.test.js +++ b/test/throttle/throttle.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const throttle = require('./throttle.js'); - - test('throttle is a Function', () => { +test('throttle is a Function', () => { expect(throttle).toBeInstanceOf(Function); }); - - - diff --git a/test/timeTaken/timeTaken.test.js b/test/timeTaken/timeTaken.test.js index 3782a78ee..fe67c4284 100644 --- a/test/timeTaken/timeTaken.test.js +++ b/test/timeTaken/timeTaken.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const timeTaken = require('./timeTaken.js'); - - test('timeTaken is a Function', () => { +test('timeTaken is a Function', () => { expect(timeTaken).toBeInstanceOf(Function); }); - - - diff --git a/test/times/times.test.js b/test/times/times.test.js index 6197b7cee..e5108af66 100644 --- a/test/times/times.test.js +++ b/test/times/times.test.js @@ -1,14 +1,11 @@ const expect = require('expect'); const times = require('./times.js'); - - test('times is a Function', () => { +test('times is a Function', () => { expect(times).toBeInstanceOf(Function); }); - var output = ''; - times(5, i => (output += i)); - test('Runs a function the specified amount of times', () => { - expect(output, '01234').toBe() +var output = ''; +times(5, i => (output += i)); +test('Runs a function the specified amount of times', () => { + expect(output).toBe('01234'); }); - - diff --git a/test/toCamelCase/toCamelCase.test.js b/test/toCamelCase/toCamelCase.test.js index 46b8caa2c..22b625ee8 100644 --- a/test/toCamelCase/toCamelCase.test.js +++ b/test/toCamelCase/toCamelCase.test.js @@ -1,32 +1,36 @@ const expect = require('expect'); const toCamelCase = require('./toCamelCase.js'); - - test('toCamelCase is a Function', () => { +test('toCamelCase is a Function', () => { expect(toCamelCase).toBeInstanceOf(Function); }); - test('toCamelCase('some_database_field_name') returns someDatabaseFieldName', () => { - expect(toCamelCase('some_database_field_name')).toBe('someDatabaseFieldName') +test('toCamelCase('some_database_field_name') returns someDatabaseFieldName', () => { + expect(toCamelCase('some_database_field_name')).toBe('someDatabaseFieldName'); }); - test('toCamelCase('Some label that needs to be camelized') returns someLabelThatNeedsToBeCamelized', () => { - expect(toCamelCase('Some label that needs to be camelized')).toBe('someLabelThatNeedsToBeCamelized') +test('toCamelCase('Some label that needs to be camelized') returns someLabelThatNeedsToBeCamelized', () => { + expect(toCamelCase('Some label that needs to be camelized')).toBe('someLabelThatNeedsToBeCamelized'); }); - test('toCamelCase('some-javascript-property') return someJavascriptProperty', () => { - expect(toCamelCase('some-javascript-property')).toBe('someJavascriptProperty') +test('toCamelCase('some-javascript-property') return someJavascriptProperty', () => { + expect(toCamelCase('some-javascript-property')).toBe('someJavascriptProperty'); }); - test('toCamelCase('some-mixed_string with spaces_underscores-and-hyphens') returns someMixedStringWithSpacesUnderscoresAndHyphens', () => { - expect(toCamelCase('some-mixed_string with spaces_underscores-and-hyphens')).toBe('someMixedStringWithSpacesUnderscoresAndHyphens') +test('toCamelCase('some-mixed_string with spaces_underscores-and-hyphens') returns someMixedStringWithSpacesUnderscoresAndHyphens', () => { + expect(toCamelCase('some-mixed_string with spaces_underscores-and-hyphens')).toBe('someMixedStringWithSpacesUnderscoresAndHyphens'); }); - t.throws(() => toCamelCase(), 'toCamelCase() throws a error'); - t.throws(() => toCamelCase([]), 'toCamelCase([]) throws a error'); - t.throws(() => toCamelCase({}), 'toCamelCase({}) throws a error'); - t.throws(() => toCamelCase(123), 'toCamelCase(123) throws a error'); - - let start = new Date().getTime(); - toCamelCase('some-mixed_string with spaces_underscores-and-hyphens'); - let end = new Date().getTime(); - test('toCamelCase(some-mixed_string with spaces_underscores-and-hyphens) takes less than 2s to run', () => { +test('toCamelCase() throws a error', () => { + expect(toCamelCase()).toThrow(); +}); +test('toCamelCase([]) throws a error', () => { + expect(toCamelCase([])).toThrow(); +}); +test('toCamelCase({}) throws a error', () => { + expect(toCamelCase({})).toThrow(); +}); +test('toCamelCase(123) throws a error', () => { + expect(toCamelCase(123)).toThrow(); +}); +let start = new Date().getTime(); +toCamelCase('some-mixed_string with spaces_underscores-and-hyphens'); +let end = new Date().getTime(); +test('toCamelCase(some-mixed_string with spaces_underscores-and-hyphens) takes less than 2s to run', () => { expect((end - start) < 2000).toBeTruthy(); }); - - diff --git a/test/toCurrency/toCurrency.test.js b/test/toCurrency/toCurrency.test.js index c429efcfc..81f56d85e 100644 --- a/test/toCurrency/toCurrency.test.js +++ b/test/toCurrency/toCurrency.test.js @@ -1,18 +1,15 @@ const expect = require('expect'); const toCurrency = require('./toCurrency.js'); - - test('toCurrency is a Function', () => { +test('toCurrency is a Function', () => { expect(toCurrency).toBeInstanceOf(Function); }); - test('currency: Euro | currencyLangFormat: Local', () => { - expect(toCurrency(123456.789, 'EUR'), '€ 123,456.79').toBe() +test('currency: Euro | currencyLangFormat: Local', () => { + expect(toCurrency(123456.789, 'EUR'), '€ 123,456.79').stringMatching(/€\s*123,456.79/g); }); - test(' currency: US Dollar | currencyLangFormat: English (United States)', () => { - expect(toCurrency(123456.789, 'USD', 'en-us'), '$123,456.79').toBe() +test(' currency: US Dollar | currencyLangFormat: English (United States)', () => { + expect(toCurrency(123456.789, 'USD', 'en-us')).stringMatching(/\$\s*123,456.79/g); }); - test('currency: Japanese Yen | currencyLangFormat: Local', () => { - expect(toCurrency(322342436423.2435, 'JPY'), 'JP¥ 322,342,436,423').toBe() +test('currency: Japanese Yen | currencyLangFormat: Local', () => { + expect(toCurrency(322342436423.2435, 'JPY'), 'JP¥ 322,342,436,423').stringMatching(/J*P*¥\s*322,342,436,423/g); }); - - diff --git a/test/toDecimalMark/toDecimalMark.test.js b/test/toDecimalMark/toDecimalMark.test.js index 05c4574de..017f3723c 100644 --- a/test/toDecimalMark/toDecimalMark.test.js +++ b/test/toDecimalMark/toDecimalMark.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const toDecimalMark = require('./toDecimalMark.js'); - - test('toDecimalMark is a Function', () => { +test('toDecimalMark is a Function', () => { expect(toDecimalMark).toBeInstanceOf(Function); }); - test('convert a float-point arithmetic to the Decimal mark form', () => { - expect(toDecimalMark(12305030388.9087), "12,305,030).toBe(388.909") +test('convert a float-point arithmetic to the Decimal mark form', () => { + expect(toDecimalMark(12305030388.9087)).toBe("12,305,030,388.909"); }); - diff --git a/test/toHash/toHash.test.js b/test/toHash/toHash.test.js index 662177031..27c2b4e2a 100644 --- a/test/toHash/toHash.test.js +++ b/test/toHash/toHash.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const toHash = require('./toHash.js'); - - test('toHash is a Function', () => { +test('toHash is a Function', () => { expect(toHash).toBeInstanceOf(Function); }); - diff --git a/test/toKebabCase/toKebabCase.test.js b/test/toKebabCase/toKebabCase.test.js index d59756ca0..a2ae6b202 100644 --- a/test/toKebabCase/toKebabCase.test.js +++ b/test/toKebabCase/toKebabCase.test.js @@ -1,34 +1,36 @@ const expect = require('expect'); const toKebabCase = require('./toKebabCase.js'); - - test('toKebabCase is a Function', () => { +test('toKebabCase is a Function', () => { expect(toKebabCase).toBeInstanceOf(Function); }); - test('toKebabCase('camelCase') returns camel-case', () => { - expect(toKebabCase('camelCase')).toBe('camel-case') +test('toKebabCase(\'camelCase\') returns camel-case', () => { + expect(toKebabCase('camelCase')).toBe('camel-case'); }); - test('toKebabCase('some text') returns some-text', () => { - expect(toKebabCase('some text')).toBe('some-text') +test('toKebabCase(\'some text\') returns some-text', () => { + expect(toKebabCase('some text')).toBe('some-text'); }); - test('toKebabCase('some-mixed-string With spaces-underscores-and-hyphens') returns some-mixed-string-with-spaces-underscores-and-hyphens', () => { - expect(toKebabCase('some-mixed-string With spaces-underscores-and-hyphens')).toBe('some-mixed-string-with-spaces-underscores-and-hyphens') +test('toKebabCase(\'some-mixed-string With spaces-underscores-and-hyphens\') returns some-mixed-string-with-spaces-underscores-and-hyphens', () => { + expect(toKebabCase('some-mixed-string With spaces-underscores-and-hyphens')).toBe('some-mixed-string-with-spaces-underscores-and-hyphens'); }); - test('toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html', () => { +test('toKebabCase(\'IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML\') returns i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html', () => { expect(toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML')).toBe('i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html') }); - test('toKebabCase() return undefined', () => { - expect(toKebabCase(), undefined).toBe() +test('toKebabCase() returns undefined', () => { + expect(toKebabCase()).toBe(undefined) }); - t.throws(() => toKebabCase([]), 'toKebabCase([]) throws an error'); - t.throws(() => toKebabCase({}), 'toKebabCase({}) throws an error'); - t.throws(() => toKebabCase(123), 'toKebabCase(123) throws an error'); - - let start = new Date().getTime(); - toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML'); - let end = new Date().getTime(); - test('toKebabCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run', () => { +test('toKebabCase([]) throws an erro', () => { + expect(toKebabCase([])).toThrow(); +}); +test('toKebabCase({}) throws an erro', () => { + expect(toKebabCase({})).toThrow(); +}); +test('toKebabCase(123) throws an erro', () => { + expect(toKebabCase(123)).toThrow(); +}); +let start = new Date().getTime(); +toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML'); +let end = new Date().getTime(); +test('toKebabCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run', () => { expect((end - start) < 2000).toBeTruthy(); }); - - diff --git a/test/toOrdinalSuffix/toOrdinalSuffix.test.js b/test/toOrdinalSuffix/toOrdinalSuffix.test.js index 523191f58..8bdcb11ac 100644 --- a/test/toOrdinalSuffix/toOrdinalSuffix.test.js +++ b/test/toOrdinalSuffix/toOrdinalSuffix.test.js @@ -1,20 +1,18 @@ const expect = require('expect'); const toOrdinalSuffix = require('./toOrdinalSuffix.js'); - - test('toOrdinalSuffix is a Function', () => { +test('toOrdinalSuffix is a Function', () => { expect(toOrdinalSuffix).toBeInstanceOf(Function); }); - test('Adds an ordinal suffix to a number', () => { - expect(toOrdinalSuffix('123'), '123rd').toBe() +test('Adds an ordinal suffix to a number', () => { + expect(toOrdinalSuffix('123')).toBe('123rd'); }); - test('Adds an ordinal suffix to a number', () => { - expect(toOrdinalSuffix(5), '5th').toBe() +test('Adds an ordinal suffix to a number', () => { + expect(toOrdinalSuffix(5)).toBe('5th'); }); - test('Adds an ordinal suffix to a number', () => { - expect(toOrdinalSuffix(1), '1st').toBe() +test('Adds an ordinal suffix to a number', () => { + expect(toOrdinalSuffix(1)).toBe('1st'); }); - test('Adds an ordinal suffix to a number', () => { - expect(toOrdinalSuffix(0), '0th').toBe() +test('Adds an ordinal suffix to a number', () => { + expect(toOrdinalSuffix(0)).toBe('0th'); }); - diff --git a/test/toSafeInteger/toSafeInteger.test.js b/test/toSafeInteger/toSafeInteger.test.js index 49abc7547..8362ab0e3 100644 --- a/test/toSafeInteger/toSafeInteger.test.js +++ b/test/toSafeInteger/toSafeInteger.test.js @@ -1,46 +1,42 @@ const expect = require('expect'); const toSafeInteger = require('./toSafeInteger.js'); - - test('toSafeInteger is a Function', () => { +test('toSafeInteger is a Function', () => { expect(toSafeInteger).toBeInstanceOf(Function); }); - test('Number(toSafeInteger(3.2)) is a number', () => { +test('Number(toSafeInteger(3.2)) is a number', () => { expect(Number(toSafeInteger(3.2))).toBeTruthy(); }); - test('Converts a value to a safe integer', () => { - expect(toSafeInteger(3.2)).toBe(3) +test('Converts a value to a safe integer', () => { + expect(toSafeInteger(3.2)).toBe(3); }); - test('toSafeInteger('4.2') returns 4', () => { - expect(toSafeInteger('4.2')).toBe(4) +test('toSafeInteger('4.2') returns 4', () => { + expect(toSafeInteger('4.2')).toBe(4); }); - test('toSafeInteger(4.6) returns 5', () => { - expect(toSafeInteger(4.6)).toBe(5) +test('toSafeInteger(4.6) returns 5', () => { + expect(toSafeInteger(4.6)).toBe(5); }); - test('toSafeInteger([]) returns 0', () => { - expect(toSafeInteger([])).toBe(0) +test('toSafeInteger([]) returns 0', () => { + expect(toSafeInteger([])).toBe(0); }); - test('isNaN(toSafeInteger([1.5, 3124])) is true', () => { - expect(isNaN(toSafeInteger([1.5, 3124]))).toBeTruthy() +test('isNaN(toSafeInteger([1.5, 3124])) is true', () => { + expect(isNaN(toSafeInteger([1.5, 3124]))).toBeTruthy(); }); - test('isNaN(toSafeInteger('string')) is true', () => { - expect(isNaN(toSafeInteger('string'))).toBeTruthy() +test('isNaN(toSafeInteger('string')) is true', () => { + expect(isNaN(toSafeInteger('string'))).toBeTruthy(); }); - test('isNaN(toSafeInteger({})) is true', () => { - expect(isNaN(toSafeInteger({}))).toBeTruthy() +test('isNaN(toSafeInteger({})) is true', () => { + expect(isNaN(toSafeInteger({}))).toBeTruthy(); }); - test('isNaN(toSafeInteger()) is true', () => { - expect(isNaN(toSafeInteger())).toBeTruthy() +test('isNaN(toSafeInteger()) is true', () => { + expect(isNaN(toSafeInteger())).toBeTruthy(); }); - test('toSafeInteger(Infinity) returns 9007199254740991', () => { - expect(toSafeInteger(Infinity)).toBe(9007199254740991) +test('toSafeInteger(Infinity) returns 9007199254740991', () => { + expect(toSafeInteger(Infinity)).toBe(9007199254740991); }); - - let start = new Date().getTime(); - toSafeInteger(3.2); - let end = new Date().getTime(); - test('toSafeInteger(3.2) takes less than 2s to run', () => { +let start = new Date().getTime(); +toSafeInteger(3.2); +let end = new Date().getTime(); +test('toSafeInteger(3.2) takes less than 2s to run', () => { expect((end - start) < 2000).toBeTruthy(); }); - - diff --git a/test/toSnakeCase/toSnakeCase.test.js b/test/toSnakeCase/toSnakeCase.test.js index ff0690f70..0f532f15c 100644 --- a/test/toSnakeCase/toSnakeCase.test.js +++ b/test/toSnakeCase/toSnakeCase.test.js @@ -1,34 +1,36 @@ const expect = require('expect'); const toSnakeCase = require('./toSnakeCase.js'); - - test('toSnakeCase is a Function', () => { +test('toSnakeCase is a Function', () => { expect(toSnakeCase).toBeInstanceOf(Function); }); - test('toSnakeCase('camelCase') returns camel_case', () => { - expect(toSnakeCase('camelCase')).toBe('camel_case') +test('toSnakeCase('\camelCase\') returns camel_case', () => { + expect(toSnakeCase('camelCase')).toBe('camel_case'); }); - test('toSnakeCase('some text') returns some_text', () => { - expect(toSnakeCase('some text')).toBe('some_text') +test('toSnakeCase(\'some text\') returns some_text', () => { + expect(toSnakeCase('some text')).toBe('some_text'); }); - test('toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens') returns some_mixed_string_with_spaces_underscores_and_hyphens', () => { - expect(toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens')).toBe('some_mixed_string_with_spaces_underscores_and_hyphens') +test('toSnakeCase(\'some-mixed_string With spaces_underscores-and-hyphens\') returns some_mixed_string_with_spaces_underscores_and_hyphens', () => { + expect(toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens')).toBe('some_mixed_string_with_spaces_underscores_and_hyphens'); }); - test('toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html', () => { +test('toSnakeCase(\'IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML\') returns i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html', () => { expect(toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML')).toBe('i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html') }); - test('toSnakeCase() returns undefined', () => { - expect(toSnakeCase(), undefined).toBe() +test('toSnakeCase() returns undefined', () => { + expect(toSnakeCase()).toBe(undefined); }); - t.throws(() => toSnakeCase([]), 'toSnakeCase([]) throws an error'); - t.throws(() => toSnakeCase({}), 'toSnakeCase({}) throws an error'); - t.throws(() => toSnakeCase(123), 'toSnakeCase(123) throws an error'); - - let start = new Date().getTime(); - toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML'); - let end = new Date().getTime(); - test('toSnakeCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run', () => { +test('toSnakeCase([]) throws an error', () => { + expect(toSnakeCase([])).toThrow(); +}); +test('toSnakeCase({}) throws an error', () => { + expect(toSnakeCase({})).toThrow(); +}); +test('toSnakeCase(123) throws an error', () => { + expect(toSnakeCase(123)).toThrow(); +}); +let start = new Date().getTime(); +toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML'); +let end = new Date().getTime(); +test('toSnakeCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run', () => { expect((end - start) < 2000).toBeTruthy(); }); - - diff --git a/test/toggleClass/toggleClass.test.js b/test/toggleClass/toggleClass.test.js index 82a15fff7..7c0be8524 100644 --- a/test/toggleClass/toggleClass.test.js +++ b/test/toggleClass/toggleClass.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const toggleClass = require('./toggleClass.js'); - - test('toggleClass is a Function', () => { +test('toggleClass is a Function', () => { expect(toggleClass).toBeInstanceOf(Function); }); - - - diff --git a/test/tomorrow/tomorrow.test.js b/test/tomorrow/tomorrow.test.js index fc516576d..4827289c8 100644 --- a/test/tomorrow/tomorrow.test.js +++ b/test/tomorrow/tomorrow.test.js @@ -1,20 +1,17 @@ const expect = require('expect'); const tomorrow = require('./tomorrow.js'); - - test('tomorrow is a Function', () => { +test('tomorrow is a Function', () => { expect(tomorrow).toBeInstanceOf(Function); }); - const t1 = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate() + 1); - const t2 = new Date(tomorrow()); - test('Returns the correct year', () => { - expect(t1.getFullYear(), t2.getFullYear()).toBe() +const t1 = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate() + 1); +const t2 = new Date(tomorrow()); +test('Returns the correct year', () => { + expect(t1.getFullYear()).toBe(t2.getFullYear()); }); - test('Returns the correct month', () => { - expect(t1.getMonth(), t2.getMonth()).toBe() +test('Returns the correct month', () => { + expect(t1.getMonth()).toBe(t2.getMonth()); }); - test('Returns the correct date', () => { - expect(t1.getDate(), t2.getDate()).toBe() +test('Returns the correct date', () => { + expect(t1.getDate()).toBe(t2.getDate()); }); - - diff --git a/test/transform/transform.test.js b/test/transform/transform.test.js index a2407b0c6..d87d3f0c4 100644 --- a/test/transform/transform.test.js +++ b/test/transform/transform.test.js @@ -1,17 +1,14 @@ const expect = require('expect'); const transform = require('./transform.js'); - - test('transform is a Function', () => { +test('transform is a Function', () => { expect(transform).toBeInstanceOf(Function); }); - t.deepEqual(transform( +test('Transforms an object', () => { + expect(transform( { a: 1, b: 2, c: 1 }, (r, v, k) => { (r[v] || (r[v] = [])).push(k); return r; - }, - {} -), { '1': ['a', 'c'], '2': ['b'] }, 'Transforms an object'); - - + },{}).toEqual({ '1': ['a', 'c'], '2': ['b'] }); +}); diff --git a/test/truncateString/truncateString.test.js b/test/truncateString/truncateString.test.js index c3ec9db4e..bcbf57a6a 100644 --- a/test/truncateString/truncateString.test.js +++ b/test/truncateString/truncateString.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const truncateString = require('./truncateString.js'); - - test('truncateString is a Function', () => { +test('truncateString is a Function', () => { expect(truncateString).toBeInstanceOf(Function); }); - test('Truncates a "boomerang" up to a specified length.', () => { - expect(truncateString('boomerang', 7), 'boom...').toBe() +test('Truncates a "boomerang" up to a specified length.', () => { + expect(truncateString('boomerang', 7)).toBe('boom...'); }); - diff --git a/test/truthCheckCollection/truthCheckCollection.test.js b/test/truthCheckCollection/truthCheckCollection.test.js index 1c5d1a0ee..8f8c89a0a 100644 --- a/test/truthCheckCollection/truthCheckCollection.test.js +++ b/test/truthCheckCollection/truthCheckCollection.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const truthCheckCollection = require('./truthCheckCollection.js'); - - test('truthCheckCollection is a Function', () => { +test('truthCheckCollection is a Function', () => { expect(truthCheckCollection).toBeInstanceOf(Function); }); - test('second argument is truthy on all elements of a collection', () => { - expect(truthCheckCollection([{ user: 'Tinky-Winky', sex: 'male' }, { user: 'Dipsy', sex: 'male' }], 'sex')).toBe(true) +test('second argument is truthy on all elements of a collection', () => { + expect(truthCheckCollection([{ user: 'Tinky-Winky', sex: 'male' }, { user: 'Dipsy', sex: 'male' }], 'sex')).toBeTruthy(); }); - From c0a42d906aedcfeb782492b1d8ecf4f08fb309af Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Mon, 18 Jun 2018 18:52:13 +0300 Subject: [PATCH 13/19] Test cleanup and fixes [u-v] --- test/URLJoin/URLJoin.test.js | 13 ++-- .../UUIDGeneratorBrowser.test.js | 6 +- .../UUIDGeneratorNode.test.js | 13 ++-- test/unary/unary.test.js | 8 +-- test/uncurry/uncurry.test.js | 25 ++++---- test/unescapeHTML/unescapeHTML.test.js | 8 +-- test/unflattenObject/unflattenObject.test.js | 9 +-- test/unfold/unfold.test.js | 11 ++-- test/union/union.test.js | 54 ++++++++++------- test/unionBy/unionBy.test.js | 9 +-- test/unionWith/unionWith.test.js | 9 +-- test/uniqueElements/uniqueElements.test.js | 60 ++++++++++--------- test/untildify/untildify.test.js | 15 ++--- test/unzip/unzip.test.js | 13 ++-- test/unzipWith/unzipWith.test.js | 9 ++- test/validateNumber/validateNumber.test.js | 30 ++++------ 16 files changed, 135 insertions(+), 157 deletions(-) diff --git a/test/URLJoin/URLJoin.test.js b/test/URLJoin/URLJoin.test.js index fd51c5c5b..4e72b9363 100644 --- a/test/URLJoin/URLJoin.test.js +++ b/test/URLJoin/URLJoin.test.js @@ -1,11 +1,12 @@ const expect = require('expect'); const URLJoin = require('./URLJoin.js'); - - test('URLJoin is a Function', () => { +test('URLJoin is a Function', () => { expect(URLJoin).toBeInstanceOf(Function); }); - t.equal(URLJoin('http: - t.equal(URLJoin('file: - - +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 4448c0449..60033da0e 100644 --- a/test/UUIDGeneratorBrowser/UUIDGeneratorBrowser.test.js +++ b/test/UUIDGeneratorBrowser/UUIDGeneratorBrowser.test.js @@ -1,10 +1,6 @@ const expect = require('expect'); const UUIDGeneratorBrowser = require('./UUIDGeneratorBrowser.js'); - - test('UUIDGeneratorBrowser is a Function', () => { +test('UUIDGeneratorBrowser is a Function', () => { expect(UUIDGeneratorBrowser).toBeInstanceOf(Function); }); - - - diff --git a/test/UUIDGeneratorNode/UUIDGeneratorNode.test.js b/test/UUIDGeneratorNode/UUIDGeneratorNode.test.js index 5aec30a90..8c3aa4356 100644 --- a/test/UUIDGeneratorNode/UUIDGeneratorNode.test.js +++ b/test/UUIDGeneratorNode/UUIDGeneratorNode.test.js @@ -1,16 +1,13 @@ const expect = require('expect'); const UUIDGeneratorNode = require('./UUIDGeneratorNode.js'); - - test('UUIDGeneratorNode is a Function', () => { +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() +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', () => { +test('Only contains hexadecimal digits', () => { expect(/^[0-9A-Fa-f-]+$/.test(uuid)).toBeTruthy(); }); - - diff --git a/test/unary/unary.test.js b/test/unary/unary.test.js index 0dc3ee657..464c8173b 100644 --- a/test/unary/unary.test.js +++ b/test/unary/unary.test.js @@ -1,12 +1,10 @@ const expect = require('expect'); const unary = require('./unary.js'); - - test('unary is a Function', () => { +test('unary is a Function', () => { expect(unary).toBeInstanceOf(Function); }); - test('Discards arguments after the first one', () => { - expect(['6', '8', '10'].map(unary(parseInt)), [6, 8, 10]).toEqual() +test('Discards arguments after the first one', () => { + expect(['6', '8', '10'].map(unary(parseInt))).toEqual([6, 8, 10]); }); - diff --git a/test/uncurry/uncurry.test.js b/test/uncurry/uncurry.test.js index d9e39c581..b94e3d1ff 100644 --- a/test/uncurry/uncurry.test.js +++ b/test/uncurry/uncurry.test.js @@ -1,22 +1,19 @@ const expect = require('expect'); const uncurry = require('./uncurry.js'); - - test('uncurry is a Function', () => { +test('uncurry is a Function', () => { expect(uncurry).toBeInstanceOf(Function); }); - const add = x => y => z => x + y + z; - const add1 = uncurry(add); - const add2 = uncurry(add, 2); - const add3 = uncurry(add, 3); - test('Works without a provided value for n', () => { - expect(add1(1)(2)(3), 6).toBe() +const add = x => y => z => x + y + z; +const add1 = uncurry(add); +const add2 = uncurry(add, 2); +const add3 = uncurry(add, 3); +test('Works without a provided value for n', () => { + expect(add1(1)(2)(3)).toBe(6); }); - test('Works without n = 2', () => { - expect(add2(1,2)(3), 6).toBe() +test('Works with n = 2', () => { + expect(add2(1,2)(3)).toBe(6); }); - test('Works withoutn = 3', () => { - expect(add3(1,2,3), 6).toBe() + test('Works with n = 3', () => { + expect(add3(1,2,3)).toBe(6); }); - - diff --git a/test/unescapeHTML/unescapeHTML.test.js b/test/unescapeHTML/unescapeHTML.test.js index 0521796c2..6f5571384 100644 --- a/test/unescapeHTML/unescapeHTML.test.js +++ b/test/unescapeHTML/unescapeHTML.test.js @@ -1,11 +1,9 @@ const expect = require('expect'); const unescapeHTML = require('./unescapeHTML.js'); - - test('unescapeHTML is a Function', () => { +test('unescapeHTML is a Function', () => { expect(unescapeHTML).toBeInstanceOf(Function); }); - test('Unescapes escaped HTML characters.', () => { - expect(unescapeHTML('<a href="#">Me & you</a>'), 'Me & you').toBe() +test('Unescapes escaped HTML characters.', () => { + expect(unescapeHTML('<a href="#">Me & you</a>')).toBe('Me & you'); }); - diff --git a/test/unflattenObject/unflattenObject.test.js b/test/unflattenObject/unflattenObject.test.js index 55fa668b9..743524974 100644 --- a/test/unflattenObject/unflattenObject.test.js +++ b/test/unflattenObject/unflattenObject.test.js @@ -1,12 +1,9 @@ const expect = require('expect'); const unflattenObject = require('./unflattenObject.js'); - - test('unflattenObject is a Function', () => { +test('unflattenObject is a Function', () => { expect(unflattenObject).toBeInstanceOf(Function); }); - test('Unflattens an object with the paths for keys', () => { - expect(unflattenObject({ 'a.b.c': 1, d: 1 }), { a: { b: { c: 1 } }, d: 1 }).toEqual() +test('Unflattens an object with the paths for keys', () => { + expect(unflattenObject({ 'a.b.c': 1, d: 1 })).toEqual({ a: { b: { c: 1 } }, d: 1 }); }); - - diff --git a/test/unfold/unfold.test.js b/test/unfold/unfold.test.js index ee36c7572..b8eb61ac7 100644 --- a/test/unfold/unfold.test.js +++ b/test/unfold/unfold.test.js @@ -1,13 +1,10 @@ const expect = require('expect'); const unfold = require('./unfold.js'); - - test('unfold is a Function', () => { +test('unfold is a Function', () => { expect(unfold).toBeInstanceOf(Function); }); - var f = n => (n > 50 ? false : [-n, n + 10]); - test('Works with a given function, producing an array', () => { - expect(unfold(f, 10), [-10, -20, -30, -40, -50]).toEqual() +var f = n => (n > 50 ? false : [-n, n + 10]); +test('Works with a given function, producing an array', () => { + expect(unfold(f, 10)).toEqual([-10, -20, -30, -40, -50]); }); - - diff --git a/test/union/union.test.js b/test/union/union.test.js index a0a80f846..4c16c547d 100644 --- a/test/union/union.test.js +++ b/test/union/union.test.js @@ -1,34 +1,42 @@ const expect = require('expect'); const union = require('./union.js'); - - test('union is a Function', () => { +test('union is a Function', () => { expect(union).toBeInstanceOf(Function); }); - test('union([1, 2, 3], [4, 3, 2]) returns [1, 2, 3, 4]', () => { - expect(union([1, 2, 3], [4, 3, 2]), [1, 2, 3).toEqual(4]) +test('union([1, 2, 3], [4, 3, 2]) returns [1, 2, 3, 4]', () => { + expect(union([1, 2, 3], [4, 3, 2])).toEqual([1, 2, 3, 4]); }); - test('union('str', 'asd') returns [ 's', 't', 'r', 'a', 'd' ]', () => { - expect(union('str', 'asd'), [ 's', 't', 'r', 'a').toEqual('d' ]) +test('union('str', 'asd') returns [ 's', 't', 'r', 'a', 'd' ]', () => { + expect(union('str', 'asd')).toEqual([ 's', 't', 'r', 'a', 'd' ]); }); - test('union([[], {}], [1, 2, 3]) returns [[], {}, 1, 2, 3]', () => { - expect(union([[], {}], [1, 2, 3]), [[], {}, 1, 2).toEqual(3]) +test('union([[], {}], [1, 2, 3]) returns [[], {}, 1, 2, 3]', () => { + expect(union([[], {}], [1, 2, 3])).toEqual([[], {}, 1, 2, 3]); }); - test('union([], []) returns []', () => { - expect(union([], [])).toEqual([]) +test('union([], []) returns []', () => { + expect(union([], [])).toEqual([]); }); - t.throws(() => union(), 'union() throws an error'); - t.throws(() => union(true, 'str'), 'union(true, str) throws an error'); - t.throws(() => union('false', true), 'union(false, true) throws an error'); - t.throws(() => union(123, {}), 'union(123, {}) throws an error'); - t.throws(() => union([], {}), 'union([], {}) throws an error'); - t.throws(() => union(undefined, null), 'union(undefined, null) throws an error'); - - let start = new Date().getTime(); - union([1, 2, 3], [4, 3, 2]); - let end = new Date().getTime(); - test('union([1, 2, 3], [4, 3, 2]) takes less than 2s to run', () => { +test('union() throws an error', () => { + expect(union()).toThrow(); +}); +test('union(true, \'str\') throws an error', () => { + expect(union(true, 'str')).toThrow(); +}); +test('union(\'false\', true) throws an error', () => { + expect(union('false', true)).toThrow(); +}); +test('union((123, {}) throws an error', () => { + expect(union((123, {})).toThrow(); +}); +test('union([], {}) throws an error', () => { + expect(union([], {})).toThrow(); +}); +test('union(undefined, null) throws an error', () => { + expect(union(undefined, null)).toThrow(); +}); +let start = new Date().getTime(); +union([1, 2, 3], [4, 3, 2]); +let end = new Date().getTime(); +test('union([1, 2, 3], [4, 3, 2]) takes less than 2s to run', () => { expect((end - start) < 2000).toBeTruthy(); }); - - diff --git a/test/unionBy/unionBy.test.js b/test/unionBy/unionBy.test.js index 95c5c870e..e4f5ed98b 100644 --- a/test/unionBy/unionBy.test.js +++ b/test/unionBy/unionBy.test.js @@ -1,12 +1,9 @@ const expect = require('expect'); const unionBy = require('./unionBy.js'); - - test('unionBy is a Function', () => { +test('unionBy is a Function', () => { expect(unionBy).toBeInstanceOf(Function); }); - test('Produces the appropriate results', () => { - expect(unionBy([2.1], [1.2, 2.3], Math.floor), [2.1, 1.2]).toEqual() +test('Produces the appropriate results', () => { + expect(unionBy([2.1], [1.2, 2.3], Math.floor)).toEqual([2.1, 1.2]); }); - - diff --git a/test/unionWith/unionWith.test.js b/test/unionWith/unionWith.test.js index c4c0d44cc..d99c24835 100644 --- a/test/unionWith/unionWith.test.js +++ b/test/unionWith/unionWith.test.js @@ -1,12 +1,9 @@ const expect = require('expect'); const unionWith = require('./unionWith.js'); - - test('unionWith is a Function', () => { +test('unionWith is a Function', () => { expect(unionWith).toBeInstanceOf(Function); }); - test('Produces the appropriate results', () => { - expect(unionWith([1, 1.2, 1.5, 3, 0], [1.9, 3, 0, 3.9], (a, b) => Math.round(a) === Math.round(b)), [1, 1.2, 1.5, 3, 0, 3.9]).toEqual() +test('Produces the appropriate results', () => { + expect(unionWith([1, 1.2, 1.5, 3, 0], [1.9, 3, 0, 3.9], (a, b) => Math.round(a) === Math.round(b))).toEqual([1, 1.2, 1.5, 3, 0, 3.9]); }); - - diff --git a/test/uniqueElements/uniqueElements.test.js b/test/uniqueElements/uniqueElements.test.js index 061c4da8f..ee7ad4e9e 100644 --- a/test/uniqueElements/uniqueElements.test.js +++ b/test/uniqueElements/uniqueElements.test.js @@ -2,43 +2,45 @@ const expect = require('expect'); const uniqueElements = require('./uniqueElements.js'); - test('uniqueElements is a Function', () => { +test('uniqueElements is a Function', () => { expect(uniqueElements).toBeInstanceOf(Function); }); - test('uniqueElements([1, 2, 2, 3, 4, 4, 5]) returns [1,2,3,4,5]', () => { - expect(uniqueElements([1, 2, 2, 3, 4, 4, 5]), [1,2,3,4).toEqual(5]) +test('uniqueElements([1, 2, 2, 3, 4, 4, 5]) returns [1,2,3,4,5]', () => { + expect(uniqueElements([1, 2, 2, 3, 4, 4, 5])).toEqual([1,2,3,4,5]); }); - test('uniqueElements([1, 23, 53]) returns [1, 23, 53]', () => { - expect(uniqueElements([1, 23, 53]), [1, 23).toEqual(53]) +test('uniqueElements([1, 23, 53]) returns [1, 23, 53]', () => { + expect(uniqueElements([1, 23, 53])).toEqual([1, 23, 53]); }); - test('uniqueElements([true, 0, 1, false, false, undefined, null, '']) returns [true, 0, 1, false, false, undefined, null, '']', () => { - expect(uniqueElements([true, 0, 1, false, false, undefined, null, '']), [true, 0, 1, false, undefined, null).toEqual('']) +test('uniqueElements([true, 0, 1, false, false, undefined, null, '']) returns [true, 0, 1, false, false, undefined, null, '']', () => { + expect(uniqueElements([true, 0, 1, false, false, undefined, null, ''])).toEqual([true, 0, 1, false, undefined, null, '']); }); - test('uniqueElements() returns []', () => { - expect(uniqueElements()).toEqual([]) +test('uniqueElements() returns []', () => { + expect(uniqueElements()).toEqual([]); }); - test('uniqueElements(null) returns []', () => { - expect(uniqueElements(null)).toEqual([]) +test('uniqueElements(null) returns []', () => { + expect(uniqueElements(null)).toEqual([]); }); - test('uniqueElements(undefined) returns []', () => { - expect(uniqueElements(undefined)).toEqual([]) +test('uniqueElements(undefined) returns []', () => { + expect(uniqueElements(undefined)).toEqual([]); }); - test('uniqueElements('strt') returns ['s', 't', 'r']', () => { - expect(uniqueElements('strt'), ['s', 't').toEqual('r']) +test('uniqueElements(\'strt\') returns ['s', 't', 'r']', () => { + expect(uniqueElements('strt')).toEqual(['s', 't', 'r']); }); - t.throws(() => uniqueElements(1, 1, 2543, 534, 5), 'uniqueElements(1, 1, 2543, 534, 5) throws an error'); - t.throws(() => uniqueElements({}), 'uniqueElements({}) throws an error'); - t.throws(() => uniqueElements(true), 'uniqueElements(true) throws an error'); - t.throws(() => uniqueElements(false), 'uniqueElements(false) throws an error'); - - let start = new Date().getTime(); - uniqueElements([true, 0, 1, false, false, undefined, null, '']); - let end = new Date().getTime(); - test('uniqueElements([true, 0, 1, false, false, undefined, null]) takes less than 2s to run', () => { +test('uniqueElements(1, 1, 2543, 534, 5) throws an error', () => { + expect(uniqueElements(1, 1, 2543, 534, 5)).toThrow(); +}); +test('uniqueElements({}) throws an error', () => { + expect(uniqueElements({})).toThrow(); +}); +test('uniqueElements(true) throws an error', () => { + expect(uniqueElements(true)).toThrow(); +}); +test('uniqueElements(false) throws an error', () => { + expect(uniqueElements(false)).toThrow(); +}); +let start = new Date().getTime(); +uniqueElements([true, 0, 1, false, false, undefined, null, '']); +let end = new Date().getTime(); +test('uniqueElements([true, 0, 1, false, false, undefined, null]) takes less than 2s to run', () => { expect((end - start) < 2000).toBeTruthy(); }); - - - - -uniqueElements([1, 2, 2, '1', 4, 4, 4, 5, true]); diff --git a/test/untildify/untildify.test.js b/test/untildify/untildify.test.js index f020ade98..d8e3134e1 100644 --- a/test/untildify/untildify.test.js +++ b/test/untildify/untildify.test.js @@ -1,18 +1,15 @@ const expect = require('expect'); const untildify = require('./untildify.js'); - - test('untildify is a Function', () => { +test('untildify is a Function', () => { expect(untildify).toBeInstanceOf(Function); }); - test('Contains no tildes', () => { +test('Contains no tildes', () => { expect(untildify('~/test/dir/file.f').indexOf('~') === -1).toBeTruthy(); }); - test('Does not alter the rest of the path', () => { - expect(untildify('~/test/dir/file.f').slice(-16), '/test/dir/file.f').toBe() +test('Does not alter the rest of the path', () => { + expect(untildify('~/test/dir/file.f').slice(-16)).toBe('/test/dir/file.f'); }); - test('Does not alter paths without tildes', () => { - expect(untildify('test/dir/file.f'), 'test/dir/file.f').toBe() +test('Does not alter paths without tildes', () => { + expect(untildify('test/dir/file.f')).toBe('test/dir/file.f'); }); - - diff --git a/test/unzip/unzip.test.js b/test/unzip/unzip.test.js index 16b125928..2347b64af 100644 --- a/test/unzip/unzip.test.js +++ b/test/unzip/unzip.test.js @@ -1,11 +1,12 @@ const expect = require('expect'); const unzip = require('./unzip.js'); - - test('unzip is a Function', () => { +test('unzip is a Function', () => { expect(unzip).toBeInstanceOf(Function); }); - t.deepEqual(unzip([['a', 1, true], ['b', 2, false]]), [['a', 'b'], [1, 2], [true, false]], `unzip([['a', 1, true], ['b', 2, false]]) equals [['a', 'b'], [1, 2], [true, false]]`); - t.deepEqual(unzip([['a', 1, true], ['b', 2]]), [['a', 'b'], [1, 2], [true]], `unzip([['a', 1, true], ['b', 2]]) equals [['a', 'b'], [1, 2], [true]]`); - - +test('unzip([[\'a\', 1, true], [\'b\', 2, false]]) equals [[\'a\',\'b\'], [1, 2], [true, false]]', () => { + expect(unzip([['a', 1, true], ['b', 2, false]])).toBe([['a', 'b'], [1, 2], [true, false]]); +}); +test('unzip([[\'a\', 1, true], [\'b\', 2]]) equals [[\'a\',\'b\'], [1, 2], [true]]', () => { + expect(unzip([['a', 1, true], ['b', 2]])).toBe([['a', 'b'], [1, 2], [true]]); +}); diff --git a/test/unzipWith/unzipWith.test.js b/test/unzipWith/unzipWith.test.js index d33b5b86f..9d29f9cc4 100644 --- a/test/unzipWith/unzipWith.test.js +++ b/test/unzipWith/unzipWith.test.js @@ -1,10 +1,9 @@ const expect = require('expect'); const unzipWith = require('./unzipWith.js'); - - test('unzipWith is a Function', () => { +test('unzipWith is a Function', () => { expect(unzipWith).toBeInstanceOf(Function); }); - t.deepEqual(unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)), [3, 30, 300], `unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)) equals [3, 30, 300]`); - - +test('unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)) equals [3, 30, 300]', () => { + expect(unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0))).toBe([3, 30, 300]); +}); diff --git a/test/validateNumber/validateNumber.test.js b/test/validateNumber/validateNumber.test.js index 3b6d00842..2d009afae 100644 --- a/test/validateNumber/validateNumber.test.js +++ b/test/validateNumber/validateNumber.test.js @@ -1,46 +1,42 @@ const expect = require('expect'); const validateNumber = require('./validateNumber.js'); - - test('validateNumber is a Function', () => { +test('validateNumber is a Function', () => { expect(validateNumber).toBeInstanceOf(Function); }); - test('validateNumber(9) returns true', () => { +test('validateNumber(9) returns true', () => { expect(validateNumber(9)).toBeTruthy(); }); - test('validateNumber(234asd.slice(0, 2)) returns true', () => { +test('validateNumber(234asd.slice(0, 2)) returns true', () => { expect(validateNumber('234asd'.slice(0, 2))).toBeTruthy(); }); - test('validateNumber(1232) returns true', () => { +test('validateNumber(1232) returns true', () => { expect(validateNumber(1232)).toBeTruthy(); }); - test('validateNumber(1232 + 13423) returns true', () => { +test('validateNumber(1232 + 13423) returns true', () => { expect(validateNumber(1232 + 13423)).toBeTruthy(); }); - test('validateNumber(1232 * 2342 * 123) returns true', () => { +test('validateNumber(1232 * 2342 * 123) returns true', () => { expect(validateNumber(1232 * 2342 * 123)).toBeTruthy(); }); - test('validateNumber(1232.23423536) returns true', () => { +test('validateNumber(1232.23423536) returns true', () => { expect(validateNumber(1232.23423536)).toBeTruthy(); }); - test('validateNumber(234asd) returns false', () => { +test('validateNumber(234asd) returns false', () => { expect(validateNumber('234asd')).toBeFalsy(); }); - test('validateNumber(e234d) returns false', () => { +test('validateNumber(e234d) returns false', () => { expect(validateNumber('e234d')).toBeFalsy(); }); - test('validateNumber(false) returns false', () => { +test('validateNumber(false) returns false', () => { expect(validateNumber(false)).toBeFalsy(); }); - test('validateNumber(true) returns false', () => { +test('validateNumber(true) returns false', () => { expect(validateNumber(true)).toBeFalsy(); }); - test('validateNumber(null) returns false', () => { +test('validateNumber(null) returns false', () => { expect(validateNumber(null)).toBeFalsy(); }); - test('validateNumber(123 * asd) returns false', () => { +test('validateNumber(123 * asd) returns false', () => { expect(validateNumber(123 * 'asd')).toBeFalsy(); }); - - - From 584ed191d411355148e1ba19c0dcebb5fc8787e3 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Mon, 18 Jun 2018 19:01:06 +0300 Subject: [PATCH 14/19] Test cleanup and fixes [w-z] --- test/when/when.test.js | 24 +++++++++--------- test/without/without.test.js | 42 ++++++++++++++++++-------------- test/words/words.test.js | 40 ++++++++++++++++++------------ test/xProd/xProd.test.js | 9 +++---- test/yesNo/yesNo.test.js | 30 ++++++++++------------- test/zip/zip.test.js | 33 +++++++++++++------------ test/zipObject/zipObject.test.js | 42 ++++++++++++++++++-------------- test/zipWith/zipWith.test.js | 4 +-- 8 files changed, 118 insertions(+), 106 deletions(-) diff --git a/test/when/when.test.js b/test/when/when.test.js index c736288f8..0feb021e8 100644 --- a/test/when/when.test.js +++ b/test/when/when.test.js @@ -1,18 +1,16 @@ const expect = require('expect'); const when = require('./when.js'); - - test('when is a Function', () => { +test('when is a Function', () => { expect(when).toBeInstanceOf(Function); }); - - const doubleEvenNumbers = when( - (x) => x % 2 === 0, - (x) => x * 2 - ); - - t.true(doubleEvenNumbers(2) === 4); - t.true(doubleEvenNumbers(1) === 1); - - - +const doubleEvenNumbers = when( + (x) => x % 2 === 0, + (x) => x * 2 +); +test('Returns the proper result', () => { + expect(doubleEvenNumbers(2)).toBe(4); +}); +test('Returns the proper result', () => { + expect(doubleEvenNumbers(1)).toBe(1); +}); diff --git a/test/without/without.test.js b/test/without/without.test.js index 48967d1ce..54ef78bb5 100644 --- a/test/without/without.test.js +++ b/test/without/without.test.js @@ -1,27 +1,33 @@ const expect = require('expect'); const without = require('./without.js'); - - test('without is a Function', () => { +test('without is a Function', () => { expect(without).toBeInstanceOf(Function); }); - test('without([2, 1, 2, 3], 1, 2) returns [3]', () => { - expect(without([2, 1, 2, 3], 1, 2)).toEqual([3]) +test('without([2, 1, 2, 3], 1, 2) returns [3]', () => { + expect(without([2, 1, 2, 3], 1, 2)).toEqual([3]); }); - test('without([]) returns []', () => { - expect(without([])).toEqual([]) +test('without([]) returns []', () => { + expect(without([])).toEqual([]); }); - test('without([3, 1, true, '3', true], '3', true) returns [3, 1]', () => { - expect(without([3, 1, true, '3', true], '3', true), [3).toEqual(1]) +test('without([3, 1, true, '3', true], '3', true) returns [3, 1]', () => { + expect(without([3, 1, true, '3', true], '3', true)).toEqual([3, 1]); }); - test('without('string'.split(''), 's', 't', 'g') returns ['r', 'i', 'n']', () => { - expect(without('string'.split(''), 's', 't', 'g'), ['r', 'i').toEqual('n']) +test('without('string'.split(''), 's', 't', 'g') returns [\'r\', \'i\', \'n\']', () => { + expect(without('string'.split(''), 's', 't', 'g')).toEqual(['r', 'i', 'n']); +}); +test('without() throws an error', () => { + expect(without()).toThrow(); +}); +test('without(null) throws an error', () => { + expect(without(null)).toThrow(); +}); +test('without(undefined) throws an error', () => { + expect(without(undefined)).toThrow(); +}); +test('without(123) throws an error', () => { + expect(without(123)).toThrow(); +}); +test('without({}) throws an error', () => { + expect(without({})).toThrow(); }); - t.throws(() => without(), 'without() throws an error'); - t.throws(() => without(null), 'without(null) throws an error'); - t.throws(() => without(undefined), 'without(undefined) throws an error'); - t.throws(() => without(123), 'without() throws an error'); - t.throws(() => without({}), 'without({}) throws an error'); - - - diff --git a/test/words/words.test.js b/test/words/words.test.js index ec99f3882..fbedafabf 100644 --- a/test/words/words.test.js +++ b/test/words/words.test.js @@ -1,25 +1,33 @@ const expect = require('expect'); const words = require('./words.js'); - - test('words is a Function', () => { +test('words is a Function', () => { expect(words).toBeInstanceOf(Function); }); - test('words('I love javaScript!!') returns [I, love, javaScript]', () => { - expect(words('I love javaScript!!'), ["I", "love").toEqual("javaScript"]) +test('words('I love javaScript!!') returns [I, love, javaScript]', () => { + expect(words('I love javaScript!!')).toEqual(["I", "love", "javaScript"]); }); - test('words('python, javaScript & coffee') returns [python, javaScript, coffee]', () => { - expect(words('python, javaScript & coffee'), ["python", "javaScript").toEqual("coffee"]) +test('words('python, javaScript & coffee') returns [python, javaScript, coffee]', () => { + expect(words('python, javaScript & coffee')).toEqual(["python", "javaScript", "coffee"]); }); - test('words(I love javaScript!!) returns an array', () => { +test('words(I love javaScript!!) returns an array', () => { expect(Array.isArray(words('I love javaScript!!'))).toBeTruthy(); }); - t.throws(() => words(), 'words() throws a error'); - t.throws(() => words(null), 'words(null) throws a error'); - t.throws(() => words(undefined), 'words(undefined) throws a error'); - t.throws(() => words({}), 'words({}) throws a error'); - t.throws(() => words([]), 'words([]) throws a error'); - t.throws(() => words(1234), 'words(1234) throws a error'); - - - +test('words() throws an error', () => { + expect(words()).toThrow(); +}); +test('words(null) throws an error', () => { + expect(words(null)).toThrow(); +}); +test('words(undefined) throws an error', () => { + expect(words(undefined)).toThrow(); +}); +test('words({}) throws an error', () => { + expect(words({})).toThrow(); +}); +test('words([]) throws an error', () => { + expect(words([])).toThrow(); +}); +test('words(1234) throws an error', () => { + expect(words(1234)).toThrow(); +}); diff --git a/test/xProd/xProd.test.js b/test/xProd/xProd.test.js index 392dcfd47..c4cea5de1 100644 --- a/test/xProd/xProd.test.js +++ b/test/xProd/xProd.test.js @@ -1,10 +1,9 @@ const expect = require('expect'); const xProd = require('./xProd.js'); - - test('xProd is a Function', () => { +test('xProd is a Function', () => { expect(xProd).toBeInstanceOf(Function); }); - t.deepEqual(xProd([1, 2], ['a', 'b']), [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']], `xProd([1, 2], ['a', 'b']) returns [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]`); - - +test('xProd([1, 2], [\'a\', \'b\']) returns [[1, \'a\'], [1, \'b\'], [2, \'a\'], [2, \'b\']]', () => { + expect(xProd([1, 2], ['a', 'b'])).toEqual([[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']]); +}); diff --git a/test/yesNo/yesNo.test.js b/test/yesNo/yesNo.test.js index b3d658754..9bc825531 100644 --- a/test/yesNo/yesNo.test.js +++ b/test/yesNo/yesNo.test.js @@ -1,46 +1,42 @@ const expect = require('expect'); const yesNo = require('./yesNo.js'); - - test('yesNo is a Function', () => { +test('yesNo is a Function', () => { expect(yesNo).toBeInstanceOf(Function); }); - test('yesNo(Y) returns true', () => { +test('yesNo(Y) returns true', () => { expect(yesNo('Y')).toBeTruthy(); }); - test('yesNo(yes) returns true', () => { +test('yesNo(yes) returns true', () => { expect(yesNo('yes')).toBeTruthy(); }); - test('yesNo(foo, true) returns true', () => { +test('yesNo(foo, true) returns true', () => { expect(yesNo('foo', true)).toBeTruthy(); }); - test('yesNo(No) returns false', () => { +test('yesNo(No) returns false', () => { expect(yesNo('No')).toBeFalsy(); }); - test('yesNo() returns false', () => { +test('yesNo() returns false', () => { expect(yesNo()).toBeFalsy(); }); - test('yesNo(null) returns false', () => { +test('yesNo(null) returns false', () => { expect(yesNo(null)).toBeFalsy(); }); - test('yesNo(undefined) returns false', () => { +test('yesNo(undefined) returns false', () => { expect(yesNo(undefined)).toBeFalsy(); }); - test('yesNo([123, null]) returns false', () => { +test('yesNo([123, null]) returns false', () => { expect(yesNo([123, null])).toBeFalsy(); }); - test('yesNo([Yes, No]) returns false', () => { +test('yesNo([Yes, No]) returns false', () => { expect(yesNo(['Yes', 'No'])).toBeFalsy(); }); - test('yesNo({ 2: Yes }) returns false', () => { +test('yesNo({ 2: Yes }) returns false', () => { expect(yesNo({ 2: 'Yes' })).toBeFalsy(); }); - test('yesNo([Yes, No], true) returns true', () => { +test('yesNo([Yes, No], true) returns true', () => { expect(yesNo(['Yes', 'No'], true)).toBeTruthy(); }); - test('yesNo({ 2: Yes }, true) returns true', () => { +test('yesNo({ 2: Yes }, true) returns true', () => { expect(yesNo({ 2: 'Yes' }, true)).toBeTruthy(); }); - - - diff --git a/test/zip/zip.test.js b/test/zip/zip.test.js index f6af12c43..c9822d2c0 100644 --- a/test/zip/zip.test.js +++ b/test/zip/zip.test.js @@ -2,29 +2,30 @@ const expect = require('expect'); const zip = require('./zip.js'); - test('zip is a Function', () => { +test('zip is a Function', () => { expect(zip).toBeInstanceOf(Function); }); - test('zip([a, b], [1, 2], [true, false]) returns [[a, 1, true], [b, 2, false]]', () => { - expect(zip(['a', 'b'], [1, 2], [true, false]), [['a', 1, true], ['b', 2, false]]).toEqual() +test('zip([a, b], [1, 2], [true, false]) returns [[a, 1, true], [b, 2, false]]', () => { + expect(zip(['a', 'b'], [1, 2], [true, false])).toEqual([['a', 1, true], ['b', 2, false]]); }); - test('zip([a], [1, 2], [true, false]) returns [[a, 1, true], [undefined, 2, false]]', () => { - expect(zip(['a'], [1, 2], [true, false]), [['a', 1, true], [undefined, 2, false]]).toEqual() +test('zip([a], [1, 2], [true, false]) returns [[a, 1, true], [undefined, 2, false]]', () => { + expect(zip(['a'], [1, 2], [true, false])).toEqual([['a', 1, true], [undefined, 2, false]]); }); - test('zip([]) returns []', () => { - expect(zip(), []).toEqual() +test('zip([]) returns []', () => { + expect(zip()).toEqual([]); }); - test('zip(123) returns []', () => { - expect(zip(123), []).toEqual() +test('zip(123) returns []', () => { + expect(zip(123)).toEqual([]); }); - test('zip([a, b], [1, 2], [true, false]) returns an Array', () => { +test('zip([a, b], [1, 2], [true, false]) returns an Array', () => { expect(Array.isArray(zip(['a', 'b'], [1, 2], [true, false]))).toBeTruthy(); }); - test('zip([a], [1, 2], [true, false]) returns an Array', () => { +test('zip([a], [1, 2], [true, false]) returns an Array', () => { expect(Array.isArray(zip(['a'], [1, 2], [true, false]))).toBeTruthy(); }); - t.throws(() => zip(null), 'zip(null) throws an error'); - t.throws(() => zip(undefined), 'zip(undefined) throws an error'); - - - +test('zip(null) throws an error', () => { + expect(zip(null)).toThrow(); +}); +test('zip(undefined) throws an error', () => { + expect(zip(undefined)).toThrow(); +}); diff --git a/test/zipObject/zipObject.test.js b/test/zipObject/zipObject.test.js index b0a2b4b76..d07fe81df 100644 --- a/test/zipObject/zipObject.test.js +++ b/test/zipObject/zipObject.test.js @@ -1,27 +1,33 @@ const expect = require('expect'); const zipObject = require('./zipObject.js'); - - test('zipObject is a Function', () => { +test('zipObject is a Function', () => { expect(zipObject).toBeInstanceOf(Function); }); - test('zipObject([a, b, c], [1, 2]) returns {a: 1, b: 2, c: undefined}', () => { - expect(zipObject(['a', 'b', 'c'], [1, 2]), {a: 1, b: 2, c: undefined}).toEqual() +test('zipObject([a, b, c], [1, 2]) returns {a: 1, b: 2, c: undefined}', () => { + expect(zipObject(['a', 'b', 'c'], [1, 2])).toEqual({a: 1, b: 2, c: undefined}); }); - test('zipObject([a, b], [1, 2, 3]) returns {a: 1, b: 2}', () => { - expect(zipObject(['a', 'b'], [1, 2, 3]), {a: 1, b: 2}).toEqual() +test('zipObject([a, b], [1, 2, 3]) returns {a: 1, b: 2}', () => { + expect(zipObject(['a', 'b'], [1, 2, 3])).toEqual({a: 1, b: 2}); }); - test('zipObject([a, b, c], string) returns { a: s, b: t, c: r }', () => { - expect(zipObject(['a', 'b', 'c'], 'string'), { a: 's', b: 't', c: 'r' }).toEqual() +test('zipObject([a, b, c], string) returns { a: s, b: t, c: r }', () => { + expect(zipObject(['a', 'b', 'c'], 'string')).toEqual({ a: 's', b: 't', c: 'r' }); }); - test('zipObject([a], string) returns { a: s }', () => { - expect(zipObject(['a'], 'string'), { a: 's' }).toEqual() +test('zipObject([a], string) returns { a: s }', () => { + expect(zipObject(['a'], 'string')).toEqual({ a: 's' }); +}); +test('zipObject() throws an error', () => { + expect(zipObject()).toThrow(); +}); +test('zipObject(([\'string\'], null) throws an error', () => { + expect(zipObject((['string'], null)).toThrow(); +}); +test('zipObject(null, [1]) throws an error', () => { + expect(zipObject(null, [1])).toThrow(); +}); +test('zipObject(\'string\') throws an error', () => { + expect(zipObject('string')).toThrow(); +}); +test('zipObject(\'test\', \'string\') throws an error', () => { + expect(zipObject('test', 'string')).toThrow(); }); - t.throws(() => zipObject(), 'zipObject() throws an error'); - t.throws(() => zipObject(['string'], null), 'zipObject([string], null) throws an error'); - t.throws(() => zipObject(null, [1]), 'zipObject(null, [1]) throws an error'); - t.throws(() => zipObject('string'), 'zipObject(string) throws an error'); - t.throws(() => zipObject('test', 'string'), 'zipObject(test, string) throws an error'); - - - diff --git a/test/zipWith/zipWith.test.js b/test/zipWith/zipWith.test.js index f5e60492e..3cffd0a46 100644 --- a/test/zipWith/zipWith.test.js +++ b/test/zipWith/zipWith.test.js @@ -1,8 +1,6 @@ const expect = require('expect'); const zipWith = require('./zipWith.js'); - - test('zipWith is a Function', () => { +test('zipWith is a Function', () => { expect(zipWith).toBeInstanceOf(Function); }); - From ed3b40c4f2218fd0c5eac7c50a3162fa461ea3cc Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Mon, 18 Jun 2018 19:05:29 +0300 Subject: [PATCH 15/19] Test scripting updates --- package.json | 4 ++-- scripts/tdd.js | 12 +++--------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 60601fc5f..9694e7ef6 100644 --- a/package.json +++ b/package.json @@ -33,8 +33,8 @@ "extractor": "node ./scripts/extract.js", "packager": "node ./scripts/module.js", "localizer": "node ./scripts/localize.js", - "test": "tape test/**/*.test.js | tap-spec", - "test2": "jest test/**/*.test.js" + "testold": "tape test/**/*.test.js | tap-spec", + "test": "jest test/**/*.test.js" }, "repository": { "type": "git", diff --git a/scripts/tdd.js b/scripts/tdd.js index 0ade624d5..6c60aced8 100644 --- a/scripts/tdd.js +++ b/scripts/tdd.js @@ -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'); From a3390a6588072f66c0b7d1a1cb57bce8e19f0404 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Mon, 18 Jun 2018 19:07:48 +0300 Subject: [PATCH 16/19] Fixed some issues in test files --- package-lock.json | 1357 +++++++++++ test/URLJoin/URLJoin.js | 2 +- test/cleanObj/cleanObj.js | 2 +- test/colorize/colorize.js | 2 +- test/countBy/countBy.js | 2 +- test/createEventHub/createEventHub.js | 2 +- test/flattenObject/flattenObject.js | 2 +- test/getScrollPosition/getScrollPosition.js | 2 +- test/groupBy/groupBy.js | 2 +- test/hashBrowser/hashBrowser.js | 2 +- test/httpsRedirect/httpsRedirect.js | 2 +- test/invertKeyValues/invertKeyValues.js | 2 +- test/lowercaseKeys/lowercaseKeys.js | 2 +- test/mapKeys/mapKeys.js | 2 +- test/mapValues/mapValues.js | 2 +- test/mostPerformant/mostPerformant.js | 2 +- test/objectFromPairs/objectFromPairs.js | 2 +- test/omit/omit.js | 2 +- test/omitBy/omitBy.js | 2 +- test/onUserInputChange/onUserInputChange.js | 2 +- test/parseCookie/parseCookie.js | 2 +- test/pick/pick.js | 2 +- test/pickBy/pickBy.js | 2 +- .../recordAnimationFrames.js | 2 +- test/runAsync/runAsync.js | 2 +- test/smoothScroll/smoothScroll.js | 2 +- test/solveRPN/solveRPN.js | 2 +- test/testlog | 2055 +---------------- test/unflattenObject/unflattenObject.js | 2 +- test/zip/zip.js | 2 +- test/zipObject/zipObject.js | 2 +- 31 files changed, 1390 insertions(+), 2080 deletions(-) diff --git a/package-lock.json b/package-lock.json index 710f23ce3..080b8cbe4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,6 +24,24 @@ "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", @@ -51,6 +69,41 @@ "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", @@ -189,6 +242,31 @@ "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", @@ -201,6 +279,12 @@ "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", @@ -429,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", @@ -440,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", @@ -473,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", @@ -507,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", @@ -521,6 +641,12 @@ "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", @@ -588,6 +714,101 @@ "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", @@ -868,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", @@ -877,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", @@ -887,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", @@ -935,6 +1228,37 @@ "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", @@ -1230,6 +1554,23 @@ "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", @@ -1325,12 +1666,24 @@ } } }, + "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", @@ -1363,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", @@ -1478,12 +1846,30 @@ "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", @@ -1591,6 +1977,12 @@ "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", @@ -1687,6 +2079,35 @@ "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", "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", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -1706,6 +2127,12 @@ "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", @@ -1727,6 +2154,15 @@ "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", @@ -1767,6 +2203,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", @@ -1840,12 +2285,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", @@ -2045,6 +2796,17 @@ } } }, + "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", @@ -2149,6 +2911,29 @@ "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 + } + } + }, "figures": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", @@ -2159,6 +2944,16 @@ "object-assign": "4.1.1" } }, + "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", @@ -2198,6 +2993,12 @@ } } }, + "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", @@ -2208,6 +3009,18 @@ "pinkie-promise": "2.0.1" } }, + "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": { + "circular-json": "0.3.3", + "del": "2.2.2", + "graceful-fs": "4.1.11", + "write": "0.2.1" + } + }, "for-each": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.2.tgz", @@ -2264,6 +3077,17 @@ "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", @@ -2817,6 +3641,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", @@ -2885,6 +3715,12 @@ "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", @@ -2945,6 +3781,20 @@ "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", @@ -3240,6 +4090,12 @@ "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", @@ -3287,6 +4143,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", @@ -3489,6 +4393,30 @@ } } }, + "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", @@ -3510,6 +4438,12 @@ "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", @@ -3525,6 +4459,12 @@ "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", @@ -3573,6 +4513,16 @@ "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", @@ -4312,6 +5262,12 @@ "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", @@ -4324,6 +5280,12 @@ "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", @@ -4336,6 +5298,15 @@ "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", @@ -4354,6 +5325,15 @@ "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", @@ -4410,6 +5390,18 @@ "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", @@ -4446,12 +5438,30 @@ "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", @@ -4499,6 +5509,15 @@ "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", @@ -4749,6 +5768,12 @@ "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", @@ -4798,6 +5823,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", @@ -5195,6 +6230,15 @@ "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", @@ -5357,6 +6401,12 @@ "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", @@ -5407,6 +6457,66 @@ "pinkie": "2.0.4" } }, + "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", @@ -5433,6 +6543,12 @@ "integrity": "sha1-24XGgU9eXlo7Se/CjWBP7GKXUVY=", "dev": true }, + "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": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", @@ -5522,6 +6638,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", @@ -5821,6 +6963,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", @@ -5851,6 +7011,16 @@ "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" + } + }, "resumer": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", @@ -5885,6 +7055,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", @@ -5894,6 +7074,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", @@ -5910,6 +7112,36 @@ "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", @@ -6017,6 +7249,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", @@ -6052,6 +7302,12 @@ } } }, + "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", @@ -6085,6 +7341,15 @@ "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", @@ -6317,6 +7582,18 @@ "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", @@ -6471,6 +7748,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", @@ -6483,6 +7766,20 @@ "integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY=", "dev": true }, + "table": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", + "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", + "dev": true, + "requires": { + "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" + } + }, "tap-out": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/tap-out/-/tap-out-1.4.2.tgz", @@ -6606,6 +7903,12 @@ } } }, + "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", @@ -6635,6 +7938,15 @@ "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", @@ -6771,6 +8083,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", @@ -6837,6 +8161,18 @@ } } }, + "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", @@ -6949,6 +8285,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", @@ -6992,6 +8334,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", @@ -7106,6 +8454,15 @@ "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", diff --git a/test/URLJoin/URLJoin.js b/test/URLJoin/URLJoin.js index 5280f8ac7..0125c4ffa 100644 --- a/test/URLJoin/URLJoin.js +++ b/test/URLJoin/URLJoin.js @@ -2,7 +2,7 @@ const URLJoin = (...args) => args .join('/') .replace(/[\/]+/g, '/') -.replace(/^(.+):\ +.replace(/^(.+):\//, '$1://') .replace(/^file:/, 'file:/') .replace(/\/(\?|&|#[^!])/g, '$1') .replace(/\?/g, '&') diff --git a/test/cleanObj/cleanObj.js b/test/cleanObj/cleanObj.js index 9e7573fb4..0d38b03f8 100644 --- a/test/cleanObj/cleanObj.js +++ b/test/cleanObj/cleanObj.js @@ -5,7 +5,7 @@ cleanObj(obj[key], keysToKeep, childIndicator); } else if (!keysToKeep.includes(key)) { delete obj[key]; } - +}); return obj; }; module.exports = cleanObj; \ No newline at end of file diff --git a/test/colorize/colorize.js b/test/colorize/colorize.js index 1322cc934..7c8fe1846 100644 --- a/test/colorize/colorize.js +++ b/test/colorize/colorize.js @@ -15,5 +15,5 @@ bgBlue: `\x1b[44m${args.join(' ')}\x1b[0m`, bgMagenta: `\x1b[45m${args.join(' ')}\x1b[0m`, bgCyan: `\x1b[46m${args.join(' ')}\x1b[0m`, bgWhite: `\x1b[47m${args.join(' ')}\x1b[0m` - +}); module.exports = colorize; \ No newline at end of file diff --git a/test/countBy/countBy.js b/test/countBy/countBy.js index c75f9fd51..256070afb 100644 --- a/test/countBy/countBy.js +++ b/test/countBy/countBy.js @@ -2,5 +2,5 @@ const countBy = (arr, fn) => arr.map(typeof fn === 'function' ? fn : val => val[fn]).reduce((acc, val, i) => { acc[val] = (acc[val] || 0) + 1; return acc; -}, { +}, {}); module.exports = countBy; \ No newline at end of file diff --git a/test/createEventHub/createEventHub.js b/test/createEventHub/createEventHub.js index d219a0815..949f8fbc0 100644 --- a/test/createEventHub/createEventHub.js +++ b/test/createEventHub/createEventHub.js @@ -11,5 +11,5 @@ off(event, handler) { const i = (this.hub[event] || []).findIndex(h => h === handler); if (i > -1) this.hub[event].splice(i, 1); } - +}); module.exports = createEventHub; \ No newline at end of file diff --git a/test/flattenObject/flattenObject.js b/test/flattenObject/flattenObject.js index 9607a2fb8..1a01f7f0a 100644 --- a/test/flattenObject/flattenObject.js +++ b/test/flattenObject/flattenObject.js @@ -4,5 +4,5 @@ const pre = prefix.length ? prefix + '.' : ''; if (typeof obj[k] === 'object') Object.assign(acc, flattenObject(obj[k], pre + k)); else acc[pre + k] = obj[k]; return acc; -}, { +}, {}); module.exports = flattenObject; \ No newline at end of file diff --git a/test/getScrollPosition/getScrollPosition.js b/test/getScrollPosition/getScrollPosition.js index ad622cf02..5bedcc1fe 100644 --- a/test/getScrollPosition/getScrollPosition.js +++ b/test/getScrollPosition/getScrollPosition.js @@ -1,5 +1,5 @@ const getScrollPosition = (el = window) => ({ x: el.pageXOffset !== undefined ? el.pageXOffset : el.scrollLeft, y: el.pageYOffset !== undefined ? el.pageYOffset : el.scrollTop - +}); module.exports = getScrollPosition; \ No newline at end of file diff --git a/test/groupBy/groupBy.js b/test/groupBy/groupBy.js index 2ab3ffb3d..b423945a4 100644 --- a/test/groupBy/groupBy.js +++ b/test/groupBy/groupBy.js @@ -2,5 +2,5 @@ const groupBy = (arr, fn) => arr.map(typeof fn === 'function' ? fn : val => val[fn]).reduce((acc, val, i) => { acc[val] = (acc[val] || []).concat(arr[i]); return acc; -}, { +}, {}); module.exports = groupBy; \ No newline at end of file diff --git a/test/hashBrowser/hashBrowser.js b/test/hashBrowser/hashBrowser.js index c2a79576b..d7d70d6a7 100644 --- a/test/hashBrowser/hashBrowser.js +++ b/test/hashBrowser/hashBrowser.js @@ -5,5 +5,5 @@ view = new DataView(h); for (let i = 0; i < view.byteLength; i += 4) hexes.push(('00000000' + view.getUint32(i).toString(16)).slice(-8)); return hexes.join(''); - +}); module.exports = hashBrowser; \ No newline at end of file diff --git a/test/httpsRedirect/httpsRedirect.js b/test/httpsRedirect/httpsRedirect.js index e3084f306..42473e321 100644 --- a/test/httpsRedirect/httpsRedirect.js +++ b/test/httpsRedirect/httpsRedirect.js @@ -1,4 +1,4 @@ const httpsRedirect = () => { -if (location.protocol !== 'https:') location.replace('https: +if (location.protocol !== 'https:') location.replace('https://' + location.href.split('//')[1]); }; module.exports = httpsRedirect; \ No newline at end of file diff --git a/test/invertKeyValues/invertKeyValues.js b/test/invertKeyValues/invertKeyValues.js index 7712379e2..59c52315a 100644 --- a/test/invertKeyValues/invertKeyValues.js +++ b/test/invertKeyValues/invertKeyValues.js @@ -4,5 +4,5 @@ const val = fn ? fn(obj[key]) : obj[key]; acc[val] = acc[val] || []; acc[val].push(key); return acc; -}, { +}, {}); module.exports = invertKeyValues; \ No newline at end of file diff --git a/test/lowercaseKeys/lowercaseKeys.js b/test/lowercaseKeys/lowercaseKeys.js index e78c5fba2..3c5901fe4 100644 --- a/test/lowercaseKeys/lowercaseKeys.js +++ b/test/lowercaseKeys/lowercaseKeys.js @@ -2,5 +2,5 @@ const lowercaseKeys = obj => Object.keys(obj).reduce((acc, key) => { acc[key.toLowerCase()] = obj[key]; return acc; -}, { +}, {}); module.exports = lowercaseKeys; \ No newline at end of file diff --git a/test/mapKeys/mapKeys.js b/test/mapKeys/mapKeys.js index 1600ca90e..524a636c3 100644 --- a/test/mapKeys/mapKeys.js +++ b/test/mapKeys/mapKeys.js @@ -2,5 +2,5 @@ const mapKeys = (obj, fn) => Object.keys(obj).reduce((acc, k) => { acc[fn(obj[k], k, obj)] = obj[k]; return acc; -}, { +}, {}); module.exports = mapKeys; \ No newline at end of file diff --git a/test/mapValues/mapValues.js b/test/mapValues/mapValues.js index 34955dbd4..abec7632d 100644 --- a/test/mapValues/mapValues.js +++ b/test/mapValues/mapValues.js @@ -2,5 +2,5 @@ const mapValues = (obj, fn) => Object.keys(obj).reduce((acc, k) => { acc[k] = fn(obj[k], k, obj); return acc; -}, { +}, {}); module.exports = mapValues; \ No newline at end of file diff --git a/test/mostPerformant/mostPerformant.js b/test/mostPerformant/mostPerformant.js index f1764e058..ae084a5cf 100644 --- a/test/mostPerformant/mostPerformant.js +++ b/test/mostPerformant/mostPerformant.js @@ -3,7 +3,7 @@ const times = fns.map(fn => { const before = performance.now(); for (let i = 0; i < iterations; i++) fn(); return performance.now() - before; - +}); return times.indexOf(Math.min(...times)); }; module.exports = mostPerformant; \ No newline at end of file diff --git a/test/objectFromPairs/objectFromPairs.js b/test/objectFromPairs/objectFromPairs.js index ba14b229f..fa1f3fe47 100644 --- a/test/objectFromPairs/objectFromPairs.js +++ b/test/objectFromPairs/objectFromPairs.js @@ -1,2 +1,2 @@ -const objectFromPairs = arr => arr.reduce((a, v) => ((a[v[0]] = v[1]), a), { +const objectFromPairs = arr => arr.reduce((a, v) => ((a[v[0]] = v[1]), a), {}); module.exports = objectFromPairs; \ No newline at end of file diff --git a/test/omit/omit.js b/test/omit/omit.js index d86c40009..ffdbcbd82 100644 --- a/test/omit/omit.js +++ b/test/omit/omit.js @@ -1,5 +1,5 @@ const omit = (obj, arr) => Object.keys(obj) .filter(k => !arr.includes(k)) -.reduce((acc, key) => ((acc[key] = obj[key]), acc), { +.reduce((acc, key) => ((acc[key] = obj[key]), acc), {}); module.exports = omit; \ No newline at end of file diff --git a/test/omitBy/omitBy.js b/test/omitBy/omitBy.js index ae8328ef9..5937a3d8a 100644 --- a/test/omitBy/omitBy.js +++ b/test/omitBy/omitBy.js @@ -1,5 +1,5 @@ const omitBy = (obj, fn) => Object.keys(obj) .filter(k => !fn(obj[k], k)) -.reduce((acc, key) => ((acc[key] = obj[key]), acc), { +.reduce((acc, key) => ((acc[key] = obj[key]), acc), {}); module.exports = omitBy; \ No newline at end of file diff --git a/test/onUserInputChange/onUserInputChange.js b/test/onUserInputChange/onUserInputChange.js index aea7639a8..5cb956112 100644 --- a/test/onUserInputChange/onUserInputChange.js +++ b/test/onUserInputChange/onUserInputChange.js @@ -10,6 +10,6 @@ lastTime = now; document.addEventListener('touchstart', () => { if (type === 'touch') return; (type = 'touch'), callback(type), document.addEventListener('mousemove', mousemoveHandler); - +}); }; module.exports = onUserInputChange; \ No newline at end of file diff --git a/test/parseCookie/parseCookie.js b/test/parseCookie/parseCookie.js index 4a36c778c..9e620bfe0 100644 --- a/test/parseCookie/parseCookie.js +++ b/test/parseCookie/parseCookie.js @@ -5,5 +5,5 @@ str .reduce((acc, v) => { acc[decodeURIComponent(v[0].trim())] = decodeURIComponent(v[1].trim()); return acc; -}, { +}, {}); module.exports = parseCookie; \ No newline at end of file diff --git a/test/pick/pick.js b/test/pick/pick.js index 305fc06af..28e8caac7 100644 --- a/test/pick/pick.js +++ b/test/pick/pick.js @@ -1,3 +1,3 @@ const pick = (obj, arr) => -arr.reduce((acc, curr) => (curr in obj && (acc[curr] = obj[curr]), acc), { +arr.reduce((acc, curr) => (curr in obj && (acc[curr] = obj[curr]), acc), {}); module.exports = pick; \ No newline at end of file diff --git a/test/pickBy/pickBy.js b/test/pickBy/pickBy.js index 7d10b8139..fa2f4701f 100644 --- a/test/pickBy/pickBy.js +++ b/test/pickBy/pickBy.js @@ -1,5 +1,5 @@ const pickBy = (obj, fn) => Object.keys(obj) .filter(k => fn(obj[k], k)) -.reduce((acc, key) => ((acc[key] = obj[key]), acc), { +.reduce((acc, key) => ((acc[key] = obj[key]), acc), {}); module.exports = pickBy; \ No newline at end of file diff --git a/test/recordAnimationFrames/recordAnimationFrames.js b/test/recordAnimationFrames/recordAnimationFrames.js index 4408e0d77..7e7ca9004 100644 --- a/test/recordAnimationFrames/recordAnimationFrames.js +++ b/test/recordAnimationFrames/recordAnimationFrames.js @@ -13,7 +13,7 @@ const run = () => { raf = requestAnimationFrame(() => { callback(); if (running) run(); - +}); }; if (autoStart) start(); return { start, stop }; diff --git a/test/runAsync/runAsync.js b/test/runAsync/runAsync.js index 046dc1b35..e049e49f0 100644 --- a/test/runAsync/runAsync.js +++ b/test/runAsync/runAsync.js @@ -11,6 +11,6 @@ res(data), worker.terminate(); worker.onerror = err => { rej(err), worker.terminate(); }; - +}); }; module.exports = runAsync; \ No newline at end of file diff --git a/test/smoothScroll/smoothScroll.js b/test/smoothScroll/smoothScroll.js index 925223bef..6d4ff2a1c 100644 --- a/test/smoothScroll/smoothScroll.js +++ b/test/smoothScroll/smoothScroll.js @@ -1,5 +1,5 @@ const smoothScroll = element => document.querySelector(element).scrollIntoView({ behavior: 'smooth' - +}); module.exports = smoothScroll; \ No newline at end of file diff --git a/test/solveRPN/solveRPN.js b/test/solveRPN/solveRPN.js index a144db5ab..ac84c4a3d 100644 --- a/test/solveRPN/solveRPN.js +++ b/test/solveRPN/solveRPN.js @@ -22,7 +22,7 @@ stack.push(OPERATORS[symbol](parseFloat(b), parseFloat(a))); } else { throw `${symbol} is not a recognized symbol`; } - +}); if (stack.length === 1) return stack.pop(); else throw `${rpn} is not a proper RPN. Please check it and try again`; }; diff --git a/test/testlog b/test/testlog index 790dd2119..670262308 100644 --- a/test/testlog +++ b/test/testlog @@ -1,2054 +1,7 @@ -Test log for: Sun Jun 17 2018 21:26:15 GMT+0000 (Coordinated Universal Time) - -> 30-seconds-of-code@0.0.3 test /home/travis/build/Chalarangelo/30-seconds-of-code -> tape test/**/*.test.js | tap-spec - - - Testing JSONToDate - - ✔ JSONToDate is a Function - - Testing JSONToFile - - ✔ JSONToFile is a Function - ✔ Tested on 09/02/2018 by @chalarangelo - - Testing RGBToHex - - ✔ RGBToHex is a Function - ✔ Converts the values of RGB components to a color code. - - Testing URLJoin - - ✔ URLJoin is a Function - ✔ Returns proper URL - ✔ Returns proper URL - - Testing UUIDGeneratorBrowser - - ✔ UUIDGeneratorBrowser is a Function - ✔ Tested 09/02/2018 by @chalarangelo - - Testing UUIDGeneratorNode - - ✔ UUIDGeneratorNode is a Function - ✔ Contains dashes in the proper places - ✔ Only contains hexadecimal digits - - Testing all - - ✔ all is a Function - ✔ Returns true for arrays with no falsey values - ✔ Returns false for arrays with 0 - ✔ Returns false for arrays with NaN - ✔ Returns false for arrays with undefined - ✔ Returns false for arrays with null - ✔ Returns false for arrays with empty strings - ✔ Returns true with predicate function - ✔ Returns false with a predicate function - - Testing any - - ✔ any is a Function - ✔ Returns true for arrays with at least one truthy value - ✔ Returns false for arrays with no truthy values - ✔ Returns false for arrays with no truthy values - ✔ Returns true with predicate function - ✔ Returns false with a predicate function - - Testing approximatelyEqual - - ✔ approximatelyEqual is a Function - ✔ Works for PI / 2 - ✔ Works for 0.1 + 0.2 === 0.3 - ✔ Works for exactly equal values - ✔ Works for a custom epsilon - - Testing arrayToHtmlList - - ✔ arrayToHtmlList is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing ary - - ✔ ary is a Function - ✔ Discards arguments with index >=n - - Testing atob - - ✔ atob is a Function - ✔ atob("Zm9vYmFy") equals "foobar" - ✔ atob("Z") returns "" - - Testing attempt - - ✔ attempt is a Function - ✔ Returns a value - ✔ Returns an error - - Testing average - - ✔ average is a Function - ✔ average(true) returns 0 - ✔ average(false) returns 1 - ✔ average(9, 1) returns 5 - ✔ average(153, 44, 55, 64, 71, 1122, 322774, 2232, 23423, 234, 3631) returns 32163.909090909092 - ✔ average(1, 2, 3) returns 2 - ✔ average(null) returns 0 - ✔ average(1, 2, 3) returns NaN - ✔ average(String) returns NaN - ✔ average({ a: 123}) returns NaN - ✔ average([undefined, 0, string]) returns NaN - ✔ average([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run - - Testing averageBy - - ✔ averageBy is a Function - ✔ Produces the right result with a function - ✔ Produces the right result with a property name - - Testing bifurcate - - ✔ bifurcate is a Function - ✔ Splits the collection into two groups - - Testing bifurcateBy - - ✔ bifurcateBy is a Function - ✔ Splits the collection into two groups - - Testing binarySearch - - ✔ binarySearch is a Function - ✔ Finds item in array - ✔ Returns -1 when not found - ✔ Works with empty arrays - ✔ Works for one element arrays - - Testing bind - - ✔ bind is a Function - ✔ Binds to an object context - - Testing bindAll - - ✔ bindAll is a Function - ✔ Binds to an object context - - Testing bindKey - - ✔ bindKey is a Function - ✔ Binds function to an object context - - Testing binomialCoefficient - - ✔ binomialCoefficient is a Function - ✔ Returns the appropriate value - ✔ Returns the appropriate value - ✔ Returns the appropriate value - ✔ Returns NaN - ✔ Returns NaN - - Testing bottomVisible - - ✔ bottomVisible is a Function - ✔ Tested on 09/02/2018 by @chalarangelo - - Testing btoa - - ✔ btoa is a Function - ✔ btoa("foobar") equals "Zm9vYmFy" - - Testing byteSize - - ✔ byteSize is a Function - ✔ Works for a single letter - ✔ Works for a common string - ✔ Works for emoji - - Testing call - - ✔ call is a Function - ✔ Calls function on given object - - Testing capitalize - - ✔ capitalize is a Function - ✔ Capitalizes the first letter of a string - ✔ Capitalizes the first letter of a string - ✔ Works with characters - ✔ Works with single character words - - Testing capitalizeEveryWord - - ✔ capitalizeEveryWord is a Function - ✔ Capitalizes the first letter of every word in a string - ✔ Works with characters - ✔ Works with one word string - - Testing castArray - - ✔ castArray is a Function - ✔ Works for single values - ✔ Works for arrays with one value - ✔ Works for arrays with multiple value - ✔ Works for strings - ✔ Works for objects - - Testing chainAsync - - ✔ chainAsync is a Function - ✔ Calls all functions in an array - - Testing chunk - - ✔ chunk is a Function - ✔ chunk([1, 2, 3, 4, 5], 2) returns [[1,2],[3,4],[5]] - ✔ chunk([]) returns [] - ✔ chunk(123) returns [] - ✔ chunk({ a: 123}) returns [] - ✔ chunk(string, 2) returns [ st, ri, ng ] - ✔ chunk() throws an error - ✔ chunk(undefined) throws an error - ✔ chunk(null) throws an error - ✔ chunk(This is a string, 2) takes less than 2s to run - - Testing clampNumber - - ✔ clampNumber is a Function - ✔ Clamps num within the inclusive range specified by the boundary values a and b - - Testing cleanObj - - ✔ cleanObj is a Function - ✔ Removes any properties except the ones specified from a JSON object - - Testing cloneRegExp - - ✔ cloneRegExp is a Function - ✔ Clones regular expressions properly - - Testing coalesce - - ✔ coalesce is a Function - ✔ Returns the first non-null/undefined argument - - Testing coalesceFactory - - ✔ coalesceFactory is a Function - ✔ Returns a customized coalesce function - - Testing collatz - - ✔ collatz is a Function - ✔ When n is even, divide by 2 - ✔ When n is odd, times by 3 and add 1 - ✔ Eventually reaches 1 - - Testing collectInto - - ✔ collectInto is a Function - - Testing colorize - - ✔ colorize is a Function - ✔ Tested on 09/02/2018 by @chalarangelo - - Testing compact - - ✔ compact is a Function - ✔ Removes falsey values from an array - - Testing compose - - ✔ compose is a Function - ✔ Performs right-to-left function composition - - Testing composeRight - - ✔ composeRight is a Function - ✔ Performs left-to-right function composition - - Testing converge - - ✔ converge is a Function - ✔ Produces the average of the array - ✔ Produces the strange concatenation - - Testing copyToClipboard - - ✔ copyToClipboard is a Function - ✔ Tested on 09/02/2018 by @chalarangelo - - Testing countBy - - ✔ countBy is a Function - ✔ Works for functions - ✔ Works for property names - - Testing countOccurrences - - ✔ countOccurrences is a Function - ✔ Counts the occurrences of a value in an array - - Testing countVowels - - ✔ countVowels is a Function - - Testing counter - - ✔ counter is a Function - - Testing createElement - - ✔ createElement is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing createEventHub - - ✔ createEventHub is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing currentURL - - ✔ currentURL is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing curry - - ✔ curry is a Function - ✔ curries a Math.pow - ✔ curries a Math.min - - Testing debounce - - ✔ debounce is a Function - - Testing decapitalize - - ✔ decapitalize is a Function - ✔ Works with default parameter - ✔ Works with second parameter set to true - - Testing deepClone - - ✔ deepClone is a Function - ✔ Shallow cloning works - ✔ Deep cloning works - ✔ Array shallow cloning works - ✔ Array deep cloning works - - Testing deepFlatten - - ✔ deepFlatten is a Function - ✔ Deep flattens an array - - Testing defaults - - ✔ defaults is a Function - ✔ Assigns default values for undefined properties - - Testing defer - - ✔ defer is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing degreesToRads - - ✔ degreesToRads is a Function - ✔ Returns the appropriate value - - Testing delay - - ✔ delay is a Function - - Testing detectDeviceType - - ✔ detectDeviceType is a Function - ✔ Tested on 09/02/2018 by @chalarangelo - - Testing difference - - ✔ difference is a Function - ✔ Returns the difference between two arrays - - Testing differenceBy - - ✔ differenceBy is a Function - ✔ Works using a native function and numbers - ✔ Works with arrow function and objects - - Testing differenceWith - - ✔ differenceWith is a Function - ✔ Filters out all values from an array - - Testing digitize - - ✔ digitize is a Function - ✔ Converts a number to an array of digits - - Testing distance - - ✔ distance is a Function - ✔ Calculates the distance between two points - - Testing drop - - ✔ drop is a Function - ✔ Works without the last argument - ✔ Removes appropriate element count as specified - ✔ Empties array given a count greater than length - - Testing dropRight - - ✔ dropRight is a Function - ✔ Returns a new array with n elements removed from the right - ✔ Returns a new array with n elements removed from the right - ✔ Returns a new array with n elements removed from the right - - Testing dropRightWhile - - ✔ dropRightWhile is a Function - ✔ Removes elements from the end of an array until the passed function returns true. - - Testing dropWhile - - ✔ dropWhile is a Function - ✔ Removes elements in an array until the passed function returns true. - - Testing elementIsVisibleInViewport - - ✔ elementIsVisibleInViewport is a Function - ✔ Tested on 09/02/2018 by @chalarangelo - - Testing elo - - ✔ elo is a Function - ✔ Standard 1v1s - ✔ should be equivalent - ✔ 4 player FFA, all same rank - - Testing equals - - ✔ equals is a Function - ✔ { a: [2, {e: 3}], b: [4], c: 'foo' } is equal to { a: [2, {e: 3}], b: [4], c: 'foo' } - ✔ [1,2,3] is equal to [1,2,3] - ✔ { a: [2, 3], b: [4] } is not equal to { a: [2, 3], b: [6] } - ✔ [1,2,3] is not equal to [1,2,4] - ✔ [1, 2, 3] should be equal to { 0: 1, 1: 2, 2: 3 }) - type is different, but their enumerable properties match. - - Testing escapeHTML - - ✔ escapeHTML is a Function - ✔ Escapes a string for use in HTML - - Testing escapeRegExp - - ✔ escapeRegExp is a Function - ✔ Escapes a string to use in a regular expression - - Testing everyNth - - ✔ everyNth is a Function - ✔ Returns every nth element in an array - - Testing extendHex - - ✔ extendHex is a Function - ✔ Extends a 3-digit color code to a 6-digit color code - ✔ Extends a 3-digit color code to a 6-digit color code - - Testing factorial - - ✔ factorial is a Function - ✔ Calculates the factorial of 720 - ✔ Calculates the factorial of 0 - ✔ Calculates the factorial of 1 - ✔ Calculates the factorial of 4 - ✔ Calculates the factorial of 10 - - Testing factors - - ✔ factors is a Function - - Testing fibonacci - - ✔ fibonacci is a Function - ✔ Generates an array, containing the Fibonacci sequence - - Testing fibonacciCountUntilNum - - ✔ fibonacciCountUntilNum is a Function - - Testing fibonacciUntilNum - - ✔ fibonacciUntilNum is a Function - - Testing filterNonUnique - - ✔ filterNonUnique is a Function - ✔ Filters out the non-unique values in an array - - Testing findKey - - ✔ findKey is a Function - ✔ Returns the appropriate key - - Testing findLast - - ✔ findLast is a Function - ✔ Finds last element for which the given function returns true - - Testing findLastIndex - - ✔ findLastIndex is a Function - ✔ Finds last index for which the given function returns true - - Testing findLastKey - - ✔ findLastKey is a Function - ✔ Returns the appropriate key - - Testing flatten - - ✔ flatten is a Function - ✔ Flattens an array - ✔ Flattens an array - - Testing flattenObject - - ✔ flattenObject is a Function - ✔ Flattens an object with the paths for keys - ✔ Works with arrays - - Testing flip - - ✔ flip is a Function - ✔ Flips argument order - - Testing forEachRight - - ✔ forEachRight is a Function - ✔ Iterates over the array in reverse - - Testing forOwn - - ✔ forOwn is a Function - ✔ Iterates over an element's key-value pairs - - Testing forOwnRight - - ✔ forOwnRight is a Function - ✔ Iterates over an element's key-value pairs in reverse - - Testing formatDuration - - ✔ formatDuration is a Function - ✔ Returns the human readable format of the given number of milliseconds - ✔ Returns the human readable format of the given number of milliseconds - - Testing fromCamelCase - - ✔ fromCamelCase is a Function - ✔ Converts a string from camelcase - ✔ Converts a string from camelcase - ✔ Converts a string from camelcase - - Testing functionName - - ✔ functionName is a Function - ✔ Works for native functions - ✔ Works for functions - ✔ Works for arrow functions - - Testing functions - - ✔ functions is a Function - ✔ Returns own methods - ✔ Returns own and inherited methods - - Testing gcd - - ✔ gcd is a Function - ✔ Calculates the greatest common divisor between two or more numbers/arrays - ✔ Calculates the greatest common divisor between two or more numbers/arrays - - Testing geometricProgression - - ✔ geometricProgression is a Function - ✔ Initializes an array containing the numbers in the specified range - ✔ Initializes an array containing the numbers in the specified range - ✔ Initializes an array containing the numbers in the specified range - - Testing get - - ✔ get is a Function - ✔ Retrieve a property indicated by the selector from an object. - - Testing getColonTimeFromDate - - ✔ getColonTimeFromDate is a Function - - Testing getDaysDiffBetweenDates - - ✔ getDaysDiffBetweenDates is a Function - ✔ Returns the difference in days between two dates - - Testing getMeridiemSuffixOfInteger - - ✔ getMeridiemSuffixOfInteger is a Function - - Testing getScrollPosition - - ✔ getScrollPosition is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing getStyle - - ✔ getStyle is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing getType - - ✔ getType is a Function - ✔ Returns the native type of a value - - Testing getURLParameters - - ✔ getURLParameters is a Function - ✔ Returns an object containing the parameters of the current URL - - Testing groupBy - - ✔ groupBy is a Function - ✔ Groups the elements of an array based on the given function - ✔ Groups the elements of an array based on the given function - - Testing hammingDistance - - ✔ hammingDistance is a Function - ✔ retuns hamming disance between 2 values - - Testing hasClass - - ✔ hasClass is a Function - - Testing hasFlags - - ✔ hasFlags is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing hashBrowser - - ✔ hashBrowser is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing hashNode - - ✔ hashNode is a Function - - Testing head - - ✔ head is a Function - ✔ head({ a: 1234}) returns undefined - ✔ head([1, 2, 3]) returns 1 - ✔ head({ 0: false}) returns false - ✔ head(String) returns S - ✔ head(null) throws an Error - ✔ head(undefined) throws an Error - ✔ head() throws an Error - ✔ head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run - - Testing hexToRGB - - ✔ hexToRGB is a Function - ✔ Converts a color code to a rgb() or rgba() string - ✔ Converts a color code to a rgb() or rgba() string - ✔ Converts a color code to a rgb() or rgba() string - - Testing hide - - ✔ hide is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing howManyTimes - - ✔ howManyTimes is a Function - - Testing httpDelete - - ✔ httpDelete is a Function - - Testing httpGet - - ✔ httpGet is a Function - - Testing httpPost - - ✔ httpPost is a Function - - Testing httpPut - - ✔ httpPut is a Function - - Testing httpsRedirect - - ✔ httpsRedirect is a Function - ✔ Tested on 09/02/2018 by @chalarangelo - - Testing hz - - ✔ hz is a Function - - Testing inRange - - ✔ inRange is a Function - ✔ The given number falls within the given range - ✔ The given number falls within the given range - ✔ The given number does not falls within the given range - ✔ The given number does not falls within the given range - - Testing indexOfAll - - ✔ indexOfAll is a Function - ✔ Returns all indices of val in an array - ✔ Returns all indices of val in an array - - Testing initial - - ✔ initial is a Function - ✔ Returns all the elements of an array except the last one - - Testing initialize2DArray - - ✔ initialize2DArray is a Function - ✔ Initializes a 2D array of given width and height and value - - Testing initializeArrayWithRange - - ✔ initializeArrayWithRange is a Function - ✔ Initializes an array containing the numbers in the specified range - - Testing initializeArrayWithRangeRight - - ✔ initializeArrayWithRangeRight is a Function - - Testing initializeArrayWithValues - - ✔ initializeArrayWithValues is a Function - ✔ Initializes and fills an array with the specified values - - Testing initializeNDArray - - ✔ initializeNDArray is a Function - - Testing intersection - - ✔ intersection is a Function - ✔ Returns a list of elements that exist in both arrays - - Testing intersectionBy - - ✔ intersectionBy is a Function - ✔ Returns a list of elements that exist in both arrays, after applying the provided function to each array element of both - - Testing intersectionWith - - ✔ intersectionWith is a Function - ✔ Returns a list of elements that exist in both arrays, using a provided comparator function - - Testing invertKeyValues - - ✔ invertKeyValues is a Function - ✔ invertKeyValues({ a: 1, b: 2, c: 1 }) returns { 1: [ 'a', 'c' ], 2: [ 'b' ] } - ✔ invertKeyValues({ a: 1, b: 2, c: 1 }, value => 'group' + value) returns { group1: [ 'a', 'c' ], group2: [ 'b' ] } - - Testing is - - ✔ is is a Function - ✔ Works for arrays with data - ✔ Works for empty arrays - ✔ Works for arrays, not objects - ✔ Works for objects - ✔ Works for maps - ✔ Works for regular expressions - ✔ Works for sets - ✔ Works for weak maps - ✔ Works for weak sets - ✔ Works for strings - returns true for primitive - ✔ Works for strings - returns true when using constructor - ✔ Works for numbers - returns true for primitive - ✔ Works for numbers - returns true when using constructor - ✔ Works for booleans - returns true for primitive - ✔ Works for booleans - returns true when using constructor - ✔ Works for functions - - Testing isAbsoluteURL - - ✔ isAbsoluteURL is a Function - ✔ Given string is an absolute URL - ✔ Given string is an absolute URL - ✔ Given string is not an absolute URL - - Testing isAnagram - - ✔ isAnagram is a Function - ✔ Checks valid anagram - ✔ Works with spaces - ✔ Ignores case - ✔ Ignores special characters - - Testing isArmstrongNumber - - ✔ isArmstrongNumber is a Function - - Testing isArray - - ✔ isArray is a Function - ✔ passed value is an array - ✔ passed value is not an array - - Testing isArrayBuffer - - ✔ isArrayBuffer is a Function - - Testing isArrayLike - - ✔ isArrayLike is a Function - ✔ Returns true for a string - ✔ Returns true for an array - ✔ Returns false for null - - Testing isBoolean - - ✔ isBoolean is a Function - ✔ passed value is not a boolean - ✔ passed value is not a boolean - - Testing isBrowser - - ✔ isBrowser is a Function - - Testing isBrowserTabFocused - - ✔ isBrowserTabFocused is a Function - - Testing isDivisible - - ✔ isDivisible is a Function - ✔ The number 6 is divisible by 3 - - Testing isEmpty - - ✔ isEmpty is a Function - ✔ Returns true for empty Map - ✔ Returns true for empty Set - ✔ Returns true for empty array - ✔ Returns true for empty object - ✔ Returns true for empty string - ✔ Returns false for non-empty array - ✔ Returns false for non-empty object - ✔ Returns false for non-empty string - ✔ Returns true - type is not considered a collection - ✔ Returns true - type is not considered a collection - - Testing isEven - - ✔ isEven is a Function - ✔ 4 is even number - ✔ undefined - - Testing isFunction - - ✔ isFunction is a Function - ✔ passed value is a function - ✔ passed value is not a function - - Testing isLowerCase - - ✔ isLowerCase is a Function - ✔ passed string is a lowercase - ✔ passed string is a lowercase - ✔ passed value is not a lowercase - - Testing isMap - - ✔ isMap is a Function - - Testing isNil - - ✔ isNil is a Function - ✔ Returns true for null - ✔ Returns true for undefined - ✔ Returns false for an empty string - - Testing isNull - - ✔ isNull is a Function - ✔ passed argument is a null - ✔ passed argument is a null - - Testing isNumber - - ✔ isNumber is a Function - ✔ passed argument is a number - ✔ passed argument is not a number - - Testing isObject - - ✔ isObject is a Function - ✔ isObject([1, 2, 3, 4]) is a object - ✔ isObject([]) is a object - ✔ isObject({ a:1 }) is a object - ✔ isObject(true) is not a object - - Testing isObjectLike - - ✔ isObjectLike is a Function - ✔ Returns true for an object - ✔ Returns true for an array - ✔ Returns false for a function - ✔ Returns false for null - - Testing isPlainObject - - ✔ isPlainObject is a Function - ✔ Returns true for a plain object - ✔ Returns false for a Map (example of non-plain object) - - Testing isPrime - - ✔ isPrime is a Function - ✔ passed number is a prime - - Testing isPrimitive - - ✔ isPrimitive is a Function - ✔ isPrimitive(null) is primitive - ✔ isPrimitive(undefined) is primitive - ✔ isPrimitive(string) is primitive - ✔ isPrimitive(true) is primitive - ✔ isPrimitive(50) is primitive - ✔ isPrimitive('Hello') is primitive - ✔ isPrimitive(false) is primitive - ✔ isPrimitive(Symbol()) is primitive - ✔ isPrimitive([1, 2, 3]) is not primitive - ✔ isPrimitive({ a: 123 }) is not primitive - ✔ isPrimitive({ a: 123 }) takes less than 2s to run - - Testing isPromiseLike - - ✔ isPromiseLike is a Function - ✔ Returns true for a promise-like object - ✔ Returns false for null - ✔ Returns false for an empty object - - Testing isRegExp - - ✔ isRegExp is a Function - - Testing isSet - - ✔ isSet is a Function - - Testing isSimilar - - ✔ isSimilar is a Function - - Testing isSorted - - ✔ isSorted is a Function - ✔ Array is sorted in ascending order - ✔ Array is sorted in ascending order - ✔ Array is sorted in ascending order - ✔ Array is sorted in ascending order - ✔ Array is sorted in descending order - ✔ Array is sorted in descending order - ✔ Array is sorted in descending order - ✔ Array is sorted in descending order - ✔ Array is empty - ✔ Array is not sorted, direction changed in array - ✔ Array is not sorted, direction changed in array - - Testing isString - - ✔ isString is a Function - ✔ foo is a string - ✔ "10" is a string - ✔ Empty string is a string - ✔ 10 is not a string - ✔ true is not string - - Testing isSymbol - - ✔ isSymbol is a Function - ✔ Checks if the given argument is a symbol - - Testing isTravisCI - - ✔ isTravisCI is a Function - ✔ Running on Travis, correctly evaluates - - Testing isTypedArray - - ✔ isTypedArray is a Function - - Testing isUndefined - - ✔ isUndefined is a Function - ✔ Returns true for undefined - - Testing isUpperCase - - ✔ isUpperCase is a Function - ✔ ABC is all upper case - ✔ abc is not all upper case - ✔ A3@$ is all uppercase - - Testing isValidJSON - - ✔ isValidJSON is a Function - ✔ {"name":"Adam","age":20} is a valid JSON - ✔ {"name":"Adam",age:"20"} is not a valid JSON - ✔ null is a valid JSON - - Testing isWeakMap - - ✔ isWeakMap is a Function - - Testing isWeakSet - - ✔ isWeakSet is a Function - - Testing join - - ✔ join is a Function - ✔ Joins all elements of an array into a string and returns this string - ✔ Joins all elements of an array into a string and returns this string - ✔ Joins all elements of an array into a string and returns this string - - Testing last - - ✔ last is a Function - ✔ last({ a: 1234}) returns undefined - ✔ last([1, 2, 3]) returns 3 - ✔ last({ 0: false}) returns undefined - ✔ last(String) returns g - ✔ last(null) throws an Error - ✔ last(undefined) throws an Error - ✔ last() throws an Error - ✔ last([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run - - Testing lcm - - ✔ lcm is a Function - ✔ Returns the least common multiple of two or more numbers. - ✔ Returns the least common multiple of two or more numbers. - - Testing levenshteinDistance - - ✔ levenshteinDistance is a Function - - Testing longestItem - - ✔ longestItem is a Function - ✔ Returns the longest object - - Testing lowercaseKeys - - ✔ lowercaseKeys is a Function - ✔ Lowercases object keys - ✔ Does not mutate original object - - Testing luhnCheck - - ✔ luhnCheck is a Function - ✔ validates identification number - ✔ validates identification number - ✔ validates identification number - - Testing mapKeys - - ✔ mapKeys is a Function - ✔ Maps keys - - Testing mapObject - - ✔ mapObject is a Function - ✔ mapObject([1, 2, 3], a => a * a) returns { 1: 1, 2: 4, 3: 9 } - ✔ mapObject([1, 2, 3, 4], (a, b) => b - a) returns { 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 } - - Testing mapValues - - ✔ mapValues is a Function - ✔ Maps values - - Testing mask - - ✔ mask is a Function - ✔ Replaces all but the last num of characters with the specified mask character - ✔ Replaces all but the last num of characters with the specified mask character - ✔ Replaces all but the last num of characters with the specified mask character - - Testing matches - - ✔ matches is a Function - ✔ Matches returns true for two similar objects - ✔ Matches returns false for two non-similar objects - - Testing matchesWith - - ✔ matchesWith is a Function - ✔ Returns true for two objects with similar values, based on the provided function - - Testing maxBy - - ✔ maxBy is a Function - ✔ Produces the right result with a function - ✔ Produces the right result with a property name - - Testing maxN - - ✔ maxN is a Function - ✔ Returns the n maximum elements from the provided array - ✔ Returns the n maximum elements from the provided array - - Testing median - - ✔ median is a Function - ✔ Returns the median of an array of numbers - ✔ Returns the median of an array of numbers - - Testing memoize - - ✔ memoize is a Function - ✔ Function works properly - ✔ Function works properly - ✔ Cache stores values - - Testing merge - - ✔ merge is a Function - ✔ Merges two objects - - Testing minBy - - ✔ minBy is a Function - ✔ Produces the right result with a function - ✔ Produces the right result with a property name - - Testing minN - - ✔ minN is a Function - ✔ Returns the n minimum elements from the provided array - ✔ Returns the n minimum elements from the provided array - - Testing mostPerformant - - ✔ mostPerformant is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing negate - - ✔ negate is a Function - ✔ Negates a predicate function - - Testing nest - - ✔ nest is a Function - - Testing nodeListToArray - - ✔ nodeListToArray is a Function - - Testing none - - ✔ none is a Function - ✔ Returns true for arrays with no truthy values - ✔ Returns false for arrays with at least one truthy value - ✔ Returns true with a predicate function - ✔ Returns false with predicate function - - Testing nthArg - - ✔ nthArg is a Function - ✔ Returns the nth argument - ✔ Returns undefined if arguments too few - ✔ Works for negative values - - Testing nthElement - - ✔ nthElement is a Function - ✔ Returns the nth element of an array. - ✔ Returns the nth element of an array. - - Testing objectFromPairs - - ✔ objectFromPairs is a Function - ✔ Creates an object from the given key-value pairs. - - Testing objectToPairs - - ✔ objectToPairs is a Function - ✔ Creates an array of key-value pair arrays from an object. - - Testing observeMutations - - ✔ observeMutations is a Function - ✔ Tested on 09/02/2018 by @chalarangelo - - Testing off - - ✔ off is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing offset - - ✔ offset is a Function - ✔ Offset of 0 returns the same array. - ✔ Offset > 0 returns the offsetted array. - ✔ Offset < 0 returns the reverse offsetted array. - ✔ Offset greater than the length of the array returns the same array. - ✔ Offset less than the negative length of the array returns the same array. - ✔ Offsetting empty array returns an empty array. - - Testing omit - - ✔ omit is a Function - ✔ Omits the key-value pairs corresponding to the given keys from an object - - Testing omitBy - - ✔ omitBy is a Function - ✔ Creates an object composed of the properties the given function returns falsey for - - Testing on - - ✔ on is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing onUserInputChange - - ✔ onUserInputChange is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing once - - ✔ once is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing orderBy - - ✔ orderBy is a Function - ✔ Returns a sorted array of objects ordered by properties and orders. - ✔ Returns a sorted array of objects ordered by properties and orders. - - Testing over - - ✔ over is a Function - ✔ Applies given functions over multiple arguments - - Testing overArgs - - ✔ overArgs is a Function - ✔ Invokes the provided function with its arguments transformed - - Testing pad - - ✔ pad is a Function - ✔ cat is padded on both sides - ✔ length of string is 8 - ✔ pads 42 with "0" - ✔ does not truncates if string exceeds length - - Testing palindrome - - ✔ palindrome is a Function - ✔ Given string is a palindrome - ✔ Given string is not a palindrome - - Testing parseCookie - - ✔ parseCookie is a Function - ✔ Parses the cookie - - Testing partial - - ✔ partial is a Function - ✔ Prepends arguments - - Testing partialRight - - ✔ partialRight is a Function - ✔ Appends arguments - - Testing partition - - ✔ partition is a Function - ✔ Groups the elements into two arrays, depending on the provided function's truthiness for each element. - - Testing percentile - - ✔ percentile is a Function - ✔ Uses the percentile formula to calculate how many numbers in the given array are less or equal to the given value. - - Testing permutations - - ✔ permutations is a Function - ✔ Generates all permutations of an array - - Testing pick - - ✔ pick is a Function - ✔ Picks the key-value pairs corresponding to the given keys from an object. - - Testing pickBy - - ✔ pickBy is a Function - ✔ Creates an object composed of the properties the given function returns truthy for. - - Testing pipeAsyncFunctions - - ✔ pipeAsyncFunctions is a Function - ✔ Produces the appropriate hash - ✔ pipeAsyncFunctions result should be 15 - - Testing pipeFunctions - - ✔ pipeFunctions is a Function - ✔ Performs left-to-right function composition - - Testing pluralize - - ✔ pluralize is a Function - ✔ Produces the plural of the word - ✔ Produces the singular of the word - ✔ Produces the plural of the word - ✔ Prodices the defined plural of the word - ✔ Works with a dictionary - - Testing powerset - - ✔ powerset is a Function - ✔ Returns the powerset of a given array of numbers. - - Testing prefix - - ✔ prefix is a Function - - Testing prettyBytes - - ✔ prettyBytes is a Function - ✔ Converts a number in bytes to a human-readable string. - ✔ Converts a number in bytes to a human-readable string. - ✔ Converts a number in bytes to a human-readable string. - - Testing primes - - ✔ primes is a Function - ✔ Generates primes up to a given number, using the Sieve of Eratosthenes. - - Testing promisify - - ✔ promisify is a Function - ✔ Returns a promise - - Testing pull - - ✔ pull is a Function - ✔ Pulls the specified values - - Testing pullAtIndex - - ✔ pullAtIndex is a Function - ✔ Pulls the given values - ✔ Pulls the given values - - Testing pullAtValue - - ✔ pullAtValue is a Function - ✔ Pulls the specified values - ✔ Pulls the specified values - - Testing pullBy - - ✔ pullBy is a Function - ✔ Pulls the specified values - - Testing quickSort - - ✔ quickSort is a Function - ✔ quickSort([5, 6, 4, 3, 1, 2]) returns [1, 2, 3, 4, 5, 6] - ✔ quickSort([-1, 0, -2]) returns [-2, -1, 0] - ✔ quickSort() throws an error - ✔ quickSort(123) throws an error - ✔ quickSort({ 234: string}) throws an error - ✔ quickSort(null) throws an error - ✔ quickSort(undefined) throws an error - ✔ quickSort([11, 1, 324, 23232, -1, 53, 2, 524, 32, 13, 156, 133, 62, 12, 4]) takes less than 2s to run - - Testing radsToDegrees - - ✔ radsToDegrees is a Function - ✔ Returns the appropriate value - - Testing randomHexColorCode - - ✔ randomHexColorCode is a Function - ✔ should be equal - ✔ The color code starts with "#" - ✔ The color code contains only valid hex-digits - - Testing randomIntArrayInRange - - ✔ randomIntArrayInRange is a Function - ✔ The returned array contains only integers - ✔ The returned array has the proper length - ✔ The returned array's values lie between provided lowerLimit and upperLimit (both inclusive). - - Testing randomIntegerInRange - - ✔ randomIntegerInRange is a Function - ✔ The returned value is an integer - ✔ The returned value lies between provided lowerLimit and upperLimit (both inclusive). - - Testing randomNumberInRange - - ✔ randomNumberInRange is a Function - ✔ The returned value is a number - ✔ The returned value lies between provided lowerLimit and upperLimit (both inclusive). - - Testing readFileLines - - ✔ readFileLines is a Function - ✔ Tested on 09/02/2018 by @chalarangelo - - Testing rearg - - ✔ rearg is a Function - ✔ Reorders arguments in invoked function - - Testing recordAnimationFrames - - ✔ recordAnimationFrames is a Function - - Testing redirect - - ✔ redirect is a Function - ✔ Tested on 09/02/2018 by @chalarangelo - - Testing reduceSuccessive - - ✔ reduceSuccessive is a Function - ✔ Returns the array of successively reduced values - - Testing reduceWhich - - ✔ reduceWhich is a Function - ✔ Returns the minimum of an array - ✔ Returns the maximum of an array - ✔ Returns the object with the minimum specified value in an array - - Testing reducedFilter - - ✔ reducedFilter is a Function - ✔ Filter an array of objects based on a condition while also filtering out unspecified keys. - - Testing reject - - ✔ reject is a Function - ✔ should be equivalent - ✔ should be equivalent - - Testing remove - - ✔ remove is a Function - ✔ Removes elements from an array for which the given function returns false - - Testing removeNonASCII - - ✔ removeNonASCII is a Function - ✔ Removes non-ASCII characters - - Testing removeVowels - - ✔ removeVowels is a Function - - Testing renameKeys - - ✔ renameKeys is a Function - ✔ should be equivalent - - Testing reverseString - - ✔ reverseString is a Function - ✔ Reverses a string. - - Testing round - - ✔ round is a Function - ✔ round(1.005, 2) returns 1.01 - ✔ round(123.3423345345345345344, 11) returns 123.34233453453 - ✔ round(3.342, 11) returns 3.342 - ✔ round(1.005) returns 1 - ✔ round([1.005, 2]) returns NaN - ✔ round(string) returns NaN - ✔ round() returns NaN - ✔ round(132, 413, 4134) returns NaN - ✔ round({a: 132}, 413) returns NaN - ✔ round(123.3423345345345345344, 11) takes less than 2s to run - - Testing runAsync - - ✔ runAsync is a Function - ✔ Tested on 09/02/2018 by @chalarangelo - - Testing runPromisesInSeries - - ✔ runPromisesInSeries is a Function - - Testing sample - - ✔ sample is a Function - ✔ Returns a random element from the array - ✔ Works for single-element arrays - ✔ Returns undefined for empty array - - Testing sampleSize - - ✔ sampleSize is a Function - ✔ Returns a single element without n specified - ✔ Returns a random sample of specified size from an array - ✔ Returns all elements in an array if n >= length - ✔ Returns an empty array if original array is empty - ✔ Returns an empty array if n = 0 - - Testing scrollToTop - - ✔ scrollToTop is a Function - ✔ Tested on 09/02/2018 by @chalarangelo - - Testing sdbm - - ✔ sdbm is a Function - ✔ Hashes the input string into a whole number. - - Testing serializeCookie - - ✔ serializeCookie is a Function - ✔ Serializes the cookie - - Testing setStyle - - ✔ setStyle is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing shallowClone - - ✔ shallowClone is a Function - ✔ Shallow cloning works - ✔ Does not clone deeply - - Testing show - - ✔ show is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing shuffle - - ✔ shuffle is a Function - ✔ Shuffles the array - ✔ New array contains all original elements - ✔ Works for empty arrays - ✔ Works for single-element arrays - - Testing similarity - - ✔ similarity is a Function - ✔ Returns an array of elements that appear in both arrays. - - Testing size - - ✔ size is a Function - ✔ Get size of arrays, objects or strings. - ✔ Get size of arrays, objects or strings. - - Testing sleep - - ✔ sleep is a Function - - Testing smoothScroll - - ✔ smoothScroll is a Function - - Testing solveRPN - - ✔ solveRPN is a Function - - Testing sortCharactersInString - - ✔ sortCharactersInString is a Function - ✔ Alphabetically sorts the characters in a string. - - Testing sortedIndex - - ✔ sortedIndex is a Function - ✔ Returns the lowest index at which value should be inserted into array in order to maintain its sort order. - ✔ Returns the lowest index at which value should be inserted into array in order to maintain its sort order. - - Testing sortedIndexBy - - ✔ sortedIndexBy is a Function - ✔ Returns the lowest index to insert the element without messing up the list order - - Testing sortedLastIndex - - ✔ sortedLastIndex is a Function - ✔ Returns the highest index to insert the element without messing up the list order - - Testing sortedLastIndexBy - - ✔ sortedLastIndexBy is a Function - ✔ Returns the highest index to insert the element without messing up the list order - - Testing speechSynthesis - - ✔ speechSynthesis is a Function - - Testing splitLines - - ✔ splitLines is a Function - ✔ Splits a multiline string into an array of lines. - - Testing spreadOver - - ✔ spreadOver is a Function - ✔ Takes a variadic function and returns a closure that accepts an array of arguments to map to the inputs of the function. - - Testing stableSort - - ✔ stableSort is a Function - ✔ Array is properly sorted - - Testing standardDeviation - - ✔ standardDeviation is a Function - ✔ Returns the standard deviation of an array of numbers - ✔ Returns the standard deviation of an array of numbers - - Testing stringPermutations - - ✔ stringPermutations is a Function - ✔ Generates all stringPermutations of a string - ✔ Works for single-letter strings - ✔ Works for empty strings - - Testing stripHTMLTags - - ✔ stripHTMLTags is a Function - ✔ Removes HTML tags - - Testing sum - - ✔ sum is a Function - ✔ Returns the sum of two or more numbers/arrays. - - Testing sumBy - - ✔ sumBy is a Function - - Testing sumPower - - ✔ sumPower is a Function - ✔ Returns the sum of the powers of all the numbers from start to end - ✔ Returns the sum of the powers of all the numbers from start to end - ✔ Returns the sum of the powers of all the numbers from start to end - - Testing symmetricDifference - - ✔ symmetricDifference is a Function - ✔ Returns the symmetric difference between two arrays. - - Testing symmetricDifferenceBy - - ✔ symmetricDifferenceBy is a Function - ✔ Returns the symmetric difference between two arrays, after applying the provided function to each array element of both - - Testing symmetricDifferenceWith - - ✔ symmetricDifferenceWith is a Function - ✔ Returns the symmetric difference between two arrays, using a provided function as a comparator - - Testing tail - - ✔ tail is a Function - ✔ Returns tail - ✔ Returns tail - - Testing take - - ✔ take is a Function - ✔ Returns an array with n elements removed from the beginning. - ✔ Returns an array with n elements removed from the beginning. - - Testing takeRight - - ✔ takeRight is a Function - ✔ Returns an array with n elements removed from the end - ✔ Returns an array with n elements removed from the end - - Testing takeRightWhile - - ✔ takeRightWhile is a Function - ✔ Removes elements until the function returns true - - Testing takeWhile - - ✔ takeWhile is a Function - ✔ Removes elements until the function returns true - - Testing throttle - - ✔ throttle is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing timeTaken - - ✔ timeTaken is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing times - - ✔ times is a Function - ✔ Runs a function the specified amount of times - - Testing toCamelCase - - ✔ toCamelCase is a Function - ✔ toCamelCase('some_database_field_name') returns someDatabaseFieldName - ✔ toCamelCase('Some label that needs to be camelized') returns someLabelThatNeedsToBeCamelized - ✔ toCamelCase('some-javascript-property') return someJavascriptProperty - ✔ toCamelCase('some-mixed_string with spaces_underscores-and-hyphens') returns someMixedStringWithSpacesUnderscoresAndHyphens - ✔ toCamelCase() throws a error - ✔ toCamelCase([]) throws a error - ✔ toCamelCase({}) throws a error - ✔ toCamelCase(123) throws a error - ✔ toCamelCase(some-mixed_string with spaces_underscores-and-hyphens) takes less than 2s to run - - Testing toCurrency - - ✔ toCurrency is a Function - - ✖ currency: Euro | currencyLangFormat: Local - --------------------------------------------- - operator: equal - expected: '€ 123,456.79' - actual: '€123,456.79' - at: Test.test (/home/travis/build/Chalarangelo/30-seconds-of-code/test/toCurrency/toCurrency.test.js:8:5) - stack: |- - - ✔ currency: US Dollar | currencyLangFormat: English (United States) - - ✖ currency: Japanese Yen | currencyLangFormat: Local - ----------------------------------------------------- - operator: equal - expected: 'JP¥ 322,342,436,423' - actual: '¥322,342,436,423' - at: Test.test (/home/travis/build/Chalarangelo/30-seconds-of-code/test/toCurrency/toCurrency.test.js:11:5) - stack: |- - - - Testing toDecimalMark - - ✔ toDecimalMark is a Function - ✔ convert a float-point arithmetic to the Decimal mark form - - Testing toHash - - ✔ toHash is a Function - - Testing toKebabCase - - ✔ toKebabCase is a Function - ✔ toKebabCase('camelCase') returns camel-case - ✔ toKebabCase('some text') returns some-text - ✔ toKebabCase('some-mixed-string With spaces-underscores-and-hyphens') returns some-mixed-string-with-spaces-underscores-and-hyphens - ✔ toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html - ✔ toKebabCase() return undefined - ✔ toKebabCase([]) throws an error - ✔ toKebabCase({}) throws an error - ✔ toKebabCase(123) throws an error - ✔ toKebabCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run - - Testing toOrdinalSuffix - - ✔ toOrdinalSuffix is a Function - ✔ Adds an ordinal suffix to a number - ✔ Adds an ordinal suffix to a number - ✔ Adds an ordinal suffix to a number - ✔ Adds an ordinal suffix to a number - - Testing toSafeInteger - - ✔ toSafeInteger is a Function - ✔ Number(toSafeInteger(3.2)) is a number - ✔ Converts a value to a safe integer - ✔ toSafeInteger('4.2') returns 4 - ✔ toSafeInteger(4.6) returns 5 - ✔ toSafeInteger([]) returns 0 - ✔ isNaN(toSafeInteger([1.5, 3124])) is true - ✔ isNaN(toSafeInteger('string')) is true - ✔ isNaN(toSafeInteger({})) is true - ✔ isNaN(toSafeInteger()) is true - ✔ toSafeInteger(Infinity) returns 9007199254740991 - ✔ toSafeInteger(3.2) takes less than 2s to run - - Testing toSnakeCase - - ✔ toSnakeCase is a Function - ✔ toSnakeCase('camelCase') returns camel_case - ✔ toSnakeCase('some text') returns some_text - ✔ toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens') returns some_mixed_string_with_spaces_underscores_and_hyphens - ✔ toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html - ✔ toSnakeCase() returns undefined - ✔ toSnakeCase([]) throws an error - ✔ toSnakeCase({}) throws an error - ✔ toSnakeCase(123) throws an error - ✔ toSnakeCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run - - Testing toggleClass - - ✔ toggleClass is a Function - ✔ Tested by @chalarangelo on 16/02/2018 - - Testing tomorrow - - ✔ tomorrow is a Function - ✔ Returns the correct year - ✔ Returns the correct month - ✔ Returns the correct date - - Testing transform - - ✔ transform is a Function - ✔ Transforms an object - - Testing truncateString - - ✔ truncateString is a Function - ✔ Truncates a "boomerang" up to a specified length. - - Testing truthCheckCollection - - ✔ truthCheckCollection is a Function - ✔ second argument is truthy on all elements of a collection - - Testing unary - - ✔ unary is a Function - ✔ Discards arguments after the first one - - Testing uncurry - - ✔ uncurry is a Function - ✔ Works without a provided value for n - ✔ Works without n = 2 - ✔ Works withoutn = 3 - - Testing unescapeHTML - - ✔ unescapeHTML is a Function - ✔ Unescapes escaped HTML characters. - - Testing unflattenObject - - ✔ unflattenObject is a Function - ✔ Unflattens an object with the paths for keys - - Testing unfold - - ✔ unfold is a Function - ✔ Works with a given function, producing an array - - Testing union - - ✔ union is a Function - ✔ union([1, 2, 3], [4, 3, 2]) returns [1, 2, 3, 4] - ✔ union('str', 'asd') returns [ 's', 't', 'r', 'a', 'd' ] - ✔ union([[], {}], [1, 2, 3]) returns [[], {}, 1, 2, 3] - ✔ union([], []) returns [] - ✔ union() throws an error - ✔ union(true, str) throws an error - ✔ union(false, true) throws an error - ✔ union(123, {}) throws an error - ✔ union([], {}) throws an error - ✔ union(undefined, null) throws an error - ✔ union([1, 2, 3], [4, 3, 2]) takes less than 2s to run - - Testing unionBy - - ✔ unionBy is a Function - ✔ Produces the appropriate results - - Testing unionWith - - ✔ unionWith is a Function - ✔ Produces the appropriate results - - Testing uniqueElements - - ✔ uniqueElements is a Function - ✔ uniqueElements([1, 2, 2, 3, 4, 4, 5]) returns [1,2,3,4,5] - ✔ uniqueElements([1, 23, 53]) returns [1, 23, 53] - ✔ uniqueElements([true, 0, 1, false, false, undefined, null, '']) returns [true, 0, 1, false, false, undefined, null, ''] - ✔ uniqueElements() returns [] - ✔ uniqueElements(null) returns [] - ✔ uniqueElements(undefined) returns [] - ✔ uniqueElements('strt') returns ['s', 't', 'r'] - ✔ uniqueElements(1, 1, 2543, 534, 5) throws an error - ✔ uniqueElements({}) throws an error - ✔ uniqueElements(true) throws an error - ✔ uniqueElements(false) throws an error - ✔ uniqueElements([true, 0, 1, false, false, undefined, null]) takes less than 2s to run - - Testing untildify - - ✔ untildify is a Function - ✔ Contains no tildes - ✔ Does not alter the rest of the path - ✔ Does not alter paths without tildes - - Testing unzip - - ✔ unzip is a Function - ✔ unzip([['a', 1, true], ['b', 2, false]]) equals [['a', 'b'], [1, 2], [true, false]] - ✔ unzip([['a', 1, true], ['b', 2]]) equals [['a', 'b'], [1, 2], [true]] - - Testing unzipWith - - ✔ unzipWith is a Function - ✔ unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)) equals [3, 30, 300] - - Testing validateNumber - - ✔ validateNumber is a Function - ✔ validateNumber(9) returns true - ✔ validateNumber(234asd.slice(0, 2)) returns true - ✔ validateNumber(1232) returns true - ✔ validateNumber(1232 + 13423) returns true - ✔ validateNumber(1232 * 2342 * 123) returns true - ✔ validateNumber(1232.23423536) returns true - ✔ validateNumber(234asd) returns false - ✔ validateNumber(e234d) returns false - ✔ validateNumber(false) returns false - ✔ validateNumber(true) returns false - ✔ validateNumber(null) returns false - ✔ validateNumber(123 * asd) returns false - - Testing when - - ✔ when is a Function - ✔ should be truthy - ✔ should be truthy - - Testing without - - ✔ without is a Function - ✔ without([2, 1, 2, 3], 1, 2) returns [3] - ✔ without([]) returns [] - ✔ without([3, 1, true, '3', true], '3', true) returns [3, 1] - ✔ without('string'.split(''), 's', 't', 'g') returns ['r', 'i', 'n'] - ✔ without() throws an error - ✔ without(null) throws an error - ✔ without(undefined) throws an error - ✔ without() throws an error - ✔ without({}) throws an error - - Testing words - - ✔ words is a Function - ✔ words('I love javaScript!!') returns [I, love, javaScript] - ✔ words('python, javaScript & coffee') returns [python, javaScript, coffee] - ✔ words(I love javaScript!!) returns an array - ✔ words() throws a error - ✔ words(null) throws a error - ✔ words(undefined) throws a error - ✔ words({}) throws a error - ✔ words([]) throws a error - ✔ words(1234) throws a error - - Testing xProd - - ✔ xProd is a Function - ✔ xProd([1, 2], ['a', 'b']) returns [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']] - - Testing yesNo - - ✔ yesNo is a Function - ✔ yesNo(Y) returns true - ✔ yesNo(yes) returns true - ✔ yesNo(foo, true) returns true - ✔ yesNo(No) returns false - ✔ yesNo() returns false - ✔ yesNo(null) returns false - ✔ yesNo(undefined) returns false - ✔ yesNo([123, null]) returns false - ✔ yesNo([Yes, No]) returns false - ✔ yesNo({ 2: Yes }) returns false - ✔ yesNo([Yes, No], true) returns true - ✔ yesNo({ 2: Yes }, true) returns true - - Testing zip - - ✔ zip is a Function - ✔ zip([a, b], [1, 2], [true, false]) returns [[a, 1, true], [b, 2, false]] - ✔ zip([a], [1, 2], [true, false]) returns [[a, 1, true], [undefined, 2, false]] - ✔ zip([]) returns [] - ✔ zip(123) returns [] - ✔ zip([a, b], [1, 2], [true, false]) returns an Array - ✔ zip([a], [1, 2], [true, false]) returns an Array - ✔ zip(null) throws an error - ✔ zip(undefined) throws an error - - Testing zipObject - - ✔ zipObject is a Function - ✔ zipObject([a, b, c], [1, 2]) returns {a: 1, b: 2, c: undefined} - ✔ zipObject([a, b], [1, 2, 3]) returns {a: 1, b: 2} - ✔ zipObject([a, b, c], string) returns { a: s, b: t, c: r } - ✔ zipObject([a], string) returns { a: s } - ✔ zipObject() throws an error - ✔ zipObject([string], null) throws an error - ✔ zipObject(null, [1]) throws an error - ✔ zipObject(string) throws an error - ✔ zipObject(test, string) throws an error - - Testing zipWith - - ✔ zipWith is a Function - ✔ Sends a GET request - ✔ Sends a POST request - ✔ Runs the function provided - ✔ Runs promises in series - ✔ Works as expecting, passing arguments properly - ✔ Works with multiple promises - - - - Failed Tests: There were 2 failures - - Testing toCurrency - - ✖ currency: Euro | currencyLangFormat: Local - ✖ currency: Japanese Yen | currencyLangFormat: Local - - - total: 1022 - passing: 1020 - failing: 2 - duration: 2.4s +Test log for: Mon Jun 18 2018 19:06:56 GMT+0300 (GTB Daylight Time) +> 30-seconds-of-code@0.0.3 test H:\My Files\git Repositories\30-seconds-of-code +> jest test/**/*.test.js + Invalid testPattern test\\**\\*.test.js supplied. Running all tests instead. undefined \ No newline at end of file diff --git a/test/unflattenObject/unflattenObject.js b/test/unflattenObject/unflattenObject.js index e5303a886..b0b4f48ba 100644 --- a/test/unflattenObject/unflattenObject.js +++ b/test/unflattenObject/unflattenObject.js @@ -13,5 +13,5 @@ obj[k] + ); } else acc[k] = obj[k]; return acc; -}, { +}, {}); module.exports = unflattenObject; \ No newline at end of file diff --git a/test/zip/zip.js b/test/zip/zip.js index aad64ff83..54a162bce 100644 --- a/test/zip/zip.js +++ b/test/zip/zip.js @@ -2,6 +2,6 @@ const zip = (...arrays) => { const maxLength = Math.max(...arrays.map(x => x.length)); return Array.from({ length: maxLength }).map((_, i) => { return Array.from({ length: arrays.length }, (_, k) => arrays[k][i]); - +}); }; module.exports = zip; \ No newline at end of file diff --git a/test/zipObject/zipObject.js b/test/zipObject/zipObject.js index 90aeeacf1..c44e95eda 100644 --- a/test/zipObject/zipObject.js +++ b/test/zipObject/zipObject.js @@ -1,3 +1,3 @@ const zipObject = (props, values) => -props.reduce((obj, prop, index) => ((obj[prop] = values[index]), obj), { +props.reduce((obj, prop, index) => ((obj[prop] = values[index]), obj), {}); module.exports = zipObject; \ No newline at end of file From 3a89fe304a3603a1117690f20d695b63a599f6aa Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Mon, 18 Jun 2018 20:41:57 +0300 Subject: [PATCH 17/19] Final fixes, all tests running --- package-lock.json | 70 + package.json | 17 +- scripts/tdd.js | 2 +- test/call/call.test.js | 2 +- test/capitalize/capitalize.test.js | 2 +- .../capitalizeEveryWord.test.js | 2 +- test/chunk/chunk.test.js | 8 +- test/cloneRegExp/cloneRegExp.test.js | 2 +- test/deepClone/deepClone.test.js | 8 +- test/defaults/defaults.test.js | 2 +- test/elo/elo.test.js | 2 +- test/equals/equals.test.js | 2 +- test/findKey/findKey.test.js | 2 +- test/findLastKey/findLastKey.test.js | 2 +- test/functionName/functionName.test.js | 13 +- test/functions/functions.test.js | 2 +- .../getURLParameters/getURLParameters.test.js | 2 +- test/head/head.test.js | 6 +- test/httpGet/httpGet.test.js | 537 +---- test/httpPost/httpPost.test.js | 537 +---- test/inRange/inRange.test.js | 2 +- test/initial/initial.test.js | 2 +- test/invertKeyValues/invertKeyValues.test.js | 4 +- test/isPrimitive/isPrimitive.test.js | 4 +- test/last/last.test.js | 6 +- test/maxN/maxN.test.js | 4 +- test/nodeListToArray/nodeListToArray.test.js | 2 +- .../pipeAsyncFunctions.test.js | 4 +- test/quickSort/quickSort.test.js | 10 +- .../runPromisesInSeries.test.js | 2 +- test/shallowClone/shallowClone.test.js | 4 +- .../stringPermutations.test.js | 2 +- test/tail/tail.test.js | 2 +- test/take/take.test.js | 4 +- test/testlog | 1997 ++++++++++++++++- test/toCamelCase/toCamelCase.test.js | 16 +- test/toCurrency/toCurrency.test.js | 6 +- test/toKebabCase/toKebabCase.test.js | 6 +- test/toSafeInteger/toSafeInteger.test.js | 4 +- test/toSnakeCase/toSnakeCase.test.js | 8 +- test/transform/transform.test.js | 2 +- test/union/union.test.js | 14 +- test/uniqueElements/uniqueElements.test.js | 12 +- test/unzip/unzip.test.js | 4 +- test/unzipWith/unzipWith.test.js | 2 +- test/without/without.test.js | 14 +- test/words/words.test.js | 16 +- test/zip/zip.test.js | 4 +- test/zipObject/zipObject.test.js | 10 +- 49 files changed, 2189 insertions(+), 1198 deletions(-) diff --git a/package-lock.json b/package-lock.json index 080b8cbe4..9f4aa394c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5137,6 +5137,48 @@ "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", @@ -7684,6 +7726,28 @@ } } }, + "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", + "es-abstract": "1.11.0", + "function-bind": "1.1.1" + } + }, "string.prototype.trim": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz", @@ -8242,6 +8306,12 @@ } } }, + "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", diff --git a/package.json b/package.json index 9694e7ef6..90868ebf7 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "fs-extra": "^6.0.0", "html-minifier": "^3.5.15", "jest": "^23.1.0", + "jest-tap-reporter": "^1.9.0", "jsdom": "^11.10.0", "markdown-it": "^8.4.1", "mini.css": "^2.3.7", @@ -16,8 +17,6 @@ "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" }, "name": "30-seconds-of-code", "description": "A collection of useful JavaScript snippets.", @@ -33,8 +32,7 @@ "extractor": "node ./scripts/extract.js", "packager": "node ./scripts/module.js", "localizer": "node ./scripts/localize.js", - "testold": "tape test/**/*.test.js | tap-spec", - "test": "jest test/**/*.test.js" + "test": "jest --verbose" }, "repository": { "type": "git", @@ -51,5 +49,14 @@ "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 6c60aced8..a08077b63 100644 --- a/scripts/tdd.js +++ b/scripts/tdd.js @@ -84,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`); + child_process.execSync(`npm test`); } catch (e) { fs.appendFileSync(path.join(TEST_PATH,'testlog')); diff --git a/test/call/call.test.js b/test/call/call.test.js index d445ab45f..a90669ddf 100644 --- a/test/call/call.test.js +++ b/test/call/call.test.js @@ -5,5 +5,5 @@ test('call is a Function', () => { expect(call).toBeInstanceOf(Function); }); test('Calls function on given object', () => { - expect(call('map', x => x * 2)([1, 2, 3])).toBe([2, 4, 6]); + 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 6fb4a1bd8..68fe363e7 100644 --- a/test/capitalize/capitalize.test.js +++ b/test/capitalize/capitalize.test.js @@ -8,7 +8,7 @@ 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'); + expect(capitalize('fooBar', true)).toBe('Foobar'); }); test('Works with characters', () => { expect(capitalize('#!#', true)).toBe('#!#'); diff --git a/test/capitalizeEveryWord/capitalizeEveryWord.test.js b/test/capitalizeEveryWord/capitalizeEveryWord.test.js index 39a025b0b..a57e2619d 100644 --- a/test/capitalizeEveryWord/capitalizeEveryWord.test.js +++ b/test/capitalizeEveryWord/capitalizeEveryWord.test.js @@ -5,7 +5,7 @@ test('capitalizeEveryWord is a Function', () => { expect(capitalizeEveryWord).toBeInstanceOf(Function); }); test('Capitalizes the first letter of every word in a string', () => { - expect(capitalizeEveryWord('hello world!'), 'Hello World!').toBe(); + expect(capitalizeEveryWord('hello world!')).toBe('Hello World!'); }); test('Works with characters', () => { expect(capitalizeEveryWord('$# @!')).toBe('$# @!'); diff --git a/test/chunk/chunk.test.js b/test/chunk/chunk.test.js index 212ef3c79..208455711 100644 --- a/test/chunk/chunk.test.js +++ b/test/chunk/chunk.test.js @@ -5,7 +5,7 @@ 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]]); + expect(chunk([1, 2, 3, 4, 5], 2)).toEqual([[1,2],[3,4],[5]]); }); test('chunk([]) returns []', () => { expect(chunk([])).toEqual([]) @@ -20,13 +20,13 @@ test('chunk(string, 2) returns [ st, ri, ng ]', () => { expect(chunk('string', 2)).toEqual( [ 'st', 'ri', 'ng' ]) }); test('chunk() throws an error', () => { - expect(chunk()).toThrow(); + expect(() => {chunk();}).toThrow(); }); test('chunk(undefined) throws an error', () => { - expect(chunk(undefined)).toThrow(); + expect(() => {chunk(undefined);}).toThrow(); }); test('chunk(null) throws an error', () => { - expect(chunk(null)).toThrow(); + expect(() => {chunk(null);}).toThrow(); }); let start = new Date().getTime(); chunk('This is a string', 2); diff --git a/test/cloneRegExp/cloneRegExp.test.js b/test/cloneRegExp/cloneRegExp.test.js index e4469ec39..d16147c7a 100644 --- a/test/cloneRegExp/cloneRegExp.test.js +++ b/test/cloneRegExp/cloneRegExp.test.js @@ -6,5 +6,5 @@ test('cloneRegExp is a Function', () => { }); const rgTest = /./g; test('Clones regular expressions properly', () => { - expect(cloneRegExp(rgTest).not.toEqual(rgTest); + expect(cloneRegExp(rgTest)).not.toBe(rgTest); }); diff --git a/test/deepClone/deepClone.test.js b/test/deepClone/deepClone.test.js index 8806fd060..7fdf04e01 100644 --- a/test/deepClone/deepClone.test.js +++ b/test/deepClone/deepClone.test.js @@ -9,14 +9,14 @@ const b = deepClone(a); const c = [{foo: "bar"}]; const d = deepClone(c); test('Shallow cloning works', () => { - expect(a).not.toEqual(b); + expect(a).not.toBe(b); }); test('Deep cloning works', () => { - expect(a.obj).not.toEqual(b.obj); + expect(a.obj).not.toBe(b.obj); }); test('Array shallow cloning works', () => { - expect(c).not.toEqual(d); + expect(c).not.toBe(d); }); test('Array deep cloning works', () => { - expect(c[0]).not.toEqual(d[0]); + expect(c[0]).not.toBe(d[0]); }); diff --git a/test/defaults/defaults.test.js b/test/defaults/defaults.test.js index d416fef6a..6a98064cd 100644 --- a/test/defaults/defaults.test.js +++ b/test/defaults/defaults.test.js @@ -5,5 +5,5 @@ 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 })).toBe({ a: 1, b: 2 }); + expect(defaults({ a: 1 }, { b: 2 }, { b: 6 }, { a: 3 })).toEqual({ a: 1, b: 2 }); }); diff --git a/test/elo/elo.test.js b/test/elo/elo.test.js index 3690a3425..a5e146384 100644 --- a/test/elo/elo.test.js +++ b/test/elo/elo.test.js @@ -8,7 +8,7 @@ test('Standard 1v1s', () => { expect(elo([1200, 1200])).toEqual([1216,1184]); }); test('Standard 1v1s' ,() => { - expect(elo([1200, 1200], 64)).toBe([1232, 1168]); + 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 f43d92336..4d40b9b63 100644 --- a/test/equals/equals.test.js +++ b/test/equals/equals.test.js @@ -4,7 +4,7 @@ const equals = require('./equals.js'); 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' }', () => { +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]', () => { diff --git a/test/findKey/findKey.test.js b/test/findKey/findKey.test.js index ca8b397b0..54dcc5d33 100644 --- a/test/findKey/findKey.test.js +++ b/test/findKey/findKey.test.js @@ -11,5 +11,5 @@ test('Returns the appropriate key', () => { fred: { age: 40, active: false }, pebbles: { age: 1, active: true } }, - o => o['active']).toBe('barney'); + o => o['active'])).toBe('barney'); }); diff --git a/test/findLastKey/findLastKey.test.js b/test/findLastKey/findLastKey.test.js index 5277755d3..434e3e031 100644 --- a/test/findLastKey/findLastKey.test.js +++ b/test/findLastKey/findLastKey.test.js @@ -11,5 +11,5 @@ test('eturns the appropriate key', () => { fred: { age: 40, active: false }, pebbles: { age: 1, active: true } }, - o => o['active']).toBe('pebbles'); + o => o['active'])).toBe('pebbles'); }); diff --git a/test/functionName/functionName.test.js b/test/functionName/functionName.test.js index a4255180e..91c75a6a4 100644 --- a/test/functionName/functionName.test.js +++ b/test/functionName/functionName.test.js @@ -1,23 +1,18 @@ const expect = require('expect'); let output = ''; -const console = {}; -console.debug = (x) => output = x; -const functionName = fn => (console.debug(fn.name), fn); +const functionName = fn => fn.name; test('functionName is a Function', () => { expect(functionName).toBeInstanceOf(Function); }); -functionName(Math.max); test('Works for native functions', () => { - expect(output).toBe('max'); + expect(functionName(Math.max)).toBe('max'); }); function fun(x) {return x;} -functionName(fun); test('Works for functions', () => { - expect(output).toBe('fun'); + expect(functionName(fun)).toBe('fun'); }); const fn = x => x; -functionName(fn); test('Works for arrow functions', () => { - expect(output).toBe('fn'); + expect(functionName(fn)).toBe('fn'); }); diff --git a/test/functions/functions.test.js b/test/functions/functions.test.js index d8d8ad5fe..b7193bf92 100644 --- a/test/functions/functions.test.js +++ b/test/functions/functions.test.js @@ -10,7 +10,7 @@ function Foo() { } Foo.prototype.c = () => 3; test('Returns own methods', () => { - expect(functions(new Foo()).toEqual( ['a', 'b']); + 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/getURLParameters/getURLParameters.test.js b/test/getURLParameters/getURLParameters.test.js index 3a63c7890..f23854b52 100644 --- a/test/getURLParameters/getURLParameters.test.js +++ b/test/getURLParameters/getURLParameters.test.js @@ -5,5 +5,5 @@ test('getURLParameters is a Function', () => { expect(getURLParameters).toBeInstanceOf(Function); }); test('Returns an object containing the parameters of the current URL', () => { - expect(getURLParameters(getURLParameters('http://url.com/page?name=Adam&surname=Smith')).toEqual({name: 'Adam', surname: 'Smith'}); + expect(getURLParameters('http://url.com/page?name=Adam&surname=Smith')).toEqual({name: 'Adam', surname: 'Smith'}); }); diff --git a/test/head/head.test.js b/test/head/head.test.js index 01591d787..ec707eb30 100644 --- a/test/head/head.test.js +++ b/test/head/head.test.js @@ -17,13 +17,13 @@ test('head(String) returns S', () => { expect(head('String')).toBe('S'); }); test('head(null) throws an Error', () => { - expect(head(null)).toThrow(); + expect(() => { head(null); }).toThrow(); }); test('head(undefined) throws an Error', () => { - expect(head(undefined)).toThrow(); + expect(() => { head(undefined); }).toThrow(); }); test('head() throws an Error', () => { - expect(head()).toThrow(); + expect(() => { head(); }).toThrow(); }); let start = new Date().getTime(); head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]); diff --git a/test/httpGet/httpGet.test.js b/test/httpGet/httpGet.test.js index f5859ff68..5a19d5adc 100644 --- a/test/httpGet/httpGet.test.js +++ b/test/httpGet/httpGet.test.js @@ -1,541 +1,6 @@ const expect = require('expect'); -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 httpGet = require('./httpGet.js'); test('httpGet is a Function', () => { expect(httpGet).toBeInstanceOf(Function); }); -test('Sends a GET request', () => { -httpGet('https://jsonplaceholder.typicode.com/posts/1', response => { - expect(JSON.parse(response)),toEqual({ - 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', - }); -}); - -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"); - var request; - var response; - var settings = {}; - var disableHeaderCheck = false; - var defaultHeaders = { - "User-Agent": "node-XMLHttpRequest", - "Accept": "*/*", - }; - - var headers = {}; - var headersCase = {}; - 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" - ]; - var forbiddenRequestMethods = [ - "TRACE", - "TRACK", - "CONNECT" - ]; - var sendFlag = false; - var errorFlag = false; - var listeners = {}; - - /** - * Constants - */ - - this.UNSENT = 0; - this.OPENED = 1; - this.HEADERS_RECEIVED = 2; - this.LOADING = 3; - this.DONE = 4; - - /** - * Public vars - */ - this.readyState = this.UNSENT; - this.onreadystatechange = null; - this.responseText = ""; - this.responseXML = ""; - this.status = null; - this.statusText = null; - 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; - 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) { - 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; - switch (url.protocol) { - case "https:": - ssl = true; - 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."); - } - 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; - } - var port = url.port || (ssl ? 443 : 80); - var uri = url.pathname + (url.search ? url.search : ""); - for (var name in defaultHeaders) { - if (!headersCase[name.toLowerCase()]) { - headers[name] = defaultHeaders[name]; - } - } - headers.Host = host; - if (!((ssl && port === 443) || port === 80)) { - headers.Host += ":" + url.port; - } - if (settings.user) { - if (typeof settings.password === "undefined") { - settings.password = ""; - } - var authBuf = new Buffer(settings.user + ":" + settings.password); - headers.Authorization = "Basic " + authBuf.toString("base64"); - } - 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") { - headers["Content-Length"] = 0; - } - - var options = { - host: host, - port: port, - path: uri, - method: settings.method, - headers: headers, - agent: false, - withCredentials: self.withCredentials - }; - errorFlag = false; - if (settings.async) { - var doRequest = ssl ? https.request : http.request; - sendFlag = true; - self.dispatchEvent("readystatechange"); - var responseHandler = function responseHandler(resp) { - response = resp; - if (response.statusCode === 301 || response.statusCode === 302 || response.statusCode === 303 || response.statusCode === 307) { - settings.url = response.headers.location; - var url = Url.parse(settings.url); - host = url.hostname; - var newOptions = { - hostname: url.hostname, - port: url.port, - path: url.path, - method: response.statusCode === 303 ? "GET" : settings.method, - headers: headers, - withCredentials: self.withCredentials - }; - request = doRequest(newOptions, responseHandler).on("error", errorHandler); - reques - return; - } - - response.setEncoding("utf8"); - - setState(self.HEADERS_RECEIVED); - self.status = response.statusCode; - - response.on("data", function(chunk) { - if (chunk) { - self.responseText += chunk; - } - if (sendFlag) { - setState(self.LOADING); - } - - - response.on("end", function() { - if (sendFlag) { - setState(self.DONE); - sendFlag = false; - } - - - response.on("error", function(error) { - self.handleError(error); - - }; - var errorHandler = function errorHandler(error) { - self.handleError(error); - }; - request = doRequest(options, responseHandler).on("error", errorHandler); - if (data) { - request.write(data); - } - - reques - - self.dispatchEvent("loadstart"); - } else { - var contentFile = ".node-xmlhttprequest-content-" + process.pid; - var syncFile = ".node-xmlhttprequest-sync-" + process.pid; - fs.writeFileSync(syncFile, "", "utf8"); - 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();"; - var syncProc = spawn(process.argv[0], ["-e", execString]); - while(fs.existsSync(syncFile)) { - } - var resp = JSON.parse(fs.readFileSync(contentFile, 'utf8')); - syncProc.stdin.end(); - 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] = []; - } - 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) { - 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"); - self.dispatchEvent("loadend"); - } - } - }; -}; diff --git a/test/httpPost/httpPost.test.js b/test/httpPost/httpPost.test.js index 84dfe26ff..13ec36ccd 100644 --- a/test/httpPost/httpPost.test.js +++ b/test/httpPost/httpPost.test.js @@ -1,541 +1,6 @@ const expect = require('expect'); -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); -}; +const httpPost = require('./httpPost.js'); test('httpPost is a Function', () => { expect(httpPost).toBeInstanceOf(Function); }); -const data = { - title: 'foo', - body: 'bar', - userId: 1 -}; -test('Sends a POST request', () => { - httpPost('https://jsonplaceholder.typicode.com/posts', JSON.stringify(data), response => { - expect(JSON.parse(response).id).toEqual(101); - }); -}); - -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"); - var request; - var response; - var settings = {}; - var disableHeaderCheck = false; - var defaultHeaders = { - "User-Agent": "node-XMLHttpRequest", - "Accept": "*/*", - }; - - var headers = {}; - var headersCase = {}; - 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" - ]; - var forbiddenRequestMethods = [ - "TRACE", - "TRACK", - "CONNECT" - ]; - var sendFlag = false; - var errorFlag = false; - var listeners = {}; - - /** - * Constants - */ - - this.UNSENT = 0; - this.OPENED = 1; - this.HEADERS_RECEIVED = 2; - this.LOADING = 3; - this.DONE = 4; - - /** - * Public vars - */ - this.readyState = this.UNSENT; - this.onreadystatechange = null; - this.responseText = ""; - this.responseXML = ""; - this.status = null; - this.statusText = null; - 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; - 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) { - 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; - switch (url.protocol) { - case "https:": - ssl = true; - 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."); - } - 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; - } - var port = url.port || (ssl ? 443 : 80); - var uri = url.pathname + (url.search ? url.search : ""); - for (var name in defaultHeaders) { - if (!headersCase[name.toLowerCase()]) { - headers[name] = defaultHeaders[name]; - } - } - headers.Host = host; - if (!((ssl && port === 443) || port === 80)) { - headers.Host += ":" + url.port; - } - if (settings.user) { - if (typeof settings.password === "undefined") { - settings.password = ""; - } - var authBuf = new Buffer(settings.user + ":" + settings.password); - headers.Authorization = "Basic " + authBuf.toString("base64"); - } - 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") { - headers["Content-Length"] = 0; - } - - var options = { - host: host, - port: port, - path: uri, - method: settings.method, - headers: headers, - agent: false, - withCredentials: self.withCredentials - }; - errorFlag = false; - if (settings.async) { - var doRequest = ssl ? https.request : http.request; - sendFlag = true; - self.dispatchEvent("readystatechange"); - var responseHandler = function responseHandler(resp) { - response = resp; - if (response.statusCode === 301 || response.statusCode === 302 || response.statusCode === 303 || response.statusCode === 307) { - settings.url = response.headers.location; - var url = Url.parse(settings.url); - host = url.hostname; - var newOptions = { - hostname: url.hostname, - port: url.port, - path: url.path, - method: response.statusCode === 303 ? "GET" : settings.method, - headers: headers, - withCredentials: self.withCredentials - }; - request = doRequest(newOptions, responseHandler).on("error", errorHandler); - reques - return; - } - - response.setEncoding("utf8"); - - setState(self.HEADERS_RECEIVED); - self.status = response.statusCode; - - response.on("data", function(chunk) { - if (chunk) { - self.responseText += chunk; - } - if (sendFlag) { - setState(self.LOADING); - } - - - response.on("end", function() { - if (sendFlag) { - setState(self.DONE); - sendFlag = false; - } - - - response.on("error", function(error) { - self.handleError(error); - - }; - var errorHandler = function errorHandler(error) { - self.handleError(error); - }; - request = doRequest(options, responseHandler).on("error", errorHandler); - if (data) { - request.write(data); - } - - reques - - self.dispatchEvent("loadstart"); - } else { - var contentFile = ".node-xmlhttprequest-content-" + process.pid; - var syncFile = ".node-xmlhttprequest-sync-" + process.pid; - fs.writeFileSync(syncFile, "", "utf8"); - 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();"; - var syncProc = spawn(process.argv[0], ["-e", execString]); - while(fs.existsSync(syncFile)) { - } - var resp = JSON.parse(fs.readFileSync(contentFile, 'utf8')); - syncProc.stdin.end(); - 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] = []; - } - 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) { - 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"); - self.dispatchEvent("loadend"); - } - } - }; -}; diff --git a/test/inRange/inRange.test.js b/test/inRange/inRange.test.js index 5825a2f3b..c72efec2d 100644 --- a/test/inRange/inRange.test.js +++ b/test/inRange/inRange.test.js @@ -14,5 +14,5 @@ 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)).toBeTruthy(); + expect(inRange(3, 2)).toBeFalsy(); }); diff --git a/test/initial/initial.test.js b/test/initial/initial.test.js index 13a85b519..2c8a8b944 100644 --- a/test/initial/initial.test.js +++ b/test/initial/initial.test.js @@ -5,5 +5,5 @@ 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])'' + expect(initial([1, 2, 3])).toEqual([1, 2]); }); diff --git a/test/invertKeyValues/invertKeyValues.test.js b/test/invertKeyValues/invertKeyValues.test.js index 5bc005e4e..00c6d5f85 100644 --- a/test/invertKeyValues/invertKeyValues.test.js +++ b/test/invertKeyValues/invertKeyValues.test.js @@ -4,9 +4,9 @@ const invertKeyValues = require('./invertKeyValues.js'); test('invertKeyValues is a Function', () => { expect(invertKeyValues).toBeInstanceOf(Function); }); -test('invertKeyValues({ a: 1, b: 2, c: 1 }) returns { 1: [ 'a', 'c' ], 2: [ 'b' ] }', () => { +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' ] }', () => { +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/isPrimitive/isPrimitive.test.js b/test/isPrimitive/isPrimitive.test.js index c9652b170..ac7e593e9 100644 --- a/test/isPrimitive/isPrimitive.test.js +++ b/test/isPrimitive/isPrimitive.test.js @@ -19,7 +19,7 @@ test('isPrimitive(true) is primitive', () => { test('isPrimitive(50) is primitive', () => { expect(isPrimitive(50)).toBeTruthy(); }); -test('isPrimitive('Hello') is primitive', () => { +test('isPrimitive(\'Hello\') is primitive', () => { expect(isPrimitive('Hello')).toBeTruthy(); }); test('isPrimitive(false) is primitive', () => { @@ -35,7 +35,7 @@ test('isPrimitive({ a: 123 }) is not primitive', () => { expect(isPrimitive({ a: 123 })).toBeFalsy(); }); let start = new Date().getTime(); -isPrimitive({ a: 123 +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/last/last.test.js b/test/last/last.test.js index 8da663642..48f7b4179 100644 --- a/test/last/last.test.js +++ b/test/last/last.test.js @@ -17,13 +17,13 @@ test('last(String) returns g', () => { expect(last('String')).toBe('g'); }); test('last(null) throws an Error', () => { - expect(last(null)).toThrow(); + expect(() => { last(null); }).toThrow(); }); test('last(undefined) throws an Error', () => { - expect(last(undefined)).toThrow(); + expect(() => { last(undefined); }).toThrow(); }); test('last() throws an Error', () => { - expect(last()).toThrow(); + expect(() => { last(); }).toThrow(); }); let start = new Date().getTime(); last([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]); diff --git a/test/maxN/maxN.test.js b/test/maxN/maxN.test.js index ab64c28bb..dc100b2f7 100644 --- a/test/maxN/maxN.test.js +++ b/test/maxN/maxN.test.js @@ -5,8 +5,8 @@ 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])l + 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])l + expect(maxN([1, 2, 3], 2)).toEqual([3, 2]); }); diff --git a/test/nodeListToArray/nodeListToArray.test.js b/test/nodeListToArray/nodeListToArray.test.js index 414565976..3ebb00c14 100644 --- a/test/nodeListToArray/nodeListToArray.test.js +++ b/test/nodeListToArray/nodeListToArray.test.js @@ -3,4 +3,4 @@ const nodeListToArray = require('./nodeListToArray.js'); test('nodeListToArray is a Function', () => { expect(nodeListToArray).toBeInstanceOf(Function); -}); +}); \ No newline at end of file diff --git a/test/pipeAsyncFunctions/pipeAsyncFunctions.test.js b/test/pipeAsyncFunctions/pipeAsyncFunctions.test.js index 725fb196c..53ec89173 100644 --- a/test/pipeAsyncFunctions/pipeAsyncFunctions.test.js +++ b/test/pipeAsyncFunctions/pipeAsyncFunctions.test.js @@ -5,11 +5,11 @@ test('pipeAsyncFunctions is a Function', () => { expect(pipeAsyncFunctions).toBeInstanceOf(Function); }); test('pipeAsyncFunctions result should be 15', () => { - expect(await pipeAsyncFunctions( + expect(pipeAsyncFunctions( (x) => x + 1, (x) => new Promise((resolve) => setTimeout(() => resolve(x + 2), 0)), (x) => x + 3, async (x) => await x + 4, ) - (5)).toBe(15); + (5)).resolves.toBe(15); }); diff --git a/test/quickSort/quickSort.test.js b/test/quickSort/quickSort.test.js index 62ae9806e..b15e58969 100644 --- a/test/quickSort/quickSort.test.js +++ b/test/quickSort/quickSort.test.js @@ -11,19 +11,19 @@ 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(); + expect(() => { quickSort(); }).toThrow(); }); test('quickSort(123) throws an error', () => { - expect(quickSort(123)).toThrow(); + expect(() => { quickSort(123); }).toThrow(); }); test('quickSort({ 234: string}) throws an error', () => { - expect(quickSort({ 234: string})).toThrow(); + expect(() => { quickSort({ 234: string}); }).toThrow(); }); test('quickSort(null) throws an error', () => { - expect(quickSort(null)).toThrow(); + expect(() => { quickSort(null); }).toThrow(); }); test('quickSort(undefined) throws an error', () => { - expect(quickSort(undefined)).toThrow(); + 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]); diff --git a/test/runPromisesInSeries/runPromisesInSeries.test.js b/test/runPromisesInSeries/runPromisesInSeries.test.js index df3814da4..1fb99d262 100644 --- a/test/runPromisesInSeries/runPromisesInSeries.test.js +++ b/test/runPromisesInSeries/runPromisesInSeries.test.js @@ -7,5 +7,5 @@ test('runPromisesInSeries is a Function', () => { }); const delay = d => new Promise(r => setTimeout(r, d)); test('Runs promises in series', () => { - runPromisesInSeries([() => delay(100), () => delay(200).then(() => expect(true).toBeTruthy())); + runPromisesInSeries([() => delay(100), () => delay(200).then(() => expect(true).toBeTruthy())]); }); diff --git a/test/shallowClone/shallowClone.test.js b/test/shallowClone/shallowClone.test.js index fd08a3395..14c8fdf1c 100644 --- a/test/shallowClone/shallowClone.test.js +++ b/test/shallowClone/shallowClone.test.js @@ -6,7 +6,9 @@ test('shallowClone is a Function', () => { }); const a = { foo: 'bar', obj: { a: 1, b: 2 } }; const b = shallowClone(a); -t.notEqual(a, b, 'Shallow cloning works'); +test('Shallow cloning works', () => { + expect(a).not.toBe(b); +}); test('Does not clone deeply', () => { expect(a.obj).toBe(b.obj); }); diff --git a/test/stringPermutations/stringPermutations.test.js b/test/stringPermutations/stringPermutations.test.js index f58224879..b97252f6d 100644 --- a/test/stringPermutations/stringPermutations.test.js +++ b/test/stringPermutations/stringPermutations.test.js @@ -5,7 +5,7 @@ test('stringPermutations is a Function', () => { expect(stringPermutations).toBeInstanceOf(Function); }); test('Generates all stringPermutations of a string', () => { - expect(stringPermutations('abc'), ['abc','acb','bac','bca','cab').toEqual('cba']); + expect(stringPermutations('abc')).toEqual(['abc','acb','bac','bca','cab','cba']); }); test('Works for single-letter strings', () => { expect(stringPermutations('a')).toEqual(['a']); diff --git a/test/tail/tail.test.js b/test/tail/tail.test.js index 6ed96e45c..e38eb7d37 100644 --- a/test/tail/tail.test.js +++ b/test/tail/tail.test.js @@ -5,7 +5,7 @@ test('tail is a Function', () => { expect(tail).toBeInstanceOf(Function); }); test('Returns tail', () => { - expect(tail([1, 2, 3]), [2).toEqual(3]); + expect(tail([1, 2, 3])).toEqual([2, 3]); }); test('Returns tail', () => { expect(tail([1])).toEqual([1]); diff --git a/test/take/take.test.js b/test/take/take.test.js index 966e0ca7a..6621a5176 100644 --- a/test/take/take.test.js +++ b/test/take/take.test.js @@ -5,8 +5,8 @@ test('take is a Function', () => { expect(take).toBeInstanceOf(Function); }); test('Returns an array with n elements removed from the beginning.', () => { - expect(take([1, 2, 3], 5), [1, 2).toEqual(3]) + expect(take([1, 2, 3], 5)).toEqual([1, 2, 3]); }); test('Returns an array with n elements removed from the beginning.', () => { - expect(take([1, 2, 3], 0)).toEqual([]) + expect(take([1, 2, 3], 0)).toEqual([]); }); diff --git a/test/testlog b/test/testlog index 670262308..c17ca9b95 100644 --- a/test/testlog +++ b/test/testlog @@ -1,7 +1,1994 @@ -Test log for: Mon Jun 18 2018 19:06:56 GMT+0300 (GTB Daylight Time) -> 30-seconds-of-code@0.0.3 test H:\My Files\git Repositories\30-seconds-of-code -> jest test/**/*.test.js - Invalid testPattern test\\**\\*.test.js supplied. Running all tests instead. -undefined \ No newline at end of file +# Starting... +# 331 test suites found. + +# PASS test\toCurrency\toCurrency.test.js + +ok 1 — toCurrency is a Function +ok 2 — currency: Euro | currencyLangFormat: Local +ok 3 — currency: US Dollar | currencyLangFormat: English (United States) +ok 4 — currency: Japanese Yen | currencyLangFormat: Local + +# PASS test\functionName\functionName.test.js + +ok 5 — functionName is a Function +ok 6 — Works for native functions +ok 7 — Works for functions +ok 8 — Works for arrow functions + +# PASS test\unzip\unzip.test.js + +ok 9 — unzip is a Function +ok 10 — unzip([['a', 1, true], ['b', 2, false]]) equals [['a','b'], [1, 2], [true, false]] +ok 11 — unzip([['a', 1, true], ['b', 2]]) equals [['a','b'], [1, 2], [true]] + +# PASS test\uniqueElements\uniqueElements.test.js + +ok 12 — uniqueElements is a Function +ok 13 — uniqueElements([1, 2, 2, 3, 4, 4, 5]) returns [1,2,3,4,5] +ok 14 — uniqueElements([1, 23, 53]) returns [1, 23, 53] +ok 15 — uniqueElements([true, 0, 1, false, false, undefined, null, '']) returns [true, 0, 1, false, false, undefined, null, ''] +ok 16 — uniqueElements() returns [] +ok 17 — uniqueElements(null) returns [] +ok 18 — uniqueElements(undefined) returns [] +ok 19 — uniqueElements('strt') returns ['s', 't', 'r'] +ok 20 — uniqueElements(1, 1, 2543, 534, 5) throws an error +ok 21 — uniqueElements({}) throws an error +ok 22 — uniqueElements(true) throws an error +ok 23 — uniqueElements(false) throws an error +ok 24 — uniqueElements([true, 0, 1, false, false, undefined, null]) takes less than 2s to run + +# PASS test\chunk\chunk.test.js + +ok 25 — chunk is a Function +ok 26 — chunk([1, 2, 3, 4, 5], 2) returns [[1,2],[3,4],[5]] +ok 27 — chunk([]) returns [] +ok 28 — chunk(123) returns [] +ok 29 — chunk({ a: 123}) returns [] +ok 30 — chunk(string, 2) returns [ st, ri, ng ] +ok 31 — chunk() throws an error +ok 32 — chunk(undefined) throws an error +ok 33 — chunk(null) throws an error +ok 34 — chunk(This is a string, 2) takes less than 2s to run + +# PASS test\similarity\similarity.test.js + +ok 35 — similarity is a Function +ok 36 — Returns an array of elements that appear in both arrays. + +# PASS test\inRange\inRange.test.js + +ok 37 — inRange is a Function +ok 38 — The given number falls within the given range +ok 39 — The given number falls within the given range +ok 40 — The given number does not falls within the given range +ok 41 — The given number does not falls within the given range + +# PASS test\matches\matches.test.js + +ok 42 — matches is a Function +ok 43 — Matches returns true for two similar objects +ok 44 — Matches returns false for two non-similar objects + +# PASS test\gcd\gcd.test.js + +ok 45 — gcd is a Function +ok 46 — Calculates the greatest common divisor between two or more numbers/arrays +ok 47 — Calculates the greatest common divisor between two or more numbers/arrays + +# PASS test\everyNth\everyNth.test.js + +ok 48 — everyNth is a Function +ok 49 — Returns every nth element in an array + +# PASS test\isSorted\isSorted.test.js + +ok 50 — isSorted is a Function +ok 51 — Array is sorted in ascending order +ok 52 — Array is sorted in ascending order +ok 53 — Array is sorted in ascending order +ok 54 — Array is sorted in ascending order +ok 55 — Array is sorted in descending order +ok 56 — Array is sorted in descending order +ok 57 — Array is sorted in descending order +ok 58 — Array is sorted in descending order +ok 59 — Array is empty +ok 60 — Array is not sorted, direction changed in array +ok 61 — Array is not sorted, direction changed in array + +# PASS test\union\union.test.js + +ok 62 — union is a Function +ok 63 — union([1, 2, 3], [4, 3, 2]) returns [1, 2, 3, 4] +ok 64 — union('str', 'asd') returns [ 's', 't', 'r', 'a', 'd' ] +ok 65 — union([[], {}], [1, 2, 3]) returns [[], {}, 1, 2, 3] +ok 66 — union([], []) returns [] +ok 67 — union() throws an error +ok 68 — union(true, 'str') throws an error +ok 69 — union('false', true) throws an error +ok 70 — union((123, {}) throws an error +ok 71 — union([], {}) throws an error +ok 72 — union(undefined, null) throws an error +ok 73 — union([1, 2, 3], [4, 3, 2]) takes less than 2s to run + +# PASS test\luhnCheck\luhnCheck.test.js + +ok 74 — luhnCheck is a Function +ok 75 — validates identification number +ok 76 — validates identification number +ok 77 — validates identification number + +# PASS test\nodeListToArray\nodeListToArray.test.js + +ok 78 — nodeListToArray is a Function + +# PASS test\overArgs\overArgs.test.js + +ok 79 — overArgs is a Function +ok 80 — Invokes the provided function with its arguments transformed + +# PASS test\sortedIndex\sortedIndex.test.js + +ok 81 — sortedIndex is a Function +ok 82 — Returns the lowest index at which value should be inserted into array in order to maintain its sort order. +ok 83 — Returns the lowest index at which value should be inserted into array in order to maintain its sort order. + +# PASS test\isPrimitive\isPrimitive.test.js + +ok 84 — isPrimitive is a Function +ok 85 — isPrimitive(null) is primitive +ok 86 — isPrimitive(undefined) is primitive +ok 87 — isPrimitive(string) is primitive +ok 88 — isPrimitive(true) is primitive +ok 89 — isPrimitive(50) is primitive +ok 90 — isPrimitive('Hello') is primitive +ok 91 — isPrimitive(false) is primitive +ok 92 — isPrimitive(Symbol()) is primitive +ok 93 — isPrimitive([1, 2, 3]) is not primitive +ok 94 — isPrimitive({ a: 123 }) is not primitive +ok 95 — isPrimitive({ a: 123 }) takes less than 2s to run + +# PASS test\isBoolean\isBoolean.test.js + +ok 96 — isBoolean is a Function +ok 97 — passed value is not a boolean +ok 98 — passed value is not a boolean + +# PASS test\without\without.test.js + +ok 99 — without is a Function +ok 100 — without([2, 1, 2, 3], 1, 2) returns [3] +ok 101 — without([]) returns [] +ok 102 — without([3, 1, true, '3', true], '3', true) returns [3, 1] +ok 103 — without('string'.split(''), 's', 't', 'g') returns ['r', 'i', 'n'] +ok 104 — without() throws an error +ok 105 — without(null) throws an error +ok 106 — without(undefined) throws an error +ok 107 — without(123) throws an error +ok 108 — without({}) throws an error + +# PASS test\validateNumber\validateNumber.test.js + +ok 109 — validateNumber is a Function +ok 110 — validateNumber(9) returns true +ok 111 — validateNumber(234asd.slice(0, 2)) returns true +ok 112 — validateNumber(1232) returns true +ok 113 — validateNumber(1232 + 13423) returns true +ok 114 — validateNumber(1232 * 2342 * 123) returns true +ok 115 — validateNumber(1232.23423536) returns true +ok 116 — validateNumber(234asd) returns false +ok 117 — validateNumber(e234d) returns false +ok 118 — validateNumber(false) returns false +ok 119 — validateNumber(true) returns false +ok 120 — validateNumber(null) returns false +ok 121 — validateNumber(123 * asd) returns false + +# PASS test\zipObject\zipObject.test.js + +ok 122 — zipObject is a Function +ok 123 — zipObject([a, b, c], [1, 2]) returns {a: 1, b: 2, c: undefined} +ok 124 — zipObject([a, b], [1, 2, 3]) returns {a: 1, b: 2} +ok 125 — zipObject([a, b, c], string) returns { a: s, b: t, c: r } +ok 126 — zipObject([a], string) returns { a: s } +ok 127 — zipObject() throws an error +ok 128 — zipObject((['string'], null) throws an error +ok 129 — zipObject(null, [1]) throws an error +ok 130 — zipObject('string') throws an error +ok 131 — zipObject('test', 'string') throws an error + +# PASS test\memoize\memoize.test.js + +ok 132 — memoize is a Function +ok 133 — Function works properly +ok 134 — Function works properly +ok 135 — Cache stores values + +# PASS test\toggleClass\toggleClass.test.js + +ok 136 — toggleClass is a Function + +# PASS test\bind\bind.test.js + +ok 137 — bind is a Function +ok 138 — Binds to an object context + +# PASS test\promisify\promisify.test.js + +ok 139 — promisify is a Function +ok 140 — Returns a promise +ok 141 — Runs the function provided + +# PASS test\reverseString\reverseString.test.js + +ok 142 — reverseString is a Function +ok 143 — Reverses a string. + +# PASS test\yesNo\yesNo.test.js + +ok 144 — yesNo is a Function +ok 145 — yesNo(Y) returns true +ok 146 — yesNo(yes) returns true +ok 147 — yesNo(foo, true) returns true +ok 148 — yesNo(No) returns false +ok 149 — yesNo() returns false +ok 150 — yesNo(null) returns false +ok 151 — yesNo(undefined) returns false +ok 152 — yesNo([123, null]) returns false +ok 153 — yesNo([Yes, No]) returns false +ok 154 — yesNo({ 2: Yes }) returns false +ok 155 — yesNo([Yes, No], true) returns true +ok 156 — yesNo({ 2: Yes }, true) returns true + +# PASS test\arrayToHtmlList\arrayToHtmlList.test.js + +ok 157 — arrayToHtmlList is a Function + +# PASS test\toSafeInteger\toSafeInteger.test.js + +ok 158 — toSafeInteger is a Function +ok 159 — Number(toSafeInteger(3.2)) is a number +ok 160 — Converts a value to a safe integer +ok 161 — toSafeInteger('4.2') returns 4 +ok 162 — toSafeInteger(4.6) returns 5 +ok 163 — toSafeInteger([]) returns 0 +ok 164 — isNaN(toSafeInteger([1.5, 3124])) is true +ok 165 — isNaN(toSafeInteger('string')) is true +ok 166 — isNaN(toSafeInteger({})) is true +ok 167 — isNaN(toSafeInteger()) is true +ok 168 — toSafeInteger(Infinity) returns 9007199254740991 +ok 169 — toSafeInteger(3.2) takes less than 2s to run + +# PASS test\reduceWhich\reduceWhich.test.js + +ok 170 — reduceWhich is a Function +ok 171 — Returns the minimum of an array +ok 172 — Returns the maximum of an array +ok 173 — Returns the object with the minimum specified value in an array + +# PASS test\elo\elo.test.js + +ok 174 — elo is a Function +ok 175 — Standard 1v1s +ok 176 — Standard 1v1s +ok 177 — 4 player FFA, all same rank + +# PASS test\toKebabCase\toKebabCase.test.js + +ok 178 — toKebabCase is a Function +ok 179 — toKebabCase('camelCase') returns camel-case +ok 180 — toKebabCase('some text') returns some-text +ok 181 — toKebabCase('some-mixed-string With spaces-underscores-and-hyphens') returns some-mixed-string-with-spaces-underscores-and-hyphens +ok 182 — toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html +ok 183 — toKebabCase() returns undefined +ok 184 — toKebabCase([]) throws an erro +ok 185 — toKebabCase({}) throws an erro +ok 186 — toKebabCase(123) throws an erro +ok 187 — toKebabCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run + +# PASS test\round\round.test.js + +ok 188 — round is a Function +ok 189 — round(1.005, 2) returns 1.01 +ok 190 — round(123.3423345345345345344, 11) returns 123.34233453453 +ok 191 — round(3.342, 11) returns 3.342 +ok 192 — round(1.005) returns 1 +ok 193 — round([1.005, 2]) returns NaN +ok 194 — round(string) returns NaN +ok 195 — round() returns NaN +ok 196 — round(132, 413, 4134) returns NaN +ok 197 — round({a: 132}, 413) returns NaN +ok 198 — round(123.3423345345345345344, 11) takes less than 2s to run + +# PASS test\offset\offset.test.js + +ok 199 — offset is a Function +ok 200 — Offset of 0 returns the same array. +ok 201 — Offset > 0 returns the offsetted array. +ok 202 — Offset < 0 returns the reverse offsetted array. +ok 203 — Offset greater than the length of the array returns the same array. +ok 204 — Offset less than the negative length of the array returns the same array. +ok 205 — Offsetting empty array returns an empty array. + +# PASS test\times\times.test.js + +ok 206 — times is a Function +ok 207 — Runs a function the specified amount of times + +# PASS test\difference\difference.test.js + +ok 208 — difference is a Function +ok 209 — Returns the difference between two arrays + +# PASS test\head\head.test.js + +ok 210 — head is a Function +ok 211 — head({ a: 1234}) returns undefined +ok 212 — head([1, 2, 3]) returns 1 +ok 213 — head({ 0: false}) returns false +ok 214 — head(String) returns S +ok 215 — head(null) throws an Error +ok 216 — head(undefined) throws an Error +ok 217 — head() throws an Error +ok 218 — head([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run + +# PASS test\countBy\countBy.test.js + +ok 219 — countBy is a Function +ok 220 — Works for functions +ok 221 — Works for property names + +# PASS test\quickSort\quickSort.test.js + +ok 222 — quickSort is a Function +ok 223 — quickSort([5, 6, 4, 3, 1, 2]) returns [1, 2, 3, 4, 5, 6] +ok 224 — quickSort([-1, 0, -2]) returns [-2, -1, 0] +ok 225 — quickSort() throws an error +ok 226 — quickSort(123) throws an error +ok 227 — quickSort({ 234: string}) throws an error +ok 228 — quickSort(null) throws an error +ok 229 — quickSort(undefined) throws an error +ok 230 — quickSort([11, 1, 324, 23232, -1, 53, 2, 524, 32, 13, 156, 133, 62, 12, 4]) takes less than 2s to run + +# PASS test\nthArg\nthArg.test.js + +ok 231 — nthArg is a Function +ok 232 — Returns the nth argument +ok 233 — Returns undefined if arguments too few +ok 234 — Works for negative values + +# PASS test\castArray\castArray.test.js + +ok 235 — castArray is a Function +ok 236 — Works for single values +ok 237 — Works for arrays with one value +ok 238 — Works for arrays with multiple value +ok 239 — Works for strings +ok 240 — Works for objects + +# PASS test\minN\minN.test.js + +ok 241 — minN is a Function +ok 242 — Returns the n minimum elements from the provided array +ok 243 — Returns the n minimum elements from the provided array + +# PASS test\isEmpty\isEmpty.test.js + +ok 244 — isEmpty is a Function +ok 245 — Returns true for empty Map +ok 246 — Returns true for empty Set +ok 247 — Returns true for empty array +ok 248 — Returns true for empty object +ok 249 — Returns true for empty string +ok 250 — Returns false for non-empty array +ok 251 — Returns false for non-empty object +ok 252 — Returns false for non-empty string +ok 253 — Returns true - type is not considered a collection +ok 254 — Returns true - type is not considered a collection + +# PASS test\mapObject\mapObject.test.js + +ok 255 — mapObject is a Function +ok 256 — mapObject([1, 2, 3], a => a * a) returns { 1: 1, 2: 4, 3: 9 } +ok 257 — mapObject([1, 2, 3, 4], (a, b) => b - a) returns { 1: -1, 2: -1, 3: -1, 4: -1 } +ok 258 — mapObject([1, 2, 3, 4], (a, b) => a - b) returns { 1: 1, 2: 1, 3: 1, 4: 1 } + +# PASS test\prettyBytes\prettyBytes.test.js + +ok 259 — prettyBytes is a Function +ok 260 — Converts a number in bytes to a human-readable string. +ok 261 — Converts a number in bytes to a human-readable string. +ok 262 — Converts a number in bytes to a human-readable string. + +# PASS test\atob\atob.test.js + +ok 263 — atob is a Function +ok 264 — atob("Zm9vYmFy") equals "foobar" +ok 265 — atob("Z") returns "" + +# PASS test\cloneRegExp\cloneRegExp.test.js + +ok 266 — cloneRegExp is a Function +ok 267 — Clones regular expressions properly + +# PASS test\toSnakeCase\toSnakeCase.test.js + +ok 268 — toSnakeCase is a Function +ok 269 — toSnakeCase('camelCase') returns camel_case +ok 270 — toSnakeCase('some text') returns some_text +ok 271 — toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens') returns some_mixed_string_with_spaces_underscores_and_hyphens +ok 272 — toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML') returns i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html +ok 273 — toSnakeCase() returns undefined +ok 274 — toSnakeCase([]) throws an error +ok 275 — toSnakeCase({}) throws an error +ok 276 — toSnakeCase(123) throws an error +ok 277 — toSnakeCase(IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML) takes less than 2s to run + +# PASS test\debounce\debounce.test.js + +ok 278 — debounce is a Function +ok 279 — Works as expected + +# PASS test\orderBy\orderBy.test.js + +ok 280 — orderBy is a Function +ok 281 — Returns a sorted array of objects ordered by properties and orders. +ok 282 — Returns a sorted array of objects ordered by properties and orders. + +# PASS test\toCamelCase\toCamelCase.test.js + +ok 283 — toCamelCase is a Function +ok 284 — toCamelCase('some_database_field_name') returns someDatabaseFieldName +ok 285 — toCamelCase('Some label that needs to be camelized') returns someLabelThatNeedsToBeCamelized +ok 286 — toCamelCase('some-javascript-property') return someJavascriptProperty +ok 287 — toCamelCase('some-mixed_string with spaces_underscores-and-hyphens') returns someMixedStringWithSpacesUnderscoresAndHyphens +ok 288 — toCamelCase() throws a error +ok 289 — toCamelCase([]) throws a error +ok 290 — toCamelCase({}) throws a error +ok 291 — toCamelCase(123) throws a error +ok 292 — toCamelCase(some-mixed_string with spaces_underscores-and-hyphens) takes less than 2s to run + +# PASS test\isArray\isArray.test.js + +ok 293 — isArray is a Function +ok 294 — passed value is an array +ok 295 — passed value is not an array + +# PASS test\isArrayBuffer\isArrayBuffer.test.js + +ok 296 — isArrayBuffer is a Function + +# PASS test\isString\isString.test.js + +ok 297 — isString is a Function +ok 298 — foo is a string +ok 299 — "10" is a string +ok 300 — Empty string is a string +ok 301 — 10 is not a string +ok 302 — true is not string + +# PASS test\pick\pick.test.js + +ok 303 — pick is a Function +ok 304 — Picks the key-value pairs corresponding to the given keys from an object. + +# PASS test\isWeakMap\isWeakMap.test.js + +ok 305 — isWeakMap is a Function + +# PASS test\httpsRedirect\httpsRedirect.test.js + +ok 306 — httpsRedirect is a Function + +# PASS test\toOrdinalSuffix\toOrdinalSuffix.test.js + +ok 307 — toOrdinalSuffix is a Function +ok 308 — Adds an ordinal suffix to a number +ok 309 — Adds an ordinal suffix to a number +ok 310 — Adds an ordinal suffix to a number +ok 311 — Adds an ordinal suffix to a number + +# PASS test\sortedLastIndexBy\sortedLastIndexBy.test.js + +ok 312 — sortedLastIndexBy is a Function +ok 313 — Returns the highest index to insert the element without messing up the list order + +# PASS test\runPromisesInSeries\runPromisesInSeries.test.js + +ok 314 — runPromisesInSeries is a Function +ok 315 — Runs promises in series + +# PASS test\sampleSize\sampleSize.test.js + +ok 316 — sampleSize is a Function +ok 317 — Returns a single element without n specified +ok 318 — Returns a random sample of specified size from an array +ok 319 — Returns all elements in an array if n >= length +ok 320 — Returns an empty array if original array is empty +ok 321 — Returns an empty array if n = 0 + +# PASS test\recordAnimationFrames\recordAnimationFrames.test.js + +ok 322 — recordAnimationFrames is a Function + +# PASS test\isAbsoluteURL\isAbsoluteURL.test.js + +ok 323 — isAbsoluteURL is a Function +ok 324 — Given string is an absolute URL +ok 325 — Given string is an absolute URL +ok 326 — Given string is not an absolute URL + +# PASS test\timeTaken\timeTaken.test.js + +ok 327 — timeTaken is a Function + +# PASS test\tomorrow\tomorrow.test.js + +ok 328 — tomorrow is a Function +ok 329 — Returns the correct year +ok 330 — Returns the correct month +ok 331 — Returns the correct date + +# PASS test\pullAtIndex\pullAtIndex.test.js + +ok 332 — pullAtIndex is a Function +ok 333 — Pulls the given values +ok 334 — Pulls the given values + +# PASS test\words\words.test.js + +ok 335 — words is a Function +ok 336 — words('I love javaScript!!') returns [I, love, javaScript] +ok 337 — words('python, javaScript & coffee') returns [python, javaScript, coffee] +ok 338 — words(I love javaScript!!) returns an array +ok 339 — words() throws an error +ok 340 — words(null) throws an error +ok 341 — words(undefined) throws an error +ok 342 — words({}) throws an error +ok 343 — words([]) throws an error +ok 344 — words(1234) throws an error + +# PASS test\isNumber\isNumber.test.js + +ok 345 — isNumber is a Function +ok 346 — passed argument is a number +ok 347 — passed argument is not a number + +# PASS test\median\median.test.js + +ok 348 — median is a Function +ok 349 — Returns the median of an array of numbers +ok 350 — Returns the median of an array of numbers + +# PASS test\bindKey\bindKey.test.js + +ok 351 — bindKey is a Function +ok 352 — Binds function to an object context + +# PASS test\cleanObj\cleanObj.test.js + +ok 353 — cleanObj is a Function +ok 354 — Removes any properties except the ones specified from a JSON object + +# PASS test\forOwnRight\forOwnRight.test.js + +ok 355 — forOwnRight is a Function +ok 356 — Iterates over an element's key-value pairs in reverse + +# PASS test\primes\primes.test.js + +ok 357 — primes is a Function +ok 358 — Generates primes up to a given number, using the Sieve of Eratosthenes. + +# PASS test\pad\pad.test.js + +ok 359 — pad is a Function +ok 360 — cat is padded on both sides +ok 361 — length of string is 8 +ok 362 — pads 42 with "0" +ok 363 — does not truncates if string exceeds length + +# PASS test\xProd\xProd.test.js + +ok 364 — xProd is a Function +ok 365 — xProd([1, 2], ['a', 'b']) returns [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']] + +# PASS test\isObjectLike\isObjectLike.test.js + +ok 366 — isObjectLike is a Function +ok 367 — Returns true for an object +ok 368 — Returns true for an array +ok 369 — Returns false for a function +ok 370 — Returns false for null + +# PASS test\partition\partition.test.js + +ok 371 — partition is a Function +ok 372 — Groups the elements into two arrays, depending on the provided function's truthiness for each element. + +# PASS test\all\all.test.js + +ok 373 — all is a Function +ok 374 — Returns true for arrays with no falsey values +ok 375 — Returns false for arrays with 0 +ok 376 — Returns false for arrays with NaN +ok 377 — Returns false for arrays with undefined +ok 378 — Returns false for arrays with null +ok 379 — Returns false for arrays with empty strings +ok 380 — Returns true with predicate function +ok 381 — Returns false with a predicate function + +# PASS test\fromCamelCase\fromCamelCase.test.js + +ok 382 — fromCamelCase is a Function +ok 383 — Converts a string from camelcase +ok 384 — Converts a string from camelcase +ok 385 — Converts a string from camelcase + +# PASS test\splitLines\splitLines.test.js + +ok 386 — splitLines is a Function +ok 387 — Splits a multiline string into an array of lines. + +# PASS test\factorial\factorial.test.js + +ok 388 — factorial is a Function +ok 389 — Calculates the factorial of 720 +ok 390 — Calculates the factorial of 0 +ok 391 — Calculates the factorial of 1 +ok 392 — Calculates the factorial of 4 +ok 393 — Calculates the factorial of 10 + +# PASS test\forOwn\forOwn.test.js + +ok 394 — forOwn is a Function +ok 395 — Iterates over an element's key-value pairs + +# PASS test\take\take.test.js + +ok 396 — take is a Function +ok 397 — Returns an array with n elements removed from the beginning. +ok 398 — Returns an array with n elements removed from the beginning. + +# PASS test\hashNode\hashNode.test.js + +ok 399 — hashNode is a Function +ok 400 — Produces the appropriate hash + +# PASS test\colorize\colorize.test.js + +ok 401 — colorize is a Function + +# PASS test\unfold\unfold.test.js + +ok 402 — unfold is a Function +ok 403 — Works with a given function, producing an array + +# PASS test\stripHTMLTags\stripHTMLTags.test.js + +ok 404 — stripHTMLTags is a Function +ok 405 — Removes HTML tags + +# PASS test\longestItem\longestItem.test.js + +ok 406 — longestItem is a Function +ok 407 — Returns the longest object + +# PASS test\average\average.test.js + +ok 408 — average is a Function +ok 409 — average(true) returns 0 +ok 410 — average(false) returns 1 +ok 411 — average(9, 1) returns 5 +ok 412 — average(153, 44, 55, 64, 71, 1122, 322774, 2232, 23423, 234, 3631) returns 32163.909090909092 +ok 413 — average(1, 2, 3) returns 2 +ok 414 — average(null) returns 0 +ok 415 — average(1, 2, 3) returns NaN +ok 416 — average(String) returns NaN +ok 417 — average({ a: 123}) returns NaN +ok 418 — average([undefined, 0, string]) returns NaN +ok 419 — average([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run + +# PASS test\randomIntegerInRange\randomIntegerInRange.test.js + +ok 420 — randomIntegerInRange is a Function +ok 421 — The returned value is an integer +ok 422 — The returned value lies between provided lowerLimit and upperLimit (both inclusive). + +# PASS test\any\any.test.js + +ok 423 — any is a Function +ok 424 — Returns true for arrays with at least one truthy value +ok 425 — Returns false for arrays with no truthy values +ok 426 — Returns false for arrays with no truthy values +ok 427 — Returns true with predicate function +ok 428 — Returns false with a predicate function + +# PASS test\curry\curry.test.js + +ok 429 — curry is a Function +ok 430 — curries a Math.pow +ok 431 — curries a Math.min + +# PASS test\when\when.test.js + +ok 432 — when is a Function +ok 433 — Returns the proper result +ok 434 — Returns the proper result + +# PASS test\hasFlags\hasFlags.test.js + +ok 435 — hasFlags is a Function + +# PASS test\randomHexColorCode\randomHexColorCode.test.js + +ok 436 — randomHexColorCode is a Function +ok 437 — randomHexColorCode has to proper length +ok 438 — The color code starts with "#" +ok 439 — The color code contains only valid hex-digits + +# PASS test\getURLParameters\getURLParameters.test.js + +ok 440 — getURLParameters is a Function +ok 441 — Returns an object containing the parameters of the current URL + +# PASS test\last\last.test.js + +ok 442 — last is a Function +ok 443 — last({ a: 1234}) returns undefined +ok 444 — last([1, 2, 3]) returns 3 +ok 445 — last({ 0: false}) returns undefined +ok 446 — last(String) returns g +ok 447 — last(null) throws an Error +ok 448 — last(undefined) throws an Error +ok 449 — last() throws an Error +ok 450 — last([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run + +# PASS test\flip\flip.test.js + +ok 451 — flip is a Function +ok 452 — Flips argument order + +# PASS test\formatDuration\formatDuration.test.js + +ok 453 — formatDuration is a Function +ok 454 — Returns the human readable format of the given number of milliseconds +ok 455 — Returns the human readable format of the given number of milliseconds + +# PASS test\isWeakSet\isWeakSet.test.js + +ok 456 — isWeakSet is a Function + +# PASS test\bindAll\bindAll.test.js + +ok 457 — bindAll is a Function +ok 458 — Binds to an object context + +# PASS test\maxBy\maxBy.test.js + +ok 459 — maxBy is a Function +ok 460 — Produces the right result with a function +ok 461 — Produces the right result with a property name + +# PASS test\averageBy\averageBy.test.js + +ok 462 — averageBy is a Function +ok 463 — Produces the right result with a function +ok 464 — Produces the right result with a property name + +# PASS test\removeVowels\removeVowels.test.js + +ok 465 — removeVowels is a Function + +# PASS test\equals\equals.test.js + +ok 466 — equals is a Function +ok 467 — { a: [2, {e: 3}], b: [4], c: 'foo' } is equal to { a: [2, {e: 3}], b: [4], c: 'foo' } +ok 468 — [1,2,3] is equal to [1,2,3] +ok 469 — { a: [2, 3], b: [4] } is not equal to { a: [2, 3], b: [6] } +ok 470 — [1,2,3] is not equal to [1,2,4] +ok 471 — [1, 2, 3] should be equal to { 0: 1, 1: 2, 2: 3 }) - type is different, but their enumerable properties match. + +# PASS test\sleep\sleep.test.js + +ok 472 — sleep is a Function +ok 473 — Works as expected + +# PASS test\over\over.test.js + +ok 474 — over is a Function +ok 475 — Applies given functions over multiple arguments + +# PASS test\findLast\findLast.test.js + +ok 476 — findLast is a Function +ok 477 — Finds last element for which the given function returns true + +# PASS test\unescapeHTML\unescapeHTML.test.js + +ok 478 — unescapeHTML is a Function +ok 479 — Unescapes escaped HTML characters. + +# PASS test\sortCharactersInString\sortCharactersInString.test.js + +ok 480 — sortCharactersInString is a Function +ok 481 — Alphabetically sorts the characters in a string. + +# PASS test\JSONToDate\JSONToDate.test.js + +ok 482 — JSONToDate is a Function + +# PASS test\negate\negate.test.js + +ok 483 — negate is a Function +ok 484 — Negates a predicate function + +# PASS test\mostPerformant\mostPerformant.test.js + +ok 485 — mostPerformant is a Function + +# PASS test\flattenObject\flattenObject.test.js + +ok 486 — flattenObject is a Function +ok 487 — Flattens an object with the paths for keys +ok 488 — Works with arrays + +# PASS test\shuffle\shuffle.test.js + +ok 489 — shuffle is a Function +ok 490 — Shuffles the array +ok 491 — New array contains all original elements +ok 492 — Works for empty arrays +ok 493 — Works for single-element arrays + +# PASS test\matchesWith\matchesWith.test.js + +ok 494 — matchesWith is a Function +ok 495 — Returns true for two objects with similar values, based on the provided function + +# PASS test\renameKeys\renameKeys.test.js + +ok 496 — renameKeys is a Function +ok 497 — renameKeys is a Function + +# PASS test\show\show.test.js + +ok 498 — show is a Function + +# PASS test\on\on.test.js + +ok 499 — on is a Function + +# PASS test\extendHex\extendHex.test.js + +ok 500 — extendHex is a Function +ok 501 — Extends a 3-digit color code to a 6-digit color code +ok 502 — Extends a 3-digit color code to a 6-digit color code + +# PASS test\sample\sample.test.js + +ok 503 — sample is a Function +ok 504 — Returns a random element from the array +ok 505 — Works for single-element arrays +ok 506 — Returns undefined for empty array + +# PASS test\coalesceFactory\coalesceFactory.test.js + +ok 507 — coalesceFactory is a Function +ok 508 — Returns a customized coalesce function + +# PASS test\unary\unary.test.js + +ok 509 — unary is a Function +ok 510 — Discards arguments after the first one + +# PASS test\fibonacci\fibonacci.test.js + +ok 511 — fibonacci is a Function +ok 512 — Generates an array, containing the Fibonacci sequence + +# PASS test\palindrome\palindrome.test.js + +ok 513 — palindrome is a Function +ok 514 — Given string is a palindrome +ok 515 — Given string is not a palindrome + +# PASS test\shallowClone\shallowClone.test.js + +ok 516 — shallowClone is a Function +ok 517 — Shallow cloning works +ok 518 — Does not clone deeply + +# PASS test\isBrowserTabFocused\isBrowserTabFocused.test.js + +ok 519 — isBrowserTabFocused is a Function + +# PASS test\sumBy\sumBy.test.js + +ok 520 — sumBy is a Function + +# PASS test\minBy\minBy.test.js + +ok 521 — minBy is a Function +ok 522 — Produces the right result with a function +ok 523 — Produces the right result with a property name + +# PASS test\findLastKey\findLastKey.test.js + +ok 524 — findLastKey is a Function +ok 525 — eturns the appropriate key + +# PASS test\countVowels\countVowels.test.js + +ok 526 — countVowels is a Function + +# PASS test\factors\factors.test.js + +ok 527 — factors is a Function + +# PASS test\is\is.test.js + +ok 528 — is is a Function +ok 529 — Works for arrays with data +ok 530 — Works for empty arrays +ok 531 — Works for arrays, not objects +ok 532 — Works for objects +ok 533 — Works for maps +ok 534 — Works for regular expressions +ok 535 — Works for sets +ok 536 — Works for weak maps +ok 537 — Works for weak sets +ok 538 — Works for strings - returns true for primitive +ok 539 — Works for strings - returns true when using constructor +ok 540 — Works for numbers - returns true for primitive +ok 541 — Works for numbers - returns true when using constructor +ok 542 — Works for booleans - returns true for primitive +ok 543 — Works for booleans - returns true when using constructor +ok 544 — Works for functions + +# PASS test\converge\converge.test.js + +ok 545 — converge is a Function +ok 546 — Produces the average of the array +ok 547 — Produces the strange concatenation + +# PASS test\observeMutations\observeMutations.test.js + +ok 548 — observeMutations is a Function + +# PASS test\isTravisCI\isTravisCI.test.js + +ok 549 — isTravisCI is a Function +ok 550 — Not running on Travis, correctly evaluates + +# PASS test\maxN\maxN.test.js + +ok 551 — maxN is a Function +ok 552 — Returns the n maximum elements from the provided array +ok 553 — Returns the n maximum elements from the provided array + +# PASS test\objectToPairs\objectToPairs.test.js + +ok 554 — objectToPairs is a Function +ok 555 — Creates an array of key-value pair arrays from an object. + +# PASS test\forEachRight\forEachRight.test.js + +ok 556 — forEachRight is a Function +ok 557 — Iterates over the array in reverse + +# PASS test\isNil\isNil.test.js + +ok 558 — isNil is a Function +ok 559 — Returns true for null +ok 560 — Returns true for undefined +ok 561 — Returns false for an empty string + +# PASS test\bifurcateBy\bifurcateBy.test.js + +ok 562 — bifurcateBy is a Function +ok 563 — Splits the collection into two groups + +# PASS test\digitize\digitize.test.js + +ok 564 — digitize is a Function +ok 565 — Converts a number to an array of digits + +# PASS test\isUndefined\isUndefined.test.js + +ok 566 — isUndefined is a Function +ok 567 — Returns true for undefined + +# PASS test\isUpperCase\isUpperCase.test.js + +ok 568 — isUpperCase is a Function +ok 569 — ABC is all upper case +ok 570 — abc is not all upper case +ok 571 — A3@$ is all uppercase + +# PASS test\isEven\isEven.test.js + +ok 572 — isEven is a Function +ok 573 — 4 is even number +ok 574 — 5 is not an even number + +# PASS test\countOccurrences\countOccurrences.test.js + +ok 575 — countOccurrences is a Function +ok 576 — Counts the occurrences of a value in an array + +# PASS test\randomIntArrayInRange\randomIntArrayInRange.test.js + +ok 577 — randomIntArrayInRange is a Function +ok 578 — The returned array contains only integers +ok 579 — The returned array has the proper length +ok 580 — The returned array's values lie between provided lowerLimit and upperLimit (both inclusive). + +# PASS test\collatz\collatz.test.js + +ok 581 — collatz is a Function +ok 582 — When n is even, divide by 2 +ok 583 — When n is odd, times by 3 and add 1 +ok 584 — Eventually reaches 1 + +# PASS test\isLowerCase\isLowerCase.test.js + +ok 585 — isLowerCase is a Function +ok 586 — passed string is a lowercase +ok 587 — passed string is a lowercase +ok 588 — passed value is not a lowercase + +# PASS test\filterNonUnique\filterNonUnique.test.js + +ok 589 — filterNonUnique is a Function +ok 590 — Filters out the non-unique values in an array + +# PASS test\unflattenObject\unflattenObject.test.js + +ok 591 — unflattenObject is a Function +ok 592 — Unflattens an object with the paths for keys + +# PASS test\capitalizeEveryWord\capitalizeEveryWord.test.js + +ok 593 — capitalizeEveryWord is a Function +ok 594 — Capitalizes the first letter of every word in a string +ok 595 — Works with characters +ok 596 — Works with one word string + +# PASS test\pickBy\pickBy.test.js + +ok 597 — pickBy is a Function +ok 598 — Creates an object composed of the properties the given function returns truthy for. + +# PASS test\takeRight\takeRight.test.js + +ok 599 — takeRight is a Function +ok 600 — Returns an array with n elements removed from the end +ok 601 — Returns an array with n elements removed from the end + +# PASS test\compact\compact.test.js + +ok 602 — compact is a Function +ok 603 — Removes falsey values from an array + +# PASS test\dropRight\dropRight.test.js + +ok 604 — dropRight is a Function +ok 605 — Returns a new array with n elements removed from the right +ok 606 — Returns a new array with n elements removed from the right +ok 607 — Returns a new array with n elements removed from the right + +# PASS test\standardDeviation\standardDeviation.test.js + +ok 608 — standardDeviation is a Function +ok 609 — Returns the standard deviation of an array of numbers +ok 610 — Returns the standard deviation of an array of numbers + +# PASS test\distance\distance.test.js + +ok 611 — distance is a Function +ok 612 — Calculates the distance between two points + +# PASS test\isPrime\isPrime.test.js + +ok 613 — isPrime is a Function +ok 614 — passed number is a prime + +# PASS test\unionWith\unionWith.test.js + +ok 615 — unionWith is a Function +ok 616 — Produces the appropriate results + +# PASS test\getScrollPosition\getScrollPosition.test.js + +ok 617 — getScrollPosition is a Function + +# PASS test\deepFlatten\deepFlatten.test.js + +ok 618 — deepFlatten is a Function +ok 619 — Deep flattens an array + +# PASS test\reject\reject.test.js + +ok 620 — reject is a Function +ok 621 — Works with numbers +ok 622 — Works with strings + +# PASS test\omit\omit.test.js + +ok 623 — omit is a Function +ok 624 — Omits the key-value pairs corresponding to the given keys from an object + +# PASS test\howManyTimes\howManyTimes.test.js + +ok 625 — howManyTimes is a Function + +# PASS test\merge\merge.test.js + +ok 626 — merge is a Function +ok 627 — Merges two objects + +# PASS test\findKey\findKey.test.js + +ok 628 — findKey is a Function +ok 629 — Returns the appropriate key + +# PASS test\randomNumberInRange\randomNumberInRange.test.js + +ok 630 — randomNumberInRange is a Function +ok 631 — The returned value is a number +ok 632 — The returned value lies between provided lowerLimit and upperLimit (both inclusive). + +# PASS test\pullAtValue\pullAtValue.test.js + +ok 633 — pullAtValue is a Function +ok 634 — Pulls the specified values +ok 635 — Pulls the specified values + +# PASS test\readFileLines\readFileLines.test.js + +ok 636 — readFileLines is a Function + +# PASS test\redirect\redirect.test.js + +ok 637 — redirect is a Function + +# PASS test\throttle\throttle.test.js + +ok 638 — throttle is a Function + +# PASS test\hasClass\hasClass.test.js + +ok 639 — hasClass is a Function + +# PASS test\serializeCookie\serializeCookie.test.js + +ok 640 — serializeCookie is a Function +ok 641 — Serializes the cookie + +# PASS test\collectInto\collectInto.test.js + +ok 642 — collectInto is a Function +ok 643 — Works with multiple promises + +# PASS test\zipWith\zipWith.test.js + +ok 644 — zipWith is a Function + +# PASS test\escapeHTML\escapeHTML.test.js + +ok 645 — escapeHTML is a Function +ok 646 — Escapes a string for use in HTML + +# PASS test\unzipWith\unzipWith.test.js + +ok 647 — unzipWith is a Function +ok 648 — unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)) equals [3, 30, 300] + +# PASS test\speechSynthesis\speechSynthesis.test.js + +ok 649 — speechSynthesis is a Function + +# PASS test\binomialCoefficient\binomialCoefficient.test.js + +ok 650 — binomialCoefficient is a Function +ok 651 — Returns the appropriate value +ok 652 — Returns the appropriate value +ok 653 — Returns the appropriate value +ok 654 — Returns NaN +ok 655 — Returns NaN + +# PASS test\stringPermutations\stringPermutations.test.js + +ok 656 — stringPermutations is a Function +ok 657 — Generates all stringPermutations of a string +ok 658 — Works for single-letter strings +ok 659 — Works for empty strings + +# PASS test\setStyle\setStyle.test.js + +ok 660 — setStyle is a Function + +# PASS test\flatten\flatten.test.js + +ok 661 — flatten is a Function +ok 662 — Flattens an array +ok 663 — Flattens an array + +# PASS test\reduceSuccessive\reduceSuccessive.test.js + +ok 664 — reduceSuccessive is a Function +ok 665 — Returns the array of successively reduced values + +# PASS test\lowercaseKeys\lowercaseKeys.test.js + +ok 666 — lowercaseKeys is a Function +ok 667 — Lowercases object keys +ok 668 — Does not mutate original object + +# PASS test\isArmstrongNumber\isArmstrongNumber.test.js + +ok 669 — isArmstrongNumber is a Function + +# PASS test\toHash\toHash.test.js + +ok 670 — toHash is a Function + +# PASS test\dropRightWhile\dropRightWhile.test.js + +ok 671 — dropRightWhile is a Function +ok 672 — Removes elements from the end of an array until the passed function returns true. + +# PASS test\none\none.test.js + +ok 673 — none is a Function +ok 674 — Returns true for arrays with no truthy values +ok 675 — Returns false for arrays with at least one truthy value +ok 676 — Returns true with a predicate function +ok 677 — Returns false with predicate function + +# PASS test\initialize2DArray\initialize2DArray.test.js + +ok 678 — initialize2DArray is a Function +ok 679 — Initializes a 2D array of given width and height and value + +# PASS test\getStyle\getStyle.test.js + +ok 680 — getStyle is a Function + +# PASS test\transform\transform.test.js + +ok 681 — transform is a Function +ok 682 — Transforms an object + +# PASS test\truthCheckCollection\truthCheckCollection.test.js + +ok 683 — truthCheckCollection is a Function +ok 684 — second argument is truthy on all elements of a collection + +# PASS test\deepClone\deepClone.test.js + +ok 685 — deepClone is a Function +ok 686 — Shallow cloning works +ok 687 — Deep cloning works +ok 688 — Array shallow cloning works +ok 689 — Array deep cloning works + +# PASS test\uncurry\uncurry.test.js + +ok 690 — uncurry is a Function +ok 691 — Works without a provided value for n +ok 692 — Works with n = 2 +ok 693 — Works with n = 3 + +# PASS test\dropWhile\dropWhile.test.js + +ok 694 — dropWhile is a Function +ok 695 — Removes elements in an array until the passed function returns true. + +# PASS test\initial\initial.test.js + +ok 696 — initial is a Function +ok 697 — Returns all the elements of an array except the last one + +# PASS test\fibonacciUntilNum\fibonacciUntilNum.test.js + +ok 698 — fibonacciUntilNum is a Function + +# PASS test\zip\zip.test.js + +ok 699 — zip is a Function +ok 700 — zip([a, b], [1, 2], [true, false]) returns [[a, 1, true], [b, 2, false]] +ok 701 — zip([a], [1, 2], [true, false]) returns [[a, 1, true], [undefined, 2, false]] +ok 702 — zip([]) returns [] +ok 703 — zip(123) returns [] +ok 704 — zip([a, b], [1, 2], [true, false]) returns an Array +ok 705 — zip([a], [1, 2], [true, false]) returns an Array +ok 706 — zip(null) throws an error +ok 707 — zip(undefined) throws an error + +# PASS test\clampNumber\clampNumber.test.js + +ok 708 — clampNumber is a Function +ok 709 — Clamps num within the inclusive range specified by the boundary values a and b + +# PASS test\degreesToRads\degreesToRads.test.js + +ok 710 — degreesToRads is a Function +ok 711 — Returns the appropriate value + +# PASS test\isArrayLike\isArrayLike.test.js + +ok 712 — isArrayLike is a Function +ok 713 — Returns true for a string +ok 714 — Returns true for an array +ok 715 — Returns false for null + +# PASS test\currentURL\currentURL.test.js + +ok 716 — currentURL is a Function + +# PASS test\drop\drop.test.js + +ok 717 — drop is a Function +ok 718 — Works without the last argument +ok 719 — Removes appropriate element count as specified +ok 720 — Empties array given a count greater than length + +# PASS test\hexToRGB\hexToRGB.test.js + +ok 721 — hexToRGB is a Function +ok 722 — Converts a color code to a rgb() or rgba() string +ok 723 — Converts a color code to a rgb() or rgba() string +ok 724 — Converts a color code to a rgb() or rgba() string + +# PASS test\spreadOver\spreadOver.test.js + +ok 725 — spreadOver is a Function +ok 726 — Takes a variadic function and returns a closure that accepts an array of arguments to map to the inputs of the function. + +# PASS test\initializeArrayWithRange\initializeArrayWithRange.test.js + +ok 727 — initializeArrayWithRange is a Function +ok 728 — Initializes an array containing the numbers in the specified range + +# PASS test\composeRight\composeRight.test.js + +ok 729 — composeRight is a Function +ok 730 — Performs left-to-right function composition + +# PASS test\isPromiseLike\isPromiseLike.test.js + +ok 731 — isPromiseLike is a Function +ok 732 — Returns true for a promise-like object +ok 733 — Returns false for an empty object + +# PASS test\isFunction\isFunction.test.js + +ok 734 — isFunction is a Function +ok 735 — passed value is a function +ok 736 — passed value is not a function + +# PASS test\off\off.test.js + +ok 737 — off is a Function + +# PASS test\byteSize\byteSize.test.js + +ok 738 — byteSize is a Function +ok 739 — Works for a single letter +ok 740 — Works for a common string +ok 741 — Works for emoji + +# PASS test\sumPower\sumPower.test.js + +ok 742 — sumPower is a Function +ok 743 — Returns the sum of the powers of all the numbers from start to end +ok 744 — Returns the sum of the powers of all the numbers from start to end +ok 745 — Returns the sum of the powers of all the numbers from start to end + +# PASS test\levenshteinDistance\levenshteinDistance.test.js + +ok 746 — levenshteinDistance is a Function + +# PASS test\isSet\isSet.test.js + +ok 747 — isSet is a Function + +# PASS test\copyToClipboard\copyToClipboard.test.js + +ok 748 — copyToClipboard is a Function + +# PASS test\objectFromPairs\objectFromPairs.test.js + +ok 749 — objectFromPairs is a Function +ok 750 — Creates an object from the given key-value pairs. + +# PASS test\once\once.test.js + +ok 751 — once is a Function + +# PASS test\bottomVisible\bottomVisible.test.js + +ok 752 — bottomVisible is a Function + +# PASS test\pipeAsyncFunctions\pipeAsyncFunctions.test.js + +ok 753 — pipeAsyncFunctions is a Function +ok 754 — pipeAsyncFunctions result should be 15 + +# PASS test\takeWhile\takeWhile.test.js + +ok 755 — takeWhile is a Function +ok 756 — Removes elements until the function returns true + +# PASS test\sum\sum.test.js + +ok 757 — sum is a Function +ok 758 — Returns the sum of two or more numbers/arrays. + +# PASS test\hide\hide.test.js + +ok 759 — hide is a Function + +# PASS test\toDecimalMark\toDecimalMark.test.js + +ok 760 — toDecimalMark is a Function +ok 761 — convert a float-point arithmetic to the Decimal mark form + +# PASS test\JSONToFile\JSONToFile.test.js + +ok 762 — JSONToFile is a Function + +# PASS test\parseCookie\parseCookie.test.js + +ok 763 — parseCookie is a Function +ok 764 — Parses the cookie + +# PASS test\reducedFilter\reducedFilter.test.js + +ok 765 — reducedFilter is a Function +ok 766 — Filter an array of objects based on a condition while also filtering out unspecified keys. + +# PASS test\remove\remove.test.js + +ok 767 — remove is a Function +ok 768 — Removes elements from an array for which the given function returns false + +# PASS test\takeRightWhile\takeRightWhile.test.js + +ok 769 — takeRightWhile is a Function +ok 770 — Removes elements until the function returns true + +# PASS test\isTypedArray\isTypedArray.test.js + +ok 771 — isTypedArray is a Function + +# PASS test\get\get.test.js + +ok 772 — get is a Function +ok 773 — Retrieve a property indicated by the selector from an object. + +# PASS test\getDaysDiffBetweenDates\getDaysDiffBetweenDates.test.js + +ok 774 — getDaysDiffBetweenDates is a Function +ok 775 — Returns the difference in days between two dates + +# PASS test\UUIDGeneratorNode\UUIDGeneratorNode.test.js + +ok 776 — UUIDGeneratorNode is a Function +ok 777 — Contains dashes in the proper places +ok 778 — Only contains hexadecimal digits + +# PASS test\httpDelete\httpDelete.test.js + +ok 779 — httpDelete is a Function + +# PASS test\percentile\percentile.test.js + +ok 780 — percentile is a Function +ok 781 — Uses the percentile formula to calculate how many numbers in the given array are less or equal to the given value. + +# PASS test\findLastIndex\findLastIndex.test.js + +ok 782 — findLastIndex is a Function +ok 783 — Finds last index for which the given function returns true + +# PASS test\symmetricDifference\symmetricDifference.test.js + +ok 784 — symmetricDifference is a Function +ok 785 — Returns the symmetric difference between two arrays. + +# PASS test\delay\delay.test.js + +ok 786 — delay is a Function +ok 787 — Works as expecting, passing arguments properly + +# PASS test\groupBy\groupBy.test.js + +ok 788 — groupBy is a Function +ok 789 — Groups the elements of an array based on the given function +ok 790 — Groups the elements of an array based on the given function + +# PASS test\symmetricDifferenceBy\symmetricDifferenceBy.test.js + +ok 791 — symmetricDifferenceBy is a Function +ok 792 — Returns the symmetric difference between two arrays, after applying the provided function to each array element of both + +# PASS test\intersectionBy\intersectionBy.test.js + +ok 793 — intersectionBy is a Function +ok 794 — Returns a list of elements that exist in both arrays, after applying the provided function to each array element of both + +# PASS test\isAnagram\isAnagram.test.js + +ok 795 — isAnagram is a Function +ok 796 — Checks valid anagram +ok 797 — Works with spaces +ok 798 — Ignores case +ok 799 — Ignores special characters + +# PASS test\isSimilar\isSimilar.test.js + +ok 800 — isSimilar is a Function + +# PASS test\omitBy\omitBy.test.js + +ok 801 — omitBy is a Function +ok 802 — Creates an object composed of the properties the given function returns falsey for + +# PASS test\approximatelyEqual\approximatelyEqual.test.js + +ok 803 — approximatelyEqual is a Function +ok 804 — Works for PI / 2 +ok 805 — Works for 0.1 + 0.2 === 0.3 +ok 806 — Works for exactly equal values +ok 807 — Works for a custom epsilon + +# PASS test\tail\tail.test.js + +ok 808 — tail is a Function +ok 809 — Returns tail +ok 810 — Returns tail + +# PASS test\initializeArrayWithRangeRight\initializeArrayWithRangeRight.test.js + +ok 811 — initializeArrayWithRangeRight is a Function + +# PASS test\isSymbol\isSymbol.test.js + +ok 812 — isSymbol is a Function +ok 813 — Checks if the given argument is a symbol + +# PASS test\httpPut\httpPut.test.js + +ok 814 — httpPut is a Function + +# PASS test\geometricProgression\geometricProgression.test.js + +ok 815 — geometricProgression is a Function +ok 816 — Initializes an array containing the numbers in the specified range +ok 817 — Initializes an array containing the numbers in the specified range +ok 818 — Initializes an array containing the numbers in the specified range + +# PASS test\btoa\btoa.test.js + +ok 819 — btoa is a Function +ok 820 — btoa("foobar") equals "Zm9vYmFy" + +# PASS test\isMap\isMap.test.js + +ok 821 — isMap is a Function + +# PASS test\hammingDistance\hammingDistance.test.js + +ok 822 — hammingDistance is a Function +ok 823 — retuns hamming disance between 2 values + +# PASS test\mapValues\mapValues.test.js + +ok 824 — mapValues is a Function +ok 825 — Maps values + +# PASS test\decapitalize\decapitalize.test.js + +ok 826 — decapitalize is a Function +ok 827 — Works with default parameter +ok 828 — Works with second parameter set to true + +# PASS test\intersection\intersection.test.js + +ok 829 — intersection is a Function +ok 830 — Returns a list of elements that exist in both arrays + +# PASS test\symmetricDifferenceWith\symmetricDifferenceWith.test.js + +ok 831 — symmetricDifferenceWith is a Function +ok 832 — Returns the symmetric difference between two arrays, using a provided function as a comparator + +# PASS test\radsToDegrees\radsToDegrees.test.js + +ok 833 — radsToDegrees is a Function +ok 834 — Returns the appropriate value + +# PASS test\powerset\powerset.test.js + +ok 835 — powerset is a Function +ok 836 — Returns the powerset of a given array of numbers. + +# PASS test\UUIDGeneratorBrowser\UUIDGeneratorBrowser.test.js + +ok 837 — UUIDGeneratorBrowser is a Function + +# PASS test\pipeFunctions\pipeFunctions.test.js + +ok 838 — pipeFunctions is a Function +ok 839 — Performs left-to-right function composition + +# PASS test\getType\getType.test.js + +ok 840 — getType is a Function +ok 841 — Returns the native type of a value + +# PASS test\indexOfAll\indexOfAll.test.js + +ok 842 — indexOfAll is a Function +ok 843 — Returns all indices of val in an array +ok 844 — Returns all indices of val in an array + +# PASS test\RGBToHex\RGBToHex.test.js + +ok 845 — RGBToHex is a Function +ok 846 — Converts the values of RGB components to a color code. + +# PASS test\invertKeyValues\invertKeyValues.test.js + +ok 847 — invertKeyValues is a Function +ok 848 — invertKeyValues({ a: 1, b: 2, c: 1 }) returns { 1: [ 'a', 'c' ], 2: [ 'b' ] } +ok 849 — invertKeyValues({ a: 1, b: 2, c: 1 }, value => 'group' + value) returns { group1: [ 'a', 'c' ], group2: [ 'b' ] } + +# PASS test\differenceWith\differenceWith.test.js + +ok 850 — differenceWith is a Function +ok 851 — Filters out all values from an array + +# PASS test\defaults\defaults.test.js + +ok 852 — defaults is a Function +ok 853 — Assigns default values for undefined properties + +# PASS test\sortedIndexBy\sortedIndexBy.test.js + +ok 854 — sortedIndexBy is a Function +ok 855 — Returns the lowest index to insert the element without messing up the list order + +# PASS test\size\size.test.js + +ok 856 — size is a Function +ok 857 — Get size of arrays, objects or strings. +ok 858 — Get size of arrays, objects or strings. + +# PASS test\coalesce\coalesce.test.js + +ok 859 — coalesce is a Function +ok 860 — Returns the first non-null/undefined argument + +# PASS test\partialRight\partialRight.test.js + +ok 861 — partialRight is a Function +ok 862 — Appends arguments + +# PASS test\functions\functions.test.js + +ok 863 — functions is a Function +ok 864 — Returns own methods +ok 865 — Returns own and inherited methods + +# PASS test\binarySearch\binarySearch.test.js + +ok 866 — binarySearch is a Function +ok 867 — Finds item in array +ok 868 — Returns -1 when not found +ok 869 — Works with empty arrays +ok 870 — Works for one element arrays + +# PASS test\pluralize\pluralize.test.js + +ok 871 — pluralize is a Function +ok 872 — Produces the plural of the word +ok 873 — Produces the singular of the word +ok 874 — Produces the plural of the word +ok 875 — Prodices the defined plural of the word +ok 876 — Works with a dictionary + +# PASS test\nthElement\nthElement.test.js + +ok 877 — nthElement is a Function +ok 878 — Returns the nth element of an array. +ok 879 — Returns the nth element of an array. + +# PASS test\truncateString\truncateString.test.js + +ok 880 — truncateString is a Function +ok 881 — Truncates a "boomerang" up to a specified length. + +# PASS test\mapKeys\mapKeys.test.js + +ok 882 — mapKeys is a Function +ok 883 — Maps keys + +# PASS test\permutations\permutations.test.js + +ok 884 — permutations is a Function +ok 885 — Generates all permutations of an array + +# PASS test\bifurcate\bifurcate.test.js + +ok 886 — bifurcate is a Function +ok 887 — Splits the collection into two groups + +# PASS test\httpPost\httpPost.test.js + +ok 888 — httpPost is a Function + +# PASS test\detectDeviceType\detectDeviceType.test.js + +ok 889 — detectDeviceType is a Function + +# PASS test\join\join.test.js + +ok 890 — join is a Function +ok 891 — Joins all elements of an array into a string and returns this string +ok 892 — Joins all elements of an array into a string and returns this string +ok 893 — Joins all elements of an array into a string and returns this string + +# PASS test\differenceBy\differenceBy.test.js + +ok 894 — differenceBy is a Function +ok 895 — Works using a native function and numbers +ok 896 — Works with arrow function and objects + +# PASS test\isDivisible\isDivisible.test.js + +ok 897 — isDivisible is a Function +ok 898 — The number 6 is divisible by 3 + +# PASS test\escapeRegExp\escapeRegExp.test.js + +ok 899 — escapeRegExp is a Function +ok 900 — Escapes a string to use in a regular expression + +# PASS test\untildify\untildify.test.js + +ok 901 — untildify is a Function +ok 902 — Contains no tildes +ok 903 — Does not alter the rest of the path +ok 904 — Does not alter paths without tildes + +# PASS test\solveRPN\solveRPN.test.js + +ok 905 — solveRPN is a Function + +# PASS test\isObject\isObject.test.js + +ok 906 — isObject is a Function +ok 907 — isObject([1, 2, 3, 4]) is a object +ok 908 — isObject([]) is a object +ok 909 — isObject({ a:1 }) is a object +ok 910 — isObject(true) is not a object + +# PASS test\onUserInputChange\onUserInputChange.test.js + +ok 911 — onUserInputChange is a Function + +# PASS test\lcm\lcm.test.js + +ok 912 — lcm is a Function +ok 913 — Returns the least common multiple of two or more numbers. +ok 914 — Returns the least common multiple of two or more numbers. + +# PASS test\partial\partial.test.js + +ok 915 — partial is a Function +ok 916 — Prepends arguments + +# PASS test\capitalize\capitalize.test.js + +ok 917 — capitalize is a Function +ok 918 — Capitalizes the first letter of a string +ok 919 — Capitalizes the first letter of a string +ok 920 — Works with characters +ok 921 — "Works with single character words + +# PASS test\ary\ary.test.js + +ok 922 — ary is a Function +ok 923 — Discards arguments with index >=n + +# PASS test\prefix\prefix.test.js + +ok 924 — prefix is a Function + +# PASS test\pullBy\pullBy.test.js + +ok 925 — pullBy is a Function +ok 926 — Pulls the specified values + +# PASS test\createEventHub\createEventHub.test.js + +ok 927 — createEventHub is a Function + +# PASS test\isNull\isNull.test.js + +ok 928 — isNull is a Function +ok 929 — passed argument is a null +ok 930 — passed argument is a null + +# PASS test\mask\mask.test.js + +ok 931 — mask is a Function +ok 932 — Replaces all but the last num of characters with the specified mask character +ok 933 — Replaces all but the last num of characters with the specified mask character +ok 934 — Replaces all but the last num of characters with the specified mask character + +# PASS test\runAsync\runAsync.test.js + +ok 935 — runAsync is a Function + +# PASS test\intersectionWith\intersectionWith.test.js + +ok 936 — intersectionWith is a Function +ok 937 — Returns a list of elements that exist in both arrays, using a provided comparator function + +# PASS test\call\call.test.js + +ok 938 — call is a Function +ok 939 — Calls function on given object + +# PASS test\isValidJSON\isValidJSON.test.js + +ok 940 — isValidJSON is a Function +ok 941 — {"name":"Adam","age":20} is a valid JSON +ok 942 — {"name":"Adam",age:"20"} is not a valid JSON +ok 943 — null is a valid JSON + +# PASS test\nest\nest.test.js + +ok 944 — nest is a Function + +# PASS test\pull\pull.test.js + +ok 945 — pull is a Function +ok 946 — Pulls the specified values + +# PASS test\rearg\rearg.test.js + +ok 947 — rearg is a Function +ok 948 — Reorders arguments in invoked function + +# PASS test\httpGet\httpGet.test.js + +ok 949 — httpGet is a Function + +# PASS test\initializeNDArray\initializeNDArray.test.js + +ok 950 — initializeNDArray is a Function + +# PASS test\removeNonASCII\removeNonASCII.test.js + +ok 951 — removeNonASCII is a Function +ok 952 — Removes non-ASCII characters + +# PASS test\fibonacciCountUntilNum\fibonacciCountUntilNum.test.js + +ok 953 — fibonacciCountUntilNum is a Function + +# PASS test\hashBrowser\hashBrowser.test.js + +ok 954 — hashBrowser is a Function + +# PASS test\URLJoin\URLJoin.test.js + +ok 955 — URLJoin is a Function +ok 956 — Returns proper URL +ok 957 — Returns proper URL + +# PASS test\getColonTimeFromDate\getColonTimeFromDate.test.js + +ok 958 — getColonTimeFromDate is a Function + +# PASS test\compose\compose.test.js + +ok 959 — compose is a Function +ok 960 — Performs right-to-left function composition + +# PASS test\sdbm\sdbm.test.js + +ok 961 — sdbm is a Function +ok 962 — Hashes the input string into a whole number. + +# PASS test\chainAsync\chainAsync.test.js + +ok 963 — chainAsync is a Function +ok 964 — Calls all functions in an array + +# PASS test\counter\counter.test.js + +ok 965 — counter is a Function + +# PASS test\isRegExp\isRegExp.test.js + +ok 966 — isRegExp is a Function + +# PASS test\isPlainObject\isPlainObject.test.js + +ok 967 — isPlainObject is a Function +ok 968 — Returns true for a plain object +ok 969 — Returns false for a Map (example of non-plain object) + +# PASS test\scrollToTop\scrollToTop.test.js + +ok 970 — scrollToTop is a Function + +# PASS test\unionBy\unionBy.test.js + +ok 971 — unionBy is a Function +ok 972 — Produces the appropriate results + +# PASS test\createElement\createElement.test.js + +ok 973 — createElement is a Function + +# PASS test\hz\hz.test.js + +ok 974 — hz is a Function + +# PASS test\defer\defer.test.js + +ok 975 — defer is a Function + +# PASS test\initializeArrayWithValues\initializeArrayWithValues.test.js + +ok 976 — initializeArrayWithValues is a Function +ok 977 — Initializes and fills an array with the specified values + +# PASS test\elementIsVisibleInViewport\elementIsVisibleInViewport.test.js + +ok 978 — elementIsVisibleInViewport is a Function + +# PASS test\stableSort\stableSort.test.js + +ok 979 — stableSort is a Function +ok 980 — Array is properly sorted + +# PASS test\sortedLastIndex\sortedLastIndex.test.js + +ok 981 — sortedLastIndex is a Function +ok 982 — Returns the highest index to insert the element without messing up the list order + +# PASS test\isBrowser\isBrowser.test.js + +ok 983 — isBrowser is a Function + +# PASS test\smoothScroll\smoothScroll.test.js + +ok 984 — smoothScroll is a Function + +# PASS test\attempt\attempt.test.js + +ok 985 — attempt is a Function +ok 986 — Returns a value +ok 987 — Returns an error + +# PASS test\getMeridiemSuffixOfInteger\getMeridiemSuffixOfInteger.test.js + +ok 988 — getMeridiemSuffixOfInteger is a Function + +1..988 + +# Test Suites: 100% ██████████, 331 passed, 331 total +# Tests: 100% ██████████, 988 passed, 988 total +# Time: 7.420s, estimated 5s + +# Ran all test suites. + diff --git a/test/toCamelCase/toCamelCase.test.js b/test/toCamelCase/toCamelCase.test.js index 22b625ee8..1443c9c98 100644 --- a/test/toCamelCase/toCamelCase.test.js +++ b/test/toCamelCase/toCamelCase.test.js @@ -4,29 +4,29 @@ const toCamelCase = require('./toCamelCase.js'); test('toCamelCase is a Function', () => { expect(toCamelCase).toBeInstanceOf(Function); }); -test('toCamelCase('some_database_field_name') returns someDatabaseFieldName', () => { +test('toCamelCase(\'some_database_field_name\') returns someDatabaseFieldName', () => { expect(toCamelCase('some_database_field_name')).toBe('someDatabaseFieldName'); }); -test('toCamelCase('Some label that needs to be camelized') returns someLabelThatNeedsToBeCamelized', () => { +test('toCamelCase(\'Some label that needs to be camelized\') returns someLabelThatNeedsToBeCamelized', () => { expect(toCamelCase('Some label that needs to be camelized')).toBe('someLabelThatNeedsToBeCamelized'); }); -test('toCamelCase('some-javascript-property') return someJavascriptProperty', () => { +test('toCamelCase(\'some-javascript-property\') return someJavascriptProperty', () => { expect(toCamelCase('some-javascript-property')).toBe('someJavascriptProperty'); }); -test('toCamelCase('some-mixed_string with spaces_underscores-and-hyphens') returns someMixedStringWithSpacesUnderscoresAndHyphens', () => { +test('toCamelCase(\'some-mixed_string with spaces_underscores-and-hyphens\') returns someMixedStringWithSpacesUnderscoresAndHyphens', () => { expect(toCamelCase('some-mixed_string with spaces_underscores-and-hyphens')).toBe('someMixedStringWithSpacesUnderscoresAndHyphens'); }); test('toCamelCase() throws a error', () => { - expect(toCamelCase()).toThrow(); + expect(() => {toCamelCase(); }).toThrow(); }); test('toCamelCase([]) throws a error', () => { - expect(toCamelCase([])).toThrow(); + expect(() => {toCamelCase([]); }).toThrow(); }); test('toCamelCase({}) throws a error', () => { - expect(toCamelCase({})).toThrow(); + expect(() => {toCamelCase({}); }).toThrow(); }); test('toCamelCase(123) throws a error', () => { - expect(toCamelCase(123)).toThrow(); + expect(() => {toCamelCase(123); }).toThrow(); }); let start = new Date().getTime(); toCamelCase('some-mixed_string with spaces_underscores-and-hyphens'); diff --git a/test/toCurrency/toCurrency.test.js b/test/toCurrency/toCurrency.test.js index 81f56d85e..b8fdf0a22 100644 --- a/test/toCurrency/toCurrency.test.js +++ b/test/toCurrency/toCurrency.test.js @@ -5,11 +5,11 @@ test('toCurrency is a Function', () => { expect(toCurrency).toBeInstanceOf(Function); }); test('currency: Euro | currencyLangFormat: Local', () => { - expect(toCurrency(123456.789, 'EUR'), '€ 123,456.79').stringMatching(/€\s*123,456.79/g); + expect(toCurrency(123456.789, 'EUR')).toEqual(expect.stringMatching(/€\s*123,456.79/g)); }); test(' currency: US Dollar | currencyLangFormat: English (United States)', () => { - expect(toCurrency(123456.789, 'USD', 'en-us')).stringMatching(/\$\s*123,456.79/g); + expect(toCurrency(123456.789, 'USD', 'en-us')).toEqual(expect.stringMatching(/\$\s*123,456.79/g)); }); test('currency: Japanese Yen | currencyLangFormat: Local', () => { - expect(toCurrency(322342436423.2435, 'JPY'), 'JP¥ 322,342,436,423').stringMatching(/J*P*¥\s*322,342,436,423/g); + expect(toCurrency(322342436423.2435, 'JPY')).toEqual(expect.stringMatching(/J*P*¥\s*322,342,436,423/g)); }); diff --git a/test/toKebabCase/toKebabCase.test.js b/test/toKebabCase/toKebabCase.test.js index a2ae6b202..925367a5e 100644 --- a/test/toKebabCase/toKebabCase.test.js +++ b/test/toKebabCase/toKebabCase.test.js @@ -20,13 +20,13 @@ test('toKebabCase() returns undefined', () => { expect(toKebabCase()).toBe(undefined) }); test('toKebabCase([]) throws an erro', () => { - expect(toKebabCase([])).toThrow(); + expect(() => { toKebabCase([]); }).toThrow(); }); test('toKebabCase({}) throws an erro', () => { - expect(toKebabCase({})).toThrow(); + expect(() => { toKebabCase({}); }).toThrow(); }); test('toKebabCase(123) throws an erro', () => { - expect(toKebabCase(123)).toThrow(); + expect(() => { toKebabCase(123); }).toThrow(); }); let start = new Date().getTime(); toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML'); diff --git a/test/toSafeInteger/toSafeInteger.test.js b/test/toSafeInteger/toSafeInteger.test.js index 8362ab0e3..29901a2b5 100644 --- a/test/toSafeInteger/toSafeInteger.test.js +++ b/test/toSafeInteger/toSafeInteger.test.js @@ -10,7 +10,7 @@ test('Number(toSafeInteger(3.2)) is a number', () => { test('Converts a value to a safe integer', () => { expect(toSafeInteger(3.2)).toBe(3); }); -test('toSafeInteger('4.2') returns 4', () => { +test('toSafeInteger(\'4.2\') returns 4', () => { expect(toSafeInteger('4.2')).toBe(4); }); test('toSafeInteger(4.6) returns 5', () => { @@ -22,7 +22,7 @@ test('toSafeInteger([]) returns 0', () => { test('isNaN(toSafeInteger([1.5, 3124])) is true', () => { expect(isNaN(toSafeInteger([1.5, 3124]))).toBeTruthy(); }); -test('isNaN(toSafeInteger('string')) is true', () => { +test('isNaN(toSafeInteger(\'string\')) is true', () => { expect(isNaN(toSafeInteger('string'))).toBeTruthy(); }); test('isNaN(toSafeInteger({})) is true', () => { diff --git a/test/toSnakeCase/toSnakeCase.test.js b/test/toSnakeCase/toSnakeCase.test.js index 0f532f15c..2acb4aeb8 100644 --- a/test/toSnakeCase/toSnakeCase.test.js +++ b/test/toSnakeCase/toSnakeCase.test.js @@ -4,7 +4,7 @@ const toSnakeCase = require('./toSnakeCase.js'); test('toSnakeCase is a Function', () => { expect(toSnakeCase).toBeInstanceOf(Function); }); -test('toSnakeCase('\camelCase\') returns camel_case', () => { +test('toSnakeCase(\'camelCase\') returns camel_case', () => { expect(toSnakeCase('camelCase')).toBe('camel_case'); }); test('toSnakeCase(\'some text\') returns some_text', () => { @@ -20,13 +20,13 @@ test('toSnakeCase() returns undefined', () => { expect(toSnakeCase()).toBe(undefined); }); test('toSnakeCase([]) throws an error', () => { - expect(toSnakeCase([])).toThrow(); + expect(() => {toSnakeCase([]);}).toThrow(); }); test('toSnakeCase({}) throws an error', () => { - expect(toSnakeCase({})).toThrow(); + expect(() => {toSnakeCase({});}).toThrow(); }); test('toSnakeCase(123) throws an error', () => { - expect(toSnakeCase(123)).toThrow(); + expect(() => {toSnakeCase(123);}).toThrow(); }); let start = new Date().getTime(); toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML'); diff --git a/test/transform/transform.test.js b/test/transform/transform.test.js index d87d3f0c4..54f940e4c 100644 --- a/test/transform/transform.test.js +++ b/test/transform/transform.test.js @@ -10,5 +10,5 @@ test('Transforms an object', () => { (r, v, k) => { (r[v] || (r[v] = [])).push(k); return r; - },{}).toEqual({ '1': ['a', 'c'], '2': ['b'] }); + },{})).toEqual({ '1': ['a', 'c'], '2': ['b'] }); }); diff --git a/test/union/union.test.js b/test/union/union.test.js index 4c16c547d..bf23e1805 100644 --- a/test/union/union.test.js +++ b/test/union/union.test.js @@ -7,7 +7,7 @@ test('union is a Function', () => { test('union([1, 2, 3], [4, 3, 2]) returns [1, 2, 3, 4]', () => { expect(union([1, 2, 3], [4, 3, 2])).toEqual([1, 2, 3, 4]); }); -test('union('str', 'asd') returns [ 's', 't', 'r', 'a', 'd' ]', () => { +test('union(\'str\', \'asd\') returns [ \'s\', \'t\', \'r\', \'a\', \'d\' ]', () => { expect(union('str', 'asd')).toEqual([ 's', 't', 'r', 'a', 'd' ]); }); test('union([[], {}], [1, 2, 3]) returns [[], {}, 1, 2, 3]', () => { @@ -17,22 +17,22 @@ test('union([], []) returns []', () => { expect(union([], [])).toEqual([]); }); test('union() throws an error', () => { - expect(union()).toThrow(); + expect(() => {union(); }).toThrow(); }); test('union(true, \'str\') throws an error', () => { - expect(union(true, 'str')).toThrow(); + expect(() => {union(true, 'str'); }).toThrow(); }); test('union(\'false\', true) throws an error', () => { - expect(union('false', true)).toThrow(); + expect(() => {union('false', true); }).toThrow(); }); test('union((123, {}) throws an error', () => { - expect(union((123, {})).toThrow(); + expect(() => {union(123, {}); }).toThrow(); }); test('union([], {}) throws an error', () => { - expect(union([], {})).toThrow(); + expect(() => {union([], {}); }).toThrow(); }); test('union(undefined, null) throws an error', () => { - expect(union(undefined, null)).toThrow(); + expect(() => {union(undefined, null); }).toThrow(); }); let start = new Date().getTime(); union([1, 2, 3], [4, 3, 2]); diff --git a/test/uniqueElements/uniqueElements.test.js b/test/uniqueElements/uniqueElements.test.js index ee7ad4e9e..7c659f2ed 100644 --- a/test/uniqueElements/uniqueElements.test.js +++ b/test/uniqueElements/uniqueElements.test.js @@ -11,7 +11,7 @@ test('uniqueElements([1, 2, 2, 3, 4, 4, 5]) returns [1,2,3,4,5]', () => { test('uniqueElements([1, 23, 53]) returns [1, 23, 53]', () => { expect(uniqueElements([1, 23, 53])).toEqual([1, 23, 53]); }); -test('uniqueElements([true, 0, 1, false, false, undefined, null, '']) returns [true, 0, 1, false, false, undefined, null, '']', () => { +test('uniqueElements([true, 0, 1, false, false, undefined, null, \'\']) returns [true, 0, 1, false, false, undefined, null, \'\']', () => { expect(uniqueElements([true, 0, 1, false, false, undefined, null, ''])).toEqual([true, 0, 1, false, undefined, null, '']); }); test('uniqueElements() returns []', () => { @@ -23,20 +23,20 @@ test('uniqueElements(null) returns []', () => { test('uniqueElements(undefined) returns []', () => { expect(uniqueElements(undefined)).toEqual([]); }); -test('uniqueElements(\'strt\') returns ['s', 't', 'r']', () => { +test('uniqueElements(\'strt\') returns [\'s\', \'t\', \'r\']', () => { expect(uniqueElements('strt')).toEqual(['s', 't', 'r']); }); test('uniqueElements(1, 1, 2543, 534, 5) throws an error', () => { - expect(uniqueElements(1, 1, 2543, 534, 5)).toThrow(); + expect(() => {uniqueElements(1, 1, 2543, 534, 5); }).toThrow(); }); test('uniqueElements({}) throws an error', () => { - expect(uniqueElements({})).toThrow(); + expect(() => {uniqueElements({}); }).toThrow(); }); test('uniqueElements(true) throws an error', () => { - expect(uniqueElements(true)).toThrow(); + expect(() => {uniqueElements(true); }).toThrow(); }); test('uniqueElements(false) throws an error', () => { - expect(uniqueElements(false)).toThrow(); + expect(() => {uniqueElements(false); }).toThrow(); }); let start = new Date().getTime(); uniqueElements([true, 0, 1, false, false, undefined, null, '']); diff --git a/test/unzip/unzip.test.js b/test/unzip/unzip.test.js index 2347b64af..1d25cd38c 100644 --- a/test/unzip/unzip.test.js +++ b/test/unzip/unzip.test.js @@ -5,8 +5,8 @@ test('unzip is a Function', () => { expect(unzip).toBeInstanceOf(Function); }); test('unzip([[\'a\', 1, true], [\'b\', 2, false]]) equals [[\'a\',\'b\'], [1, 2], [true, false]]', () => { - expect(unzip([['a', 1, true], ['b', 2, false]])).toBe([['a', 'b'], [1, 2], [true, false]]); + expect(unzip([['a', 1, true], ['b', 2, false]])).toEqual([['a', 'b'], [1, 2], [true, false]]); }); test('unzip([[\'a\', 1, true], [\'b\', 2]]) equals [[\'a\',\'b\'], [1, 2], [true]]', () => { - expect(unzip([['a', 1, true], ['b', 2]])).toBe([['a', 'b'], [1, 2], [true]]); + expect(unzip([['a', 1, true], ['b', 2]])).toEqual([['a', 'b'], [1, 2], [true]]); }); diff --git a/test/unzipWith/unzipWith.test.js b/test/unzipWith/unzipWith.test.js index 9d29f9cc4..40e0fbacd 100644 --- a/test/unzipWith/unzipWith.test.js +++ b/test/unzipWith/unzipWith.test.js @@ -5,5 +5,5 @@ test('unzipWith is a Function', () => { expect(unzipWith).toBeInstanceOf(Function); }); test('unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0)) equals [3, 30, 300]', () => { - expect(unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0))).toBe([3, 30, 300]); + expect(unzipWith([[1, 10, 100], [2, 20, 200]], (...args) => args.reduce((acc, v) => acc + v, 0))).toEqual([3, 30, 300]); }); diff --git a/test/without/without.test.js b/test/without/without.test.js index 54ef78bb5..38711423e 100644 --- a/test/without/without.test.js +++ b/test/without/without.test.js @@ -10,24 +10,24 @@ test('without([2, 1, 2, 3], 1, 2) returns [3]', () => { test('without([]) returns []', () => { expect(without([])).toEqual([]); }); -test('without([3, 1, true, '3', true], '3', true) returns [3, 1]', () => { +test('without([3, 1, true, \'3\', true], \'3\', true) returns [3, 1]', () => { expect(without([3, 1, true, '3', true], '3', true)).toEqual([3, 1]); }); -test('without('string'.split(''), 's', 't', 'g') returns [\'r\', \'i\', \'n\']', () => { +test('without(\'string\'.split(\'\'), \'s\', \'t\', \'g\') returns [\'r\', \'i\', \'n\']', () => { expect(without('string'.split(''), 's', 't', 'g')).toEqual(['r', 'i', 'n']); }); test('without() throws an error', () => { - expect(without()).toThrow(); + expect(() => { without(); }).toThrow(); }); test('without(null) throws an error', () => { - expect(without(null)).toThrow(); + expect(() => { without(null); }).toThrow(); }); test('without(undefined) throws an error', () => { - expect(without(undefined)).toThrow(); + expect(() => { without(undefined); }).toThrow(); }); test('without(123) throws an error', () => { - expect(without(123)).toThrow(); + expect(() => { without(123); }).toThrow(); }); test('without({}) throws an error', () => { - expect(without({})).toThrow(); + expect(() => { without({}); }).toThrow(); }); diff --git a/test/words/words.test.js b/test/words/words.test.js index fbedafabf..ff64ef83b 100644 --- a/test/words/words.test.js +++ b/test/words/words.test.js @@ -4,30 +4,30 @@ const words = require('./words.js'); test('words is a Function', () => { expect(words).toBeInstanceOf(Function); }); -test('words('I love javaScript!!') returns [I, love, javaScript]', () => { +test('words(\'I love javaScript!!\') returns [I, love, javaScript]', () => { expect(words('I love javaScript!!')).toEqual(["I", "love", "javaScript"]); }); -test('words('python, javaScript & coffee') returns [python, javaScript, coffee]', () => { +test('words(\'python, javaScript & coffee\') returns [python, javaScript, coffee]', () => { expect(words('python, javaScript & coffee')).toEqual(["python", "javaScript", "coffee"]); }); test('words(I love javaScript!!) returns an array', () => { expect(Array.isArray(words('I love javaScript!!'))).toBeTruthy(); }); test('words() throws an error', () => { - expect(words()).toThrow(); + expect(() => { words(); }).toThrow(); }); test('words(null) throws an error', () => { - expect(words(null)).toThrow(); + expect(() => { words(null); }).toThrow(); }); test('words(undefined) throws an error', () => { - expect(words(undefined)).toThrow(); + expect(() => { words(undefined); }).toThrow(); }); test('words({}) throws an error', () => { - expect(words({})).toThrow(); + expect(() => { words({}); }).toThrow(); }); test('words([]) throws an error', () => { - expect(words([])).toThrow(); + expect(() => { words([]); }).toThrow(); }); test('words(1234) throws an error', () => { - expect(words(1234)).toThrow(); + expect(() => { words(1234); }).toThrow(); }); diff --git a/test/zip/zip.test.js b/test/zip/zip.test.js index c9822d2c0..270554046 100644 --- a/test/zip/zip.test.js +++ b/test/zip/zip.test.js @@ -24,8 +24,8 @@ test('zip([a], [1, 2], [true, false]) returns an Array', () => { expect(Array.isArray(zip(['a'], [1, 2], [true, false]))).toBeTruthy(); }); test('zip(null) throws an error', () => { - expect(zip(null)).toThrow(); + expect(() => {zip(null);}).toThrow(); }); test('zip(undefined) throws an error', () => { - expect(zip(undefined)).toThrow(); + expect(() => {zip(undefined);}).toThrow(); }); diff --git a/test/zipObject/zipObject.test.js b/test/zipObject/zipObject.test.js index d07fe81df..2a10a9f0f 100644 --- a/test/zipObject/zipObject.test.js +++ b/test/zipObject/zipObject.test.js @@ -17,17 +17,17 @@ test('zipObject([a], string) returns { a: s }', () => { expect(zipObject(['a'], 'string')).toEqual({ a: 's' }); }); test('zipObject() throws an error', () => { - expect(zipObject()).toThrow(); + expect(() => {zipObject();}).toThrow(); }); test('zipObject(([\'string\'], null) throws an error', () => { - expect(zipObject((['string'], null)).toThrow(); + expect(() => {zipObject(['string'], null);}).toThrow(); }); test('zipObject(null, [1]) throws an error', () => { - expect(zipObject(null, [1])).toThrow(); + expect(() => {zipObject(null, [1]);}).toThrow(); }); test('zipObject(\'string\') throws an error', () => { - expect(zipObject('string')).toThrow(); + expect(() => {zipObject('string');}).toThrow(); }); test('zipObject(\'test\', \'string\') throws an error', () => { - expect(zipObject('test', 'string')).toThrow(); + expect(() => {zipObject('test', 'string');}).toThrow(); }); From ba3fcbb95aede332fcaf338b669bd3230bd032ed Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Mon, 18 Jun 2018 20:48:37 +0300 Subject: [PATCH 18/19] Refreshed packages --- package-lock.json | 193 ---- package.json | 10 +- yarn.lock | 2298 ++++++++++++++++++++++++++++++++++++++------- 3 files changed, 1969 insertions(+), 532 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9f4aa394c..a0f21e80e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1995,12 +1995,6 @@ "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", "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=", - "dev": true - }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", @@ -2073,12 +2067,6 @@ } } }, - "defined": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", - "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", - "dev": true - }, "deglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/deglob/-/deglob-2.1.1.tgz", @@ -2172,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", @@ -2934,16 +2916,6 @@ } } }, - "figures": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", - "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", - "dev": true, - "requires": { - "escape-string-regexp": "1.0.5", - "object-assign": "4.1.1" - } - }, "file-entry-cache": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", @@ -3021,15 +2993,6 @@ "write": "0.2.1" } }, - "for-each": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.2.tgz", - "integrity": "sha1-LEBFC5NI6X8oEyJZO6lnBLmr1NQ=", - "dev": true, - "requires": { - "is-function": "1.0.1" - } - }, "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -4327,12 +4290,6 @@ "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, - "is-function": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.1.tgz", - "integrity": "sha1-Es+5i2W1fdPRk6MSH19uL0N2ArU=", - "dev": true - }, "is-generator-fn": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-1.0.0.tgz", @@ -6204,12 +6161,6 @@ } } }, - "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-keys": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz", @@ -6410,12 +6361,6 @@ "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", @@ -6579,12 +6524,6 @@ } } }, - "plur": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/plur/-/plur-1.0.0.tgz", - "integrity": "sha1-24XGgU9eXlo7Se/CjWBP7GKXUVY=", - "dev": true - }, "pluralize": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", @@ -6648,17 +6587,6 @@ } } }, - "pretty-ms": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-2.1.0.tgz", - "integrity": "sha1-QlfCVt8/sLRR1q/6qwIYhBJpgdw=", - "dev": true, - "requires": { - "is-finite": "1.0.2", - "parse-ms": "1.0.1", - "plur": "1.0.0" - } - }, "prismjs": { "version": "1.14.0", "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.14.0.tgz", @@ -6749,12 +6677,6 @@ } } }, - "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 - }, "read-pkg": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", @@ -7063,15 +6985,6 @@ "signal-exit": "3.0.2" } }, - "resumer": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", - "integrity": "sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k=", - "dev": true, - "requires": { - "through": "2.3.8" - } - }, "ret": { "version": "0.1.15", "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", @@ -7578,15 +7491,6 @@ "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==", - "dev": true, - "requires": { - "through": "2.3.8" - } - }, "split-string": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", @@ -7748,17 +7652,6 @@ "function-bind": "1.1.1" } }, - "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=", - "dev": true, - "requires": { - "define-properties": "1.1.2", - "es-abstract": "1.11.0", - "function-bind": "1.1.1" - } - }, "string_decoder": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", @@ -7844,76 +7737,6 @@ "string-width": "2.1.1" } }, - "tap-out": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/tap-out/-/tap-out-1.4.2.tgz", - "integrity": "sha1-yQfsG/lAURHQiCY+kvVgi4jLs3o=", - "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" - } - }, "tar": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", @@ -7985,16 +7808,6 @@ "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", @@ -8080,12 +7893,6 @@ "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", diff --git a/package.json b/package.json index 90868ebf7..1e2008d3d 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,6 @@ "html-minifier": "^3.5.15", "jest": "^23.1.0", "jest-tap-reporter": "^1.9.0", - "jsdom": "^11.10.0", "markdown-it": "^8.4.1", "mini.css": "^2.3.7", "node-sass": "^4.9.0", @@ -16,7 +15,7 @@ "rollup": "^0.58.2", "rollup-plugin-babel": "^3.0.4", "rollup-plugin-babel-minify": "^4.0.0", - "semistandard": "^12.0.1", + "semistandard": "^12.0.1" }, "name": "30-seconds-of-code", "description": "A collection of useful JavaScript snippets.", @@ -52,11 +51,14 @@ "dependencies": {}, "jest": { "reporters": [ - ["jest-tap-reporter", { + [ + "jest-tap-reporter", + { "logLevel": "INFO", "showInternalStackTraces": false, "filePath": "test/testlog" - }] + } ] + ] } } diff --git a/yarn.lock b/yarn.lock index 023d7e69c..b28612d52 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,28 @@ # yarn lockfile v1 +"@babel/code-frame@7.0.0-beta.36": + version "7.0.0-beta.36" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.36.tgz#2349d7ec04b3a06945ae173280ef8579b63728e4" + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^3.0.0" + +"@babel/code-frame@^7.0.0-beta.35": + version "7.0.0-beta.51" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.51.tgz#bd71d9b192af978df915829d39d4094456439a0c" + dependencies: + "@babel/highlight" "7.0.0-beta.51" + +"@babel/highlight@7.0.0-beta.51": + version "7.0.0-beta.51" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-beta.51.tgz#e8844ae25a1595ccfd42b89623b4376ca06d225d" + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^3.0.0" + "@comandeer/babel-plugin-banner@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@comandeer/babel-plugin-banner/-/babel-plugin-banner-1.0.0.tgz#40bcce0bbee084b5b02545a33635d053c248356f" @@ -11,8 +33,8 @@ resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.38.tgz#c1be40aa933723c608820a99a373a16d215a1ca2" "@types/node@*": - version "10.0.3" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.0.3.tgz#1f89840c7aac2406cc43a2ecad98fc02a8e130e4" + version "10.3.3" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.3.3.tgz#8798d9e39af2fa604f715ee6a6b19796528e46c3" abab@^1.0.4: version "1.0.4" @@ -39,13 +61,20 @@ acorn@^3.0.4: resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" acorn@^5.0.0, acorn@^5.3.0, acorn@^5.5.0: - version "5.5.3" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.5.3.tgz#f473dd47e0277a08e28e9bec5aeeb04751f0b8c9" + version "5.7.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.1.tgz#f095829297706a7c9776958c0afc8930a9b9d9d8" ajv-keywords@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762" +ajv@^4.9.1: + version "4.11.8" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" + dependencies: + co "^4.6.0" + json-stable-stringify "^1.0.1" + ajv@^5.1.0, ajv@^5.2.3, ajv@^5.3.0: version "5.5.2" resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" @@ -55,6 +84,14 @@ ajv@^5.1.0, ajv@^5.2.3, ajv@^5.3.0: fast-json-stable-stringify "^2.0.0" json-schema-traverse "^0.3.0" +align-text@^0.1.1, align-text@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" + dependencies: + kind-of "^3.0.2" + longest "^1.0.1" + repeat-string "^1.5.2" + amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" @@ -75,19 +112,32 @@ ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" -ansi-styles@^3.2.1: +ansi-styles@^3.2.0, ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" dependencies: color-convert "^1.9.0" +anymatch@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" + dependencies: + micromatch "^3.1.4" + normalize-path "^2.1.1" + +append-transform@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-1.0.0.tgz#046a52ae582a228bd72f58acfbe2967c678759ab" + dependencies: + default-require-extensions "^2.0.0" + aproba@^1.0.3: version "1.2.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" are-we-there-yet@~1.1.2: - version "1.1.4" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz#bb5dca382bb94f05e15194373d16fd3ba1ca110d" + version "1.1.5" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" dependencies: delegates "^1.0.0" readable-stream "^2.0.6" @@ -98,6 +148,24 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" +arr-diff@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + dependencies: + arr-flatten "^1.0.1" + +arr-diff@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + +arr-flatten@^1.0.1, arr-flatten@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + +arr-union@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + array-equal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" @@ -123,7 +191,15 @@ array-uniq@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" -arrify@^1.0.0: +array-unique@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + +array-unique@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + +arrify@^1.0.0, arrify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" @@ -143,6 +219,14 @@ assert-plus@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" +assign-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + +astral-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" + async-foreach@^0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/async-foreach/-/async-foreach-0.1.3.tgz#36121f845c0578172de419a97dbeb1d16ec34542" @@ -151,10 +235,24 @@ async-limiter@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" +async@^1.4.0: + version "1.5.2" + resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" + +async@^2.1.4: + version "2.6.1" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610" + dependencies: + lodash "^4.17.10" + asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" +atob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.1.tgz#ae2d5a729477f289d60dd7f96a6314a22dd6c22a" + aws-sign2@~0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f" @@ -175,7 +273,7 @@ babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: esutils "^2.0.2" js-tokens "^3.0.2" -babel-core@^6.26.0: +babel-core@^6.0.0, babel-core@^6.26.0: version "6.26.3" resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" dependencies: @@ -199,7 +297,7 @@ babel-core@^6.26.0: slash "^1.0.0" source-map "^0.5.7" -babel-generator@^6.26.0: +babel-generator@^6.18.0, babel-generator@^6.26.0: version "6.26.1" resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" dependencies: @@ -341,6 +439,13 @@ babel-helpers@^6.24.1: babel-runtime "^6.22.0" babel-template "^6.24.1" +babel-jest@^23.0.1: + version "23.0.1" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-23.0.1.tgz#bbad3bf523fb202da05ed0a6540b48c84eed13a6" + dependencies: + babel-plugin-istanbul "^4.1.6" + babel-preset-jest "^23.0.1" + babel-messages@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" @@ -353,6 +458,19 @@ babel-plugin-check-es2015-constants@^6.22.0: dependencies: babel-runtime "^6.22.0" +babel-plugin-istanbul@^4.1.6: + version "4.1.6" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz#36c59b2192efce81c5b378321b74175add1c9a45" + dependencies: + babel-plugin-syntax-object-rest-spread "^6.13.0" + find-up "^2.1.0" + istanbul-lib-instrument "^1.10.1" + test-exclude "^4.2.1" + +babel-plugin-jest-hoist@^23.0.1: + version "23.0.1" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-23.0.1.tgz#eaa11c964563aea9c21becef2bdf7853f7f3c148" + babel-plugin-minify-builtins@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/babel-plugin-minify-builtins/-/babel-plugin-minify-builtins-0.3.0.tgz#4740117a6a784063aaf8f092989cf9e4bd484860" @@ -426,6 +544,10 @@ babel-plugin-syntax-exponentiation-operator@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" +babel-plugin-syntax-object-rest-spread@^6.13.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" + babel-plugin-syntax-trailing-function-commas@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" @@ -619,20 +741,20 @@ babel-plugin-transform-inline-consecutive-adds@^0.3.0: resolved "https://registry.yarnpkg.com/babel-plugin-transform-inline-consecutive-adds/-/babel-plugin-transform-inline-consecutive-adds-0.3.0.tgz#f07d93689c0002ed2b2b62969bdd99f734e03f57" babel-plugin-transform-member-expression-literals@^6.9.0: - version "6.9.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-member-expression-literals/-/babel-plugin-transform-member-expression-literals-6.9.1.tgz#96be2e9968e7f5497333ae03284ecd5340405489" + version "6.9.4" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-member-expression-literals/-/babel-plugin-transform-member-expression-literals-6.9.4.tgz#37039c9a0c3313a39495faac2ff3a6b5b9d038bf" babel-plugin-transform-merge-sibling-variables@^6.9.0: - version "6.9.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-merge-sibling-variables/-/babel-plugin-transform-merge-sibling-variables-6.9.1.tgz#9071e443b21458ce6b0a8d3841ba5a174f5dc282" + version "6.9.4" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-merge-sibling-variables/-/babel-plugin-transform-merge-sibling-variables-6.9.4.tgz#85b422fc3377b449c9d1cde44087203532401dae" babel-plugin-transform-minify-booleans@^6.9.0: - version "6.9.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-minify-booleans/-/babel-plugin-transform-minify-booleans-6.9.1.tgz#52cba79c00fa509737064055efab22166e140c4d" + version "6.9.4" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-minify-booleans/-/babel-plugin-transform-minify-booleans-6.9.4.tgz#acbb3e56a3555dd23928e4b582d285162dd2b198" babel-plugin-transform-property-literals@^6.9.0: - version "6.9.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-property-literals/-/babel-plugin-transform-property-literals-6.9.1.tgz#6970f93b17793abcde9cf25d2e8cd13e0088e5c9" + version "6.9.4" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-property-literals/-/babel-plugin-transform-property-literals-6.9.4.tgz#98c1d21e255736573f93ece54459f6ce24985d39" dependencies: esutils "^2.0.2" @@ -647,12 +769,12 @@ babel-plugin-transform-regexp-constructors@^0.3.0: resolved "https://registry.yarnpkg.com/babel-plugin-transform-regexp-constructors/-/babel-plugin-transform-regexp-constructors-0.3.0.tgz#9bb2c8dd082271a5cb1b3a441a7c52e8fd07e0f5" babel-plugin-transform-remove-console@^6.9.0: - version "6.9.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-console/-/babel-plugin-transform-remove-console-6.9.1.tgz#40fe95d98cae5811d8a0e1889812d78b12859651" + version "6.9.4" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-console/-/babel-plugin-transform-remove-console-6.9.4.tgz#b980360c067384e24b357a588d807d3c83527780" babel-plugin-transform-remove-debugger@^6.9.0: - version "6.9.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-debugger/-/babel-plugin-transform-remove-debugger-6.9.1.tgz#76552d2e9d6c43d9c676bbfc08f3c2a2cc14be14" + version "6.9.4" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-debugger/-/babel-plugin-transform-remove-debugger-6.9.4.tgz#42b727631c97978e1eb2d199a7aec84a18339ef2" babel-plugin-transform-remove-undefined@^0.3.0: version "0.3.0" @@ -661,8 +783,8 @@ babel-plugin-transform-remove-undefined@^0.3.0: babel-helper-evaluate-path "^0.3.0" babel-plugin-transform-simplify-comparison-operators@^6.9.0: - version "6.9.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-simplify-comparison-operators/-/babel-plugin-transform-simplify-comparison-operators-6.9.1.tgz#5b0d06980a17a780f5318b274c00be2fb1c7c4fe" + version "6.9.4" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-simplify-comparison-operators/-/babel-plugin-transform-simplify-comparison-operators-6.9.4.tgz#f62afe096cab0e1f68a2d753fdf283888471ceb9" babel-plugin-transform-strict-mode@^6.24.1: version "6.24.1" @@ -672,12 +794,12 @@ babel-plugin-transform-strict-mode@^6.24.1: babel-types "^6.24.1" babel-plugin-transform-undefined-to-void@^6.9.0: - version "6.9.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-undefined-to-void/-/babel-plugin-transform-undefined-to-void-6.9.1.tgz#d7df9c1dd0ec12e0ffe895ed1445f61f1bf5e221" + version "6.9.4" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-undefined-to-void/-/babel-plugin-transform-undefined-to-void-6.9.4.tgz#be241ca81404030678b748717322b89d0c8fe280" babel-preset-env@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.6.1.tgz#a18b564cc9b9afdf4aae57ae3c1b0d99188e6f48" + version "1.7.0" + resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.7.0.tgz#dea79fa4ebeb883cd35dab07e260c1c9c04df77a" dependencies: babel-plugin-check-es2015-constants "^6.22.0" babel-plugin-syntax-trailing-function-commas "^6.22.0" @@ -706,10 +828,17 @@ babel-preset-env@^1.6.1: babel-plugin-transform-es2015-unicode-regex "^6.22.0" babel-plugin-transform-exponentiation-operator "^6.22.0" babel-plugin-transform-regenerator "^6.22.0" - browserslist "^2.1.2" + browserslist "^3.2.6" invariant "^2.2.2" semver "^5.3.0" +babel-preset-jest@^23.0.1: + version "23.0.1" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-23.0.1.tgz#631cc545c6cf021943013bcaf22f45d87fe62198" + dependencies: + babel-plugin-jest-hoist "^23.0.1" + babel-plugin-syntax-object-rest-spread "^6.13.0" + babel-preset-minify@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/babel-preset-minify/-/babel-preset-minify-0.3.0.tgz#7db64afa75f16f6e06c0aa5f25195f6f36784d77" @@ -757,7 +886,7 @@ babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: core-js "^2.4.0" regenerator-runtime "^0.11.0" -babel-template@^6.24.1, babel-template@^6.26.0: +babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" dependencies: @@ -767,7 +896,7 @@ babel-template@^6.24.1, babel-template@^6.26.0: babylon "^6.18.0" lodash "^4.17.4" -babel-traverse@^6.24.1, babel-traverse@^6.26.0: +babel-traverse@^6.18.0, babel-traverse@^6.24.1, babel-traverse@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" dependencies: @@ -781,7 +910,7 @@ babel-traverse@^6.24.1, babel-traverse@^6.26.0: invariant "^2.2.2" lodash "^4.17.4" -babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: +babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" dependencies: @@ -798,6 +927,18 @@ balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" +base@^0.11.1: + version "0.11.2" + resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + dependencies: + cache-base "^1.0.1" + class-utils "^0.3.5" + component-emitter "^1.2.1" + define-property "^1.0.0" + isobject "^3.0.1" + mixin-deep "^1.2.0" + pascalcase "^0.1.1" + bcrypt-pbkdf@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" @@ -816,18 +957,6 @@ boom@2.x.x: dependencies: hoek "2.x.x" -boom@4.x.x: - version "4.3.1" - resolved "https://registry.yarnpkg.com/boom/-/boom-4.3.1.tgz#4f8a3005cb4a7e3889f749030fd25b96e01d2e31" - dependencies: - hoek "4.x.x" - -boom@5.x.x: - version "5.2.0" - resolved "https://registry.yarnpkg.com/boom/-/boom-5.2.0.tgz#5dd9da6ee3a5f302077436290cb717d3f4a54e02" - dependencies: - hoek "4.x.x" - brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -835,25 +964,74 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" +braces@^1.8.2: + version "1.8.5" + resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + dependencies: + expand-range "^1.8.1" + preserve "^0.2.0" + repeat-element "^1.1.2" + +braces@^2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" + dependencies: + arr-flatten "^1.1.0" + array-unique "^0.3.2" + extend-shallow "^2.0.1" + fill-range "^4.0.0" + isobject "^3.0.1" + repeat-element "^1.1.2" + snapdragon "^0.8.1" + snapdragon-node "^2.0.1" + split-string "^3.0.2" + to-regex "^3.0.1" + browser-process-hrtime@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.2.tgz#425d68a58d3447f02a04aa894187fce8af8b7b8e" -browserslist@^2.1.2: - version "2.11.3" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-2.11.3.tgz#fe36167aed1bbcde4827ebfe71347a2cc70b99b2" +browser-resolve@^1.11.2: + version "1.11.2" + resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce" dependencies: - caniuse-lite "^1.0.30000792" - electron-to-chromium "^1.3.30" + resolve "1.1.7" + +browserslist@^3.2.6: + version "3.2.8" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-3.2.8.tgz#b0005361d6471f0f5952797a76fc985f1f978fc6" + dependencies: + caniuse-lite "^1.0.30000844" + electron-to-chromium "^1.3.47" + +bser@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719" + dependencies: + node-int64 "^0.4.0" buffer-from@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.0.0.tgz#4cb8832d23612589b0406e9e2956c17f06fdf531" + version "1.1.0" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.0.tgz#87fcaa3a298358e0ade6e442cfce840740d1ad04" builtin-modules@^1.0.0, builtin-modules@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" +cache-base@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + dependencies: + collection-visit "^1.0.0" + component-emitter "^1.2.1" + get-value "^2.0.6" + has-value "^1.0.0" + isobject "^3.0.1" + set-value "^2.0.0" + to-object-path "^0.3.0" + union-value "^1.0.0" + unset-value "^1.0.0" + caller-path@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" @@ -864,6 +1042,10 @@ callsites@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" +callsites@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" + camel-case@3.0.x: version "3.0.0" resolved "https://registry.yarnpkg.com/camel-case/-/camel-case-3.0.0.tgz#ca3c3688a4e9cf3a4cda777dc4dcbc713249cf73" @@ -878,6 +1060,10 @@ camelcase-keys@^2.0.0: camelcase "^2.0.0" map-obj "^1.0.0" +camelcase@^1.0.2: + version "1.2.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" + camelcase@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" @@ -886,9 +1072,19 @@ camelcase@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" -caniuse-lite@^1.0.30000792: - version "1.0.30000833" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000833.tgz#98e84fcdb4399c6fa0b0fd41490d3217ac7802b4" +camelcase@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" + +caniuse-lite@^1.0.30000844: + version "1.0.30000856" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000856.tgz#ecc16978135a6f219b138991eb62009d25ee8daa" + +capture-exit@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-1.2.0.tgz#1c5fcc489fd0ab00d4f1ac7ae1072e3173fbab6f" + dependencies: + rsvp "^3.3.3" caseless@~0.11.0: version "0.11.0" @@ -898,7 +1094,14 @@ caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" -chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: +center-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" + dependencies: + align-text "^0.1.3" + lazy-cache "^1.0.3" + +chalk@^1.1.1, chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" dependencies: @@ -908,7 +1111,7 @@ chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0, chalk@^2.1.0, chalk@^2.4.1: +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" dependencies: @@ -920,10 +1123,27 @@ chardet@^0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" +chownr@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.0.1.tgz#e2a75042a9551908bebd25b8523d5f9769d79181" + +ci-info@^1.0.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.1.3.tgz#710193264bb05c77b8c90d02f5aaf22216a667b2" + circular-json@^0.3.1: version "0.3.3" resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" +class-utils@^0.3.5: + version "0.3.6" + resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + dependencies: + arr-union "^3.1.0" + define-property "^0.2.5" + isobject "^3.0.0" + static-extend "^0.1.1" + clean-css@4.1.x: version "4.1.11" resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-4.1.11.tgz#2ecdf145aba38f54740f26cefd0ff3e03e125d6a" @@ -948,6 +1168,14 @@ clipboard@^2.0.0: select "^1.1.2" tiny-emitter "^2.0.0" +cliui@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" + dependencies: + center-align "^0.1.1" + right-align "^0.1.1" + wordwrap "0.0.2" + cliui@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" @@ -956,6 +1184,14 @@ cliui@^3.2.0: strip-ansi "^3.0.1" wrap-ansi "^2.0.0" +cliui@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" + dependencies: + string-width "^2.1.1" + strip-ansi "^4.0.0" + wrap-ansi "^2.0.0" + co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" @@ -964,15 +1200,22 @@ code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" -color-convert@^1.9.0: - version "1.9.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.1.tgz#c1261107aeb2f294ebffec9ed9ecad529a6097ed" +collection-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" dependencies: - color-name "^1.1.1" + map-visit "^1.0.0" + object-visit "^1.0.0" -color-name@^1.1.1: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" +color-convert@^1.9.0: + version "1.9.2" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.2.tgz#49881b8fba67df12a96bdf3f56c0aab9e7913147" + dependencies: + color-name "1.1.1" + +color-name@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.1.tgz#4b1415304cf50028ea81643643bd82ea05803689" combined-stream@1.0.6, combined-stream@^1.0.5, combined-stream@~1.0.5: version "1.0.6" @@ -984,6 +1227,14 @@ commander@2.15.x, commander@^2.9.0, commander@~2.15.0: version "2.15.1" resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" +compare-versions@^3.1.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.3.0.tgz#af93ea705a96943f622ab309578b9b90586f39c3" + +component-emitter@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" + concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" @@ -1005,17 +1256,21 @@ contains-path@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" -convert-source-map@^1.5.1: +convert-source-map@^1.4.0, convert-source-map@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" +copy-descriptor@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + core-js@^1.0.0: version "1.2.7" resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636" core-js@^2.4.0, core-js@^2.5.0: - version "2.5.5" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.5.tgz#b14dde936c640c0579a6b50cabcc132dd6127e3b" + version "2.5.7" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e" core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" @@ -1028,7 +1283,7 @@ cross-spawn@^3.0.0: lru-cache "^4.0.1" which "^1.2.9" -cross-spawn@^5.1.0: +cross-spawn@^5.0.1, cross-spawn@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" dependencies: @@ -1042,19 +1297,13 @@ cryptiles@2.x.x: dependencies: boom "2.x.x" -cryptiles@3.x.x: - version "3.1.2" - resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-3.1.2.tgz#a89fbb220f5ce25ec56e8c4aa8a4fd7b5b0d29fe" - dependencies: - boom "5.x.x" - cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": version "0.3.2" resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.2.tgz#b8036170c79f07a90ff2f16e22284027a243848b" -"cssstyle@>= 0.2.37 < 0.3.0": - version "0.2.37" - resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-0.2.37.tgz#541097234cb2513c83ceed3acddc27ff27987d54" +"cssstyle@>= 0.3.1 < 0.4.0": + version "0.3.1" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-0.3.1.tgz#6da9b4cff1bc5d716e6e5fe8e04fcb1b50a49adf" dependencies: cssom "0.3.x" @@ -1082,7 +1331,7 @@ debug-log@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/debug-log/-/debug-log-1.0.1.tgz#2307632d4c04382b8df8a32f70b895046d52745f" -debug@^2.6.8, debug@^2.6.9: +debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" dependencies: @@ -1094,18 +1343,28 @@ debug@^3.1.0: dependencies: ms "2.0.0" -decamelize@^1.1.1, decamelize@^1.1.2: +decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" -deep-equal@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" +decode-uri-component@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + +deep-extend@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" deep-is@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" +default-require-extensions@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-2.0.0.tgz#f5f8fbb18a7d6d50b21f641f649ebb522cfe24f7" + dependencies: + strip-bom "^3.0.0" + define-properties@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94" @@ -1113,13 +1372,28 @@ define-properties@^1.1.2: foreach "^2.0.5" object-keys "^1.0.8" -defined@~1.0.0: +define-property@^0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + dependencies: + is-descriptor "^0.1.0" + +define-property@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + dependencies: + is-descriptor "^1.0.0" + +define-property@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + dependencies: + is-descriptor "^1.0.2" + isobject "^3.0.1" deglob@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/deglob/-/deglob-2.1.0.tgz#4d44abe16ef32c779b4972bd141a80325029a14a" + version "2.1.1" + resolved "https://registry.yarnpkg.com/deglob/-/deglob-2.1.1.tgz#d268e168727799862e8eac07042e165957c1f3be" dependencies: find-root "^1.0.0" glob "^7.0.5" @@ -1162,6 +1436,18 @@ detect-indent@^4.0.0: dependencies: repeating "^2.0.0" +detect-libc@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + +detect-newline@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2" + +diff@^3.2.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" + doctrine@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" @@ -1181,19 +1467,15 @@ domexception@^1.0.0: dependencies: webidl-conversions "^4.0.2" -duplexer@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" - ecc-jsbn@~0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" dependencies: jsbn "~0.1.0" -electron-to-chromium@^1.3.30: - version "1.3.45" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.45.tgz#458ac1b1c5c760ce8811a16d2bfbd97ec30bafb8" +electron-to-chromium@^1.3.47: + version "1.3.48" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.48.tgz#d3b0d8593814044e092ece2108fc3ac9aea4b900" encoding@^0.1.11: version "0.1.12" @@ -1211,9 +1493,9 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.5.0, es-abstract@^1.7.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.11.0.tgz#cce87d518f0496893b1a30cd8461835535480681" +es-abstract@^1.4.3, es-abstract@^1.5.1, es-abstract@^1.7.0: + version "1.12.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.12.0.tgz#9dbbdd27c6856f0001421ca18782d786bf8a6165" dependencies: es-to-primitive "^1.1.1" function-bind "^1.1.1" @@ -1234,8 +1516,8 @@ escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" escodegen@^1.9.0: - version "1.9.1" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.9.1.tgz#dbae17ef96c8e4bedb1356f4504fa4cc2f7cb7e2" + version "1.10.0" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.10.0.tgz#f647395de22519fbd0d928ffcf1d17e0dec2603e" dependencies: esprima "^3.1.3" estraverse "^4.2.0" @@ -1403,6 +1685,76 @@ esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" +exec-sh@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.2.1.tgz#163b98a6e89e6b65b47c2a28d215bc1f63989c38" + dependencies: + merge "^1.1.3" + +execa@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" + dependencies: + cross-spawn "^5.0.1" + get-stream "^3.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +exit@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + +expand-brackets@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + dependencies: + is-posix-bracket "^0.1.0" + +expand-brackets@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + dependencies: + debug "^2.3.3" + define-property "^0.2.5" + extend-shallow "^2.0.1" + posix-character-classes "^0.1.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +expand-range@^1.8.1: + version "1.8.2" + resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + dependencies: + fill-range "^2.1.0" + +expect@^23.1.0: + version "23.1.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-23.1.0.tgz#bfdfd57a2a20170d875999ee9787cc71f01c205f" + dependencies: + ansi-styles "^3.2.0" + jest-diff "^23.0.1" + jest-get-type "^22.1.0" + jest-matcher-utils "^23.0.1" + jest-message-util "^23.1.0" + jest-regex-util "^23.0.0" + +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + dependencies: + is-extendable "^0.1.0" + +extend-shallow@^3.0.0, extend-shallow@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + dependencies: + assign-symbols "^1.0.0" + is-extendable "^1.0.1" + extend@~3.0.0, extend@~3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" @@ -1415,6 +1767,25 @@ external-editor@^2.0.4: iconv-lite "^0.4.17" tmp "^0.0.33" +extglob@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + dependencies: + is-extglob "^1.0.0" + +extglob@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + dependencies: + array-unique "^0.3.2" + define-property "^1.0.0" + expand-brackets "^2.1.4" + extend-shallow "^2.0.1" + fragment-cache "^0.2.1" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + extsprintf@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" @@ -1435,9 +1806,15 @@ fast-levenshtein@~2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" +fb-watchman@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58" + dependencies: + bser "^2.0.0" + fbjs@^0.8.16: - version "0.8.16" - resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db" + version "0.8.17" + resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd" dependencies: core-js "^1.0.0" isomorphic-fetch "^2.1.1" @@ -1445,14 +1822,7 @@ fbjs@^0.8.16: object-assign "^4.1.0" promise "^7.1.1" setimmediate "^1.0.5" - ua-parser-js "^0.7.9" - -figures@^1.4.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" - dependencies: - escape-string-regexp "^1.0.5" - object-assign "^4.1.0" + ua-parser-js "^0.7.18" figures@^2.0.0: version "2.0.0" @@ -1467,6 +1837,36 @@ file-entry-cache@^2.0.0: flat-cache "^1.2.1" object-assign "^4.0.1" +filename-regex@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" + +fileset@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/fileset/-/fileset-2.0.3.tgz#8e7548a96d3cc2327ee5e674168723a333bba2a0" + dependencies: + glob "^7.0.3" + minimatch "^3.0.3" + +fill-range@^2.1.0: + version "2.2.4" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" + dependencies: + is-number "^2.1.0" + isobject "^2.0.0" + randomatic "^3.0.0" + repeat-element "^1.1.2" + repeat-string "^1.5.2" + +fill-range@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + dependencies: + extend-shallow "^2.0.1" + is-number "^3.0.0" + repeat-string "^1.6.1" + to-regex-range "^2.1.0" + find-root@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/find-root/-/find-root-1.1.0.tgz#abcfc8ba76f708c42a97b3d685b7e9450bfb9ce4" @@ -1478,7 +1878,7 @@ find-up@^1.0.0: path-exists "^2.0.0" pinkie-promise "^2.0.0" -find-up@^2.0.0: +find-up@^2.0.0, find-up@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" dependencies: @@ -1493,11 +1893,15 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -for-each@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.2.tgz#2c40450b9348e97f281322593ba96704b9abd4d4" +for-in@^1.0.1, for-in@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + +for-own@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" dependencies: - is-function "~1.0.0" + for-in "^1.0.1" foreach@^2.0.5: version "2.0.5" @@ -1523,18 +1927,37 @@ form-data@~2.3.1: combined-stream "1.0.6" mime-types "^2.1.12" +fragment-cache@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + dependencies: + map-cache "^0.2.2" + fs-extra@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-6.0.0.tgz#0f0afb290bb3deb87978da816fcd3c7797f3a817" + version "6.0.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-6.0.1.tgz#8abc128f7946e310135ddc93b98bddb410e7a34b" dependencies: graceful-fs "^4.1.2" jsonfile "^4.0.0" universalify "^0.1.0" +fs-minipass@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" + dependencies: + minipass "^2.2.1" + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" +fsevents@^1.2.3: + version "1.2.4" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.4.tgz#f41dcb1af2582af3692da36fc55cbd8e1041c426" + dependencies: + nan "^2.9.2" + node-pre-gyp "^0.10.0" + fstream@^1.0.0, fstream@^1.0.2: version "1.0.11" resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171" @@ -1544,7 +1967,7 @@ fstream@^1.0.0, fstream@^1.0.2: mkdirp ">=0.5 0" rimraf "2" -function-bind@^1.0.2, function-bind@^1.1.1, function-bind@~1.1.1: +function-bind@^1.0.2, function-bind@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" @@ -1566,8 +1989,8 @@ gauge@~2.7.3: wide-align "^1.1.0" gaze@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/gaze/-/gaze-1.1.2.tgz#847224677adb8870d679257ed3388fdb61e40105" + version "1.1.3" + resolved "https://registry.yarnpkg.com/gaze/-/gaze-1.1.3.tgz#c441733e13b927ac8c0ff0b4c3b033f28812924a" dependencies: globule "^1.0.0" @@ -1593,12 +2016,33 @@ get-stdin@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" +get-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + +get-value@^2.0.3, get-value@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + getpass@^0.1.1: version "0.1.7" resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" dependencies: assert-plus "^1.0.0" +glob-base@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + dependencies: + glob-parent "^2.0.0" + is-glob "^2.0.0" + +glob-parent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + dependencies: + is-glob "^2.0.0" + glob@^6.0.4: version "6.0.4" resolved "https://registry.yarnpkg.com/glob/-/glob-6.0.4.tgz#0f08860f6a155127b2fadd4f9ce24b1aab6e4d22" @@ -1609,7 +2053,7 @@ glob@^6.0.4: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.2, glob@~7.1.1, glob@~7.1.2: +glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2, glob@~7.1.1: version "7.1.2" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" dependencies: @@ -1640,11 +2084,11 @@ globby@^5.0.0: pinkie-promise "^2.0.0" globule@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/globule/-/globule-1.2.0.tgz#1dc49c6822dd9e8a2fa00ba2a295006e8664bd09" + version "1.2.1" + resolved "https://registry.yarnpkg.com/globule/-/globule-1.2.1.tgz#5dffb1b191f22d20797a9369b49eab4e9839696d" dependencies: glob "~7.1.1" - lodash "~4.17.4" + lodash "~4.17.10" minimatch "~3.0.2" good-listener@^1.2.2: @@ -1653,10 +2097,28 @@ good-listener@^1.2.2: dependencies: delegate "^3.1.2" -graceful-fs@^4.1.2, graceful-fs@^4.1.6: +graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" +growly@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" + +handlebars@^4.0.3: + version "4.0.11" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.11.tgz#630a35dfe0294bc281edae6ffc5d329fc7982dcc" + dependencies: + async "^1.4.0" + optimist "^0.6.1" + source-map "^0.4.4" + optionalDependencies: + uglify-js "^2.6" + +har-schema@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-1.0.5.tgz#d263135f43307c02c602afc8fe95970c0151369e" + har-schema@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" @@ -1670,6 +2132,13 @@ har-validator@~2.0.6: is-my-json-valid "^2.12.4" pinkie-promise "^2.0.0" +har-validator@~4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-4.2.1.tgz#33481d0f1bbff600dd203d75812a6a5fba002e2a" + dependencies: + ajv "^4.9.1" + har-schema "^1.0.5" + har-validator@~5.0.3: version "5.0.3" resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.0.3.tgz#ba402c266194f15956ef15e0fcf242993f6a7dfd" @@ -1683,6 +2152,10 @@ has-ansi@^2.0.0: dependencies: ansi-regex "^2.0.0" +has-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" + has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" @@ -1691,11 +2164,38 @@ has-unicode@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" -has@^1.0.1, has@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" +has-value@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" dependencies: - function-bind "^1.0.2" + get-value "^2.0.3" + has-values "^0.1.4" + isobject "^2.0.0" + +has-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + dependencies: + get-value "^2.0.6" + has-values "^1.0.0" + isobject "^3.0.0" + +has-values@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + +has-values@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + +has@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + dependencies: + function-bind "^1.1.1" hawk@~3.1.3: version "3.1.3" @@ -1706,15 +2206,6 @@ hawk@~3.1.3: hoek "2.x.x" sntp "1.x.x" -hawk@~6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/hawk/-/hawk-6.0.2.tgz#af4d914eb065f9b5ce4d9d11c1cb2126eecc3038" - dependencies: - boom "4.x.x" - cryptiles "3.x.x" - hoek "4.x.x" - sntp "2.x.x" - he@1.1.x: version "1.1.1" resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" @@ -1723,10 +2214,6 @@ hoek@2.x.x: version "2.16.3" resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" -hoek@4.x.x: - version "4.2.1" - resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.1.tgz#9634502aa12c445dd5a7c5734b572bb8738aacbb" - home-or-tmp@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" @@ -1745,8 +2232,8 @@ html-encoding-sniffer@^1.0.2: whatwg-encoding "^1.0.1" html-minifier@^3.5.15: - version "3.5.15" - resolved "https://registry.yarnpkg.com/html-minifier/-/html-minifier-3.5.15.tgz#f869848d4543cbfd84f26d5514a2a87cbf9a05e0" + version "3.5.16" + resolved "https://registry.yarnpkg.com/html-minifier/-/html-minifier-3.5.16.tgz#39f5aabaf78bdfc057fe67334226efd7f3851175" dependencies: camel-case "3.0.x" clean-css "4.1.x" @@ -1776,16 +2263,29 @@ iconv-lite@0.4.19: version "0.4.19" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" -iconv-lite@^0.4.17, iconv-lite@~0.4.13: - version "0.4.21" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.21.tgz#c47f8733d02171189ebc4a400f3218d348094798" +iconv-lite@^0.4.17, iconv-lite@^0.4.4, iconv-lite@~0.4.13: + version "0.4.23" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" dependencies: - safer-buffer "^2.1.0" + safer-buffer ">= 2.1.2 < 3" + +ignore-walk@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" + dependencies: + minimatch "^3.0.4" ignore@^3.0.9, ignore@^3.3.3, ignore@^3.3.6: version "3.3.8" resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.8.tgz#3f8e9c35d38708a3a7e0e9abb6c73e7ee7707b2b" +import-local@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-1.0.0.tgz#5e4ffdc03f4fe6c009c6729beb29631c2f8227bc" + dependencies: + pkg-dir "^2.0.0" + resolve-cwd "^2.0.0" + imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" @@ -1811,6 +2311,10 @@ inherits@2, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" +ini@~1.3.0: + version "1.3.5" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" + inquirer@^3.0.6: version "3.3.0" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.3.0.tgz#9dd2f2ad765dcab1ff0443b491442a20ba227dc9" @@ -1840,10 +2344,26 @@ invert-kv@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" +is-accessor-descriptor@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + dependencies: + kind-of "^3.0.2" + +is-accessor-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + dependencies: + kind-of "^6.0.0" + is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + is-builtin-module@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" @@ -1854,11 +2374,69 @@ is-callable@^1.1.1, is-callable@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2" +is-ci@^1.0.10: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.1.0.tgz#247e4162e7860cebbdaf30b774d6b0ac7dcfe7a5" + dependencies: + ci-info "^1.0.0" + +is-data-descriptor@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + dependencies: + kind-of "^3.0.2" + +is-data-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + dependencies: + kind-of "^6.0.0" + is-date-object@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" -is-finite@^1.0.0, is-finite@^1.0.1: +is-descriptor@^0.1.0: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + dependencies: + is-accessor-descriptor "^0.1.6" + is-data-descriptor "^0.1.4" + kind-of "^5.0.0" + +is-descriptor@^1.0.0, is-descriptor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + dependencies: + is-accessor-descriptor "^1.0.0" + is-data-descriptor "^1.0.0" + kind-of "^6.0.2" + +is-dotfile@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" + +is-equal-shallow@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + dependencies: + is-primitive "^2.0.0" + +is-extendable@^0.1.0, is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + +is-extendable@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + dependencies: + is-plain-object "^2.0.4" + +is-extglob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + +is-finite@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" dependencies: @@ -1874,9 +2452,15 @@ is-fullwidth-code-point@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" -is-function@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.1.tgz#12cfb98b65b57dd3d193a3121f5f6e2f437602b5" +is-generator-fn@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-1.0.0.tgz#969d49e1bb3329f6bb7f09089be26578b2ddd46a" + +is-glob@^2.0.0, is-glob@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + dependencies: + is-extglob "^1.0.0" is-my-ip-valid@^1.0.0: version "1.0.0" @@ -1892,6 +2476,28 @@ is-my-json-valid@^2.12.4: jsonpointer "^4.0.0" xtend "^4.0.0" +is-number@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + dependencies: + kind-of "^3.0.2" + +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + dependencies: + kind-of "^3.0.2" + +is-number@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" + +is-odd@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-odd/-/is-odd-2.0.0.tgz#7646624671fd7ea558ccd9a2795182f2958f1b24" + dependencies: + is-number "^4.0.0" + is-path-cwd@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" @@ -1908,6 +2514,20 @@ is-path-inside@^1.0.0: dependencies: path-is-inside "^1.0.1" +is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + dependencies: + isobject "^3.0.1" + +is-posix-bracket@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + +is-primitive@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + is-promise@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" @@ -1926,7 +2546,7 @@ is-resolvable@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" -is-stream@^1.0.1: +is-stream@^1.0.1, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" @@ -1942,7 +2562,11 @@ is-utf8@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" -isarray@^1.0.0, isarray@~1.0.0: +is-windows@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + +isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -1950,6 +2574,16 @@ isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + dependencies: + isarray "1.0.0" + +isobject@^3.0.0, isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + isomorphic-fetch@^2.1.1: version "2.2.1" resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9" @@ -1961,17 +2595,374 @@ isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" +istanbul-api@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.3.1.tgz#4c3b05d18c0016d1022e079b98dc82c40f488954" + dependencies: + async "^2.1.4" + compare-versions "^3.1.0" + fileset "^2.0.2" + istanbul-lib-coverage "^1.2.0" + istanbul-lib-hook "^1.2.0" + istanbul-lib-instrument "^1.10.1" + istanbul-lib-report "^1.1.4" + istanbul-lib-source-maps "^1.2.4" + istanbul-reports "^1.3.0" + js-yaml "^3.7.0" + mkdirp "^0.5.1" + once "^1.4.0" + +istanbul-lib-coverage@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.0.tgz#f7d8f2e42b97e37fe796114cb0f9d68b5e3a4341" + +istanbul-lib-hook@^1.2.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.2.1.tgz#f614ec45287b2a8fc4f07f5660af787575601805" + dependencies: + append-transform "^1.0.0" + +istanbul-lib-instrument@^1.10.1: + version "1.10.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.1.tgz#724b4b6caceba8692d3f1f9d0727e279c401af7b" + dependencies: + babel-generator "^6.18.0" + babel-template "^6.16.0" + babel-traverse "^6.18.0" + babel-types "^6.18.0" + babylon "^6.18.0" + istanbul-lib-coverage "^1.2.0" + semver "^5.3.0" + +istanbul-lib-report@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.4.tgz#e886cdf505c4ebbd8e099e4396a90d0a28e2acb5" + dependencies: + istanbul-lib-coverage "^1.2.0" + mkdirp "^0.5.1" + path-parse "^1.0.5" + supports-color "^3.1.2" + +istanbul-lib-source-maps@^1.2.4: + version "1.2.5" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.5.tgz#ffe6be4e7ab86d3603e4290d54990b14506fc9b1" + dependencies: + debug "^3.1.0" + istanbul-lib-coverage "^1.2.0" + mkdirp "^0.5.1" + rimraf "^2.6.1" + source-map "^0.5.3" + +istanbul-reports@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.3.0.tgz#2f322e81e1d9520767597dca3c20a0cce89a3554" + dependencies: + handlebars "^4.0.3" + +jest-changed-files@^23.0.1: + version "23.0.1" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-23.0.1.tgz#f79572d0720844ea5df84c2a448e862c2254f60c" + dependencies: + throat "^4.0.0" + +jest-cli@^23.1.0: + version "23.1.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-23.1.0.tgz#eb8bdd4ce0d15250892e31ad9b69bc99d2a8f6bf" + dependencies: + ansi-escapes "^3.0.0" + chalk "^2.0.1" + exit "^0.1.2" + glob "^7.1.2" + graceful-fs "^4.1.11" + import-local "^1.0.0" + is-ci "^1.0.10" + istanbul-api "^1.3.1" + istanbul-lib-coverage "^1.2.0" + istanbul-lib-instrument "^1.10.1" + istanbul-lib-source-maps "^1.2.4" + jest-changed-files "^23.0.1" + jest-config "^23.1.0" + jest-environment-jsdom "^23.1.0" + jest-get-type "^22.1.0" + 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.5.4" + slash "^1.0.0" + string-length "^2.0.0" + strip-ansi "^4.0.0" + which "^1.2.12" + yargs "^11.0.0" + +jest-config@^23.1.0: + version "23.1.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-23.1.0.tgz#708ca0f431d356ee424fb4895d3308006bdd8241" + dependencies: + babel-core "^6.0.0" + babel-jest "^23.0.1" + chalk "^2.0.1" + glob "^7.1.1" + jest-environment-jsdom "^23.1.0" + jest-environment-node "^23.1.0" + jest-get-type "^22.1.0" + 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@^23.0.1: + version "23.0.1" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-23.0.1.tgz#3d49137cee12c320a4b4d2b4a6fa6e82d491a16a" + dependencies: + chalk "^2.0.1" + diff "^3.2.0" + jest-get-type "^22.1.0" + pretty-format "^23.0.1" + +jest-docblock@^23.0.1: + version "23.0.1" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-23.0.1.tgz#deddd18333be5dc2415260a04ef3fce9276b5725" + dependencies: + detect-newline "^2.1.0" + +jest-each@^23.1.0: + version "23.1.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-23.1.0.tgz#16146b592c354867a5ae5e13cdf15c6c65b696c6" + dependencies: + chalk "^2.0.1" + pretty-format "^23.0.1" + +jest-environment-jsdom@^23.1.0: + version "23.1.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-23.1.0.tgz#85929914e23bed3577dac9755f4106d0697c479c" + dependencies: + jest-mock "^23.1.0" + jest-util "^23.1.0" + jsdom "^11.5.1" + +jest-environment-node@^23.1.0: + version "23.1.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-23.1.0.tgz#452c0bf949cfcbbacda1e1762eeed70bc784c7d5" + dependencies: + jest-mock "^23.1.0" + jest-util "^23.1.0" + +jest-get-type@^22.1.0: + version "22.4.3" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-22.4.3.tgz#e3a8504d8479342dd4420236b322869f18900ce4" + +jest-haste-map@^23.1.0: + version "23.1.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-23.1.0.tgz#18e6c7d5a8d27136f91b7d9852f85de0c7074c49" + dependencies: + 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.0.0" + +jest-jasmine2@^23.1.0: + version "23.1.0" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-23.1.0.tgz#4afab31729b654ddcd2b074add849396f13b30b8" + dependencies: + chalk "^2.0.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@^23.0.1: + version "23.0.1" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-23.0.1.tgz#9dba07505ac3495c39d3ec09ac1e564599e861a0" + dependencies: + pretty-format "^23.0.1" + +jest-matcher-utils@^23.0.1: + version "23.0.1" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-23.0.1.tgz#0c6c0daedf9833c2a7f36236069efecb4c3f6e5f" + dependencies: + chalk "^2.0.1" + jest-get-type "^22.1.0" + pretty-format "^23.0.1" + +jest-message-util@^23.1.0: + version "23.1.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-23.1.0.tgz#9a809ba487ecac5ce511d4e698ee3b5ee2461ea9" + dependencies: + "@babel/code-frame" "^7.0.0-beta.35" + chalk "^2.0.1" + micromatch "^2.3.11" + slash "^1.0.0" + stack-utils "^1.0.1" + +jest-mock@^23.1.0: + version "23.1.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-23.1.0.tgz#a381c31b121ab1f60c462a2dadb7b86dcccac487" + +jest-regex-util@^23.0.0: + version "23.0.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-23.0.0.tgz#dd5c1fde0c46f4371314cf10f7a751a23f4e8f76" + +jest-resolve-dependencies@^23.0.1: + version "23.0.1" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-23.0.1.tgz#d01a10ddad9152c4cecdf5eac2b88571c4b6a64d" + dependencies: + jest-regex-util "^23.0.0" + jest-snapshot "^23.0.1" + +jest-resolve@^23.1.0: + version "23.1.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-23.1.0.tgz#b9e316eecebd6f00bc50a3960d1527bae65792d2" + dependencies: + browser-resolve "^1.11.2" + chalk "^2.0.1" + realpath-native "^1.0.0" + +jest-runner@^23.1.0: + version "23.1.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-23.1.0.tgz#fa20a933fff731a5432b3561e7f6426594fa29b5" + dependencies: + 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.0.0" + +jest-runtime@^23.1.0: + version "23.1.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-23.1.0.tgz#b4ae0e87259ecacfd4a884b639db07cf4dd620af" + dependencies: + babel-core "^6.0.0" + babel-plugin-istanbul "^4.1.6" + chalk "^2.0.1" + convert-source-map "^1.4.0" + exit "^0.1.2" + fast-json-stable-stringify "^2.0.0" + graceful-fs "^4.1.11" + jest-config "^23.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.1.0" + yargs "^11.0.0" + +jest-serializer@^23.0.1: + version "23.0.1" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-23.0.1.tgz#a3776aeb311e90fe83fab9e533e85102bd164165" + +jest-snapshot@^23.0.1: + version "23.0.1" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-23.0.1.tgz#6674fa19b9eb69a99cabecd415bddc42d6af3e7e" + dependencies: + chalk "^2.0.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@^1.9.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/jest-tap-reporter/-/jest-tap-reporter-1.9.0.tgz#bf3364a97116454b5f34d73cf9cda16e2cb318d1" + dependencies: + "@babel/code-frame" "7.0.0-beta.36" + chalk "^2.3.0" + string.prototype.padend "^3.0.0" + string.prototype.padstart "^3.0.0" + strip-ansi "4.0.0" + utf8-bar "0.1.0" + +jest-util@^23.1.0: + version "23.1.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-23.1.0.tgz#c0251baf34644c6dd2fea78a962f4263ac55772d" + dependencies: + callsites "^2.0.0" + chalk "^2.0.1" + graceful-fs "^4.1.11" + is-ci "^1.0.10" + jest-message-util "^23.1.0" + mkdirp "^0.5.1" + slash "^1.0.0" + source-map "^0.6.0" + +jest-validate@^23.0.1: + version "23.0.1" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-23.0.1.tgz#cd9f01a89d26bb885f12a8667715e9c865a5754f" + dependencies: + chalk "^2.0.1" + jest-get-type "^22.1.0" + leven "^2.1.0" + pretty-format "^23.0.1" + +jest-watcher@^23.1.0: + version "23.1.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-23.1.0.tgz#a8d5842e38d9fb4afff823df6abb42a58ae6cdbd" + dependencies: + ansi-escapes "^3.0.0" + chalk "^2.0.1" + string-length "^2.0.0" + +jest-worker@^23.0.1: + version "23.0.1" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-23.0.1.tgz#9e649dd963ff4046026f91c4017f039a6aa4a7bc" + dependencies: + merge-stream "^1.0.1" + +jest@^23.1.0: + version "23.1.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-23.1.0.tgz#bbb7f893100a11a742dd8bd0d047a54b0968ad1a" + dependencies: + import-local "^1.0.0" + jest-cli "^23.1.0" + js-base64@^2.1.8: - version "2.4.3" - resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.4.3.tgz#2e545ec2b0f2957f41356510205214e98fad6582" + version "2.4.5" + resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.4.5.tgz#e293cd3c7c82f070d700fc7a1ca0a2e69f101f92" js-tokens@^3.0.0, js-tokens@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" -js-yaml@^3.9.1: - version "3.11.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.11.0.tgz#597c1a8bd57152f26d622ce4117851a51f5ebaef" +js-yaml@^3.7.0, js-yaml@^3.9.1: + version "3.12.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" dependencies: argparse "^1.0.7" esprima "^4.0.0" @@ -1980,22 +2971,22 @@ jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" -jsdom@^11.10.0: - version "11.10.0" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.10.0.tgz#a42cd54e88895dc765f03f15b807a474962ac3b5" +jsdom@^11.5.1: + version "11.11.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.11.0.tgz#df486efad41aee96c59ad7a190e2449c7eb1110e" dependencies: abab "^1.0.4" acorn "^5.3.0" acorn-globals "^4.1.0" array-equal "^1.0.0" cssom ">= 0.3.2 < 0.4.0" - cssstyle ">= 0.2.37 < 0.3.0" + cssstyle ">= 0.3.1 < 0.4.0" data-urls "^1.0.0" domexception "^1.0.0" escodegen "^1.9.0" html-encoding-sniffer "^1.0.2" left-pad "^1.2.0" - nwmatcher "^1.4.3" + nwsapi "^2.0.0" parse5 "4.0.0" pn "^1.1.0" request "^2.83.0" @@ -2007,7 +2998,7 @@ jsdom@^11.10.0: webidl-conversions "^4.0.2" whatwg-encoding "^1.0.3" whatwg-mimetype "^2.1.0" - whatwg-url "^6.4.0" + whatwg-url "^6.4.1" ws "^4.0.0" xml-name-validator "^3.0.0" @@ -2035,6 +3026,12 @@ json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" +json-stable-stringify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" + dependencies: + jsonify "~0.0.0" + json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" @@ -2049,6 +3046,10 @@ jsonfile@^4.0.0: optionalDependencies: graceful-fs "^4.1.6" +jsonify@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" + jsonpointer@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" @@ -2068,6 +3069,30 @@ jsx-ast-utils@^2.0.1: dependencies: array-includes "^3.0.3" +kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + dependencies: + is-buffer "^1.1.5" + +kind-of@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + +kind-of@^6.0.0, kind-of@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" + +lazy-cache@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" + lcid@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" @@ -2078,6 +3103,10 @@ left-pad@^1.2.0: version "1.3.0" resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e" +leven@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" + levn@^0.3.0, levn@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" @@ -2154,14 +3183,14 @@ lodash.sortby@^4.7.0: version "4.7.0" resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" -lodash@^3.6.0: - version "3.10.1" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6" - -lodash@^4.0.0, lodash@^4.13.1, lodash@^4.17.4, lodash@^4.3.0, lodash@~4.17.4: +lodash@^4.0.0, lodash@^4.13.1, lodash@^4.17.10, lodash@^4.17.4, lodash@^4.3.0, lodash@~4.17.10: version "4.17.10" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" +longest@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" + loose-envify@^1.0.0, loose-envify@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" @@ -2180,8 +3209,8 @@ lower-case@^1.1.1: resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-1.1.4.tgz#9a2cabd1b9e8e0ae993a4bf7d5875c39c42e8eac" lru-cache@^4.0.1: - version "4.1.2" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.2.tgz#45234b2e6e2f2b33da125624c4664929a0224c3f" + version "4.1.3" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.3.tgz#a1175cf3496dfc8436c156c334b4955992bce69c" dependencies: pseudomap "^1.0.2" yallist "^2.1.2" @@ -2192,10 +3221,26 @@ magic-string@^0.22.4: dependencies: vlq "^0.2.2" +makeerror@1.0.x: + version "1.0.11" + resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" + dependencies: + tmpl "1.0.x" + +map-cache@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + map-obj@^1.0.0, map-obj@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" +map-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + dependencies: + object-visit "^1.0.0" + markdown-it@^8.4.1: version "8.4.1" resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-8.4.1.tgz#206fe59b0e4e1b78a7c73250af9b34a4ad0aaf44" @@ -2206,10 +3251,20 @@ markdown-it@^8.4.1: mdurl "^1.0.1" uc.micro "^1.0.5" +math-random@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.1.tgz#8b3aac588b8a66e4975e3cdea67f7bb329601fac" + mdurl@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" +mem@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" + dependencies: + mimic-fn "^1.0.0" + meow@^3.7.0: version "3.7.0" resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" @@ -2225,6 +3280,52 @@ meow@^3.7.0: redent "^1.0.0" trim-newlines "^1.0.0" +merge-stream@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1" + dependencies: + readable-stream "^2.0.1" + +merge@^1.1.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.0.tgz#7531e39d4949c281a66b8c5a6e0265e8b05894da" + +micromatch@^2.3.11: + version "2.3.11" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + dependencies: + arr-diff "^2.0.0" + array-unique "^0.2.1" + braces "^1.8.2" + expand-brackets "^0.1.4" + extglob "^0.3.1" + filename-regex "^2.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.1" + kind-of "^3.0.2" + normalize-path "^2.0.1" + object.omit "^2.0.0" + parse-glob "^3.0.4" + regex-cache "^0.4.2" + +micromatch@^3.1.4, micromatch@^3.1.8: + version "3.1.10" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + braces "^2.3.1" + define-property "^2.0.2" + extend-shallow "^3.0.2" + extglob "^2.0.4" + fragment-cache "^0.2.1" + kind-of "^6.0.2" + nanomatch "^1.2.9" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.2" + mime-db@~1.33.0: version "1.33.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.33.0.tgz#a3492050a5cb9b63450541e39d9788d2272783db" @@ -2253,10 +3354,34 @@ minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" -minimist@^1.1.0, minimist@^1.1.3, minimist@~1.2.0: +minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" +minimist@~0.0.1: + version "0.0.10" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" + +minipass@^2.2.1, minipass@^2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.3.tgz#a7dcc8b7b833f5d368759cce544dccb55f50f233" + dependencies: + safe-buffer "^5.1.2" + yallist "^3.0.0" + +minizlib@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.1.0.tgz#11e13658ce46bc3a70a267aac58359d1e0c29ceb" + dependencies: + minipass "^2.2.1" + +mixin-deep@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" + dependencies: + for-in "^1.0.2" + is-extendable "^1.0.1" + "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" @@ -2271,14 +3396,39 @@ mute-stream@0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" -nan@^2.10.0: +nan@^2.10.0, nan@^2.9.2: version "2.10.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f" +nanomatch@^1.2.9: + version "1.2.9" + resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.9.tgz#879f7150cb2dab7a471259066c104eee6e0fa7c2" + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + define-property "^2.0.2" + extend-shallow "^3.0.2" + fragment-cache "^0.2.1" + is-odd "^2.0.0" + is-windows "^1.0.2" + kind-of "^6.0.2" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" +needle@^2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.1.tgz#b5e325bd3aae8c2678902fa296f729455d1d3a7d" + dependencies: + debug "^2.1.2" + iconv-lite "^0.4.4" + sax "^1.2.4" + no-case@^2.2.0: version "2.3.2" resolved "https://registry.yarnpkg.com/no-case/-/no-case-2.3.2.tgz#60b813396be39b3f1288a4c1ed5d1e7d28b464ac" @@ -2293,23 +3443,50 @@ node-fetch@^1.0.1: is-stream "^1.0.1" node-gyp@^3.3.1: - version "3.6.2" - resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-3.6.2.tgz#9bfbe54562286284838e750eac05295853fa1c60" + version "3.7.0" + resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-3.7.0.tgz#789478e8f6c45e277aa014f3e28f958f286f9203" dependencies: fstream "^1.0.0" glob "^7.0.3" graceful-fs "^4.1.2" - minimatch "^3.0.2" mkdirp "^0.5.0" nopt "2 || 3" npmlog "0 || 1 || 2 || 3 || 4" osenv "0" - request "2" + request ">=2.9.0 <2.82.0" rimraf "2" semver "~5.3.0" tar "^2.0.0" which "1" +node-int64@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" + +node-notifier@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.2.1.tgz#fa313dd08f5517db0e2502e5758d664ac69f9dea" + dependencies: + growly "^1.3.0" + semver "^5.4.1" + shellwords "^0.1.1" + which "^1.3.0" + +node-pre-gyp@^0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.0.tgz#6e4ef5bb5c5203c6552448828c852c40111aac46" + dependencies: + detect-libc "^1.0.2" + mkdirp "^0.5.1" + needle "^2.2.0" + nopt "^4.0.1" + npm-packlist "^1.1.6" + npmlog "^4.0.2" + rc "^1.1.7" + rimraf "^2.6.1" + semver "^5.3.0" + tar "^4" + node-sass@^4.9.0: version "4.9.0" resolved "https://registry.yarnpkg.com/node-sass/-/node-sass-4.9.0.tgz#d1b8aa855d98ed684d6848db929a20771cc2ae52" @@ -2340,6 +3517,13 @@ node-sass@^4.9.0: dependencies: abbrev "1" +nopt@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" + dependencies: + abbrev "1" + osenv "^0.1.4" + normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: version "2.4.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" @@ -2349,7 +3533,30 @@ normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: semver "2 || 3 || 4 || 5" validate-npm-package-license "^3.0.1" -"npmlog@0 || 1 || 2 || 3 || 4", npmlog@^4.0.0: +normalize-path@^2.0.1, normalize-path@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + dependencies: + remove-trailing-separator "^1.0.1" + +npm-bundled@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.3.tgz#7e71703d973af3370a9591bafe3a63aca0be2308" + +npm-packlist@^1.1.6: + version "1.1.10" + resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.1.10.tgz#1039db9e985727e464df066f4cf0ab6ef85c398a" + dependencies: + ignore-walk "^3.0.1" + npm-bundled "^1.0.1" + +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + dependencies: + path-key "^2.0.0" + +"npmlog@0 || 1 || 2 || 3 || 4", npmlog@^4.0.0, npmlog@^4.0.2: version "4.1.2" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" dependencies: @@ -2362,9 +3569,9 @@ number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" -nwmatcher@^1.4.3: - version "1.4.4" - resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.4.4.tgz#2285631f34a95f0d0395cd900c96ed39b58f346e" +nwsapi@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.0.4.tgz#dc79040a5f77b97716dc79565fc7fc3ef7d50570" oauth-sign@~0.8.1, oauth-sign@~0.8.2: version "0.8.2" @@ -2374,21 +3581,51 @@ object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" -object-inspect@~1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.5.0.tgz#9d876c11e40f485c79215670281b767488f9bfe3" +object-copy@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + dependencies: + copy-descriptor "^0.1.0" + define-property "^0.2.5" + kind-of "^3.0.3" object-keys@^1.0.8: version "1.0.11" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d" +object-visit@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + dependencies: + isobject "^3.0.0" + +object.getownpropertydescriptors@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" + dependencies: + define-properties "^1.1.2" + es-abstract "^1.5.1" + +object.omit@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + dependencies: + for-own "^0.1.4" + is-extendable "^0.1.1" + +object.pick@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + dependencies: + isobject "^3.0.1" + octicons@^7.2.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/octicons/-/octicons-7.2.0.tgz#a721635f73c774d7ffda56a83a29dbde03fc4b53" + version "7.3.0" + resolved "https://registry.yarnpkg.com/octicons/-/octicons-7.3.0.tgz#ad2612b483cd4da4f655384294787cb2967beb17" dependencies: object-assign "^4.1.1" -once@^1.3.0: +once@^1.3.0, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" dependencies: @@ -2400,6 +3637,13 @@ onetime@^2.0.0: dependencies: mimic-fn "^1.0.0" +optimist@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" + dependencies: + minimist "~0.0.1" + wordwrap "~0.0.2" + optionator@^0.8.1, optionator@^0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" @@ -2421,20 +3665,32 @@ os-locale@^1.4.0: dependencies: lcid "^1.0.0" +os-locale@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" + dependencies: + execa "^0.7.0" + lcid "^1.0.0" + mem "^1.1.0" + os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" -osenv@0: +osenv@0, osenv@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" dependencies: os-homedir "^1.0.0" os-tmpdir "^1.0.0" +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + p-limit@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.2.0.tgz#0e92b6bedcb59f022c13d0f1949dc82d15909f1c" + version "1.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" dependencies: p-try "^1.0.0" @@ -2454,6 +3710,15 @@ param-case@2.1.x: dependencies: no-case "^2.2.0" +parse-glob@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + dependencies: + glob-base "^0.3.0" + is-dotfile "^1.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.0" + parse-json@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" @@ -2467,14 +3732,14 @@ parse-json@^4.0.0: error-ex "^1.3.1" json-parse-better-errors "^1.0.1" -parse-ms@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/parse-ms/-/parse-ms-1.0.1.tgz#56346d4749d78f23430ca0c713850aef91aa361d" - parse5@4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608" +pascalcase@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + path-exists@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" @@ -2493,6 +3758,10 @@ path-is-inside@^1.0.1, path-is-inside@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" +path-key@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + path-parse@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" @@ -2511,6 +3780,10 @@ path-type@^2.0.0: dependencies: pify "^2.0.0" +performance-now@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5" + performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" @@ -2554,9 +3827,11 @@ pkg-dir@^1.0.0: dependencies: find-up "^1.0.0" -plur@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/plur/-/plur-1.0.0.tgz#db85c6814f5e5e5a3b49efc28d604fec62975156" +pkg-dir@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" + dependencies: + find-up "^2.1.0" pluralize@^7.0.0: version "7.0.0" @@ -2566,25 +3841,32 @@ pn@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" +posix-character-classes@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" -prettier@^1.12.1: - version "1.12.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.12.1.tgz#c1ad20e803e7749faf905a409d2367e06bbe7325" +preserve@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" -pretty-ms@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/pretty-ms/-/pretty-ms-2.1.0.tgz#4257c256df3fb0b451d6affaab021884126981dc" +prettier@^1.12.1: + version "1.13.5" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.13.5.tgz#7ae2076998c8edce79d63834e9b7b09fead6bfd0" + +pretty-format@^23.0.1: + version "23.0.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-23.0.1.tgz#d61d065268e4c759083bccbca27a01ad7c7601f4" dependencies: - is-finite "^1.0.1" - parse-ms "^1.0.0" - plur "^1.0.0" + ansi-regex "^3.0.0" + ansi-styles "^3.2.0" prismjs@^1.14.0: - version "1.14.0" - resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.14.0.tgz#bbccfdb8be5d850d26453933cb50122ca0362ae0" + version "1.15.0" + resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.15.0.tgz#8801d332e472091ba8def94976c8877ad60398d9" optionalDependencies: clipboard "^2.0.0" @@ -2618,25 +3900,46 @@ pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" +psl@^1.1.24: + version "1.1.28" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.28.tgz#4fb6ceb08a1e2214d4fd4de0ca22dae13740bc7b" + punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" punycode@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d" + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" qs@~6.3.0: version "6.3.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.2.tgz#e75bd5f6e268122a2a0e0bda630b2550c166502c" -qs@~6.5.1: - version "6.5.1" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8" +qs@~6.4.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" -re-emitter@^1.0.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/re-emitter/-/re-emitter-1.1.3.tgz#fa9e319ffdeeeb35b27296ef0f3d374dac2f52a7" +qs@~6.5.1: + version "6.5.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" + +randomatic@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.0.0.tgz#d35490030eb4f7578de292ce6dfb04a91a128923" + dependencies: + is-number "^4.0.0" + kind-of "^6.0.0" + math-random "^1.0.1" + +rc@^1.1.7: + version "1.2.8" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + dependencies: + deep-extend "^0.6.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" read-pkg-up@^1.0.1: version "1.0.1" @@ -2668,7 +3971,7 @@ read-pkg@^2.0.0: normalize-package-data "^2.3.2" path-type "^2.0.0" -readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2: +readable-stream@^2.0.1, readable-stream@^2.0.6, readable-stream@^2.2.2: version "2.3.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" dependencies: @@ -2680,6 +3983,12 @@ readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.6, readable string_decoder "~1.1.1" util-deprecate "~1.0.1" +realpath-native@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.0.0.tgz#7885721a83b43bd5327609f0ddecb2482305fdf0" + dependencies: + util.promisify "^1.0.0" + redent@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde" @@ -2688,8 +3997,8 @@ redent@^1.0.0: strip-indent "^1.0.1" regenerate@^1.2.1: - version "1.3.3" - resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.3.tgz#0c336d3980553d755c39b586ae3b20aa49c82b7f" + version "1.4.0" + resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" regenerator-runtime@^0.11.0: version "0.11.1" @@ -2703,6 +4012,19 @@ regenerator-transform@^0.10.0: babel-types "^6.19.0" private "^0.1.6" +regex-cache@^0.4.2: + version "0.4.4" + resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" + dependencies: + is-equal-shallow "^0.1.3" + +regex-not@^1.0.0, regex-not@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + dependencies: + extend-shallow "^3.0.2" + safe-regex "^1.1.0" + regexpu-core@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" @@ -2725,7 +4047,15 @@ relateurl@0.2.x: version "0.2.7" resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" -repeat-string@^1.5.2: +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + +repeat-element@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" + +repeat-string@^1.5.2, repeat-string@^1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" @@ -2749,9 +4079,36 @@ request-promise-native@^1.0.5: stealthy-require "^1.1.0" tough-cookie ">=2.3.3" -request@2, request@^2.83.0: - version "2.85.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.85.0.tgz#5a03615a47c61420b3eb99b7dba204f83603e1fa" +"request@>=2.9.0 <2.82.0": + version "2.81.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" + dependencies: + aws-sign2 "~0.6.0" + aws4 "^1.2.1" + caseless "~0.12.0" + combined-stream "~1.0.5" + extend "~3.0.0" + forever-agent "~0.6.1" + form-data "~2.1.1" + har-validator "~4.2.1" + hawk "~3.1.3" + http-signature "~1.1.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.7" + oauth-sign "~0.8.1" + performance-now "^0.2.0" + qs "~6.4.0" + safe-buffer "^5.0.1" + stringstream "~0.0.4" + tough-cookie "~2.3.0" + tunnel-agent "^0.6.0" + uuid "^3.0.0" + +request@^2.83.0: + version "2.87.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.87.0.tgz#32f00235cd08d482b4d0d68db93a829c0ed5756e" dependencies: aws-sign2 "~0.7.0" aws4 "^1.6.0" @@ -2761,7 +4118,6 @@ request@2, request@^2.83.0: forever-agent "~0.6.1" form-data "~2.3.1" har-validator "~5.0.3" - hawk "~6.0.2" http-signature "~1.2.0" is-typedarray "~1.0.0" isstream "~0.1.2" @@ -2771,7 +4127,6 @@ request@2, request@^2.83.0: performance-now "^2.1.0" qs "~6.5.1" safe-buffer "^5.1.1" - stringstream "~0.0.5" tough-cookie "~2.3.3" tunnel-agent "^0.6.0" uuid "^3.1.0" @@ -2816,19 +4171,31 @@ require-uncached@^1.0.3: caller-path "^0.1.0" resolve-from "^1.0.0" +resolve-cwd@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" + dependencies: + resolve-from "^3.0.0" + resolve-from@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" -resolve@^1.3.3, resolve@^1.5.0: - version "1.7.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.7.1.tgz#aadd656374fd298aee895bc026b8297418677fd3" - dependencies: - path-parse "^1.0.5" +resolve-from@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" -resolve@~1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36" +resolve-url@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + +resolve@1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" + +resolve@^1.3.3, resolve@^1.5.0: + version "1.8.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26" dependencies: path-parse "^1.0.5" @@ -2839,13 +4206,17 @@ restore-cursor@^2.0.0: onetime "^2.0.0" signal-exit "^3.0.2" -resumer@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/resumer/-/resumer-0.0.0.tgz#f1e8f461e4064ba39e82af3cdc2a8c893d076759" - dependencies: - through "~2.3.4" +ret@~0.1.10: + version "0.1.15" + resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" -rimraf@2, rimraf@^2.2.8: +right-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" + dependencies: + align-text "^0.1.1" + +rimraf@2, rimraf@^2.2.8, rimraf@^2.5.4, rimraf@^2.6.1: version "2.6.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" dependencies: @@ -2882,6 +4253,10 @@ rollup@^0.58.2: "@types/estree" "0.0.38" "@types/node" "*" +rsvp@^3.3.3: + version "3.6.2" + resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-3.6.2.tgz#2e96491599a96cde1b515d5674a8f7a91452926a" + run-async@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" @@ -2902,14 +4277,35 @@ rx-lite@*, rx-lite@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" -safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: +safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" -safer-buffer@^2.1.0: +safe-regex@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + dependencies: + ret "~0.1.10" + +"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" +sane@^2.0.0: + version "2.5.2" + resolved "https://registry.yarnpkg.com/sane/-/sane-2.5.2.tgz#b4dc1861c21b427e929507a3e751e2a2cb8ab3fa" + dependencies: + anymatch "^2.0.0" + capture-exit "^1.2.0" + exec-sh "^0.2.0" + fb-watchman "^2.0.0" + micromatch "^3.1.4" + minimist "^1.1.1" + walker "~1.0.5" + watch "~0.18.0" + optionalDependencies: + fsevents "^1.2.3" + sass-graph@^2.2.4: version "2.2.4" resolved "https://registry.yarnpkg.com/sass-graph/-/sass-graph-2.2.4.tgz#13fbd63cd1caf0908b9fd93476ad43a51d1e0b49" @@ -2961,6 +4357,24 @@ set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" +set-value@^0.4.3: + version "0.4.3" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.1" + to-object-path "^0.3.0" + +set-value@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.3" + split-string "^3.0.1" + setimmediate@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" @@ -2975,6 +4389,10 @@ shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" +shellwords@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" + signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" @@ -2989,17 +4407,48 @@ slice-ansi@1.0.0: dependencies: is-fullwidth-code-point "^2.0.0" +snapdragon-node@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + dependencies: + define-property "^1.0.0" + isobject "^3.0.0" + snapdragon-util "^3.0.1" + +snapdragon-util@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + dependencies: + kind-of "^3.2.0" + +snapdragon@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + dependencies: + base "^0.11.1" + debug "^2.2.0" + define-property "^0.2.5" + extend-shallow "^2.0.1" + map-cache "^0.2.2" + source-map "^0.5.6" + source-map-resolve "^0.5.0" + use "^3.1.0" + sntp@1.x.x: version "1.0.9" resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198" dependencies: hoek "2.x.x" -sntp@2.x.x: - version "2.1.0" - resolved "https://registry.yarnpkg.com/sntp/-/sntp-2.1.0.tgz#2c6cec14fedc2222739caf9b5c3d85d1cc5a2cc8" +source-map-resolve@^0.5.0: + version "0.5.2" + resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" dependencies: - hoek "4.x.x" + atob "^2.1.1" + decode-uri-component "^0.2.0" + resolve-url "^0.2.1" + source-map-url "^0.4.0" + urix "^0.1.0" source-map-support@^0.4.15: version "0.4.18" @@ -3007,17 +4456,28 @@ source-map-support@^0.4.15: dependencies: source-map "^0.5.6" -source-map@0.5.x, source-map@^0.5.6, source-map@^0.5.7: +source-map-support@^0.5.6: + version "0.5.6" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.6.tgz#4435cee46b1aab62b8e8610ce60f788091c51c13" + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map-url@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" + +source-map@0.5.x, source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7, source-map@~0.5.1: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" -source-map@^0.4.2: +source-map@^0.4.2, source-map@^0.4.4: version "0.4.4" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" dependencies: amdefine ">=0.0.4" -source-map@~0.6.1: +source-map@^0.6.0, source-map@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" @@ -3043,30 +4503,35 @@ spdx-license-ids@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz#7a7cd28470cc6d3a1cfe6d66886f6bc430d3ac87" -split@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/split/-/split-1.0.1.tgz#605bd9be303aa59fb35f9229fbea0ddec9ea07d9" +split-string@^3.0.1, split-string@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" dependencies: - through "2" + extend-shallow "^3.0.0" sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" sshpk@^1.7.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.14.1.tgz#130f5975eddad963f1d56f92b9ac6c51fa9f83eb" + version "1.14.2" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.14.2.tgz#c6fc61648a3d9c4e764fd3fcdf4ea105e492ba98" dependencies: asn1 "~0.2.3" assert-plus "^1.0.0" dashdash "^1.12.0" getpass "^0.1.1" + safer-buffer "^2.0.2" optionalDependencies: bcrypt-pbkdf "^1.0.0" ecc-jsbn "~0.1.1" jsbn "~0.1.0" tweetnacl "~0.14.0" +stack-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.1.tgz#d4f33ab54e8e38778b0ca5cfd3b3afb12db68620" + standard-engine@~8.0.0: version "8.0.1" resolved "https://registry.yarnpkg.com/standard-engine/-/standard-engine-8.0.1.tgz#0b77be8d7ab963675717dbeac1ef1d6675fb62f0" @@ -3076,6 +4541,13 @@ standard-engine@~8.0.0: minimist "^1.1.0" pkg-conf "^2.0.0" +static-extend@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + dependencies: + define-property "^0.2.5" + object-copy "^0.1.0" + stdout-stream@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/stdout-stream/-/stdout-stream-1.4.0.tgz#a2c7c8587e54d9427ea9edb3ac3f2cd522df378b" @@ -3086,6 +4558,13 @@ stealthy-require@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" +string-length@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-2.0.0.tgz#d40dbb686a3ace960c1cffca562bf2c45f8363ed" + dependencies: + astral-regex "^1.0.0" + strip-ansi "^4.0.0" + string-width@^1.0.1, string-width@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" @@ -3094,19 +4573,27 @@ string-width@^1.0.1, string-width@^1.0.2: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -string-width@^2.1.0, string-width@^2.1.1: +"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" dependencies: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" -string.prototype.trim@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz#d04de2c89e137f4d7d206f086b5ed2fae6be8cea" +string.prototype.padend@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/string.prototype.padend/-/string.prototype.padend-3.0.0.tgz#f3aaef7c1719f170c5eab1c32bf780d96e21f2f0" dependencies: define-properties "^1.1.2" - es-abstract "^1.5.0" + es-abstract "^1.4.3" + function-bind "^1.0.2" + +string.prototype.padstart@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/string.prototype.padstart/-/string.prototype.padstart-3.0.0.tgz#5bcfad39f4649bb2d031292e19bcf0b510d4b242" + dependencies: + define-properties "^1.1.2" + es-abstract "^1.4.3" function-bind "^1.0.2" string_decoder@~1.1.1: @@ -3115,9 +4602,15 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -stringstream@~0.0.4, stringstream@~0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" +stringstream@~0.0.4: + version "0.0.6" + resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.6.tgz#7880225b0d4ad10e30927d167a1d6f2fd3b33a72" + +strip-ansi@4.0.0, strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + dependencies: + ansi-regex "^3.0.0" strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" @@ -3125,11 +4618,9 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1: dependencies: ansi-regex "^2.0.0" -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - dependencies: - ansi-regex "^3.0.0" +strip-bom@3.0.0, strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" strip-bom@^2.0.0: version "2.0.0" @@ -3137,9 +4628,9 @@ strip-bom@^2.0.0: dependencies: is-utf8 "^0.2.0" -strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" strip-indent@^1.0.1: version "1.0.1" @@ -3155,6 +4646,12 @@ supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" +supports-color@^3.1.2: + version "3.2.3" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" + dependencies: + has-flag "^1.0.0" + supports-color@^5.3.0: version "5.4.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" @@ -3176,46 +4673,6 @@ table@4.0.2: slice-ansi "1.0.0" string-width "^2.1.1" -tap-out@^1.4.1: - version "1.4.2" - resolved "https://registry.yarnpkg.com/tap-out/-/tap-out-1.4.2.tgz#c907ec1bf9405111d088263e92f5608b88cbb37a" - dependencies: - re-emitter "^1.0.0" - readable-stream "^2.0.0" - split "^1.0.0" - trim "0.0.1" - -tap-spec@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/tap-spec/-/tap-spec-4.1.1.tgz#e2e9f26f5208232b1f562288c97624d58a88f05a" - dependencies: - chalk "^1.0.0" - duplexer "^0.1.1" - figures "^1.4.0" - lodash "^3.6.0" - pretty-ms "^2.1.0" - repeat-string "^1.5.2" - tap-out "^1.4.1" - through2 "^2.0.0" - -tape@^4.9.0: - version "4.9.0" - resolved "https://registry.yarnpkg.com/tape/-/tape-4.9.0.tgz#855c08360395133709d34d3fbf9ef341eb73ca6a" - dependencies: - 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" - tar@^2.0.0: version "2.2.1" resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1" @@ -3224,18 +4681,37 @@ tar@^2.0.0: fstream "^1.0.2" inherits "2" +tar@^4: + version "4.4.4" + resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.4.tgz#ec8409fae9f665a4355cc3b4087d0820232bb8cd" + dependencies: + chownr "^1.0.1" + fs-minipass "^1.2.5" + minipass "^2.3.3" + minizlib "^1.1.0" + mkdirp "^0.5.0" + safe-buffer "^5.1.2" + yallist "^3.0.2" + +test-exclude@^4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.2.1.tgz#dfa222f03480bca69207ca728b37d74b45f724fa" + dependencies: + arrify "^1.0.1" + micromatch "^3.1.8" + object-assign "^4.1.0" + read-pkg-up "^1.0.1" + require-main-filename "^1.0.1" + text-table@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" -through2@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" - dependencies: - readable-stream "^2.1.5" - xtend "~4.0.1" +throat@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a" -through@2, through@^2.3.6, through@~2.3.4, through@~2.3.8: +through@^2.3.6: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" @@ -3249,11 +4725,44 @@ tmp@^0.0.33: dependencies: os-tmpdir "~1.0.2" +tmpl@1.0.x: + version "1.0.4" + resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" + to-fast-properties@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" -tough-cookie@>=2.3.3, tough-cookie@^2.3.3, tough-cookie@~2.3.0, tough-cookie@~2.3.3: +to-object-path@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + dependencies: + kind-of "^3.0.2" + +to-regex-range@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + dependencies: + is-number "^3.0.0" + repeat-string "^1.6.1" + +to-regex@^3.0.1, to-regex@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + dependencies: + define-property "^2.0.2" + extend-shallow "^3.0.2" + regex-not "^1.0.2" + safe-regex "^1.1.0" + +tough-cookie@>=2.3.3, tough-cookie@^2.3.3: + version "2.4.2" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.2.tgz#aa9133154518b494efab98a58247bfc38818c00c" + dependencies: + psl "^1.1.24" + punycode "^1.4.1" + +tough-cookie@~2.3.0, tough-cookie@~2.3.3: version "2.3.4" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655" dependencies: @@ -3273,10 +4782,6 @@ trim-right@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" -trim@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/trim/-/trim-0.0.1.tgz#5858547f6b290757ee95cccc666fb50084c460dd" - "true-case-path@^1.0.2": version "1.0.2" resolved "https://registry.yarnpkg.com/true-case-path/-/true-case-path-1.0.2.tgz#7ec91130924766c7f573be3020c34f8fdfd00d62" @@ -3307,21 +4812,43 @@ typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" -ua-parser-js@^0.7.9: - version "0.7.17" - resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.17.tgz#e9ec5f9498b9ec910e7ae3ac626a805c4d09ecac" +ua-parser-js@^0.7.18: + version "0.7.18" + resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.18.tgz#a7bfd92f56edfb117083b69e31d2aa8882d4b1ed" uc.micro@^1.0.1, uc.micro@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.5.tgz#0c65f15f815aa08b560a61ce8b4db7ffc3f45376" uglify-js@3.3.x: - version "3.3.23" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.3.23.tgz#48ea43e638364d18be292a6fdc2b5b7c35f239ab" + version "3.3.28" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.3.28.tgz#0efb9a13850e11303361c1051f64d2ec68d9be06" dependencies: commander "~2.15.0" source-map "~0.6.1" +uglify-js@^2.6: + version "2.8.29" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" + dependencies: + source-map "~0.5.1" + yargs "~3.10.0" + optionalDependencies: + uglify-to-browserify "~1.0.0" + +uglify-to-browserify@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" + +union-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" + dependencies: + arr-union "^3.1.0" + get-value "^2.0.6" + is-extendable "^0.1.1" + set-value "^0.4.3" + uniq@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff" @@ -3330,14 +4857,42 @@ universalify@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.1.tgz#fa71badd4437af4c148841e3b3b165f9e9e590b7" +unset-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + dependencies: + has-value "^0.3.1" + isobject "^3.0.0" + upper-case@^1.1.1: version "1.1.3" resolved "https://registry.yarnpkg.com/upper-case/-/upper-case-1.1.3.tgz#f6b4501c2ec4cdd26ba78be7222961de77621598" +urix@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + +use@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/use/-/use-3.1.0.tgz#14716bf03fdfefd03040aef58d8b4b85f3a7c544" + dependencies: + kind-of "^6.0.2" + +utf8-bar@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/utf8-bar/-/utf8-bar-0.1.0.tgz#789195506e88c6762309920b1627a77e64e1f7c1" + util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" +util.promisify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030" + dependencies: + define-properties "^1.1.2" + object.getownpropertydescriptors "^2.0.3" + uuid@^3.0.0, uuid@^3.1.0: version "3.2.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.2.1.tgz#12c528bb9d58d0b9265d9a2f6f0fe8be17ff1f14" @@ -3367,6 +4922,19 @@ w3c-hr-time@^1.0.1: dependencies: browser-process-hrtime "^0.1.2" +walker@~1.0.5: + version "1.0.7" + resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" + dependencies: + makeerror "1.0.x" + +watch@~0.18.0: + version "0.18.0" + resolved "https://registry.yarnpkg.com/watch/-/watch-0.18.0.tgz#28095476c6df7c90c963138990c0a5423eb4b986" + dependencies: + exec-sh "^0.2.0" + minimist "^1.2.0" + webidl-conversions@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" @@ -3385,9 +4953,9 @@ whatwg-mimetype@^2.0.0, whatwg-mimetype@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.1.0.tgz#f0f21d76cbba72362eb609dbed2a30cd17fcc7d4" -whatwg-url@^6.4.0: - version "6.4.1" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.4.1.tgz#fdb94b440fd4ad836202c16e9737d511f012fd67" +whatwg-url@^6.4.0, whatwg-url@^6.4.1: + version "6.5.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.5.0.tgz#f2df02bff176fd65070df74ad5ccbb5a199965a8" dependencies: lodash.sortby "^4.7.0" tr46 "^1.0.1" @@ -3397,17 +4965,33 @@ which-module@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" -which@1, which@^1.2.9: - version "1.3.0" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + +which@1, which@^1.2.12, which@^1.2.9, which@^1.3.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" dependencies: isexe "^2.0.0" wide-align@^1.1.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.2.tgz#571e0f1b0604636ebc0dfc21b0339bbe31341710" + version "1.1.3" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" dependencies: - string-width "^1.0.2" + string-width "^1.0.2 || 2" + +window-size@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" + +wordwrap@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" + +wordwrap@~0.0.2: + version "0.0.3" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" wordwrap@~1.0.0: version "1.0.0" @@ -3424,6 +5008,14 @@ wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" +write-file-atomic@^2.1.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.3.0.tgz#1ff61575c2e2a4e8e510d6fa4e243cce183999ab" + dependencies: + graceful-fs "^4.1.11" + imurmurhash "^0.1.4" + signal-exit "^3.0.2" + write@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" @@ -3441,7 +5033,7 @@ xml-name-validator@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" -xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.1: +xtend@^4.0.0, xtend@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" @@ -3453,12 +5045,39 @@ yallist@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" +yallist@^3.0.0, yallist@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.2.tgz#8452b4bb7e83c7c188d8041c1a837c773d6d8bb9" + yargs-parser@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0.tgz#275ecf0d7ffe05c77e64e7c86e4cd94bf0e1228a" dependencies: camelcase "^3.0.0" +yargs-parser@^9.0.2: + version "9.0.2" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-9.0.2.tgz#9ccf6a43460fe4ed40a9bb68f48d43b8a68cc077" + dependencies: + camelcase "^4.1.0" + +yargs@^11.0.0: + version "11.0.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-11.0.0.tgz#c052931006c5eee74610e5fc0354bedfd08a201b" + dependencies: + cliui "^4.0.0" + decamelize "^1.1.1" + find-up "^2.1.0" + get-caller-file "^1.0.1" + os-locale "^2.0.0" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^2.0.0" + which-module "^2.0.0" + y18n "^3.2.1" + yargs-parser "^9.0.2" + yargs@^7.0.0: version "7.1.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.0.tgz#6ba318eb16961727f5d284f8ea003e8d6154d0c8" @@ -3476,3 +5095,12 @@ yargs@^7.0.0: which-module "^1.0.0" y18n "^3.2.1" yargs-parser "^5.0.0" + +yargs@~3.10.0: + version "3.10.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" + dependencies: + camelcase "^1.0.2" + cliui "^2.1.0" + decamelize "^1.0.0" + window-size "0.1.0" From 17fb304f04bd6cc2e67958aea7be91c1909807fb Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Mon, 18 Jun 2018 21:18:53 +0300 Subject: [PATCH 19/19] Codacy issue fixes --- scripts/tdd.js | 4 ++-- test/binarySearch/binarySearch.test.js | 2 +- test/bindAll/bindAll.test.js | 2 +- test/bindKey/bindKey.test.js | 2 +- test/castArray/castArray.test.js | 4 ++-- test/chunk/chunk.test.js | 8 ++++---- test/clampNumber/clampNumber.test.js | 2 +- test/coalesce/coalesce.test.js | 2 +- test/coalesceFactory/coalesceFactory.test.js | 2 +- test/decapitalize/decapitalize.test.js | 2 +- test/difference/difference.test.js | 2 +- test/digitize/digitize.test.js | 2 +- test/dropRight/dropRight.test.js | 2 +- test/dropRightWhile/dropRightWhile.test.js | 2 +- test/dropWhile/dropWhile.test.js | 2 +- test/escapeHTML/escapeHTML.test.js | 4 ++-- test/escapeRegExp/escapeRegExp.test.js | 4 ++-- test/forEachRight/forEachRight.test.js | 2 +- test/geometricProgression/geometricProgression.test.js | 6 +++--- test/get/get.test.js | 2 +- .../initializeArrayWithValues.test.js | 2 +- test/is/is.test.js | 6 +++--- test/isArray/isArray.test.js | 2 +- test/isArrayLike/isArrayLike.test.js | 2 +- test/median/median.test.js | 4 ++-- test/pull/pull.test.js | 2 +- test/randomHexColorCode/randomHexColorCode.test.js | 2 +- test/reducedFilter/reducedFilter.test.js | 2 +- test/sampleSize/sampleSize.test.js | 2 +- test/takeRight/takeRight.test.js | 2 +- test/toKebabCase/toKebabCase.test.js | 4 ++-- test/toSnakeCase/toSnakeCase.test.js | 2 +- 32 files changed, 45 insertions(+), 45 deletions(-) diff --git a/scripts/tdd.js b/scripts/tdd.js index a08077b63..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') { @@ -84,7 +84,7 @@ snippetFiles }); try { fs.writeFileSync(path.join(TEST_PATH,'testlog'),`Test log for: ${new Date().toString()}\n`); - child_process.execSync(`npm test`); + childProcess.execSync(`npm test`); } catch (e) { fs.appendFileSync(path.join(TEST_PATH,'testlog')); diff --git a/test/binarySearch/binarySearch.test.js b/test/binarySearch/binarySearch.test.js index 3f45f7a98..a00680bb6 100644 --- a/test/binarySearch/binarySearch.test.js +++ b/test/binarySearch/binarySearch.test.js @@ -11,7 +11,7 @@ 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) + expect(binarySearch([], 21)).toBe(-1); }); test('Works for one element arrays', () => { expect(binarySearch([1], 1)).toBe(0); diff --git a/test/bindAll/bindAll.test.js b/test/bindAll/bindAll.test.js index 1b8a88e8d..8415c730c 100644 --- a/test/bindAll/bindAll.test.js +++ b/test/bindAll/bindAll.test.js @@ -12,5 +12,5 @@ var view = { }; bindAll(view, 'click'); test('Binds to an object context', () => { - expect(view.click()).toBe('clicked docs') + expect(view.click()).toBe('clicked docs'); }); diff --git a/test/bindKey/bindKey.test.js b/test/bindKey/bindKey.test.js index 867576d7b..cce1b4c98 100644 --- a/test/bindKey/bindKey.test.js +++ b/test/bindKey/bindKey.test.js @@ -12,5 +12,5 @@ const freddy = { }; const freddyBound = bindKey(freddy, 'greet'); test('Binds function to an object context', () => { - expect(freddyBound('hi', '!')).toBe('hi fred!') + expect(freddyBound('hi', '!')).toBe('hi fred!'); }); diff --git a/test/castArray/castArray.test.js b/test/castArray/castArray.test.js index f1c594a70..246a8cd48 100644 --- a/test/castArray/castArray.test.js +++ b/test/castArray/castArray.test.js @@ -14,8 +14,8 @@ 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']) + expect(castArray('test')).toEqual(['test']); }); test('Works for objects', () => { - expect(castArray({})).toEqual([{}]) + expect(castArray({})).toEqual([{}]); }); diff --git a/test/chunk/chunk.test.js b/test/chunk/chunk.test.js index 208455711..0509cdd6a 100644 --- a/test/chunk/chunk.test.js +++ b/test/chunk/chunk.test.js @@ -8,16 +8,16 @@ 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([]) + expect(chunk([])).toEqual([]); }); test('chunk(123) returns []', () => { - expect(chunk(123)).toEqual([]) + expect(chunk(123)).toEqual([]); }); test('chunk({ a: 123}) returns []', () => { - expect(chunk({ a: 123})).toEqual([]) + expect(chunk({ a: 123})).toEqual([]); }); test('chunk(string, 2) returns [ st, ri, ng ]', () => { - expect(chunk('string', 2)).toEqual( [ 'st', 'ri', 'ng' ]) + expect(chunk('string', 2)).toEqual( [ 'st', 'ri', 'ng' ]); }); test('chunk() throws an error', () => { expect(() => {chunk();}).toThrow(); diff --git a/test/clampNumber/clampNumber.test.js b/test/clampNumber/clampNumber.test.js index 9e9d406b6..828e82a05 100644 --- a/test/clampNumber/clampNumber.test.js +++ b/test/clampNumber/clampNumber.test.js @@ -5,5 +5,5 @@ 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) + expect(clampNumber(2, 3, 5)).toBe(3); }); diff --git a/test/coalesce/coalesce.test.js b/test/coalesce/coalesce.test.js index 5481b85db..05a6a93c0 100644 --- a/test/coalesce/coalesce.test.js +++ b/test/coalesce/coalesce.test.js @@ -5,5 +5,5 @@ test('coalesce is a Function', () => { expect(coalesce).toBeInstanceOf(Function); }); test('Returns the first non-null/undefined argument', () => { - expect(coalesce(null, undefined, '', NaN, 'Waldo')).toEqual('') + expect(coalesce(null, undefined, '', NaN, 'Waldo')).toEqual(''); }); diff --git a/test/coalesceFactory/coalesceFactory.test.js b/test/coalesceFactory/coalesceFactory.test.js index 609ac9b5d..a2836a57f 100644 --- a/test/coalesceFactory/coalesceFactory.test.js +++ b/test/coalesceFactory/coalesceFactory.test.js @@ -6,5 +6,5 @@ test('coalesceFactory is a Function', () => { }); const customCoalesce = coalesceFactory(_ => ![null, undefined, '', NaN].includes(_)); test('Returns a customized coalesce function', () => { - expect(customCoalesce(undefined, null, NaN, '', 'Waldo')).toEqual('Waldo') + expect(customCoalesce(undefined, null, NaN, '', 'Waldo')).toEqual('Waldo'); }); diff --git a/test/decapitalize/decapitalize.test.js b/test/decapitalize/decapitalize.test.js index e7a403388..14ca0fa7a 100644 --- a/test/decapitalize/decapitalize.test.js +++ b/test/decapitalize/decapitalize.test.js @@ -8,5 +8,5 @@ test('Works with default parameter', () => { expect(decapitalize('FooBar')).toBe('fooBar'); }); test('Works with second parameter set to true', () => { - expect(decapitalize('FooBar', true)).toBe('fOOBAR') + expect(decapitalize('FooBar', true)).toBe('fOOBAR'); }); diff --git a/test/difference/difference.test.js b/test/difference/difference.test.js index 657ffe119..4d0f316f0 100644 --- a/test/difference/difference.test.js +++ b/test/difference/difference.test.js @@ -5,5 +5,5 @@ 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]) + expect(difference([1, 2, 3], [1, 2, 4])).toEqual([3]); }); diff --git a/test/digitize/digitize.test.js b/test/digitize/digitize.test.js index d25668443..9bf53102b 100644 --- a/test/digitize/digitize.test.js +++ b/test/digitize/digitize.test.js @@ -5,5 +5,5 @@ 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]) + expect(digitize(123)).toEqual([1, 2,3]); }); diff --git a/test/dropRight/dropRight.test.js b/test/dropRight/dropRight.test.js index f9927ac4b..5f36ec265 100644 --- a/test/dropRight/dropRight.test.js +++ b/test/dropRight/dropRight.test.js @@ -5,7 +5,7 @@ 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]) + 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]); diff --git a/test/dropRightWhile/dropRightWhile.test.js b/test/dropRightWhile/dropRightWhile.test.js index ad39f35f9..76cf162d9 100644 --- a/test/dropRightWhile/dropRightWhile.test.js +++ b/test/dropRightWhile/dropRightWhile.test.js @@ -5,5 +5,5 @@ 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]) + 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 75bc3272e..19aa31470 100644 --- a/test/dropWhile/dropWhile.test.js +++ b/test/dropWhile/dropWhile.test.js @@ -5,5 +5,5 @@ 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]) + expect(dropWhile([1, 2, 3, 4], n => n >= 3)).toEqual([3,4]); }); diff --git a/test/escapeHTML/escapeHTML.test.js b/test/escapeHTML/escapeHTML.test.js index 26f1b0d9f..1865b7cd8 100644 --- a/test/escapeHTML/escapeHTML.test.js +++ b/test/escapeHTML/escapeHTML.test.js @@ -5,5 +5,5 @@ 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>') -}); + 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 0036bc296..bd3f2168f 100644 --- a/test/escapeRegExp/escapeRegExp.test.js +++ b/test/escapeRegExp/escapeRegExp.test.js @@ -5,5 +5,5 @@ test('escapeRegExp is a Function', () => { expect(escapeRegExp).toBeInstanceOf(Function); }); test('Escapes a string to use in a regular expression', () => { - expect(escapeRegExp('(test)')).toBe('\\(test\\)') -}); + expect(escapeRegExp('(test)')).toBe('\\(test\\)'); +}); diff --git a/test/forEachRight/forEachRight.test.js b/test/forEachRight/forEachRight.test.js index 75eabf617..e137a68e2 100644 --- a/test/forEachRight/forEachRight.test.js +++ b/test/forEachRight/forEachRight.test.js @@ -7,5 +7,5 @@ test('forEachRight is a Function', () => { let output = ''; forEachRight([1, 2, 3, 4], val => output+=val); test('Iterates over the array in reverse', () => { - expect(output).toBe('4321') + expect(output).toBe('4321'); }); diff --git a/test/geometricProgression/geometricProgression.test.js b/test/geometricProgression/geometricProgression.test.js index c673143c1..6ac3ed8e4 100644 --- a/test/geometricProgression/geometricProgression.test.js +++ b/test/geometricProgression/geometricProgression.test.js @@ -5,11 +5,11 @@ 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]) + 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]) + 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]) + 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 526bb5bc6..715ee0033 100644 --- a/test/get/get.test.js +++ b/test/get/get.test.js @@ -6,5 +6,5 @@ test('get is a 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']) + expect(get(obj, 'selector.to.val')).toEqual(['val to get']); }); diff --git a/test/initializeArrayWithValues/initializeArrayWithValues.test.js b/test/initializeArrayWithValues/initializeArrayWithValues.test.js index 5114c99e8..6b1b22eb3 100644 --- a/test/initializeArrayWithValues/initializeArrayWithValues.test.js +++ b/test/initializeArrayWithValues/initializeArrayWithValues.test.js @@ -5,5 +5,5 @@ 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]) + expect(initializeArrayWithValues(5, 2)).toEqual([2, 2, 2, 2, 2]); }); diff --git a/test/is/is.test.js b/test/is/is.test.js index 0ad1f8bc6..5309f0c08 100644 --- a/test/is/is.test.js +++ b/test/is/is.test.js @@ -8,7 +8,7 @@ test('Works for arrays with data', () => { expect(is(Array, [1])).toBeTruthy(); }); test('Works for empty arrays', () => { - expect(is(Array, [])).toBeTruthy() + expect(is(Array, [])).toBeTruthy(); }); test('Works for arrays, not objects', () => { expect(is(Array, {})).toBeFalsy(); @@ -41,10 +41,10 @@ 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() + expect(is(Number, new Number('10'))).toBeTruthy(); }); test('Works for booleans - returns true for primitive', () => { - expect(is(Boolean, false)).toBeTruthy() + expect(is(Boolean, false)).toBeTruthy(); }); test('Works for booleans - returns true when using constructor', () => { expect(is(Boolean, new Boolean(false))).toBeTruthy(); diff --git a/test/isArray/isArray.test.js b/test/isArray/isArray.test.js index e9e15dc19..5ca77144b 100644 --- a/test/isArray/isArray.test.js +++ b/test/isArray/isArray.test.js @@ -5,7 +5,7 @@ test('isArray is a Function', () => { expect(isArray).toBeInstanceOf(Function); }); test('passed value is an array', () => { - expect(isArray([1])).toBeTruthy() + expect(isArray([1])).toBeTruthy(); }); test('passed value is not an array', () => { expect(isArray('array')).toBeFalsy(); diff --git a/test/isArrayLike/isArrayLike.test.js b/test/isArrayLike/isArrayLike.test.js index 19fa803cd..c2b83ecf9 100644 --- a/test/isArrayLike/isArrayLike.test.js +++ b/test/isArrayLike/isArrayLike.test.js @@ -5,7 +5,7 @@ test('isArrayLike is a Function', () => { expect(isArrayLike).toBeInstanceOf(Function); }); test('Returns true for a string', () => { - expect(isArrayLike('abc')).toBeTruthy() + expect(isArrayLike('abc')).toBeTruthy(); }); test('Returns true for an array', () => { expect(isArrayLike([1,2,3])).toBeTruthy(); diff --git a/test/median/median.test.js b/test/median/median.test.js index 1852a9910..76835c0b8 100644 --- a/test/median/median.test.js +++ b/test/median/median.test.js @@ -5,8 +5,8 @@ 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) + 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) + expect(median([1, 2, 3])).toBe(2); }); diff --git a/test/pull/pull.test.js b/test/pull/pull.test.js index f08a416e9..3afff9097 100644 --- a/test/pull/pull.test.js +++ b/test/pull/pull.test.js @@ -7,5 +7,5 @@ test('pull is a Function', () => { let myArray = ['a', 'b', 'c', 'a', 'b', 'c']; pull(myArray, 'a', 'c'); test('Pulls the specified values', () => { - expect(myArray).toEqual(['b','b']) + expect(myArray).toEqual(['b','b']); }); diff --git a/test/randomHexColorCode/randomHexColorCode.test.js b/test/randomHexColorCode/randomHexColorCode.test.js index a7ded511b..bc38748a7 100644 --- a/test/randomHexColorCode/randomHexColorCode.test.js +++ b/test/randomHexColorCode/randomHexColorCode.test.js @@ -6,7 +6,7 @@ test('randomHexColorCode is a Function', () => { }); test('randomHexColorCode has to proper length', () => { expect(randomHexColorCode().length).toBe(7); -}) +}); test('The color code starts with "#"', () => { expect(randomHexColorCode().startsWith('#')).toBeTruthy(); }); diff --git a/test/reducedFilter/reducedFilter.test.js b/test/reducedFilter/reducedFilter.test.js index 8c9536462..4fb7a0b94 100644 --- a/test/reducedFilter/reducedFilter.test.js +++ b/test/reducedFilter/reducedFilter.test.js @@ -17,5 +17,5 @@ const data = [ } ]; 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'}]) + expect(reducedFilter(data, ['id', 'name'], item => item.age > 24)).toEqual([{ id: 2, name: 'mike'}]); }); diff --git a/test/sampleSize/sampleSize.test.js b/test/sampleSize/sampleSize.test.js index cebef527f..22d72d238 100644 --- a/test/sampleSize/sampleSize.test.js +++ b/test/sampleSize/sampleSize.test.js @@ -12,7 +12,7 @@ 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) + expect(sampleSize(arr, 5).length).toBe(4); }); test('Returns an empty array if original array is empty', () => { expect(sampleSize([], 2)).toEqual([]); diff --git a/test/takeRight/takeRight.test.js b/test/takeRight/takeRight.test.js index 2e5c1b55a..b31c99d8d 100644 --- a/test/takeRight/takeRight.test.js +++ b/test/takeRight/takeRight.test.js @@ -8,5 +8,5 @@ test('Returns an array with n elements removed from the end', () => { expect(takeRight([1, 2, 3], 2)).toEqual([2, 3]); }); test('Returns an array with n elements removed from the end', () => { - expect(takeRight([1, 2, 3])).toEqual([3]) + expect(takeRight([1, 2, 3])).toEqual([3]); }); diff --git a/test/toKebabCase/toKebabCase.test.js b/test/toKebabCase/toKebabCase.test.js index 925367a5e..c3fcc36b4 100644 --- a/test/toKebabCase/toKebabCase.test.js +++ b/test/toKebabCase/toKebabCase.test.js @@ -14,10 +14,10 @@ test('toKebabCase(\'some-mixed-string With spaces-underscores-and-hyphens\') ret expect(toKebabCase('some-mixed-string With spaces-underscores-and-hyphens')).toBe('some-mixed-string-with-spaces-underscores-and-hyphens'); }); test('toKebabCase(\'IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML\') returns i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html', () => { - expect(toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML')).toBe('i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html') + expect(toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML')).toBe('i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html'); }); test('toKebabCase() returns undefined', () => { - expect(toKebabCase()).toBe(undefined) + expect(toKebabCase()).toBe(undefined); }); test('toKebabCase([]) throws an erro', () => { expect(() => { toKebabCase([]); }).toThrow(); diff --git a/test/toSnakeCase/toSnakeCase.test.js b/test/toSnakeCase/toSnakeCase.test.js index 2acb4aeb8..5c6ebdeb8 100644 --- a/test/toSnakeCase/toSnakeCase.test.js +++ b/test/toSnakeCase/toSnakeCase.test.js @@ -14,7 +14,7 @@ test('toSnakeCase(\'some-mixed_string With spaces_underscores-and-hyphens\') ret expect(toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens')).toBe('some_mixed_string_with_spaces_underscores_and_hyphens'); }); test('toSnakeCase(\'IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML\') returns i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html', () => { - expect(toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML')).toBe('i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html') + expect(toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML')).toBe('i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html'); }); test('toSnakeCase() returns undefined', () => { expect(toSnakeCase()).toBe(undefined);