Support the old budget format too in junit and tap (#3022)

This commit is contained in:
Peter Hedenskog 2020-06-02 12:13:03 +02:00 committed by GitHub
parent 4b5fb73318
commit bde6321458
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 28 deletions

View File

@ -25,15 +25,13 @@ exports.writeJunit = function(results, dir) {
.className(fineUrl)
.name(result.type + '.' + result.metric)
.failure(
result.metric +
' is ' +
result.friendlyValue +
' and limit ' +
result.limitType +
' ' +
result.friendlyLimit +
' ' +
url
result.metric + ' is ' + result.friendlyValue ||
result.value +
' and limit ' +
result.limitType +
' ' +
result.friendlyLimit ||
result.limit + ' ' + url
);
}
}
@ -45,15 +43,9 @@ exports.writeJunit = function(results, dir) {
.className(fineUrl)
.name(result.type + '.' + result.metric)
.standardOutput(
result.metric +
' is ' +
result.friendlyValue +
' and limit ' +
result.limitType +
' ' +
result.friendlyLimit +
' ' +
url
result.metric + ' is ' + result.friendlyValue || result.value,
+' and limit ' + result.limitType + ' ' + result.friendlyLimit ||
result.limit + ' ' + url
);
}
}

View File

@ -21,19 +21,13 @@ exports.writeTap = function(results, dir) {
let extra = '';
if (resultType === 'failing') {
extra =
' limit ' + result.limitType + ' ' + result.friendlyLimit + EOL;
' limit ' + result.limitType + ' ' + result.friendlyLimit ||
result.limit + EOL;
}
t.ok(
resultType === 'failing' ? false : true,
result.type +
'.' +
result.metric +
' ' +
result.friendlyValue +
' ' +
extra +
' ' +
url
result.type + '.' + result.metric + ' ' + result.friendlyValue ||
result.value + ' ' + extra + ' ' + url
);
t.end();
});