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())); +});