Files
shields/services/docker/docker-pulls.tester.js
Paul Melnikow 226fa67a02 Create shortcut for BaseService-related imports (#2809)
Continue to implement #2698:

- Add `core/base-service/index.js` (but hold off on moving the things it imports)
- Add shortcuts in `services/index.js` for Base*Service, errors, and deprecatedService. This file will be streamlined later to avoid cluttering it with rarely used bits.
- Apply consistent ordering of imports and use of `module.exports` in testers.
- Remove some renaming of imports.
- Remove obsolete tests here and there.
2019-01-21 15:41:24 -05:00

31 lines
752 B
JavaScript

'use strict'
const Joi = require('joi')
const { dockerBlue } = require('./docker-helpers')
const { isMetric } = require('../test-validators')
const t = (module.exports = require('..').createServiceTester())
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' })