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,27 +1,22 @@
|
||||
'use strict'
|
||||
|
||||
const Joi = require('joi')
|
||||
const { isMetric } = require('../test-validators')
|
||||
const t = (module.exports = require('../tester').createServiceTester())
|
||||
|
||||
t.create('Invalid parameters')
|
||||
.get('/stackoverflow/r/invalidimage.json')
|
||||
.expectJSON({ name: 'stackoverflow', value: 'invalid parameters' })
|
||||
.expectBadge({ label: 'stackoverflow', message: 'invalid parameters' })
|
||||
|
||||
t.create('Reputation for StackOverflow user 22656')
|
||||
.get('/stackoverflow/r/22656.json')
|
||||
.expectJSONTypes(
|
||||
Joi.object().keys({
|
||||
name: 'stackoverflow reputation',
|
||||
value: isMetric,
|
||||
})
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'stackoverflow reputation',
|
||||
message: isMetric,
|
||||
})
|
||||
|
||||
t.create('Reputation for Tex user 22656')
|
||||
.get('/tex/r/226.json')
|
||||
.expectJSONTypes(
|
||||
Joi.object().keys({
|
||||
name: 'tex reputation',
|
||||
value: isMetric,
|
||||
})
|
||||
)
|
||||
.expectBadge({
|
||||
label: 'tex reputation',
|
||||
message: isMetric,
|
||||
})
|
||||
|
Reference in New Issue
Block a user