Skip to content

Instantly share code, notes, and snippets.

@thanpolas
Created February 7, 2014 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thanpolas/8867140 to your computer and use it in GitHub Desktop.
Save thanpolas/8867140 to your computer and use it in GitHub Desktop.
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