Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mbtools committed May 10, 2024
1 parent 94ea16c commit 344c3aa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
4 changes: 2 additions & 2 deletions services/github/github-check-runs.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default class GithubCheckRuns extends GithubAuthV3Service {
queryParam({
name: 'nameFilter',
description: 'Name of a check run',
example: '',
example: 'test-lint',
}),
],
},
Expand All @@ -96,7 +96,7 @@ export default class GithubCheckRuns extends GithubAuthV3Service {
queryParam({
name: 'nameFilter',
description: 'Name of a check run',
example: '',
example: 'test-lint',
}),
],
},
Expand Down
25 changes: 14 additions & 11 deletions services/github/github-check-runs.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ import GithubCheckRuns from './github-check-runs.service.js'

describe('GithubCheckRuns.transform', function () {
test(GithubCheckRuns.transform, () => {
given({
total_count: 3,
check_runs: [
{ status: 'completed', conclusion: 'success' },
{ status: 'completed', conclusion: 'failure' },
{ status: 'in_progress', conclusion: null },
],
}).expect({
given(
{
total_count: 3,
check_runs: [
{ status: 'completed', conclusion: 'success' },
{ status: 'completed', conclusion: 'failure' },
{ status: 'in_progress', conclusion: null },
],
},
'',
).expect({
total: 3,
statusCounts: { completed: 2, in_progress: 1 },
conclusionCounts: { success: 1, failure: 1, null: 1 },
Expand All @@ -25,7 +28,7 @@ describe('GithubCheckRuns.transform', function () {
{ name: 'test3', status: 'in_progress', conclusion: null },
],
},
{ nameFilter: '' },
'',
).expect({
total: 3,
statusCounts: { completed: 2, in_progress: 1 },
Expand All @@ -41,9 +44,9 @@ describe('GithubCheckRuns.transform', function () {
{ name: 'test3', status: 'in_progress', conclusion: null },
],
},
{ nameFilter: 'test1' },
'test1',
).expect({
total: 1,
total: 3,
statusCounts: { completed: 1 },
conclusionCounts: { success: 1 },
})
Expand Down

0 comments on commit 344c3aa

Please sign in to comment.