Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
Fix pending tests and outcome mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Turgeon committed Mar 19, 2018
1 parent 7e7939c commit c21dc39
Showing 1 changed file with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,14 @@
}).on('fail', function (test) {
run_results_full.tests.push(convertMochaTestEventToSfdxTestResult(test));
}).on('pending', function (test) {
test.err = {
message: ' # SKIP disabled by xit or similar'
}
run_results_full.tests.push(convertMochaTestEventToSfdxTestResult(test));
var pendingTest = Object.assign({}, test, {
err: {
message: ' # SKIP disabled by xit or similar'
},
duration: 0,
state: 'pending'
});
run_results_full.tests.push(convertMochaTestEventToSfdxTestResult(pendingTest));
}).on('end', function (suite) {
setHiddenDivContent("run_results_full", JSON.stringify(run_results_full));
});
Expand All @@ -211,12 +215,18 @@
console.log(test.state + '!', test.title, '-' + test.duration + 'ms');
return {
FullName: test.parent.title + ' : ' + test.title,
Outcome: test.state,
Outcome: mochaStateToOutcome[test.state],
RunTime: test.duration,
Message: test.err ? test.err.message : null
Message: test.err ? test.err.message : undefined
};
};

var mochaStateToOutcome = {
'passed': 'Pass',
'failed': 'Failed',
'pending': 'Skip'
};

var setHiddenDivContent = function (id, content) {
var aDiv = document.getElementById(id);

Expand Down

0 comments on commit c21dc39

Please sign in to comment.