Files
shields/services/bugzilla/bugzilla.tester.js
Caleb Cartwright 855c9cd261 Remove dev dep imports in production code (#2937)
Fixes #2876 with @paulmelnikow's suggestion 

Moved imports of `ServiceTester` and `createServiceTester` to a separate file so that dev dependencies are not imported by service classes.
2019-02-05 21:51:55 -05:00

40 lines
808 B
JavaScript

'use strict'
const Joi = require('joi')
const { ServiceTester } = require('../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' })