Skip to content

Conversation

nikolapeja6
Copy link
Member

Improving test coverage with additional tests (generated by copilot).

Before
image

After
image

GitHub issue number

/

Associated Risks

/

PR Checklist

  • I have read the contribution guidelines
  • I have read the code of conduct guidelines
  • Title of the pull request is clear and informative.
  • 👌 Code hygiene
  • 🔭 Telemetry added, updated, or N/A
  • 📄 Documentation added, updated, or N/A
  • 🛡️ Automated tests added, or N/A

🧪 How did you test it?

Executed tests.

@nikolapeja6 nikolapeja6 requested a review from a team as a code owner August 22, 2025 11:25
Copy link

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@nikolapeja6 nikolapeja6 enabled auto-merge (squash) August 22, 2025 11:28
Copy link
Collaborator

@Novaes Novaes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

expect(criteria).toHaveProperty("toolName", "CodeQL");
expect(criteria).toHaveProperty("ref", "refs/heads/main");
expect(criteria).toHaveProperty("onlyDefaultBranch", false);
});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any way we can assert via a map here?

{
 'ruleId': "rule123"
 ... 
}

With fluentAssertions you should be able to do it.

await handler(params);

expect(mockGetUserIdFromEmail).toHaveBeenCalledWith("john@example.com", tokenProvider, connectionProvider, userAgentProvider);
expect(mockGitApi.getPullRequests).toHaveBeenCalledWith("repo123", { status: PullRequestStatus.Active, repositoryId: "repo123", creatorId: "specific-user-123" }, undefined, undefined, 0, 100);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd move this payload outside here, hard to read this assertion

@nikolapeja6 nikolapeja6 merged commit 4ba5629 into main Aug 22, 2025
8 checks passed
@nikolapeja6 nikolapeja6 deleted the users/nikolapeja6/test-coverage-improvements branch August 22, 2025 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants