Skip to content

test: stub fetch in submitVote abort test to avoid undici unhandled rejection - #4180

Merged
KATO-Hiro merged 2 commits into
stagingfrom
#4179
Oct 18, 2026
Merged

KATO-Hiro merged 2 commits into
stagingfrom
#4179

Conversation

@KATO-Hiro

@KATO-Hiro KATO-Hiro commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

close #4179

Summary by CodeRabbit

  • テスト
    • リクエスト中断時に、投票送信が中断シグナル付きで行われることを検証するテストを追加しました。

KATO-Hiro and others added 2 commits October 18, 2026 05:36
…ejection

Add a plan for the nock v15 migration.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: AtCoder-NoviSteps/AtCoderNoviSteps/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: de5354ca-d753-4072-9101-7ab070cb288a
📥 Commits

Reviewing files that changed from the base of the PR and between ae31015 and c39dec7.

📒 Files selected for processing: 1
  • src/features/votes/internal_clients/vote_grade.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

投票送信の中断テストを更新しました。テスト後にモックを復元し、中断時の戻り値と fetch の呼び出し引数を検証します。

Changes: 投票送信中断テスト

Layer / File(s) Summary
モック復元と中断時の検証
src/features/votes/internal_clients/vote_grade.test.ts
テスト後に Vitest のモックを復元します。中断時の fetch をスタブし、submitVote が false を返すことと、指定 URL およびシグナルで fetch を呼ぶことを検証します。

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to c39de

This change only updates the vote-cancellation test and does not alter production behavior. It verifies the cancellation result and signal forwarding, with no actionable merge risk identified.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed タイトルは、submitVote の中断テストで fetch をスタブし、undici の未処理リジェクションを防ぐ変更を正確に要約しています。
Linked Issues check Passed #4179 の目的は、submitVote の中断テストで発生する Serialized Error を修正することです。変更は fetch を controller.signal.reason で拒否するようスタブし、submitVote が中断シグナル付きで fetch を呼ぶことを検証します。vi.restoreAllMocks() も追加され、モック状態を後続テスト…
Out of Scope Changes check Passed 変更は src/features/votes/internal_clients/vote_grade.test.ts の中断テスト修正とモック後処理に限定されています。これらは #4179 のテスト不具合修正を直接支援します。無関係な変更は確認できません。
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Full details: Linked Issues check

Explanation

#4179 の目的は、submitVote の中断テストで発生する Serialized Error を修正することです。変更は fetch を controller.signal.reason で拒否するようスタブし、submitVote が中断シグナル付きで fetch を呼ぶことを検証します。vi.restoreAllMocks() も追加され、モック状態を後続テストへ残しません。

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@KATO-Hiro KATO-Hiro left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

LGTM

@KATO-Hiro
KATO-Hiro merged commit 7d2ffad into staging Oct 18, 2026
3 checks passed
@KATO-Hiro
KATO-Hiro deleted the #4179 branch October 18, 2026 05:42

This branch was successfully deployed

1 active deployment
preview — c39dec70 Deployed Oct 18, 2026 by KATO-Hiro via preview #8994
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: fix Serialized Error in unit test

1 participant