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,6 +1,5 @@
'use strict'
const Joi = require('joi')
const { withRegex } = require('../test-validators')
const t = (module.exports = require('../tester').createServiceTester())
@@ -10,16 +9,14 @@ const projectsCount = withRegex(/^[0-9]*(\.[0-9]k)?\sprojects$/)
t.create('project usage count')
.get('/github.com/theupdateframework/notary.json')
.expectJSONTypes(
Joi.object().keys({
name: 'used by',
value: projectsCount,
})
)
.expectBadge({
label: 'used by',
message: projectsCount,
})
t.create('project without any available information')
.get('/github.com/PyvesB/EmptyRepo.json')
.expectJSON({
name: 'used by',
value: '0 projects',
.expectBadge({
label: 'used by',
message: '0 projects',
})