* use headers from options passed as argument in request method * add github total discussions badge * use nonNegativeInteger for total discussion count Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
16 lines
536 B
JavaScript
16 lines
536 B
JavaScript
'use strict'
|
|
|
|
const { withRegex } = require('../test-validators')
|
|
const t = (module.exports = require('../tester').createServiceTester())
|
|
|
|
t.create('GitHub Total Discussions (repo not found)')
|
|
.get('/not-a-user/not-a-repo.json')
|
|
.expectBadge({ label: 'discussions', message: 'repo not found' })
|
|
|
|
// example: 6000 total
|
|
const numberSpaceTotal = withRegex(/^\d+ total$/)
|
|
|
|
t.create('GitHub Total Discussions (repo having discussions)')
|
|
.get('/vercel/next.js.json')
|
|
.expectBadge({ label: 'discussions', message: numberSpaceTotal })
|