Files
shields/services/dub/dub-version.tester.js
T
Pierre-Yves BandGitHub 25f8541e5b 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
2019-04-07 18:57:55 +01:00

20 lines
516 B
JavaScript

'use strict'
const Joi = require('joi')
const {
isVPlusDottedVersionNClausesWithOptionalSuffix,
} = require('../test-validators')
const t = (module.exports = require('../tester').createServiceTester())
t.create('version (valid)')
.get('/vibe-d.json')
.expectBadge({
label: 'dub',
message: isVPlusDottedVersionNClausesWithOptionalSuffix,
color: Joi.equal('blue', 'orange'),
})
t.create('version (not found)')
.get('/not-a-package.json')
.expectBadge({ label: 'dub', message: 'not found' })