Files
shields/services/docker/docker-pulls.tester.js
Paul Melnikow 4bd16f93e8 Sort imports and requires (#3056)
This will definitely save time, and ensure more uniformity.

It moves the `createServiceTester()` calls to a different place from where I'd like them, though I'm happy to have them checked by the linter.

Closes #2701
2019-02-21 22:14:40 -05:00

30 lines
758 B
JavaScript

'use strict'
const Joi = require('joi')
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?style=_shields_test')
.expectJSONTypes(
Joi.object().keys({
name: 'docker pulls',
value: isMetric,
color: `#${dockerBlue}`,
})
)
t.create('docker pulls (valid, user)')
.get('/jrottenberg/ffmpeg.json')
.expectJSONTypes(
Joi.object().keys({
name: 'docker pulls',
value: isMetric,
})
)
t.create('docker pulls (not found)')
.get('/_/not-a-real-repo.json')
.expectJSON({ name: 'docker pulls', value: 'repo not found' })