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.
24 lines
454 B
JavaScript
24 lines
454 B
JavaScript
'use strict'
|
|
|
|
const Joi = require('joi')
|
|
|
|
const t = (module.exports = require('../tester').createServiceTester())
|
|
|
|
t.create('Watchers')
|
|
.get('/badges/shields.json')
|
|
.expectJSONTypes(
|
|
Joi.object().keys({
|
|
name: 'watchers',
|
|
value: Joi.number()
|
|
.integer()
|
|
.positive(),
|
|
})
|
|
)
|
|
|
|
t.create('Watchers (repo not found)')
|
|
.get('/badges/helmets.json')
|
|
.expectJSON({
|
|
name: 'watchers',
|
|
value: 'repo not found',
|
|
})
|