-
Notifications
You must be signed in to change notification settings - Fork 130
Fix test to pass after disable delete community #699
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
Conversation
Change back after #697 is merge
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the WalkthroughThe bot initialization test stops stubbing Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
tests/bot/bot.spec.ts (2)
307-315: Remove commented-out stub to avoid dead code driftThe
deleteCommunitystub is now commented out. If the job is disabled upstream, drop the commented line to keep the test doubles clean. If you plan to re-enable via a follow-up PR, prefer adding a brief TODO referencing the PR instead of leaving code commented out.- // deleteCommunity: sinon.stub().resolves(),
469-477: Avoid brittle assertion on total number of scheduled jobsstart.ts registers 8 scheduleJob calls (not 7); assert presence of required cron(s) instead of the total count.
File: tests/bot/bot.spec.ts Lines: 469-477
Proposed change:
- expect(scheduleStub.scheduleJob.callCount).to.be.equal(7); + const crons = scheduleStub.scheduleJob.getCalls().map(c => c.args[0]); + expect(crons).to.include('*/10 * * * *'); // attemptPendingPayments
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
tests/bot/bot.spec.ts(2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.ts
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.ts: Use Winston for logging (avoid console) and include contextual details and timeout monitoring where relevant
Wrap risky operations in try-catch with meaningful error context
Files:
tests/bot/bot.spec.ts
tests/**/*.spec.ts
📄 CodeRabbit inference engine (CLAUDE.md)
Write tests in TypeScript using Mocha and Chai with the *.spec.ts naming under tests/
Files:
tests/bot/bot.spec.ts
🧠 Learnings (1)
📚 Learning: 2025-08-14T18:53:14.640Z
Learnt from: CR
PR: lnp2pBot/bot#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-14T18:53:14.640Z
Learning: Applies to bot/start.ts : Implement bot initialization, command registration, and scheduled job setup in bot/start.ts
Applied to files:
tests/bot/bot.spec.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Analyze (javascript)
- GitHub Check: ci_to_main
- GitHub Check: ci_to_main
Change back after #697 is merge
Summary by CodeRabbit
Tests
Style