Migrated most service tests to use new expectBadge (#3122)
This commit is contained in:
@@ -1,22 +1,19 @@
|
||||
'use strict'
|
||||
|
||||
const Joi = require('joi')
|
||||
const { isMetric } = require('../test-validators')
|
||||
const t = (module.exports = require('../tester').createServiceTester())
|
||||
|
||||
t.create('dependent repo count')
|
||||
.get('/npm/got.json')
|
||||
.expectJSONTypes(
|
||||
Joi.object().keys({
|
||||
name: 'dependent repos',
|
||||
value: isMetric,
|
||||
})
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'dependent repos',
|
||||
message: isMetric,
|
||||
})
|
||||
|
||||
t.create('dependent repo count (not a package)')
|
||||
.get('/npm/foobar-is-not-package.json')
|
||||
.timeout(10000)
|
||||
.expectJSON({
|
||||
name: 'dependent repos',
|
||||
value: 'package not found',
|
||||
.expectBadge({
|
||||
label: 'dependent repos',
|
||||
message: 'package not found',
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user