@@ -47,21 +47,17 @@ const buildCodeCoverageSchema = Joi.object({
|
||||
}).required()
|
||||
|
||||
module.exports = class AzureDevOpsCoverage extends AzureDevOpsBase {
|
||||
static render({ coverage }) {
|
||||
return {
|
||||
message: `${coverage.toFixed(0)}%`,
|
||||
color: coveragePercentageColor(coverage),
|
||||
}
|
||||
}
|
||||
|
||||
static get defaultBadgeData() {
|
||||
return { label: 'coverage' }
|
||||
}
|
||||
|
||||
static get category() {
|
||||
return 'coverage'
|
||||
}
|
||||
|
||||
static get route() {
|
||||
return {
|
||||
base: 'azure-devops/coverage',
|
||||
pattern: ':organization/:project/:definitionId/:branch*',
|
||||
}
|
||||
}
|
||||
|
||||
static get examples() {
|
||||
return [
|
||||
{
|
||||
@@ -92,10 +88,14 @@ module.exports = class AzureDevOpsCoverage extends AzureDevOpsBase {
|
||||
]
|
||||
}
|
||||
|
||||
static get route() {
|
||||
static get defaultBadgeData() {
|
||||
return { label: 'coverage' }
|
||||
}
|
||||
|
||||
static render({ coverage }) {
|
||||
return {
|
||||
base: 'azure-devops/coverage',
|
||||
pattern: ':organization/:project/:definitionId/:branch*',
|
||||
message: `${coverage.toFixed(0)}%`,
|
||||
color: coveragePercentageColor(coverage),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -63,36 +63,18 @@ const buildTestResultSummarySchema = Joi.object({
|
||||
}).required()
|
||||
|
||||
module.exports = class AzureDevOpsTests extends AzureDevOpsBase {
|
||||
static render({
|
||||
passed,
|
||||
failed,
|
||||
skipped,
|
||||
total,
|
||||
passedLabel,
|
||||
failedLabel,
|
||||
skippedLabel,
|
||||
isCompact,
|
||||
}) {
|
||||
return renderTestResultBadge({
|
||||
passed,
|
||||
failed,
|
||||
skipped,
|
||||
total,
|
||||
passedLabel,
|
||||
failedLabel,
|
||||
skippedLabel,
|
||||
isCompact,
|
||||
})
|
||||
}
|
||||
|
||||
static get defaultBadgeData() {
|
||||
return { label: 'tests' }
|
||||
}
|
||||
|
||||
static get category() {
|
||||
return 'build'
|
||||
}
|
||||
|
||||
static get route() {
|
||||
return {
|
||||
base: 'azure-devops/tests',
|
||||
pattern: ':organization/:project/:definitionId/:branch*',
|
||||
queryParamSchema: testResultQueryParamSchema,
|
||||
}
|
||||
}
|
||||
|
||||
static get examples() {
|
||||
return [
|
||||
{
|
||||
@@ -175,12 +157,30 @@ module.exports = class AzureDevOpsTests extends AzureDevOpsBase {
|
||||
]
|
||||
}
|
||||
|
||||
static get route() {
|
||||
return {
|
||||
base: 'azure-devops/tests',
|
||||
pattern: ':organization/:project/:definitionId/:branch*',
|
||||
queryParamSchema: testResultQueryParamSchema,
|
||||
}
|
||||
static get defaultBadgeData() {
|
||||
return { label: 'tests' }
|
||||
}
|
||||
|
||||
static render({
|
||||
passed,
|
||||
failed,
|
||||
skipped,
|
||||
total,
|
||||
passedLabel,
|
||||
failedLabel,
|
||||
skippedLabel,
|
||||
isCompact,
|
||||
}) {
|
||||
return renderTestResultBadge({
|
||||
passed,
|
||||
failed,
|
||||
skipped,
|
||||
total,
|
||||
passedLabel,
|
||||
failedLabel,
|
||||
skippedLabel,
|
||||
isCompact,
|
||||
})
|
||||
}
|
||||
|
||||
async handle(
|
||||
|
||||
Reference in New Issue
Block a user