fix(tests): update Jest mock for @octokit/graphql v8 (ESM-only)#5171
fix(tests): update Jest mock for @octokit/graphql v8 (ESM-only)#5171SHUBHANSHU602 wants to merge 1 commit intoasyncapi:masterfrom
Conversation
✅ Deploy Preview for asyncapi-website ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughWalkthroughModified the mock setup for Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5171 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 22 22
Lines 796 796
Branches 146 146
=========================================
Hits 796 796 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-5171--asyncapi-website.netlify.app/ |
|
@princerajpoot20 @anshgoyalevil Ready for review. |
|
@coderabbitai, does this PR meet the need of Issue ? |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 3132 🏁 Script executed: Length of output: 965 🏁 Script executed: Length of output: 1024 🏁 Script executed: Length of output: 13687 🏁 Script executed: Length of output: 639
What's Covered ✅
What's Missing ❌The PR does not actually upgrade "@octokit/graphql": "^7.0.2"To Fully Resolve Issue
|
|
@derberg @princerajpoot20 @akshatnema @sambhavgupta0705 @vishvamsinh28 @anshgoyalevil @Mayaleeeee Please take a look at this PR. Thanks! 👋 |
@coderabbitai , I have been asked to fix the failing tests after upgrading the @octokit , so I did the same upgraded it locally and made the required changes , but did not push the upgrade just to maintain the scope of PR , if maintainer ask me I will upgrade that too. |
|
Tip For best results, initiate chat on the files or code changes.
Current Status ✅You're right to be thoughtful about PR scope. Your current PR:
Path ForwardThere are two valid approaches here: Option 1: Separate PRs (what you're doing)
Option 2: Combined PR
RecommendationYour current approach is valid, especially since you were specifically asked to fix the failing tests. However, given that:
You could consider adding the package.json upgrade to this PR to fully close issue Would you like to wait for maintainer feedback ( 🧠 Learnings used |
|
@princerajpoot20 @anshgoyalevil Please let me know if I should upgrade the |



This PR updates the Jest mock for @octokit/graphql in build-dashboard.test.ts.
Since newer versions of @octokit/graphql are ESM-only, Jest was attempting to parse the ESM bundle from node_modules, resulting in:
SyntaxError: Cannot use import statement outside a moduleTo resolve this, the mock has been updated to use a factory:
jest.mock('@octokit/graphql', () => ({ graphql: jest.fn(), }));This prevents Jest from loading the actual ESM module and ensures compatibility without modifying Jest configuration or production code.
All tests pass successfully.

Resolves #3690
Summary by CodeRabbit