Skip to content

Commit

Permalink
update badge text as api message instead of invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
RedSparr0w committed Oct 24, 2016
1 parent e455272 commit 4731a56
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -4549,28 +4549,31 @@ cache(function(data, match, sendBadge, request) {
return;
}
try {
var status = data[0].status;
switch(status) {
case 'success':
case 'fixed':
badgeData.colorscheme = 'brightgreen';
badgeData.text[1] = 'passing';
break;
try {
var status = data[0].status;
switch(status) {
case 'success':
case 'fixed':
badgeData.colorscheme = 'brightgreen';
badgeData.text[1] = 'passing';
break;

case 'failed':
badgeData.colorscheme = 'red';
badgeData.text[1] = 'failed';
break;
case 'failed':
badgeData.colorscheme = 'red';
badgeData.text[1] = 'failed';
break;

case 'no_tests':
case 'scheduled':
case 'not_run':
badgeData.colorscheme = 'yellow';
default:
badgeData.text[1] = status.replace('_', ' ');
case 'no_tests':
case 'scheduled':
case 'not_run':
badgeData.colorscheme = 'yellow';
default:
badgeData.text[1] = status.replace('_', ' ');
break;
}
} catch(e) {
badgeData.text[1] = data.message;
}

sendBadge(format, badgeData);
} catch(e) {
badgeData.text[1] = 'invalid';
Expand Down

0 comments on commit 4731a56

Please sign in to comment.