• show failures only
  • passes: 88
  • pending: 0
  • failures: 0
  • duration: 156ms
  • Async Filter

    • Given no arguments

      • Should reject with "TypeError: undefined is not iterable"2ms

        rejectsWithError(
        				asyncFilter(),
        				new TypeError('undefined is not iterable')
        			)
    • Given no callback

      • Should reject with "TypeError: undefined is not a function"1ms

        rejectsWithError(
        				asyncFilter(array),
        				new TypeError('undefined is not a function')
        			)
    • Given a synchronous callback

      • Should run each callback in order3ms

        ranCallbacksInOrder(result)
      • Should filter each item based on callback result7ms

        return array.every(item => {
        	if (item) {
        		return expect(filteredArray).to.contain(item);
        	} else {
        		return expect(filteredArray).to.not.contain(item);
        	}
        });
      • Should resolve to a new array0ms

        async () =>
        			expect(filteredArray).to.not.equal(array)
    • Given an asynchronous callback

      • Should run each callback in order0ms

        ranCallbacksInOrder(result)
      • Should filter each item based on callback result1ms

        async () => {
        			return array.every(item => {
        				if (item) {
        					return expect(filteredArray).to.contain(item);
        				} else {
        					return expect(filteredArray).to.not.contain(item);
        				}
        			});
        		}
      • Should resolve to a new array0ms

        async () =>
        			expect(filteredArray).to.not.equal(array)
    • Given a callback that throws an error

      • Should reject with that error0ms

        async () =>
        			rejectsWithError(asyncFilter(array, callback), error)
    • Given a callback that uses all arguments

      • Should have access to currentValue, index and array on the callback1ms

        hasAccessToCorrectArgumentsOnCallback(array, result, [
        				'currentValue',
        				'index',
        				'array'
        			])
    • Given the optional thisArg parameter

      • Should have accesss to thisArg on callback1ms

        result.every(({ thisArg }) =>
        				expect(thisArg.toString()).to.equal(providedThisArg.toString())
        			)
  • Async Find Index

    • Given no arguments

      • Should reject with "TypeError: undefined is not iterable"0ms

        rejectsWithError(
        				asyncFindIndex(),
        				new TypeError('undefined is not iterable')
        			)
    • Given no callback

      • Should reject with "TypeError: undefined is not a function"0ms

        rejectsWithError(
        				asyncFindIndex(array),
        				new TypeError('undefined is not a function')
        			)
    • Given a synchronous callback

      • Should run each callback in order0ms

        ranCallbacksInOrder(result)
      • Should find the correct index0ms

        expect(foundIndex).to.equal(findIndex)
      • Should always resolve to an integer1ms

        expect(
        				typeof foundIndex === 'number' &&
        					foundIndex === Math.floor(foundIndex)
        			).to.equal(true)
    • Given an asynchronous callback

      • Should run each callback in order0ms

        ranCallbacksInOrder(result)
      • Should find the correct index0ms

        expect(foundIndex).to.equal(findIndex)
      • Should always resolve to an integer0ms

        expect(
        				typeof foundIndex === 'number' &&
        					foundIndex === Math.floor(foundIndex)
        			).to.equal(true)
    • Given a callback that throws an error

      • Should reject with that error0ms

        async () =>
        			rejectsWithError(asyncFindIndex(array, callback), error)
    • Given a callback that uses all arguments

      • Should have access to currentValue, index and array on the callback2ms

        hasAccessToCorrectArgumentsOnCallback(array, result, [
        				'currentValue',
        				'index',
        				'array'
        			])
    • Given the optional thisArg parameter

      • Should have accesss to thisArg on callback0ms

        result.every(({ thisArg }) =>
        				expect(thisArg.toString()).to.equal(providedThisArg.toString())
        			)
  • Async Find

    • Given no arguments

      • Should reject with "TypeError: undefined is not iterable"0ms

        rejectsWithError(
        				asyncFind(),
        				new TypeError('undefined is not iterable')
        			)
    • Given no callback

      • Should reject with "TypeError: undefined is not a function"0ms

        rejectsWithError(
        				asyncFind(array),
        				new TypeError('undefined is not a function')
        			)
    • Given a synchronous callback

      • Should run each callback in order0ms

        ranCallbacksInOrder(result)
      • Should find the correct element0ms

        expect(foundElement).to.equal(array[findIndex])
    • Given an asynchronous callback

      • Should run each callback in order3ms

        ranCallbacksInOrder(result)
      • Should find the correct element0ms

        async () => {
        			expect(foundElement).to.equal(array[findIndex]);
        		}
    • Given a callback that throws an error

      • Should reject with that error0ms

        async () =>
        			rejectsWithError(asyncFind(array, callback), error)
    • Given a callback that uses all arguments

      • Should have access to currentValue, index and array on the callback2ms

        hasAccessToCorrectArgumentsOnCallback(array, result, [
        				'currentValue',
        				'index',
        				'array'
        			])
    • Given the optional thisArg parameter

      • Should have accesss to thisArg on callback1ms

        result.every(({ thisArg }) =>
        				expect(thisArg.toString()).to.equal(providedThisArg.toString())
        			)
  • Async For Each

    • Given no arguments

      • Should reject with "TypeError: undefined is not iterable"0ms

        rejectsWithError(
        				asyncForEach(),
        				new TypeError('undefined is not iterable')
        			)
    • Given no callback

      • Should reject with "TypeError: undefined is not a function"0ms

        rejectsWithError(
        				asyncForEach(array),
        				new TypeError('undefined is not a function')
        			)
    • Given a synchronous callback

      • Should run each callback in order0ms

        ranCallbacksInOrder(result)
    • Given an asynchronous callback

      • Should run each callback in order0ms

        ranCallbacksInOrder(result)
    • Given a callback that throws an error

      • Should reject with that error0ms

        async () =>
        			rejectsWithError(asyncForEach(array, callback), error)
    • Given a callback that uses all arguments

      • Should have access to currentValue, index and array on the callback8ms

        hasAccessToCorrectArgumentsOnCallback(array, result, [
        				'currentValue',
        				'index',
        				'array'
        			])
    • Given the optional thisArg parameter

      • Should have accesss to thisArg on callback0ms

        result.every(({ thisArg }) =>
        				expect(thisArg.toString()).to.equal(providedThisArg.toString())
        			)
  • Async Map Sort

    • Given no arguments

      • Should reject with "TypeError: undefined is not iterable"0ms

        rejectsWithError(
        				asyncMapSort(),
        				new TypeError('undefined is not iterable')
        			)
    • Given no mappingFunction

      • Should reject with "TypeError: undefined is not a function"0ms

        rejectsWithError(
        				asyncMapSort(array),
        				new TypeError('undefined is not a function')
        			)
    • Given a synchronous mappingFunction

      • Should run each mappingFunction in order1ms

        ranCallbacksInOrder(result)
      • Should resolve to a new array0ms

        async () => {
        			expect(mapSortedArray).to.not.equal(array);
        		}
      • Should sort by unicode after mapping1ms

        async () => {
        			const expectedResult = mapSortedArray.slice().sort();
        			expectedResult.every((item, index) =>
        				expect(mapSortedArray[index]).to.equal(item)
        			);
        		}
    • Given an asynchronous mappingFunction

      • Should run each mappingFunction in order0ms

        ranCallbacksInOrder(result)
      • Should resolve to a new array0ms

        async () => {
        			expect(mapSortedArray).to.not.equal(array);
        		}
      • Should sort by unicode after mapping1ms

        async () => {
        			const expectedResult = mapSortedArray.slice().sort();
        			expectedResult.every((item, index) =>
        				expect(mapSortedArray[index]).to.equal(item)
        			);
        		}
    • Given a mappingFunction that throws an error

      • Should reject with that error1ms

        async () =>
        			rejectsWithError(asyncMapSort(array, mappingFunction), error)
    • Given a mappingFunction that uses all arguments

      • Should have access to currentValue, index and array on the mappingFunction0ms

        hasAccessToCorrectArgumentsOnCallback(array, result, [
        				'currentValue',
        				'index',
        				'array'
        			])
    • Given an optional comparisonFunction that uses all arguments

      • Should have access to first and second elements12ms

        result.every(({ firstEl, secondEl }) =>
        				expect(array)
        					.to.contain(firstEl)
        					.and.contain(secondEl)
        			)
  • Async Map

    • Given no arguments

      • Should reject with "TypeError: undefined is not iterable"0ms

        rejectsWithError(
        				asyncMap(),
        				new TypeError('undefined is not iterable')
        			)
    • Given no callback

      • Should reject with "TypeError: undefined is not a function"0ms

        rejectsWithError(
        				asyncMap(array),
        				new TypeError('undefined is not a function')
        			)
    • Given a synchronous callback

      • Should run each callback in order1ms

        ranCallbacksInOrder(result)
      • Should map each item in order1ms

        async () => {
        			mappedArray.every((item, index) =>
        				expect(item).to.equal(array[index])
        			);
        		}
      • Should resolve to a new array0ms

        async () => {
        			expect(mappedArray).to.not.equal(array);
        		}
    • Given an asynchronous callback

      • Should run each callback in order2ms

        ranCallbacksInOrder(result)
      • Should map each item in order1ms

        async () => {
        			mappedArray.every((item, index) =>
        				expect(item).to.equal(array[index])
        			);
        		}
      • Should resolve to a new array0ms

        async () => {
        			expect(mappedArray).to.not.equal(array);
        		}
    • Given a callback that throws an error

      • Should reject with that error0ms

        async () =>
        			rejectsWithError(asyncMap(array, callback), error)
    • Given a callback that uses all arguments

      • Should have access to currentValue, index and array on the callback2ms

        hasAccessToCorrectArgumentsOnCallback(array, result, [
        				'currentValue',
        				'index',
        				'array'
        			])
    • Given the optional thisArg parameter

      • Should have accesss to thisArg on callback1ms

        result.every(({ thisArg }) =>
        				expect(thisArg.toString()).to.equal(providedThisArg.toString())
        			)
  • Async Reduce

    • Given no arguments

      • Should reject with "TypeError: undefined is not iterable"0ms

        rejectsWithError(
        				asyncReduce(),
        				new TypeError('undefined is not iterable')
        			)
    • Given no callback

      • Should reject with "TypeError: undefined is not a function"0ms

        rejectsWithError(
        				asyncReduce(array),
        				new TypeError('undefined is not a function')
        			)
    • Given an empty array, a callback and no accumulator

      • Should reject with "TypeError: asyncReduce of empty array with no accumulator given0ms

        rejectsWithError(
        				asyncReduce([], () => 1),
        				new TypeError(
        					'asyncReduce of empty array with no accumulator given'
        				)
        			)
    • Given a synchronous callback

      • Should run each callback in order1ms

        ranCallbacksInOrder(result, { skipFirst: false });
        expect(result.length).to.be.greaterThan(
        	0,
        	'No callbacks were run.'
        );
      • Should reduce each item in order1ms

        async () => {
        			array.every((element, index) => {
        				return expect(reducedAccumulator[index].item).to.equal(element);
        			});
        		}
      • Should resolve to the completed value accumulator1ms

        async () => {
        			result.every(({ item }, index) => {
        				return expect(reducedAccumulator[index].item).to.equal(item);
        			});
        			expect(result.length).to.be.greaterThan(
        				0,
        				'No callbacks were run.'
        			);
        		}
    • Given an asynchronous callback

      • Should run each callback in order1ms

        ranCallbacksInOrder(result, { skipFirst: false });
        expect(result.length).to.be.greaterThan(
        	0,
        	'No callbacks were run.'
        );
      • Should reduce each item in order1ms

        async () => {
        			array.every((element, index) => {
        				return expect(reducedAccumulator[index].item).to.equal(element);
        			});
        		}
      • Should resolve to the completed value accumulator2ms

        async () => {
        			result.every(({ item }, index) => {
        				return expect(reducedAccumulator[index].item).to.equal(item);
        			});
        			expect(result.length).to.be.greaterThan(
        				0,
        				'No callbacks were run.'
        			);
        		}
    • Given a callback that throws an error

      • Should reject with that error0ms

        async () =>
        			rejectsWithError(asyncReduce(array, callback), error)
    • Given a callback that uses all arguments

      • Should have access to accumulator, currentValue, index and array on the callback6ms

        hasAccessToCorrectArgumentsOnCallback(
        	array,
        	result,
        	['accumulator', 'currentValue', 'index', 'array'],
        	{ skipFirst: true }
        );
        expect(result.length).to.be.greaterThan(
        	0,
        	'No callbacks were run.'
        );
    • Given the optional accumulator parameter

      • Should have accesss to accumulator on all callback iterations0ms

        expect(
        	result.every(
        		({ accumulator: resultAccumulator }) =>
        			resultAccumulator === accumulator
        	)
        ).to.be.true;
        expect(result.length).to.be.greaterThan(
        	0,
        	'No callbacks were run.'
        );
  • Async Sort

    • Given no arguments

      • Should reject with "TypeError: undefined is not iterable"0ms

        rejectsWithError(
        				asyncSort(),
        				new TypeError('undefined is not iterable')
        			)
    • Given no callback

      • Should sort elements by unicode value1ms

        const expectedResult = array.slice().sort();
        expectedResult.every((item, index) =>
        	expect(item).to.equal(sortedArray[index])
        );
    • Given a synchronous compareFunc

      • Should sort each item by the compareFunc result1ms

        async () => {
        			sortedArray.every((item, index) =>
        				expect(item).to.equal(array[index])
        			);
        		}
      • Should resolve to the same array0ms

        async () =>
        			expect(sortedArray).to.equal(array)
    • Given an asynchronous compareFunc

      • Should sort each item by the compareFunc result1ms

        async () => {
        			sortedArray.every((item, index) =>
        				expect(item).to.equal(array[index])
        			);
        		}
      • Should resolve to the same array0ms

        async () =>
        			expect(sortedArray).to.equal(array)
    • Given a compareFunc that throws an error

      • Should reject with that error0ms

        async () =>
        			rejectsWithError(asyncSort(array, compareFunc), error)
    • Given a compareFunc that uses all arguments

      • Should have access to first and second elements17ms

        result.every(({ firstEl, secondEl }) =>
        				expect(array)
        					.to.contain(firstEl)
        					.and.contain(secondEl)
        			)
  • Iterable Async module

    • Module properties

      • Should have the asyncFilter function1ms

        expect(moduleImport.asyncFilter).to.be.a('function');
      • Should have the asyncFindIndex function0ms

        expect(moduleImport.asyncFindIndex).to.be.a('function');
      • Should have the asyncFind function0ms

        expect(moduleImport.asyncFind).to.be.a('function');
      • Should have the asyncForEach function0ms

        expect(moduleImport.asyncForEach).to.be.a('function');
      • Should have the asyncMapSort function0ms

        expect(moduleImport.asyncMapSort).to.be.a('function');
      • Should have the asyncMap function0ms

        expect(moduleImport.asyncMap).to.be.a('function');
      • Should have the asyncReduce function0ms

        expect(moduleImport.asyncReduce).to.be.a('function');
      • Should have the asyncSort function0ms

        expect(moduleImport.asyncSort).to.be.a('function');