Skip to content

Commit

Permalink
use metric() in [coderabbit] badge (#10779)
Browse files Browse the repository at this point in the history
  • Loading branch information
chris48s authored Jan 1, 2025
1 parent 3daef19 commit de1382d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion services/coderabbit/coderabbit-pull-request.service.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Joi from 'joi'
import { BaseJsonService, pathParams } from '../index.js'
import { metric } from '../text-formatters.js'

const schema = Joi.object({
reviews: Joi.number().required(),
Expand Down Expand Up @@ -46,7 +47,7 @@ class CodeRabbitPullRequest extends BaseJsonService {

static render({ reviews }) {
return {
message: `${reviews}`,
message: metric(reviews),
color: 'blue',
}
}
Expand Down
4 changes: 2 additions & 2 deletions services/coderabbit/coderabbit-pull-request.tester.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import Joi from 'joi'
import { createServiceTester } from '../tester.js'
import { isMetric } from '../test-validators.js'

export const t = await createServiceTester()

t.create('live CodeRabbitPullRequest')
.get('/prs/github/coderabbitai/ast-grep-essentials.json')
.expectBadge({
label: 'coderabbit reviews',
message: Joi.number().min(0),
message: isMetric,
})

t.create('live CodeRabbitPullRequest nonexistent org')
Expand Down

0 comments on commit de1382d

Please sign in to comment.