https://github.com/vitalets/js-testrunners-bench ]]>

Also from my experience, Jest is a bit faster than Mocha due to its multithreading, at least in the case when you ran a lot of tests at once.

]]>LikeLike

]]>LikeLike

]]>LikeLike

]]>//Produces a random number between i and j

const rand = (i,j) => i + Math.floor(Math.random() * j)

//Given a pair of indices i and j, then an array, returns a new array with elements at i and j swapped

const exchangeArrayIndices = (i,j) => array => {

const iElement = array[i];

const jElement = array[j];

const newArray = array.slice();

newArray[i] = jElement;

newArray[j] = iElement;

return newArray;

}

//Given i and j, produces an array of the integers from i to j, counting up if i is less than j and down if i is greater than j

const range = (i,j) => i range(array.length – 1, 0)

.map(i => [i, rand(0,i)])

.reduce((accumulator, current) => exchangeArrayIndices(…current)(accumulator), array)

LikeLike

]]>