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
2 changed files with 11 additions and 14 deletions

View File

@@ -1,12 +1,11 @@
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({
t.create('top language').get('/badges/shields.json').expectBadge({
label: 'javascript',
message: Joi.string().regex(/^([1-9]?[0-9]\.[0-9]|100\.0)%$/),
message: isDecimalPercentage,
})
t.create('top language (empty repo)')

View File

@@ -1,13 +1,11 @@
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({
t.create('Valid Repository').get('/wireshark/wireshark.json').expectBadge({
label: 'c',
message: Joi.string().regex(/^([1-9]?[0-9]\.[0-9]|100\.0)%$/),
message: isDecimalPercentage,
})
t.create('Valid Blank Repo')