Files
shields/services/github/github-workflow-status.tester.js
Caleb Cartwright c455993a4d add support for [GitHubWorkflowStatus] (Actions) using BaseSvgScraping service implementation (#3898)
* feat: add BaseSvgScraping service impl for GH Actions

* chore: fix GH Actions service test name

* feat: add branch support to GH Actions/Workflows

* chore: fix schema for GH actions

* refactor: update route path per PR discussion
2019-11-27 07:36:37 -06:00

38 lines
940 B
JavaScript

'use strict'
const Joi = require('@hapi/joi')
const { isBuildStatus } = require('../build-status')
const t = (module.exports = require('../tester').createServiceTester())
const isWorkflowStatus = Joi.alternatives()
.try(isBuildStatus, Joi.equal('no status'))
.required()
t.create('nonexistent repo')
.get('/badges/shields-fakeness/fake.json')
.expectBadge({
label: 'build',
message: 'repo, branch, or workflow not found',
})
t.create('nonexistent workflow')
.get('/actions/toolkit/not-a-real-workflow.json')
.expectBadge({
label: 'build',
message: 'repo, branch, or workflow not found',
})
t.create('valid workflow')
.get('/actions/toolkit/Main%20workflow.json')
.expectBadge({
label: 'build',
message: isWorkflowStatus,
})
t.create('valid workflow (branch)')
.get('/actions/toolkit/Main%20workflow/master.json')
.expectBadge({
label: 'build',
message: isWorkflowStatus,
})