JSON format modernisation and _shields_test removal (#3272)

* Modernised JSON format and removed _shields_test style

* Added logoWidth and labelColor fields to JSON response

* Reinstated and updated comment

* Extended expectBadge to accept Joi schemas for all fields
This commit is contained in:
Pierre-Yves B
2019-04-07 18:57:55 +01:00
committed by GitHub
parent 93333509c6
commit 25f8541e5b
75 changed files with 365 additions and 382 deletions

View File

@@ -3,25 +3,25 @@
const t = (module.exports = require('../tester').createServiceTester())
t.create('status of http://shields.io')
.get('/http/shields.io.json?style=_shields_test')
.get('/http/shields.io.json')
.expectBadge({ label: 'website', message: 'up', color: 'brightgreen' })
t.create('status of https://shields.io')
.get('/https/shields.io.json?style=_shields_test')
.get('/https/shields.io.json')
.expectBadge({ label: 'website', message: 'up', color: 'brightgreen' })
t.create('status of nonexistent domain')
.get('/https/shields-io.io.json?style=_shields_test')
.get('/https/shields-io.io.json')
.expectBadge({ label: 'website', message: 'down', color: 'red' })
t.create('status when network is off')
.get('/http/shields.io.json?style=_shields_test')
.get('/http/shields.io.json')
.networkOff()
.expectBadge({ label: 'website', message: 'down', color: 'red' })
t.create('custom online label, online message and online color')
.get(
'/http/online.com.json?style=_shields_test&up_message=up&down_message=down&up_color=green&down_color=grey'
'/http/online.com.json?up_message=up&down_message=down&up_color=green&down_color=grey'
)
.intercept(nock =>
nock('http://online.com')
@@ -32,7 +32,7 @@ t.create('custom online label, online message and online color')
t.create('custom offline message and offline color')
.get(
'/http/offline.com.json?style=_shields_test&up_message=up&down_message=down&up_color=green&down_color=grey'
'/http/offline.com.json?up_message=up&down_message=down&up_color=green&down_color=grey'
)
.intercept(nock =>
nock('http://offline.com')