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