mirror of
https://github.com/badges/shields.git
synced 2025-12-01 18:37:54 +03:00
This moves a few helpers from `lib/` to `services/`: build-status.js build-status.spec.js color-formatters.js color-formatters.spec.js contributor-count.js licenses.js licenses.spec.js php-version.js php-version.spec.js text-formatters.js text-formatters.spec.js version.js version.spec.js And one from `lib/` to `core/`: unhandled-rejection.spec.js The diff is long, but the changes are straightforward. Ref #2832
47 lines
1.0 KiB
JavaScript
47 lines
1.0 KiB
JavaScript
'use strict'
|
|
|
|
const Joi = require('joi')
|
|
const { isBuildStatus } = require('../build-status')
|
|
const t = (module.exports = require('../tester').createServiceTester())
|
|
|
|
t.create('Pipeline status')
|
|
.get('/gitlab-org/gitlab-ce.json')
|
|
.expectJSONTypes(
|
|
Joi.object().keys({
|
|
name: 'build',
|
|
value: isBuildStatus,
|
|
})
|
|
)
|
|
|
|
t.create('Pipeline status (branch)')
|
|
.get('/gitlab-org/gitlab-ce/v10.7.6.json')
|
|
.expectJSONTypes(
|
|
Joi.object().keys({
|
|
name: 'build',
|
|
value: isBuildStatus,
|
|
})
|
|
)
|
|
|
|
t.create('Pipeline status (nonexistent branch)')
|
|
.get('/gitlab-org/gitlab-ce/nope-not-a-branch.json')
|
|
.expectJSON({
|
|
name: 'build',
|
|
value: 'branch not found',
|
|
})
|
|
|
|
t.create('Pipeline status (nonexistent repo)')
|
|
.get('/this-repo/does-not-exist.json')
|
|
.expectJSON({
|
|
name: 'build',
|
|
value: 'repo not found',
|
|
})
|
|
|
|
t.create('Pipeline status (custom gitlab URL)')
|
|
.get('/GNOME/pango.json?gitlab_url=https://gitlab.gnome.org')
|
|
.expectJSONTypes(
|
|
Joi.object().keys({
|
|
name: 'build',
|
|
value: isBuildStatus,
|
|
})
|
|
)
|