Skip to content

chore(deps): update: bump vitest from 4.1.5 to 5.0.1 - #235

Merged
kb-mikihirosuda merged 2 commits into
mainfrom
dependabot/npm_and_yarn/vitest-5.0.1
Sep 25, 2026
Merged

kb-mikihirosuda merged 2 commits into
mainfrom
dependabot/npm_and_yarn/vitest-5.0.1

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Bumps vitest from 4.1.5 to 5.0.1.

Release notes

Sourced from vitest's releases.

v5.0.1

   🚀 Features

   🐞 Bug Fixes

    View changes on GitHub

v5.0.0

Vitest 5 is officially out! This release focuses on performance and brings a lot of new features while fixing long-standing bugs. See our blog post for the official announcement.

   🚨 Breaking Changes

... (truncated)

Commits
  • 03630a5 chore: release v5.0.1 (#11275)
  • a47d790 fix(fakeTimers): force queueMicrotask and nextTick in toNotFake (#11261)
  • 2ce29d5 fix: warn when deprecated deps.optimizer.web is used (#11214)
  • ccd6d05 docs: fix typecheck exclude default in documentation (#11223)
  • 91ab158 fix(doctor): measure vm pools for custom environments (#11212)
  • 23dda73 fix: share the server on self-referencing extends (#11034)
  • 498fbe9 fix: resolve ResolvedConfig exactOptionalPropertyTypes errors (#11175)
  • 115c3f6 fix: correct typos in error message and comments (#11187)
  • 7361465 fix: keep metadata file when clearing the cache (#11199)
  • 972e24b fix(browser): avoid double quotes in config.define (#11198)
  • Additional commits viewable in compare view

@kb-mikihirosuda

Copy link
Copy Markdown
Collaborator

@dependabot rebase

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
dependabot Bot force-pushed the dependabot/npm_and_yarn/vitest-5.0.1 branch from 9292c0d to 0a17911 Compare September 25, 2026 07:26
@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>
@kb-mikihirosuda

Copy link
Copy Markdown
Collaborator

@vitest/coverage-v8 4.1.5 → 5.0.1 でカバレッジ計測がどう変わるか確認しました

結論

  • 未カバー箇所(statement の開始行 / branch / function)は全ファイルで完全一致しました。テストが通っている範囲・通っていない範囲の判定は変わっていません。
  • ただし src/toolCallbacks.ts だけ statements / lines の分母が増えています(main でも PR でも 100% カバー)。そのため全体の数値が少し上がり、Statements と Lines は閾値の 80% を跨ぎます。
全体 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: 引数なしの関数(例: getMe 72 行目)では本体側の statement が記録されていませんでした。引数が複数行にわたる関数(例: deleteOrLeaveRoom 178–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/coverage

compare-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 kb-mikihirosuda left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

カバレッジの計測結果の変化は誤差の範囲内であり、またプロダクション環境にも影響を及ぼさないので approve

@kb-mikihirosuda
kb-mikihirosuda merged commit 211efa9 into main Sep 25, 2026
3 checks passed
@kb-mikihirosuda
kb-mikihirosuda deleted the dependabot/npm_and_yarn/vitest-5.0.1 branch September 25, 2026 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant