jest -> vitest#106
Conversation
Walkthroughテスト基盤をJestからVitestへ移行し、関連する設定、依存関係、型定義、テスト内モック呼び出し、CIのNode.js行列を更新した。 ChangesJest から Vitest への移行
Estimated code review effort: 2 (Simple) | ~12 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)
37-37: 🩺 Stability & Availability | 🔵 TrivialNode.js 26.xはまだLTSではない点に留意
Node.js 26は2026年5月にリリースされたばかりの「Current」ラインであり、LTS移行は2026年10月予定です。CIマトリクスに含めること自体は将来互換性の早期検証として有用ですが、Currentリリースはリリース頻度が高くAPI変更の影響を受けやすいため、CI失敗が本体コードの問題ではなくNode側の変更に起因する可能性がある点に留意してください。
🤖 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 @.github/workflows/ci.yml at line 37, The CI matrix currently includes Node.js 26.x, which is a Current release rather than LTS, so treat it as an optional forward-compatibility job in the workflow. Update the matrix in the CI workflow to either remove 26.x if only LTS support is intended, or explicitly allow it to fail / label it as non-blocking so failures there don’t mask issues in the main supported versions. Refer to the node-version matrix entry in the CI workflow.
🤖 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 @.github/workflows/ci.yml:
- Line 37: The CI matrix in build-and-test is out of sync with the stated
Node.js support: it starts at 20.x while package.json and the README files still
say v18+ is supported. Update the node-version matrix in ci.yml to include 18.x
if Node 18 remains supported, or otherwise align the support declaration by
updating the engines field in package.json and the Node version wording in
README.md and README_jp.md to match the actual CI support.
---
Nitpick comments:
In @.github/workflows/ci.yml:
- Line 37: The CI matrix currently includes Node.js 26.x, which is a Current
release rather than LTS, so treat it as an optional forward-compatibility job in
the workflow. Update the matrix in the CI workflow to either remove 26.x if only
LTS support is intended, or explicitly allow it to fail / label it as
non-blocking so failures there don’t mask issues in the main supported versions.
Refer to the node-version matrix entry in the CI workflow.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 1e25c714-8c08-4afb-9eec-ef35e1a89a0f
📒 Files selected for processing (1)
.github/workflows/ci.yml
| strategy: | ||
| matrix: | ||
| node-version: [18.x, 20.x, 22.x, 24.x] | ||
| node-version: [20.x, 22.x, 24.x, 26.x] |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== files =="
git ls-files .github/workflows/ci.yml package.json
echo
echo "== ci.yml around node-version =="
nl -ba .github/workflows/ci.yml | sed -n '1,120p'
echo
echo "== package.json engines =="
nl -ba package.json | sed -n '1,80p'Repository: microcmsio/microcms-js-sdk
Length of output: 288
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== ci.yml around node-version =="
sed -n '1,120p' .github/workflows/ci.yml | cat -n
echo
echo "== package.json engines =="
sed -n '1,80p' package.json | cat -nRepository: microcmsio/microcms-js-sdk
Length of output: 4191
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== .node-version =="
if [ -f .node-version ]; then
cat -n .node-version
else
echo "(missing)"
fi
echo
echo "== Node support mentions =="
rg -n --hidden --glob '!dist/**' --glob '!node_modules/**' \
-e 'Node\.js|node version|engines|>=18|18\.x|20\.x|22\.x|24\.x|26\.x' \
README* package.json .github/workflows ./Repository: microcmsio/microcms-js-sdk
Length of output: 19113
Node 18 の検証をマトリクスに戻すか、サポート表記を揃えてください
package.json と README.md / README_jp.md ではまだ Node.js v18+ をサポート対象としているのに、.github/workflows/ci.yml の build-and-test は 20.x からしか回っていません。18 を継続サポートするなら 18.x を追加し、切るなら engines と README もまとめて更新してください。
🤖 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 @.github/workflows/ci.yml at line 37, The CI matrix in build-and-test is out
of sync with the stated Node.js support: it starts at 20.x while package.json
and the README files still say v18+ is supported. Update the node-version matrix
in ci.yml to include 18.x if Node 18 remains supported, or otherwise align the
support declaration by updating the engines field in package.json and the Node
version wording in README.md and README_jp.md to match the actual CI support.
Summary by CodeRabbit
vi.fn、vi.resetAllMocks)に統一しました。