Files
shields/services/appveyor/appveyor-build.tester.js
Caleb Cartwright fe02ac723f add [AppVeyorJobBuild] status badge (#4409)
* feat(service): add AppVeyor Job status badge

* refactor: sync file/class/route names for appveyor job

* tests: update # of build services in frontend test

Co-authored-by: Pierre-Yves B. <PyvesDev@gmail.com>
2020-01-08 22:22:04 +00:00

36 lines
949 B
JavaScript

'use strict'
const { isBuildStatus } = require('../build-status')
const t = (module.exports = require('../tester').createServiceTester())
t.create('CI status')
.timeout(10000)
.get('/gruntjs/grunt.json')
.expectBadge({ label: 'build', message: isBuildStatus })
t.create('CI status on branch')
.timeout(10000)
.get('/gruntjs/grunt/master.json')
.expectBadge({ label: 'build', message: isBuildStatus })
t.create('CI status on nonexistent project')
.timeout(10000)
.get('/somerandomproject/thatdoesntexist.json')
.expectBadge({
label: 'build',
message: 'project not found or access denied',
})
t.create('CI status on project that does exist but has no builds yet')
.get('/gruntjs/grunt.json')
.intercept(nock =>
nock('https://ci.appveyor.com/api/projects/')
.get('/gruntjs/grunt')
.reply(200, {})
)
.expectBadge({
label: 'build',
message: 'no builds found',
color: 'lightgrey',
})