Files
shields/services/github/github-discussions-total.tester.js
2021-07-09 12:53:55 +01:00

15 lines
544 B
JavaScript

import { withRegex } from '../test-validators.js'
import { createServiceTester } from '../tester.js'
export const t = await 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 })