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

test(cli): improve test coverage in cli api handling #1408

Merged

Conversation

spirulence
Copy link
Contributor

@spirulence spirulence commented Dec 10, 2024

📚 Description

This PR improves the unit test coverage of the cli application. New tests for apps/cli/src/api.ts are included.

Previous code coverage report (commit f3fc6be ) npx vitest --coverage
CleanShot 2024-12-10 at 15 20 51

New coverage report
CleanShot 2024-12-10 at 15 20 23

🔗 Linked Issue

Makes progress on #1407

🧪 Test Plan

Test only change. New tests attached. Axios and Octokit dependencies mocked where applicable.

Line 23 in api.ts appears to have an unreachable branch which could be addressed in a follow-on effort.

📄 Documentation to Update

No documentation identified.

Copy link

vercel bot commented Dec 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
codemod ⬜️ Ignored (Inspect) Visit Preview Dec 11, 2024 5:15pm

Copy link

vercel bot commented Dec 10, 2024

@spirulence is attempting to deploy a commit to the Codemod Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

pkg-pr-new bot commented Dec 10, 2024

Open in Stackblitz

npm i https://pkg.pr.new/codemod@1408

commit: 3eb7df8

Copy link
Contributor Author

@spirulence spirulence left a comment

Choose a reason for hiding this comment

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

Some self-review

apps/cli/test/api.test.ts Show resolved Hide resolved
apps/cli/test/api.test.ts Show resolved Hide resolved
apps/cli/test/api.test.ts Show resolved Hide resolved
apps/cli/test/api.test.ts Show resolved Hide resolved
apps/cli/test/api.test.ts Show resolved Hide resolved
Copy link
Member

@mohebifar mohebifar left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks! 🎉 Just one comment.

apps/cli/test/api.test.ts Outdated Show resolved Hide resolved
@spirulence
Copy link
Contributor Author

@mohab-sameh I got caught off-guard here by the fact that pnpm lint-staged did not catch my unused variables in testing! nice catch. may be room for improvement there.

@spirulence
Copy link
Contributor Author

broke the above issue with linting out into it's own effort #1420

@alexbit-codemod
Copy link
Contributor

i let @amirabbas-gh to rebase and merge this, making sure his latest work is not lost.

@alexbit-codemod alexbit-codemod merged commit 39309a3 into codemod-com:main Dec 19, 2024
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants