Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
iliapolo committed Jan 13, 2025
1 parent d8d8427 commit 493539a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tools/@aws-cdk/prlint/lint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,15 +366,15 @@ export class PullRequestLinter {
}
}

private async checkRunConclusion(sha: string, checkName: string): Promise<CheckRunConclusion> {
private async checkRunConclusion(sha: string, checkName: string): Promise<CheckRunConclusion> {
const response = await this.client.paginate(this.client.checks.listForRef, {
owner: this.prParams.owner,
repo: this.prParams.repo,
ref: sha,
});

// grab the last check run that was started
const conclusion = response
const conclusion = response.check_runs
.filter(c => c.name === checkName)
.filter(c => c.started_at != null)
.sort((c1, c2) => c2.started_at!.localeCompare(c1.started_at!))
Expand Down
6 changes: 5 additions & 1 deletion tools/@aws-cdk/prlint/test/lint.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,11 @@ function configureMock(pr: Subset<linter.GitHubPr>, prFiles?: linter.GitHubFile[
const checksClient = {
listForRef() {
return {
data: linter.CODECOV_CHECKS.map(c => ({ name: `${linter.CODECOV_PREFIX}${c}`, conclusion: 'success' })),
data: { check_runs: linter.CODECOV_CHECKS.map(c => ({
name: `${linter.CODECOV_PREFIX}${c}`,
conclusion: 'success',
started_at: '1'
}))},
}
}
}
Expand Down

0 comments on commit 493539a

Please sign in to comment.