test(tip): Avalanche チップのテストで遅延 import の TipForm を境界 mock にする - #542
Merged
Merged
Conversation
… 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
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
何を直すか
tests/components/TipEmbedGeneratorAvalanche.test.tsxが、全 test pass のまま未処理例外で vitest を exit 1 にすることがあった (タイミング依存の flake)。原因:
TipEmbedGeneratorのプレビューはnext/dynamicでTipFormを遅延 import する。このファイルのwagmimock はuseAccountしか持たず、実物のTipFormがuseSwitchChain等を呼んで throw する。読み込みがテスト終了と重なったときだけ未処理例外になる。対応: 兄弟の
TipEmbedGenerator.test.tsxと同じく@/components/TipFormを境界 mock にする。このファイルの対象は chain chip の描画と URL で、プレビューの中身は見ていない。製品コードの変更なし。
検証
flake 自体はタイミング依存で、修正前の状態でも単体実行では再現しなかった (原因はコードの突合で特定)。
🤖 Generated with Claude Code
https://claude.ai/code/session_01HeizmagJBgL5peL5mQpxkc