Skip to content

Commit 8c078b5

Browse files
authored
chore(deps): upgrade vitest from v3 to v4 (#642)
## Summary - Upgrade vitest from ^3.2.4 to ^4.0.17 - Upgrade @vitest/coverage-v8 from ^3.2.4 to ^4.0.17 - Add `--reporter=dot` to vitest run commands for cleaner output - Add conditional vitest@3 downgrade for Node 16/18 in CI (vitest@4 requires Node 20+) ## Test plan - [x] Local tests pass with vitest@4 on Node 20+ - [x] Coverage report generates correctly - [x] Benchmarks run successfully - [x] CI passes for Node 20, 22, 24 (vitest@4) - [x] CI passes for Node 18 (vitest@3 downgrade) - [x] CI passes for Node 16 (vitest@3 downgrade) 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Updated vitest and coverage tooling to v4.0.17. * Enhanced test output formatting with dot reporter. * Improved CI workflows for Node.js version compatibility. * Refined build configuration structure. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent fd2c1a5 commit 8c078b5

6 files changed

Lines changed: 137 additions & 341 deletions

File tree

.github/workflows/nodejs-16.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
with:
2121
node-version: 16
2222
- run: npm install
23+
- name: Downgrade vitest for Node 16
24+
run: npm install vitest@3 @vitest/coverage-v8@3 --save-dev --ignore-scripts
2325
- run: npm run ci:node16
2426
- run: npm run prepublishOnly
2527
- run: node -v

.github/workflows/nodejs.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ jobs:
7777
- name: Install dependencies
7878
run: pnpm install --frozen-lockfile
7979

80+
- name: Downgrade vitest for Node 18
81+
if: matrix.node == '18'
82+
run: pnpm add vitest@3 @vitest/coverage-v8@3 --save-dev --ignore-scripts
83+
8084
- name: Run tests
8185
run: pnpm run ci
8286

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@
6161
"test-tsc:cjs": "cd test/fixtures/ts && rm -rf node_modules && npm link ../../.. && npm run build",
6262
"test-tsc:cjs:es2021": "cd test/fixtures/ts-cjs-es2021 && rm -rf node_modules && npm link ../../.. && npm run build",
6363
"test-tsc:esm": "cd test/fixtures/ts-esm && rm -rf node_modules && npm link ../../.. && npm run build",
64-
"test": "npm run lint -- --fix && vitest run",
64+
"test": "npm run lint -- --fix && vitest run --reporter=dot",
6565
"bench": "vitest bench",
66-
"test-keepalive": "cross-env TEST_KEEPALIVE_COUNT=50 vitest run --test-timeout 180000 keep-alive-header.test.ts",
66+
"test-keepalive": "cross-env TEST_KEEPALIVE_COUNT=50 vitest run --reporter=dot --test-timeout 180000 keep-alive-header.test.ts",
6767
"test-node16": "node examples/httpclient.cjs && node examples/search_github.cjs && node examples/timing.cjs",
68-
"cov": "vitest run --coverage",
68+
"cov": "vitest run --reporter=dot --coverage",
6969
"ci": "npm run cov && npm run prepublishOnly && npm pack && attw --pack",
70-
"ci:node16": "cross-env NODE_OPTIONS=\"--require ./test/patch-for-node16-18.cjs\" vitest run && npm run prepublishOnly && npm pack && attw --pack",
70+
"ci:node16": "cross-env NODE_OPTIONS=\"--require ./test/patch-for-node16-18.cjs\" vitest run --reporter=dot && npm run prepublishOnly && npm pack && attw --pack",
7171
"clean": "rm -rf dist && tsc -b --clean",
7272
"prepublishOnly": "npm run build",
7373
"prepare": "husky"
@@ -95,7 +95,7 @@
9595
"@types/tar-stream": "^2.2.3",
9696
"@typescript/native-preview": "7.0.0-dev.20260114.1",
9797
"@ungap/structured-clone": "^1.3.0",
98-
"@vitest/coverage-v8": "^3.2.4",
98+
"@vitest/coverage-v8": "^4.0.17",
9999
"busboy": "^1.6.0",
100100
"cross-env": "^10.1.0",
101101
"husky": "^9.1.7",
@@ -111,7 +111,7 @@
111111
"tshy": "^3.1.0",
112112
"tshy-after": "^1.4.1",
113113
"typescript": "^5.9.3",
114-
"vitest": "^3.2.4"
114+
"vitest": "^4.0.17"
115115
},
116116
"lint-staged": {
117117
"*": [

0 commit comments

Comments
 (0)