1
0
mirror of https://github.com/badges/shields.git synced 2025-04-18 19:44:04 +03:00
shields/services/sourceforge/sourceforge-commit-count.tester.js
jNullj 834e4e1f96
Update [SourceForge] commit count badge to support repository parameter (#10954)
* [sourceforge] update commit count service to support repo param

follow-up to #10935
sourceforge commit count also requires the new repo param for some projects.

* [sourceforge] add redirector for legacy commit count URLs

* fix missing openapi path
2025-03-16 20:27:43 +00:00

20 lines
724 B
JavaScript

import { isMetric } from '../test-validators.js'
import { createServiceTester } from '../tester.js'
export const t = await createServiceTester()
t.create('commit count')
.get('/guitarix/git.json')
.expectBadge({ label: 'commit count', message: isMetric })
t.create('commit count (non default repo)')
.get('/opencamera/code.json')
.expectBadge({ label: 'commit count', message: isMetric })
t.create('commit count (project not found)')
.get('/that-doesnt-exist/git.json')
.expectBadge({ label: 'commit count', message: 'project or repo not found' })
t.create('commit count (repo not found)')
.get('/guitarix/invalid-repo.json')
.expectBadge({ label: 'commit count', message: 'project or repo not found' })