Files
shields/services/bugzilla/bugzilla.tester.js
Paul Melnikow 8a8311d931 Unify and minimize tester boilerplate (#2472)
I started using this one-line boilerplate a while back and it seems to tidy things up a bit.
2018-12-08 13:15:24 -05:00

40 lines
812 B
JavaScript

'use strict'
const Joi = require('joi')
const ServiceTester = require('../service-tester')
const bzBugStatus = Joi.equal(
'unconfirmed',
'new',
'assigned',
'fixed',
'invalid',
"won't fix",
'duplicate',
'works for me',
'incomplete'
)
const t = (module.exports = new ServiceTester({
id: 'bugzilla',
title: 'Bugzilla',
}))
t.create('Bugzilla valid bug status')
.get('/996038.json')
.expectJSONTypes(
Joi.object().keys({
name: 'bug 996038',
value: bzBugStatus,
})
)
t.create('Bugzilla invalid bug status')
.get('/83548978974387943879.json')
.expectJSON({ name: 'bug 83548978974387943879', value: 'not found' })
t.create('Bugzilla failed request bug status')
.get('/996038.json')
.networkOff()
.expectJSON({ name: 'bug 996038', value: 'inaccessible' })