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

Fix [EcologiCarbonOffset] test (#10374)

This commit is contained in:
Pierre-Yves Bigourdan 2024-07-22 19:54:30 +02:00 committed by GitHub
parent a202a09e87
commit bb1157c6b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,12 +1,12 @@
import { createServiceTester } from '../tester.js'
import { withRegex } from '../test-validators.js'
import { isMetricWithPattern } from '../test-validators.js'
export const t = await createServiceTester()
t.create('request for existing username')
.get('/ecologi.json')
.expectBadge({
label: 'carbon offset',
message: withRegex(/[\d.]+ tonnes/),
message: isMetricWithPattern(/ tonnes/),
})
t.create('invalid username').get('/non-existent-username.json').expectBadge({