Swarm Fix: [BUG] [alpha] Test Coverage Run Tests with Coverage can keep targeting the previous workspace after a same-window project switch#36980
Conversation
…keep targeting the previous workspace after a same-window project switch
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ 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 |
Fix for Issue #36962
To fix the issue of
TestingContextnot updating after a same-window workspace switch, we need to make the following changes:Step 1: Update
TestingContextto listen forworkspace:open-foldereventIn
/src/context/TestingContext.tsx, add an event listener forworkspace:open-folder:Step 2: Update
discoverTeststo detect the framework and update the stateIn
/src/context/TestingContext.tsx, update thediscoverTestsfunction to detect the framework and update the state:Step 3: Update
runWithCoverageto use the updated stateIn
/src/context/TestingContext.tsx, update therunWithCoveragefunction to use the updated state:Step 4: Clear the old coverage state when the workspace switches
In
/src/context/TestingContext.tsx, add a function to clear the old coverage state when the workspace switches:Call this function in the
handleWorkspaceSwitchfunction:With these changes,
TestingContextshould now update correctly after a same-window workspace switch, andRun Tests with Coverageshould target the newly opened workspace.Commit message: