Files
shields/services/bintray/bintray.tester.js
Pierre-Yves B 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

36 lines
858 B
JavaScript

'use strict'
const {
isVPlusDottedVersionNClausesWithOptionalSuffix,
} = require('../test-validators')
const t = (module.exports = require('../tester').createServiceTester())
t.create('version')
.get('/asciidoctor/maven/asciidoctorj.json')
.expectBadge({
label: 'bintray',
message: isVPlusDottedVersionNClausesWithOptionalSuffix,
})
t.create('version (not found)')
.get('/asciidoctor/maven/not-a-real-package.json')
.expectBadge({
label: 'bintray',
message: 'not found',
})
t.create('version (mocked)')
.get('/asciidoctor/maven/asciidoctorj.json')
.intercept(nock =>
nock('https://bintray.com')
.get('/api/v1/packages/asciidoctor/maven/asciidoctorj/versions/_latest')
.reply(200, {
name: '1.5.7',
})
)
.expectBadge({
label: 'bintray',
message: 'v1.5.7',
color: 'blue',
})