Files
shields/services/continuousphp/continuousphp.tester.js
Paul Melnikow ea4b758612 Move service tests alongside code (#1563)
Per discussion in #1543
2018-03-20 18:32:48 -07:00

31 lines
877 B
JavaScript

'use strict';
const Joi = require('joi');
const ServiceTester = require('../service-tester');
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.equal('failing', 'passing', 'unknown', 'unstable')
}));
t.create('build status on named branch')
.get('/git-hub/doctrine/dbal/develop.json')
.expectJSONTypes(Joi.object().keys({
name: 'build',
value: Joi.equal('failing', 'passing', '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' });