fix: Jest の新しいカバレッジ閾値エラー文言にテストを追従 - #915
Conversation
Jest がカバレッジ閾値未達を 'coverage threshold for <kind> (<n>%) not met' 形式で出力するようになり、旧文言 'does not meet "global" threshold' を 期待するアサーションが失敗していた。実際の出力形式にマッチする正規表現に変更。 Closes #914 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
.claude/hooks/README.md と AGENTS.md が prettier --check に失敗し pre-commit ゲートを塞いでいたため整形。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThis PR reformats Markdown tables in ChangesDocumentation formatting and test assertion fix
Estimated code review effort: 1 (Trivial) | ~3 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
test/jest-config.test.jsOops! Something went wrong! :( ESLint: 10.6.0 ReferenceError: describe is not defined 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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.claude/hooks/README.md:
- Around line 163-176: The markdown table in the hooks README has a malformed
separator row with extra pipe-delimited cells, which breaks the intended
two-column layout. Update the table formatting so the separator row under the
header matches only the two columns used by the pattern/label rows, and verify
the entries in the surrounding table remain aligned and render correctly in
Markdown.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 74b9dc89-8199-4895-9af5-9e7a86098692
📒 Files selected for processing (3)
.claude/hooks/README.mdAGENTS.mdtest/jest-config.test.js
| | パターン | ラベル | | ||
| | ---------------------------------------- | ---------------------------- | ------------------- | --- | ---- | ----------- | ---------------- | | ||
| | `(AKIA | ASIA)[0-9A-Z]{16}` | AWS アクセスキー ID | | ||
| | `aws_secret_access_key=...` | AWS シークレットアクセスキー | | ||
| | `ghp_...` / `gho_...` / `github_pat_...` | GitHub トークン(3種) | | ||
| | `sk-ant-...` | Anthropic API キー | | ||
| | `sk-proj-...` / `sk-...` | OpenAI キー | | ||
| | `xox[baprs]-...` | Slack トークン | | ||
| | `[sr]k\_(live | test)\_...` | Stripe キー | | ||
| | `lin_api_...` | Linear API キー | | ||
| | `AIza...` | Google API キー | | ||
| | `glpat-...` | GitLab PAT | | ||
| | `(AKIA | ASIA)[0-9A-Z]{16}` | AWS アクセスキー ID | | ||
| | `aws_secret_access_key=...` | AWS シークレットアクセスキー | | ||
| | `ghp_...` / `gho_...` / `github_pat_...` | GitHub トークン(3種) | | ||
| | `sk-ant-...` | Anthropic API キー | | ||
| | `sk-proj-...` / `sk-...` | OpenAI キー | | ||
| | `xox[baprs]-...` | Slack トークン | | ||
| | `[sr]k\_(live | test)\_...` | Stripe キー | | ||
| | `lin_api_...` | Linear API キー | | ||
| | `AIza...` | Google API キー | | ||
| | `glpat-...` | GitLab PAT | | ||
| | `dp.(pt | st | sa | ct | scim | audit)....` | Doppler トークン | | ||
| | `-----BEGIN ... PRIVATE KEY-----` | 秘密鍵 | | ||
| | `-----BEGIN ... PRIVATE KEY-----` | 秘密鍵 | |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Keep the separator row to two columns.
The new separator line declares extra pipe-delimited cells, so this no longer matches the two-column header and may render incorrectly in Markdown.
Suggested fix
-| ---------------------------------------- | ---------------------------- | ------------------- | --- | ---- | ----------- | ---------------- |
+| ---------------------------------------- | ---------------------------- |📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| | パターン | ラベル | | |
| | ---------------------------------------- | ---------------------------- | ------------------- | --- | ---- | ----------- | ---------------- | | |
| | `(AKIA | ASIA)[0-9A-Z]{16}` | AWS アクセスキー ID | | |
| | `aws_secret_access_key=...` | AWS シークレットアクセスキー | | |
| | `ghp_...` / `gho_...` / `github_pat_...` | GitHub トークン(3種) | | |
| | `sk-ant-...` | Anthropic API キー | | |
| | `sk-proj-...` / `sk-...` | OpenAI キー | | |
| | `xox[baprs]-...` | Slack トークン | | |
| | `[sr]k\_(live | test)\_...` | Stripe キー | | |
| | `lin_api_...` | Linear API キー | | |
| | `AIza...` | Google API キー | | |
| | `glpat-...` | GitLab PAT | | |
| | `(AKIA | ASIA)[0-9A-Z]{16}` | AWS アクセスキー ID | | |
| | `aws_secret_access_key=...` | AWS シークレットアクセスキー | | |
| | `ghp_...` / `gho_...` / `github_pat_...` | GitHub トークン(3種) | | |
| | `sk-ant-...` | Anthropic API キー | | |
| | `sk-proj-...` / `sk-...` | OpenAI キー | | |
| | `xox[baprs]-...` | Slack トークン | | |
| | `[sr]k\_(live | test)\_...` | Stripe キー | | |
| | `lin_api_...` | Linear API キー | | |
| | `AIza...` | Google API キー | | |
| | `glpat-...` | GitLab PAT | | |
| | `dp.(pt | st | sa | ct | scim | audit)....` | Doppler トークン | | |
| | `-----BEGIN ... PRIVATE KEY-----` | 秘密鍵 | | |
| | `-----BEGIN ... PRIVATE KEY-----` | 秘密鍵 | | |
| | パターン | ラベル | | |
| | ---------------------------------------- | ---------------------------- | | |
| | `(AKIA | ASIA)[0-9A-Z]{16}` | AWS アクセスキー ID | | |
| | `aws_secret_access_key=...` | AWS シークレットアクセスキー | | |
| | `ghp_...` / `gho_...` / `github_pat_...` | GitHub トークン(3種) | | |
| | `sk-ant-...` | Anthropic API キー | | |
| | `sk-proj-...` / `sk-...` | OpenAI キー | | |
| | `xox[baprs]-...` | Slack トークン | | |
| | `[sr]k\_(live | test)\_...` | Stripe キー | | |
| | `lin_api_...` | Linear API キー | | |
| | `AIza...` | Google API キー | | |
| | `glpat-...` | GitLab PAT | | |
| | `dp.(pt | st | sa | ct | scim | audit)....` | Doppler トークン | | |
| | `-----BEGIN ... PRIVATE KEY-----` | 秘密鍵 | |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.claude/hooks/README.md around lines 163 - 176, The markdown table in the
hooks README has a malformed separator row with extra pipe-delimited cells,
which breaks the intended two-column layout. Update the table formatting so the
separator row under the header matches only the two columns used by the
pattern/label rows, and verify the entries in the surrounding table remain
aligned and render correctly in Markdown.
|
撤回します。この失敗はリポジトリのバグではなく、ローカルの node_modules が lockfile と乖離していた(古い Jest がテスト時に旧文言を出力していた)ことが原因でした。npm ci で同期後、main の元のアサーションは Jest 30.4.1 で正常にパスすることを確認済みです。 |
Why
test/jest-config.test.jsの coverage threshold テストが Jest の旧エラー文言does not meet "global" thresholdを期待しており、現行 Jest の出力形式(Jest: "global" coverage threshold for statements (70%) not met: 0%)と不一致でテストスイートが失敗していた。What
/"global" coverage threshold for \w+ \(\d+%\) not met/に変更.claude/hooks/README.mdとAGENTS.mdの prettier フォーマット崩れを別コミットで修正How
Jest を実際に閾値未達条件で実行して出力形式を確認し、文言の骨格(kind と % は可変)に対して正規表現でマッチさせる方式にした。
Risk
テストのアサーション変更のみで実装コードへの影響なし。Jest が再度文言を変えた場合はこのテストが検知する。
Closes #914
🤖 Generated with Claude Code
Summary by CodeRabbit
Documentation
Tests