service tests for [docker] (#1428)

This commit is contained in:
chris48s
2018-01-16 03:03:52 +00:00
committed by Paul Melnikow
parent eacfc1497a
commit 7c6723a79d
4 changed files with 160 additions and 16 deletions

View File

@@ -1,12 +1,15 @@
'use strict';
const checkErrorResponse = function(badgeData, err, res) {
const checkErrorResponse = function(badgeData, err, res, notFoundMessage) {
if (typeof(notFoundMessage) === 'undefined') {
notFoundMessage = 'not found';
}
if (err != null) {
badgeData.text[1] = 'inaccessible';
badgeData.colorscheme = 'red';
return true;
} else if (res.statusCode === 404) {
badgeData.text[1] = 'not found';
badgeData.text[1] = notFoundMessage;
badgeData.colorscheme = 'lightgrey';
return true;
} else if (res.statusCode !== 200) {