Migrated most service tests to use new expectBadge (#3122)

This commit is contained in:
Pierre-Yves B
2019-02-28 21:43:23 +00:00
committed by GitHub
parent 4e2d144f97
commit 1f29c22d3d
230 changed files with 3480 additions and 4439 deletions

View File

@@ -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',
})