Files
shields/services/github/github-check-runs.tester.js
Marc Bernard 12f54f3375 Add [GithubCheckRuns] service (#7759)
* Add [GithubCheckRuns] service

* Adjust ref parameter

* Rework

* Prettier

* Prettier

* Function

* Prettier

* Change CR to LF

* Adjust after #9233

* Lint camelCase

* Fix camelCase

* Fix prettier

* Switch to openAPI spec for examples

* Fix type of parameters

* Fix too many brackets

* Lint

* Add optional name filter

* Update tests

* Remove logo
2024-05-25 10:35:25 +00:00

32 lines
830 B
JavaScript

import { createServiceTester } from '../tester.js'
import { isBuildStatus } from '../build-status.js'
export const t = await createServiceTester()
t.create('check runs - for branch')
.get('/badges/shields/master.json')
.expectBadge({
label: 'checks',
message: isBuildStatus,
})
t.create('check runs - for branch with filter')
.get('/badges/shields/master.json?nameFilter=test-lint')
.expectBadge({
label: 'checks',
message: isBuildStatus,
})
t.create('check runs - no tests')
.get('/badges/shields/5d4ab86b1b5ddfb3c4a70a70bd19932c52603b8c.json')
.expectBadge({
label: 'checks',
message: 'no check runs',
})
t.create('check runs - nonexistent ref')
.get('/badges/shields/this-ref-does-not-exist.json')
.expectBadge({
label: 'checks',
message: 'ref or repo not found',
})