1
0
mirror of https://github.com/badges/shields.git synced 2025-09-19 16:01:38 +03:00
Files
shields/services/snapcraft/snapcraft-last-update.tester.js
Ambati Mohan Kumar 1d2bf19100 [Snapcraft] - Added snapcraft last update badge (#10610)
* Added badge for Maven-Cenral last update.

* Update services/maven-central/maven-central-last-update.service.js

Co-authored-by: chris48s <chris48s@users.noreply.github.com>

* updated according to the review comments.

* added Snapcraft last updated badges.

* made changes according to the review.

---------

Co-authored-by: chris48s <chris48s@users.noreply.github.com>
2024-10-14 05:48:16 +00:00

47 lines
1.2 KiB
JavaScript

import { isFormattedDate } from '../test-validators.js'
import { createServiceTester } from '../tester.js'
export const t = await createServiceTester()
t.create('last update for redis/latest/stable')
.get('/redis/latest/stable.json')
.expectBadge({
label: 'last updated',
message: isFormattedDate,
})
t.create('last update for redis/latest/stable and query param arch=arm64')
.get('/redis/latest/stable.json?arch=arm64')
.expectBadge({
label: 'last updated',
message: isFormattedDate,
})
t.create('last update when package not found')
.get('/fake_package/fake/fake.json')
.expectBadge({
label: 'last updated',
message: 'package not found',
})
t.create('last update for redis and invalid track')
.get('/redis/notFound/stable.json')
.expectBadge({
label: 'last updated',
message: 'track not found',
})
t.create('last update for redis/latest and invalid risk')
.get('/redis/latest/notFound.json')
.expectBadge({
label: 'last updated',
message: 'risk not found',
})
t.create('last update for redis/latest/stable and invalid arch (query param)')
.get('/redis/latest/stable.json?arch=fake')
.expectBadge({
label: 'last updated',
message: 'arch not found',
})