Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Mocha Cooldown
var apitest = module.exports = {};
/**
* Have a Cooldown period between tests.
*
* @param {number} seconds cooldown in seconds.
* @return {Function} use is beforeEach().
*/
apitest.cooldown = function(seconds) {
return function(done) {
setTimeout(done, seconds);
};
};
beforeEach(apitest.cooldown(1000));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment