Files
shields/services/continuousphp/continuousphp.tester.js
Paul Melnikow 7a664ca3e8 Run prettier (#1866)
Merging this separately so the commit with the tooling change is readable. This is a follow-on to #1167 which turned prettier on.
2018-08-08 17:57:14 -04:00

36 lines
976 B
JavaScript

'use strict'
const Joi = require('joi')
const ServiceTester = require('../service-tester')
const { isBuildStatus } = require('../test-validators')
const t = new ServiceTester({ id: 'continuousphp', title: 'continuousphp' })
module.exports = t
t.create('build status on default branch')
.get('/git-hub/doctrine/dbal.json')
.expectJSONTypes(
Joi.object().keys({
name: 'build',
value: Joi.alternatives().try(isBuildStatus, Joi.equal('unknown')),
})
)
t.create('build status on named branch')
.get('/git-hub/doctrine/dbal/develop.json')
.expectJSONTypes(
Joi.object().keys({
name: 'build',
value: Joi.alternatives().try(isBuildStatus, Joi.equal('unknown')),
})
)
t.create('unknown repo')
.get('/git-hub/this-repo/does-not-exist.json')
.expectJSON({ name: 'build', value: 'invalid' })
t.create('connection error')
.get('/git-hub/doctrine/dbal.json')
.networkOff()
.expectJSON({ name: 'build', value: 'invalid' })