1
0
mirror of https://github.com/badges/shields.git synced 2025-04-18 19:44:04 +03:00
shields/services/sourceforge/sourceforge-last-commit.tester.js
jNullj 231a48fa87
[sourceforge] add repo param to last commit service (#10935)
* [sourceforge] add repo param to last commit service

some sourceforge projects have multiple repositories, so we need to
specify the repository to use for the last commit service.

* [sourceforge] add redirect for old project param only URLs
2025-03-09 16:23:39 +00:00

20 lines
735 B
JavaScript

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