Files
shields/services/github/github-created-at.tester.js
Eray Erdin (&mut self) ea9445b74e [GithubCreatedAt] Add Created At Badge for Github (#9981)
* init GithubCreatedAt service

* render raw created_at

* impl formatted date

* add color

* add test for absent repo

* add `reversed` parameter to `age` color formatter

* inverse the colors of the badge

---------

Co-authored-by: Studio <studio@192.168.1.20>
2024-02-26 20:01:48 +00:00

15 lines
411 B
JavaScript

import { isFormattedDate } from '../test-validators.js'
import { createServiceTester } from '../tester.js'
export const t = await createServiceTester()
t.create('created at').get('/erayerdin/firereact.json').expectBadge({
label: 'created at',
message: isFormattedDate,
})
t.create('created at').get('/erayerdin/not-a-valid-repo.json').expectBadge({
label: 'created at',
message: 'repo not found',
})