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);