1
0
mirror of https://github.com/badges/shields.git synced 2025-04-18 19:44:04 +03:00

use isDecimalPercentage in tests for github/lab top lang (#10752)

This commit is contained in:
chris48s 2024-12-31 13:25:38 +00:00 committed by GitHub
parent b4c21fd65d
commit 7108e08670
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 14 deletions

View File

@ -1,13 +1,12 @@
import Joi from 'joi'
import { createServiceTester } from '../tester.js'
import { isDecimalPercentage } from '../test-validators.js'
export const t = await createServiceTester()
t.create('top language')
.get('/badges/shields.json')
.expectBadge({
label: 'javascript',
message: Joi.string().regex(/^([1-9]?[0-9]\.[0-9]|100\.0)%$/),
})
t.create('top language').get('/badges/shields.json').expectBadge({
label: 'javascript',
message: isDecimalPercentage,
})
t.create('top language (empty repo)')
.get('/pyvesb/emptyrepo.json')

View File

@ -1,14 +1,12 @@
import Joi from 'joi'
import { createServiceTester } from '../tester.js'
import { isDecimalPercentage } from '../test-validators.js'
export const t = await createServiceTester()
t.create('Valid Repository')
.get('/wireshark/wireshark.json')
.expectBadge({
label: 'c',
message: Joi.string().regex(/^([1-9]?[0-9]\.[0-9]|100\.0)%$/),
})
t.create('Valid Repository').get('/wireshark/wireshark.json').expectBadge({
label: 'c',
message: isDecimalPercentage,
})
t.create('Valid Blank Repo')
.get('/KoruptTinker/gitlab-blank-repo.json')