From ce11fcffbc8b977b8b72cc8ff3b8151168916abe Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Thu, 23 Apr 2015 23:52:59 +0200 Subject: [PATCH] Update mocha code. --- test/styles.less | 1 + test/util/mocha.js | 27 ++++----------------------- 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/test/styles.less b/test/styles.less index 3aa7ae61..168bf54d 100644 --- a/test/styles.less +++ b/test/styles.less @@ -181,6 +181,7 @@ } #mocha-report { + > .suite { margin: 24px 0; diff --git a/test/util/mocha.js b/test/util/mocha.js index bfd74920..b4da6cef 100644 --- a/test/util/mocha.js +++ b/test/util/mocha.js @@ -1,7 +1,9 @@ (function () { 'use strict'; -function update() { +function onEnd() { + + $('#report').addClass($('.test.fail').length ? 'fail' : 'pass'); $('#mocha-overlay .suite').each(function () { @@ -19,48 +21,27 @@ function update() { } $suite.addClass(tests === passed ? 'pass' : 'fail'); - $header.find('.count').remove(); $header.append($count); }); -} - -function onEnd() { - - $('#report').addClass($('.test.fail').length ? 'fail' : 'pass'); $('#mocha-overlay code').each(function () { var $code = $(this); $code.text($code.text().trim().replace(/;\n\s*/g, ';\n')); }); - - update(); -} - -var count = 0; -function onTestEnd() { - - if (count % 25 === 0) { - update(); - } - count += 1; } function setupMocha() { window.assert = chai.assert; mocha.setup('bdd'); - mocha.checkLeaks(); } function runMocha() { - mocha.run() - .on('test end', onTestEnd) - .on('end', onEnd); + mocha.run().on('end', onEnd); } - window.util = window.util || {}; window.util.setupMocha = setupMocha; window.util.runMocha = runMocha;