mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-24 12:07:10 -04:00
Refactor test runner.
This commit is contained in:
parent
af34531ee0
commit
2b834f0233
3 changed files with 97 additions and 99 deletions
|
@ -52,14 +52,14 @@ function onEnd() {
|
|||
var stats = (runner.stats.duration / 1000.0).toFixed(3) + 's';
|
||||
|
||||
if (failed) {
|
||||
$('#report .stats').on('click', toggleFailureFilter);
|
||||
$('#mocha-custom .stats').on('click', toggleFailureFilter);
|
||||
}
|
||||
|
||||
$('#report').addClass(failed ? 'fail' : 'pass');
|
||||
$('#report .progress').hide();
|
||||
$('#report .stats').text(stats);
|
||||
$('#mocha-overlay .suite').each(addSuiteStats);
|
||||
$('#mocha-overlay code').each(fixCodeFormatting);
|
||||
$('#mocha-custom').addClass(failed ? 'fail' : 'pass');
|
||||
$('#mocha-custom .progress').hide();
|
||||
$('#mocha-custom .stats').text(stats);
|
||||
$('#mocha-report .suite').each(addSuiteStats);
|
||||
$('#mocha-report code').each(fixCodeFormatting);
|
||||
}
|
||||
|
||||
function onTest() {
|
||||
|
@ -70,10 +70,10 @@ function onTest() {
|
|||
var stats = ((new Date().getTime() - runner.stats.start) / 1000.0).toFixed(3) + 's';
|
||||
|
||||
if (runner.stats.failures) {
|
||||
$('#report').addClass('fail');
|
||||
$('#mocha-custom').addClass('fail');
|
||||
}
|
||||
$('#report .progress').css('width', (100 - percent) + '%');
|
||||
$('#report .stats').text(stats);
|
||||
$('#mocha-custom .progress').css('width', (100 - percent) + '%');
|
||||
$('#mocha-custom .stats').text(stats);
|
||||
}
|
||||
|
||||
function setupMocha() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue