Files
shields/services/github/github-stars.tester.js
chris48s 13d75e0607 upgrade to prettier 2 (#5051)
* arrowParens: avoid
* remove trailingComma setting
2020-05-05 21:07:43 +01:00

35 lines
968 B
JavaScript

'use strict'
const { isMetric } = require('../test-validators')
const t = (module.exports = require('../tester').createServiceTester())
t.create('Stars')
.get('/badges/shields.json')
.expectBadge({
label: 'stars',
message: isMetric,
link: [
'https://github.com/badges/shields',
'https://github.com/badges/shields/stargazers',
],
})
t.create('Stars (repo not found)').get('/badges/helmets.json').expectBadge({
label: 'stars',
message: 'repo not found',
})
// https://github.com/badges/shields/issues/4982
// It doesn't seem important that this work with trailing spaces, though if it
// did we'd probably want a more global fix.
t.create('Stars (repo name with trailing spaces)')
.get('/badges/shields .json')
.expectBadge({
label: 'stars',
message: isMetric,
link: [
'https://github.com/badges/shields%20%20%20%20%20',
'https://github.com/badges/shields%20%20%20%20%20/stargazers',
],
})