* 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
25 lines
645 B
JavaScript
25 lines
645 B
JavaScript
'use strict'
|
|
|
|
const { isMetric } = require('../test-validators')
|
|
const t = (module.exports = require('../tester').createServiceTester())
|
|
const { dockerBlue } = require('./docker-helpers')
|
|
|
|
t.create('docker pulls (valid, library)')
|
|
.get('/_/ubuntu.json')
|
|
.expectBadge({
|
|
label: 'docker pulls',
|
|
message: isMetric,
|
|
color: `#${dockerBlue}`,
|
|
})
|
|
|
|
t.create('docker pulls (valid, user)')
|
|
.get('/jrottenberg/ffmpeg.json')
|
|
.expectBadge({
|
|
label: 'docker pulls',
|
|
message: isMetric,
|
|
})
|
|
|
|
t.create('docker pulls (not found)')
|
|
.get('/_/not-a-real-repo.json')
|
|
.expectBadge({ label: 'docker pulls', message: 'repo not found' })
|