Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🧪 Testing: Add unit test for accepted issue with label object #207

Open
3 tasks done
JoshuaKGoldberg opened this issue Jan 6, 2024 · 0 comments
Open
3 tasks done
Labels
area: testing Improving how the repository's tests are run and/or code is tested area: tooling Managing the repository's maintenance good first issue Good for newcomers, please hop on! status: accepting prs Please, send a pull request to resolve this! type: cleanup Tech debt or other code/repository cleanups

Comments

@JoshuaKGoldberg
Copy link
Owner

Bug Report Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have pulled the latest main branch of the repository.
  • I have searched for related issues and found none that matched my issue.

Overview

Codecov reports that there's a single logical branch that doesn't have test coverage (https://app.codecov.io/gh/JoshuaKGoldberg/all-contributors-for-repository/blob/6d731eefd01cbd3e54fd35c1ccb676e15634da49/src%2Fcollect%2Fadding%2FaddAcceptedIssues.ts):

const labels = acceptedIssue.labels.map((label) =>
	typeof label === "string" ? label : label.name,
);

That typeof label === "string" ? label : label.name condition is run by the unit test in addAcceptedIssues.test.ts... but only the case of the label being a string is covered. No unit test runs the case of a label that's an object with a name property.

Accepting PRs to add a new unit test to addAcceptedIssues.test.ts for a label that's type { name: string } instead of string.

Additional Info

No response

@JoshuaKGoldberg JoshuaKGoldberg added good first issue Good for newcomers, please hop on! area: tooling Managing the repository's maintenance status: accepting prs Please, send a pull request to resolve this! area: testing Improving how the repository's tests are run and/or code is tested type: cleanup Tech debt or other code/repository cleanups labels Jan 6, 2024
@JoshuaKGoldberg JoshuaKGoldberg changed the title 🧪 Testing: Add unit test for accepted issue 🧪 Testing: Add unit test for accepted issue with label object Jan 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: testing Improving how the repository's tests are run and/or code is tested area: tooling Managing the repository's maintenance good first issue Good for newcomers, please hop on! status: accepting prs Please, send a pull request to resolve this! type: cleanup Tech debt or other code/repository cleanups
Projects
None yet
Development

No branches or pull requests

1 participant