mirror of
https://github.com/badges/shields.git
synced 2025-07-27 19:01:52 +03:00
Migrated most service tests to use new expectBadge (#3122)
This commit is contained in:
@ -1,17 +1,14 @@
|
||||
'use strict'
|
||||
|
||||
const Joi = require('joi')
|
||||
const { isIntegerPercentage } = require('../test-validators')
|
||||
const t = (module.exports = require('../tester').createServiceTester())
|
||||
|
||||
t.create('doc percent (valid)')
|
||||
.get('/AFNetworking.json')
|
||||
.expectJSONTypes(
|
||||
Joi.object().keys({
|
||||
name: 'docs',
|
||||
value: isIntegerPercentage,
|
||||
})
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'docs',
|
||||
message: isIntegerPercentage,
|
||||
})
|
||||
|
||||
t.create('doc percent (null)')
|
||||
.get('/AFNetworking.json')
|
||||
@ -20,8 +17,8 @@ t.create('doc percent (null)')
|
||||
.get('/api/v1/pods/AFNetworking')
|
||||
.reply(200, '{"cocoadocs": {"doc_percent": null}}')
|
||||
)
|
||||
.expectJSON({ name: 'docs', value: '0%' })
|
||||
.expectBadge({ label: 'docs', message: '0%' })
|
||||
|
||||
t.create('doc percent (not found)')
|
||||
.get('/not-a-package.json')
|
||||
.expectJSON({ name: 'docs', value: 'not found' })
|
||||
.expectBadge({ label: 'docs', message: 'not found' })
|
||||
|
Reference in New Issue
Block a user