Skip to content

test(tip): Avalanche チップのテストで遅延 import の TipForm を境界 mock にする - #542

Merged
cipherwebllc merged 1 commit into
mainfrom
test/tip-embed-avalanche-tipform-mock
Sep 21, 2026
Merged

cipherwebllc merged 1 commit into
mainfrom
test/tip-embed-avalanche-tipform-mock

Conversation

@cipherwebllc

Copy link
Copy Markdown
Owner

何を直すか

tests/components/TipEmbedGeneratorAvalanche.test.tsx が、全 test pass のまま未処理例外で vitest を exit 1 にすることがあった (タイミング依存の flake)。

原因: TipEmbedGenerator のプレビューは next/dynamicTipForm を遅延 import する。このファイルの wagmi mock は useAccount しか持たず、実物の TipFormuseSwitchChain 等を呼んで throw する。読み込みがテスト終了と重なったときだけ未処理例外になる。

対応: 兄弟の TipEmbedGenerator.test.tsx と同じく @/components/TipForm を境界 mock にする。このファイルの対象は chain chip の描画と URL で、プレビューの中身は見ていない。

製品コードの変更なし。

検証

  • 対象 2 file を 3 回連続で実行 → 55/55 pass・未処理例外なし
  • eslint OK

flake 自体はタイミング依存で、修正前の状態でも単体実行では再現しなかった (原因はコードの突合で特定)。

🤖 Generated with Claude Code

https://claude.ai/code/session_01HeizmagJBgL5peL5mQpxkc

… exit 1 になる flake)

プレビューの TipForm は next/dynamic の遅延 import。実物は このファイルの wagmi mock に
無い hook (useSwitchChain 等) を呼ぶため、読み込みがテスト終了と重なると未処理例外になり、
全 test pass のまま vitest が exit 1 になることがあった。

対象は chain chip の描画と URL なので、既存 TipEmbedGenerator.test と同じく
@/components/TipForm を境界で切る。製品コードの変更なし。

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HeizmagJBgL5peL5mQpxkc
@vercel

vercel Bot commented Sep 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
openpay Ignored Ignored Preview Sep 21, 2026 1:31pm UTC

Request Review

@cipherwebllc
cipherwebllc merged commit 6984250 into main Sep 21, 2026
7 checks passed
@cipherwebllc
cipherwebllc deleted the test/tip-embed-avalanche-tipform-mock branch September 21, 2026 14:01
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.

1 participant