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,28 +1,25 @@
'use strict'
const Joi = require('joi')
const t = (module.exports = require('../tester').createServiceTester())
const { isMetric } = require('../test-validators')
t.create('Contributors')
.get('/contributors/cdnjs/cdnjs.json')
.expectJSONTypes(
Joi.object().keys({
name: 'contributors',
value: isMetric,
})
)
.expectBadge({
label: 'contributors',
message: isMetric,
})
t.create('1 contributor')
.get('/contributors/paulmelnikow/local-credential-storage.json')
.expectJSON({
name: 'contributors',
value: '1',
.expectBadge({
label: 'contributors',
message: '1',
})
t.create('Contributors (repo not found)')
.get('/contributors/badges/helmets.json')
.expectJSON({
name: 'contributors',
value: 'repo not found',
.expectBadge({
label: 'contributors',
message: 'repo not found',
})