mirror of
https://github.com/badges/shields.git
synced 2025-07-30 17:23:07 +03:00
feat: add [GitlabLastCommit] service (#8508)
* feat: add gitlab last commit service * fix Signed-off-by: guoxudong <guoxudong.dev@gmail.com> Signed-off-by: guoxudong <guoxudong.dev@gmail.com> Co-authored-by: chris48s <chris48s@users.noreply.github.com>
This commit is contained in:
30
services/gitlab/gitlab-last-commit.tester.js
Normal file
30
services/gitlab/gitlab-last-commit.tester.js
Normal file
@ -0,0 +1,30 @@
|
||||
import { isFormattedDate } from '../test-validators.js'
|
||||
import { createServiceTester } from '../tester.js'
|
||||
|
||||
export const t = await createServiceTester()
|
||||
|
||||
t.create('last commit (recent)').get('/gitlab-org/gitlab.json').expectBadge({
|
||||
label: 'last commit',
|
||||
message: isFormattedDate,
|
||||
})
|
||||
|
||||
t.create('last commit (on ref and ancient)')
|
||||
.get('/gitlab-org/gitlab.json?ref=v13.8.6-ee')
|
||||
.expectBadge({
|
||||
label: 'last commit',
|
||||
message: 'march 2021',
|
||||
})
|
||||
|
||||
t.create('last commit (self-managed)')
|
||||
.get('/gitlab-cn/gitlab.json?gitlab_url=https://jihulab.com')
|
||||
.expectBadge({
|
||||
label: 'last commit',
|
||||
message: isFormattedDate,
|
||||
})
|
||||
|
||||
t.create('last commit (project not found)')
|
||||
.get('/open/guoxudong.io/shields-test/do-not-exist.json')
|
||||
.expectBadge({
|
||||
label: 'last commit',
|
||||
message: 'project not found',
|
||||
})
|
Reference in New Issue
Block a user