Repository navigation
chore(deps): update: bump vitest from 4.1.5 to 5.0.1 - #235
Merged
Merged
Conversation
Collaborator
|
@dependabot rebase |
dependabot
Bot
force-pushed
the
dependabot/npm_and_yarn/vitest-5.0.1
branch
from
September 25, 2026 07:01
c426556 to
9292c0d
Compare
Bumps [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) from 4.1.5 to 5.0.1. - [Release notes](https://github.com/vitest-dev/vitest/releases) - [Changelog](https://github.com/vitest-dev/vitest/blob/main/docs/releases.md) - [Commits](https://github.com/vitest-dev/vitest/commits/v5.0.1/packages/vitest) --- updated-dependencies: - dependency-name: vitest dependency-version: 5.0.1 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
dependabot
Bot
force-pushed
the
dependabot/npm_and_yarn/vitest-5.0.1
branch
from
September 25, 2026 07:26
9292c0d to
0a17911
Compare
@vitest/coverage-v8@4.1.5 pins its peer to vitest@4.1.5, so npm i fails with ERESOLVE once vitest is 5.0.1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
|
| 全体 | main (vitest 4.1.5) | この PR (vitest 5.0.1) |
|---|---|---|
| Statements | 79.66% (188/236) | 80.08% (193/241) |
| Branches | 38.23% (26/68) | 38.23% (26/68) |
| Functions | 78.33% (47/60) | 78.33% (47/60) |
| Lines | 79.11% (178/225) | 80.33% (192/239) |
src/toolCallbacks.ts |
main | この PR |
|---|---|---|
| Statements | 67/67 | 72/72 |
| Lines | 57/57 | 71/71 |
その他のファイルは covered/total まですべて一致しています。
差分の中身
export const getMe = () => chatworkClient().request(...).then(...) のような、式本体のアロー関数で暗黙の return をどこに記録するかが変わっています。
- main: 引数なしの関数(例:
getMe72 行目)では本体側の statement が記録されていませんでした。引数が複数行にわたる関数(例:deleteOrLeaveRoom178–180 行目)では、本体の statement が引数の行(179 行目)に割り当てられていました。 - この PR: どの関数でも本体の開始行(73 行目、181 行目など)に揃って記録されます。
statement の終了位置にも差があり、閉じ括弧の行まで範囲に含まれるようになっています(例: toolCallbacks.ts の 114:6-134 → 114:6-135)。lines 指標は開始行で集計するので、この差は数値に影響しません。
vitest 5 と coverage-v8 5 は組み合わせでしか動かない(peer 依存)ため、どちらの変更に起因するかは切り分けていません。
補足
どちらのブランチでも、ローカルでは Functions と Branches が閾値を下回るため npm run test:coverage は失敗します(下記の手順では閾値を 0 にして比較しています)。この失敗は今回の更新とは関係なく、test:coverage は CI では実行されていません。
再現手順
Node 22 で実行しています(vitest 5 は Node ^22.12.0 || ^24.0.0 || >=26.0.0 が必要)。
git fetch origin
git worktree add --detach ../cov-main 727ae5a # main (#227 マージ後)
git worktree add --detach ../cov-pr f11d717 # この PR
for d in ../cov-main ../cov-pr; do
(cd "$d" && npm ci && npx vitest run --coverage \
--coverage.reporter=text \
--coverage.reporter=json-summary \
--coverage.reporter=json \
--coverage.thresholds.statements=0 \
--coverage.thresholds.branches=0 \
--coverage.thresholds.functions=0 \
--coverage.thresholds.lines=0)
done
node compare-coverage.mjs ../cov-main/coverage ../cov-pr/coveragecompare-coverage.mjs:
// usage: node compare-coverage.mjs <before>/coverage <after>/coverage
import { readFileSync } from 'node:fs';
const [before, after] = process.argv.slice(2);
const read = (dir, name) =>
JSON.parse(readFileSync(`${dir}/${name}`, 'utf8'));
const rel = (file) => file.replace(/^.*\/src\//, 'src/');
// 1. ファイル別の covered/total
const sa = read(before, 'coverage-summary.json');
const sb = read(after, 'coverage-summary.json');
const byRel = (o) =>
Object.fromEntries(
Object.entries(o).map(([f, v]) => [f === 'total' ? f : rel(f), v]),
);
const A = byRel(sa);
const B = byRel(sb);
console.log('## summary (covered/total)');
for (const f of Object.keys(A)) {
for (const m of ['statements', 'branches', 'functions', 'lines']) {
const x = `${A[f][m].covered}/${A[f][m].total}`;
const y = `${B[f][m].covered}/${B[f][m].total}`;
console.log(`${x === y ? '=' : '≠'} ${f.padEnd(22)} ${m.padEnd(10)} ${x} -> ${y}`);
}
}
// 2. 未カバー箇所(statement 開始行 / branch / function)
const uncovered = (dir) => {
const out = {};
for (const [f, d] of Object.entries(read(dir, 'coverage-final.json'))) {
const lines = {};
for (const [id, c] of Object.entries(d.s)) {
const l = d.statementMap[id].start.line;
lines[l] = Math.max(lines[l] ?? 0, c > 0 ? 1 : 0);
}
const branches = [];
for (const [id, counts] of Object.entries(d.b)) {
counts.forEach((c, i) => {
if (c === 0) {
const loc = d.branchMap[id].locations[i] ?? d.branchMap[id].loc;
branches.push(`${loc.start.line}:${loc.start.column}`);
}
});
}
out[rel(f)] = {
statementLines: Object.keys(lines).filter((l) => lines[l] === 0).join(','),
branches: branches.join(','),
functions: Object.entries(d.f)
.filter(([, c]) => c === 0)
.map(([id]) => `${d.fnMap[id].loc.start.line}`)
.join(','),
};
}
return out;
};
const ua = uncovered(before);
const ub = uncovered(after);
console.log('\n## uncovered locations');
let same = true;
for (const f of Object.keys(ua)) {
for (const k of ['statementLines', 'branches', 'functions']) {
const eq = ua[f][k] === ub[f]?.[k];
if (!eq) same = false;
console.log(`${eq ? '=' : '≠'} ${f.padEnd(22)} ${k}${eq ? '' : `\n before: ${ua[f][k]}\n after : ${ub[f]?.[k]}`}`);
}
}
console.log(same ? '\nuncovered locations: IDENTICAL' : '\nuncovered locations: DIFFERENT');実行結果
## summary (covered/total)
≠ total statements 188/236 -> 193/241
= total branches 26/68 -> 26/68
= total functions 47/60 -> 47/60
≠ total lines 178/225 -> 192/239
= src/chatworkClient.ts statements 16/23 -> 16/23
= src/chatworkClient.ts branches 4/6 -> 4/6
= src/chatworkClient.ts functions 3/7 -> 3/7
= src/chatworkClient.ts lines 16/23 -> 16/23
= src/global.d.ts statements 0/0 -> 0/0
= src/global.d.ts branches 0/0 -> 0/0
= src/global.d.ts functions 0/0 -> 0/0
= src/global.d.ts lines 0/0 -> 0/0
= src/http.ts statements 46/50 -> 46/50
= src/http.ts branches 16/21 -> 16/21
= src/http.ts functions 9/10 -> 9/10
= src/http.ts lines 46/50 -> 46/50
= src/index.ts statements 0/37 -> 0/37
= src/index.ts branches 0/35 -> 0/35
= src/index.ts functions 0/8 -> 0/8
= src/index.ts lines 0/36 -> 0/36
= src/schema.ts statements 26/26 -> 26/26
= src/schema.ts branches 0/0 -> 0/0
= src/schema.ts functions 0/0 -> 0/0
= src/schema.ts lines 26/26 -> 26/26
= src/server.ts statements 33/33 -> 33/33
= src/server.ts branches 0/0 -> 0/0
= src/server.ts functions 1/1 -> 1/1
= src/server.ts lines 33/33 -> 33/33
≠ src/toolCallbacks.ts statements 67/67 -> 72/72
= src/toolCallbacks.ts branches 6/6 -> 6/6
= src/toolCallbacks.ts functions 34/34 -> 34/34
≠ src/toolCallbacks.ts lines 57/57 -> 71/71
## uncovered locations
= src/chatworkClient.ts statementLines
= src/chatworkClient.ts branches
= src/chatworkClient.ts functions
= src/global.d.ts statementLines
= src/global.d.ts branches
= src/global.d.ts functions
= src/http.ts statementLines
= src/http.ts branches
= src/http.ts functions
= src/index.ts statementLines
= src/index.ts branches
= src/index.ts functions
= src/schema.ts statementLines
= src/schema.ts branches
= src/schema.ts functions
= src/server.ts statementLines
= src/server.ts branches
= src/server.ts functions
= src/toolCallbacks.ts statementLines
= src/toolCallbacks.ts branches
= src/toolCallbacks.ts functions
uncovered locations: IDENTICAL
🤖 Generated with Claude Code
kb-mikihirosuda
approved these changes
Sep 25, 2026
kb-mikihirosuda
left a comment
Collaborator
There was a problem hiding this comment.
カバレッジの計測結果の変化は誤差の範囲内であり、またプロダクション環境にも影響を及ぼさないので approve
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.
Bumps vitest from 4.1.5 to 5.0.1.
Release notes
Sourced from vitest's releases.
... (truncated)
Commits
03630a5chore: release v5.0.1 (#11275)a47d790fix(fakeTimers): forcequeueMicrotaskandnextTickintoNotFake(#11261)2ce29d5fix: warn when deprecateddeps.optimizer.webis used (#11214)ccd6d05docs: fix typecheck exclude default in documentation (#11223)91ab158fix(doctor): measure vm pools for custom environments (#11212)23dda73fix: share the server on self-referencingextends(#11034)498fbe9fix: resolve ResolvedConfig exactOptionalPropertyTypes errors (#11175)115c3f6fix: correct typos in error message and comments (#11187)7361465fix: keep metadata file when clearing the cache (#11199)972e24bfix(browser): avoid double quotes inconfig.define(#11198)