Skip to content

Instantly share code, notes, and snippets.

@indianburger
Created October 24, 2014 00:35
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 indianburger/8a68d00c81b395d3677b to your computer and use it in GitHub Desktop.
Save indianburger/8a68d00c81b395d3677b to your computer and use it in GitHub Desktop.
Print slow qunit tests
var tests = [];
var startTime;
QUnit.testStart(function() {
startTime = +new Date;
});
QUnit.testDone(function(obj) {
tests.push({
name: obj.name,
time: +new Date - startTime
});
});
QUnit.done(function() {
tests.sort(function(a, b) {
return b.time - a.time;
});
tests.forEach(function(test) {
console.log(test.name, test.time);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment