-
Notifications
You must be signed in to change notification settings - Fork 1
Bump the vitest group with 2 updates #766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
48b9635 to
1649022
Compare
|
Note
|
| Cohort / File(s) | Summary |
|---|---|
DevDependency updatespackages/app/api-common/package.json, packages/app/api-contracts/package.json, packages/app/auth/package.json, packages/app/aws-config/package.json, packages/app/backend-http-client/package.json, packages/app/background-jobs-common/package.json, packages/app/context-fastify-plugins/package.json, packages/app/error-utils/package.json, packages/app/fastify-api-contracts/package.json, packages/app/fastify-bullboard-plugin/package.json, packages/app/frontend-http-client/package.json, packages/app/healthcheck-utils/package.json, packages/app/id-utils/package.json, packages/app/metrics-utils/package.json, packages/app/non-translatable-markup/package.json, packages/app/prisma-utils/package.json, packages/app/script-utils/package.json, packages/app/supported-languages/package.json, packages/app/universal-testing-utils/package.json, packages/app/universal-ts-utils/package.json, packages/app/websockets-common/package.json, packages/app/zod-extras/package.json |
Updated devDependencies: vitest and/or @vitest/coverage-v8 bumped from 3.x → ^4.0.14 in each manifest. No other dependency, script, source code, or public API changes detected. |
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~10 minutes
- Homogeneous manifest edits across many packages.
- Pay attention to:
- Test suites for Vitest v4 breaking changes (API, hooks, mocking).
- Coverage reporter and CI integration for
@vitest/coverage-v8v4. - Any package-level Vitest configuration files or custom test scripts that might need adjustment.
Pre-merge checks and finishing touches
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Description check | The PR description lacks the required structure from the template. It is missing the 'Changes' section describing what was modified, and the checklist is not completed or present. | Add a 'Changes' section summarizing the modifications, and complete the checklist by selecting appropriate labels and confirming documentation and testing updates. |
✅ Passed checks (2 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | ✅ Passed | The title clearly describes the main change: bumping vitest and related packages to newer versions across multiple package manifests. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
✨ Finishing touches
- 📝 Generate docstrings
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Post copyable unit tests in a comment
- Commit unit tests in branch
dependabot/npm_and_yarn/vitest-0717ef0daf
Comment @coderabbitai help to get the list of available commands and usage tips.
18ea32f to
ed95d14
Compare
2941c7e to
6b5eb7e
Compare
|
Dependabot tried to update this pull request, but something went wrong. We're looking into it, but in the meantime you can retry the update by commenting |
0f73a9e to
4f6dd24
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/app/api-common/package.json (1)
32-32: Confirm Zod 4.x breaking changes are handled in validation schemas.The devDependency for
zodis bumped to ^4.0.17 (line 42), which includes breaking changes like unified error customization and stricter number/string validation. The peerDependency constraint on line 32 (>=3.25.76) is compatible but should be clarified: either tighten to>=4.0.17if this package requires Zod 4 features, or verify that the exported APIs remain compatible with Zod 3.x consumers.Per the provided library documentation, Zod 4 changes include:
- Stricter number validation (no infinite values, only safe integers for
.int())- Breaking
.default()behavior (now short-circuits onundefined)- Unified error customization via
errorparameterEnsure any validation schemas exported by this package are tested against both Zod 3 and 4 semantics, or explicitly require Zod 4.
Consider tightening the peerDependency if Zod 4 features are used:
"peerDependencies": { "zod": "^4.0.0" }Or maintain backward compatibility by verifying schemas work with both Zod 3 and 4 via testing.
Also applies to: 42-42
📜 Review details
Configuration used: Repository: lokalise/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (22)
packages/app/api-common/package.json(1 hunks)packages/app/api-contracts/package.json(1 hunks)packages/app/auth/package.json(1 hunks)packages/app/aws-config/package.json(1 hunks)packages/app/backend-http-client/package.json(1 hunks)packages/app/background-jobs-common/package.json(1 hunks)packages/app/context-fastify-plugins/package.json(1 hunks)packages/app/error-utils/package.json(1 hunks)packages/app/fastify-api-contracts/package.json(1 hunks)packages/app/fastify-bullboard-plugin/package.json(2 hunks)packages/app/frontend-http-client/package.json(1 hunks)packages/app/healthcheck-utils/package.json(1 hunks)packages/app/id-utils/package.json(1 hunks)packages/app/metrics-utils/package.json(1 hunks)packages/app/non-translatable-markup/package.json(1 hunks)packages/app/prisma-utils/package.json(1 hunks)packages/app/script-utils/package.json(1 hunks)packages/app/supported-languages/package.json(1 hunks)packages/app/universal-testing-utils/package.json(1 hunks)packages/app/universal-ts-utils/package.json(1 hunks)packages/app/websockets-common/package.json(1 hunks)packages/app/zod-extras/package.json(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (14)
- packages/app/id-utils/package.json
- packages/app/healthcheck-utils/package.json
- packages/app/context-fastify-plugins/package.json
- packages/app/universal-ts-utils/package.json
- packages/app/aws-config/package.json
- packages/app/metrics-utils/package.json
- packages/app/api-contracts/package.json
- packages/app/prisma-utils/package.json
- packages/app/non-translatable-markup/package.json
- packages/app/websockets-common/package.json
- packages/app/auth/package.json
- packages/app/error-utils/package.json
- packages/app/zod-extras/package.json
- packages/app/frontend-http-client/package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: build (24.x)
- GitHub Check: build (20.x)
🔇 Additional comments (7)
packages/app/backend-http-client/package.json (1)
56-56: Configuration is compatible with Vitest 4.0.10; manual test execution verification required.The
vitest.config.tsappears compatible with v4.0.10:
- No deprecated config options used (poolMatchGlobs, environmentMatchGlobs, etc. not present)
- Test files use correct 2-argument syntax for
describe()andit()- Coverage configuration is standard and valid
However, verify these items manually:
- Run the test suite to confirm all tests pass with Vitest 4.0.10
- Review coverage reports; the new AST-based remapper may produce different output
- If tests use automocks: verify behavior with
restoreMocks: true, as v4.0.0 changed howvi.restoreAllMocks()works (no longer resets automocks)packages/app/api-common/package.json (1)
38-38: api-common has been properly migrated to Vitest 4.0.10; no compatibility issues found.Verification confirms that
packages/app/api-common/has successfully adopted Vitest 4.0.10:
vitest.config.tsuses v4-compatible configuration:pool: 'threads',globals: true, andcoverage.provider: 'v8'- Test files import modern v4 APIs:
describe,expect,itfrom vitest- No deprecated v3 patterns detected
- Coverage configuration properly configured with v8 provider
The package.json changes at lines 38 and 41 are correct and complete.
packages/app/background-jobs-common/package.json (1)
58-58: Vitest 4.x configuration is properly migrated.The
vitest.config.tsis correctly configured for v4, using the modern API (defineConfigfrom 'vitest/config') and no deprecated options. The configuration includes:
- ✓
pool: 'threads'(v4 syntax)- ✓
poolOptions.threadsconfiguration (v4 feature)- ✓
coverage.provider: 'v8'(correctly set)- ✓ No deprecated options (poolMatchGlobs, environmentMatchGlobs, minWorkers all absent)
However, note a version discrepancy: the PR objectives mention bumping to 4.0.3, but the actual versions are ^4.0.10 for both
vitestand@vitest/coverage-v8. Confirm this is intentional (patch version difference is acceptable within the caret range).To ensure full compatibility, verify that test files and
./test/setup.tsdo not use any deprecated Vitest v3 APIs before merging. Run the test suite locally to confirm no breaking changes affect your tests.packages/app/script-utils/package.json (1)
40-40: Code inspection confirms v4 compatibility; runtime test verification still needed.Based on code analysis:
- vitest.config.ts is v4-compatible (correct pool syntax, no removed options)
- Test files use proper v4 API signatures (2-arg describe/it/afterEach)
- No deprecated patterns detected (poolMatchGlobs, environmentMatchGlobs, minWorkers, ignoreEmptyLines)
- Coverage configuration is v4-compliant (v8 provider, no ignoreEmptyLines)
- Pattern consistent across multiple packages in this migration
However, actual test execution must be verified before merge to confirm runtime compatibility with v4.0.10.
packages/app/supported-languages/package.json (1)
42-42: Tests must pass with Vitest 4—verify coverage thresholds remain achievable.The vitest configuration is compatible with Vitest 4: it uses no deprecated options like
poolMatchGlobs,minWorkers, or the removed'basic'reporter. However, Vitest 4 changes V8 coverage remapping (new AST-based) and coverage reports may differ. Since this package enforces strict 100% coverage thresholds across all metrics (lines, functions, branches, statements), coverage calculations may change slightly in v4 and potentially cause test failures.Action: Run
npm run test:cito confirm the test suite passes with the new versions and coverage thresholds are still met.packages/app/fastify-bullboard-plugin/package.json (1)
45-45: Verify test suite execution with vitest 4.0.10 to confirm compatibility.The
vitest.config.tsfile is syntactically compatible with vitest 4.0.0 and contains no deprecated configuration keys. However, two vitest 4.0 breaking changes pose potential risks:
Mocking behavior changes: vi.restoreAllMocks no longer resets automocks (only restores spies created with vi.spyOn); mock.settledResults populated immediately with an "incomplete" result on invocation. The config enables
restoreMocks: true, which may interact differently with the test suite.Coverage remapping: V8 coverage remapping is now AST‑aware with coverage.ignoreEmptyLines and coverage.experimentalAstAwareRemapping now default. This may affect coverage percentages relative to thresholds (lines: 78, functions: 75, branches: 86, statements: 78).
Action required: Run the test suite locally with the new versions to verify:
- All three test files (
basicAuth.spec.ts,bullBoard.spec.ts,errorReporterPlugin.spec.ts) pass- Coverage thresholds are still met
- No test failures due to mocking behavior changes
packages/app/fastify-api-contracts/package.json (1)
56-56: Verify compatibility with Vitest v4 breaking changes.The bump from Vitest v3 to v4 introduces breaking changes. Ensure that:
- Test files and syntax are compatible with Vitest v4
- The
vitest.config.ts(if present) is updated for v4 configuration API changes- The
@vitest/coverage-v8tool integration still works as expected- All existing tests pass without modification
Please run the following commands to verify test compatibility:
Additionally, confirm that there are no deprecation warnings or configuration errors when running the test suite. If you encounter breaking changes, please refer to the Vitest v4 migration guide for required updates.
Also applies to: 60-60
6edb763 to
8be5db0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (2)
packages/app/frontend-http-client/package.json (1)
53-53: Vitest v4 compatibility blockers apply to this package as well.This package's vitest upgrade is subject to the same critical compatibility blockers flagged in the prior review comment on
packages/app/universal-testing-utils/package.json. The resolution status of those blockers must be confirmed before this package's update can be merged.Also applies to: 59-59
packages/app/error-utils/package.json (1)
42-42: Vitest v4 compatibility blockers apply to this package as well.This package's vitest upgrade is subject to the same critical compatibility blockers flagged in the prior review comment on
packages/app/universal-testing-utils/package.json. The resolution status of those blockers must be confirmed before this package's update can be merged.Also applies to: 45-45
📜 Review details
Configuration used: Repository: lokalise/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (22)
packages/app/api-common/package.json(1 hunks)packages/app/api-contracts/package.json(1 hunks)packages/app/auth/package.json(1 hunks)packages/app/aws-config/package.json(1 hunks)packages/app/backend-http-client/package.json(1 hunks)packages/app/background-jobs-common/package.json(1 hunks)packages/app/context-fastify-plugins/package.json(1 hunks)packages/app/error-utils/package.json(1 hunks)packages/app/fastify-api-contracts/package.json(1 hunks)packages/app/fastify-bullboard-plugin/package.json(2 hunks)packages/app/frontend-http-client/package.json(1 hunks)packages/app/healthcheck-utils/package.json(1 hunks)packages/app/id-utils/package.json(1 hunks)packages/app/metrics-utils/package.json(1 hunks)packages/app/non-translatable-markup/package.json(1 hunks)packages/app/prisma-utils/package.json(1 hunks)packages/app/script-utils/package.json(1 hunks)packages/app/supported-languages/package.json(1 hunks)packages/app/universal-testing-utils/package.json(1 hunks)packages/app/universal-ts-utils/package.json(1 hunks)packages/app/websockets-common/package.json(1 hunks)packages/app/zod-extras/package.json(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (11)
- packages/app/non-translatable-markup/package.json
- packages/app/universal-ts-utils/package.json
- packages/app/auth/package.json
- packages/app/healthcheck-utils/package.json
- packages/app/aws-config/package.json
- packages/app/background-jobs-common/package.json
- packages/app/fastify-api-contracts/package.json
- packages/app/prisma-utils/package.json
- packages/app/api-contracts/package.json
- packages/app/api-common/package.json
- packages/app/websockets-common/package.json
🔇 Additional comments (8)
packages/app/id-utils/package.json (1)
41-41: I'll verify the vitest 4.0 compatibility concern by checking for configuration files and understanding the breaking changes.
<function_calls>
#!/bin/bashSearch for vitest or vite config files in packages/app/id-utils
find packages/app/id-utils -maxdepth 2 ( -name "vitest.config." -o -name "vite.config." ) 2>/dev/null
Also check the package.json structure
echo "=== Package.json content ==="
wc -l packages/app/id-utils/package.json
</function_calls>Now let me search for test files and examine the package.json more closely:
<function_calls>
#!/bin/bashCheck for test files in the package
find packages/app/id-utils -type f ( -name ".test." -o -name ".spec." ) 2>/dev/null | head -20
Extract the relevant lines from package.json
echo "=== Vitest-related dependencies ==="
sed -n '41,44p' packages/app/id-utils/package.jsonCheck if there's a vitest configuration in root
find . -maxdepth 2 -name "vitest.config." -o -name "vite.config." 2>/dev/null | grep -v node_modules
</function_calls>Let me also check the broader context of the package.json and look for vitest breaking changes:
<function_calls>
#!/bin/bashCheck full package.json to understand test setup
echo "=== Full package.json ==="
cat packages/app/id-utils/package.json
</function_calls>Now let me search for information about vitest 4.0 breaking changes:
<function_calls>
vitest 4.0.0 breaking changes migration guide
</function_calls><function_calls>
vitest 4.0 coverage-v8 compatibility issues
</function_calls>packages/app/backend-http-client/package.json (1)
56-56: The snapshot update script remains compatible with vitest v4.0.Web documentation confirms that vitest v4.0 still fully supports the
-u/--updateCLI flag for snapshot updates. The major version bump does not introduce breaking changes to snapshot functionality or the CLI interface used by thetest:update-snapshotsscript. This is a routine dependency upgrade with no action required.packages/app/context-fastify-plugins/package.json (1)
61-61: vitest 4.0 compatibility is confirmed; no action required.The vitest.config.ts already follows v4 best practices with
coverage.includeproperly configured and no usage of deprecatedcoverage.allorcoverage.extensionsoptions. Thenpm run test -- --coverageinvocation pattern is fully supported in vitest 4.0.14, and the coverage provider v8 functions correctly with the current setup.packages/app/script-utils/package.json (1)
40-40: Based on my verification, I can now provide the rewritten review comment. The original concern about a shared vite config is unfounded (the package has its ownvitest.config.tsand no shared vite config exists), but there are real vitest 4.0 compatibility considerations.Verify vitest 4.0 test and coverage behavior changes after upgrade.
The config is compatible with vitest v4.0.14 syntax, but vitest 4.0 introduces breaking changes that require validation:
- V8 coverage provider now uses AST-based remapping; expect different coverage results
- Mock naming:
vi.fn()no longer defaults to "spy" name, which may affect snapshots- restoreMocks behavior: Interaction with vi.restoreAllMocks changed in v4.0
Run tests locally and in CI to validate snapshot diffs and coverage metrics remain acceptable.
Also applies to: 43-43
packages/app/supported-languages/package.json (1)
42-42: Based on my verification, I can now provide the rewritten review comment.Verify vitest 4.0 coverage provider behavior change—AST-based remapping may affect coverage thresholds.
vitest v3→v4 includes a breaking change: the v8 coverage provider now uses AST-based remapping instead of line-based, which can produce different coverage results. This package enforces 100% coverage thresholds (lines, functions, branches, statements). Confirm that test coverage still meets these strict thresholds under v4's new remapping behavior. The config is otherwise v4-compatible (uses modern
pool: 'threads'syntax, no deprecated APIs detected in test files).packages/app/metrics-utils/package.json (1)
40-40: Based on my research, the original review comment's concern about vitest 4.0 compatibility is valid and justified. Vitest 4.0 introduces significant breaking changes that require configuration and code updates.Verified breaking changes in vitest 4.0 that apply to this package:
- Configuration migrations required: poolMatchGlobs/environmentMatchGlobs removed, deps config moved under server.deps, minWorkers removed, 'basic' reporter removed
- Coverage changes: V8 coverage remapping logic changed (AST-based), coverage.ignoreEmptyLines option removed—expect different coverage results
- Test API changes: Test options syntax changed from 3rd argument to 2nd argument form (e.g.,
test('name', { retry: 2 }, fn))- Mock API changes: vi.fn() mock names, vi.restoreAllMocks behavior, and spy semantics altered
- @vitest/coverage-v8 pairing: Must maintain matching major versions (4.x with 4.x vitest)
However, the generic concern cannot be fully resolved without verifying: (1) whether a vitest.config.* file exists and contains deprecated options, (2) whether test code uses the old test options syntax, and (3) whether custom reporters exist using removed hooks.
Verify vitest 4.0 compatibility after major version upgrade.
Major version bump of vitest/coverage-v8 to 4.0.14 introduces significant breaking changes. Confirm:
- vitest.config file is updated (removed poolMatchGlobs/environmentMatchGlobs, moved deps config to server.deps, updated reporter config)
- Test code uses new test options syntax:
test('name', { option }, fn)nottest('name', fn, { option })- Coverage baseline updated for new V8 remapper behavior
- Custom reporters (if any) migrated to new Reporters API
packages/app/zod-extras/package.json (1)
50-50: No compatibility issues detected. The zod-extras package is compatible with vitest 4.0.14.The vitest configuration uses only standard, non-deprecated APIs (
globals,environment,restoreMocks,coverage). Test files follow the correct v4.0 API patterns (two-argumentit()calls). No removed config options (poolMatchGlobs,environmentMatchGlobs,minWorkers, etc.) are in use. The v4.0 V8 coverage provider changes may affect coverage report values, but the 100% thresholds remain valid and will be validated during test execution.packages/app/universal-testing-utils/package.json (1)
58-58: Verify critical vitest v4 compatibility blockers have been resolved before merging.A prior review flagged critical blockers for this major version bump:
- Version mismatch in monorepo: Root workspace vitest remained at 3.2.4 while this package was updated to 4.0.10, causing peer dependency resolution failures and workspace package resolution issues.
- Coverage provider crash: The v4 upgrade introduced a fatal error in V8CoverageProvider (
TypeError: this.getUntestedFiles is not a function), completely breaking coverage reporting innpm run test:ci.- Test execution blocked: Test suites could not run due to missing workspace package resolutions (
@lokalise/frontend-http-client,@lokalise/api-contracts).The current PR updates this package to ^4.0.14 but doesn't show whether the root workspace package.json has also been updated to vitest v4 to resolve the version mismatch.
Before merging, confirm:
- Root workspace
package.json(at the repository root) has been updated to vitest ^4.0.14npm installorpnpm installsucceeds without ERESOLVE peer dependency warningsnpm run testexecutes successfully across all test suites in this packagenpm run test:ci(with coverage) runs without the V8CoverageProvider fatal error- All workspace packages resolve correctly (no missing peer dependencies)
If these issues persist, the PR cannot merge until the root workspace is aligned and vitest v4 is fully compatible across the monorepo.
Also applies to: 63-63
| "@lokalise/biome-config": "^3.1.0", | ||
| "@types/node": "^24.0.12", | ||
| "@vitest/coverage-v8": "^3.2.4", | ||
| "@vitest/coverage-v8": "^4.0.14", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Script executed:
#!/bin/bash
# Check for vitest/vite config files in the fastify-bullboard-plugin package
echo "=== Searching for vitest/vite config files ==="
find packages/app/fastify-bullboard-plugin -maxdepth 2 \( -name "vitest.config.*" -o -name "vite.config.*" \)
# Also check if there are any config files at root level that might apply
echo ""
echo "=== Checking root level config files ==="
find . -maxdepth 1 \( -name "vitest.config.*" -o -name "vite.config.*" \) 2>/dev/null
# Show the full package.json to see test scripts and any vitest config
echo ""
echo "=== Full package.json content ==="
cat -n packages/app/fastify-bullboard-plugin/package.jsonRepository: lokalise/shared-ts-libs
<shell_result>
Repository: lokalise/shared-ts-libs
Exit code: 0
stdout:
=== Searching for vitest/vite config files ===
packages/app/fastify-bullboard-plugin/vitest.config.ts
=== Checking root level config files ===
=== Full package.json content ===
1 {
2 "name": "@lokalise/fastify-bullboard-plugin",
3 "version": "2.1.0",
4 "type": "module",
5 "files": [
6 "dist",
7 "README.md",
8 "LICENSE.md"
9 ],
10 "engines": {
11 "node": ">=20.13.0"
12 },
13 "license": "Apache-2.0",
14 "main": "./dist/index.js",
15 "module": "./dist/index.js",
16 "types": "./dist/index.d.ts",
17 "exports": {
18 ".": "./dist/index.js",
19 "./package.json": "./package.json"
20 },
21 "scripts": {
22 "build": "rimraf dist && tsc --project tsconfig.build.json",
23 "lint": "biome check . && tsc",
24 "lint:fix": "biome check --write",
25 "test": "vitest run",
26 "test:ci": "vitest run --coverage",
27 "prepublishOnly": "npm run build",
28 "package-version": "echo $npm_package_version",
29 "postversion": "biome check --write package.json"
30 },
31 "dependencies": {
32 "@bull-board/api": "^6.14.0",
33 "@bull-board/fastify": "^6.14.0",
34 "@fastify/auth": "^5.0.3",
35 "@fastify/basic-auth": "^6.2.0"
36 },
37 "peerDependencies": {
38 "@lokalise/background-jobs-common": ">=12.6.0"
39 },
40 "devDependencies": {
41 "@biomejs/biome": "^2.3.7",
42 "@lokalise/background-jobs-common": "^14.0.0",
43 "@lokalise/biome-config": "^3.1.0",
44 "@types/node": "^24.0.12",
45 "@vitest/coverage-v8": "^4.0.14",
46 "@fastify/awilix": "^8.0.0",
47 "@fastify/schedule": "^6.0.0",
48 "@lokalise/fastify-extras": "^30.0.0",
49 "@lokalise/node-core": "^14.1.0",
50 "awilix": "^12.0.5",
51 "awilix-manager": "^6.1.0",
52 "bullmq": "^5.56.8",
53 "cross-env": "^10.0.0",
54 "fastify": "^5.4.0",
55 "fastify-graceful-shutdown": "^4.0.1",
56 "fastify-metrics": "^12.1.0",
57 "fastify-plugin": "^5.0.1",
58 "ioredis": "^5.6.1",
59 "pino": "^10.1.0",
60 "toad-scheduler": "^3.0.1",
61 "ts-deepmerge": "^7.0.3",
62 "pino-pretty": "^13.0.0",
63 "typescript": "5.9.3",
64 "vitest": "^4.0.14"
65 },
66 "keywords": [
67 "fastify",
68 "bullboard",
69 "bull",
70 "dashboard",
71 "plugin"
72 ],
73 "homepage": "https://github.com/lokalise/shared-ts-libs",
74 "repository": {
75 "type": "git",
76 "url": "git://github.com/lokalise/shared-ts-libs.git"
77 },
78 "publishConfig": {
79 "access": "public"
80 }
81 }
</shell_result>
Script executed:
#!/bin/bash
echo "=== vitest.config.ts content ==="
cat -n packages/app/fastify-bullboard-plugin/vitest.config.tsRepository: lokalise/shared-ts-libs
<shell_result>
Repository: lokalise/shared-ts-libs
Exit code: 0
stdout:
=== vitest.config.ts content ===
1 import { defineConfig } from 'vitest/config'
2
3 // biome-ignore lint/style/noDefaultExport: vite expects default export
4 export default defineConfig({
5 test: {
6 globals: true,
7 watch: false,
8 restoreMocks: true,
9 pool: 'threads',
10 coverage: {
11 provider: 'v8',
12 include: ['src/**/*.ts'],
13 exclude: ['src/index.ts'],
14 thresholds: {
15 lines: 78,
16 functions: 75,
17 branches: 86,
18 statements: 78,
19 },
20 },
21 },
22 })
</shell_result>
vitest 4.0 breaking changes migration guide from 3.x
<web_search_result>
Here are the main breaking changes and migration notes when upgrading from Vitest 3.x → 4.0 (concise summary; see linked official migration docs for full details):
- V8 coverage remapping changed — new AST‑based remapping; expect coverage report differences. coverage.ignoreEmptyLines removed; coverage ignore hints updated. [1][2]
- Mocking changes:
- vi.fn().getMockName() now returns vi.fn() (not "spy") by default (may affect snapshots).
- vi.restoreAllMocks no longer resets automocks — it only restores spies created with vi.spyOn (restoreMocks config affected). .mockRestore still clears state.
- vi.spyOn on an already mocked function returns the same mock.
- mock.settledResults populated immediately with 'incomplete' on invocation. [1][2]
- Browser mode / providers:
- Browser provider config now accepts an object (and providers are separate packages). @vitest/browser is no longer required; import paths changed (use vitest/browser). preview is not a default. Update any /// usages. [1][2]
- Removed / renamed config options and deprecated APIs:
- Removed: poolMatchGlobs, environmentMatchGlobs — use projects.
- Removed reporter APIs: onCollected, onSpecsCollected, onPathsCollected, onTaskUpdate, onFinished — use new Reporters API.
- deps.external, deps.inline, deps.fallbackCJS moved to server.deps.*.
- browser.testerScripts → use browser.testerHtmlPath.
- minWorkers removed (only maxWorkers matters).
- reporters: 'basic' removed (equivalent config shown in migration doc).
- Passing test/describe options as 3rd arg removed — use second-arg options object instead (timeout number as last arg still allowed). [1][2][3]
- Deprecated types removed (fixes accidental @types/node pull-in). [1][2]
- V8 vs Istanbul coverage provider behavior and ignore hints changed — update CI/coverage expectations and config where necessary. [1][2]
Primary references / migration docs:
- Vitest blog & announcement (4.0): [1]
- Official Migration Guide / Docs (detailed list & examples): [2][3]
If you want, I can:
- produce a diff-style checklist for your repo (config, imports, mocks, reporters) based on your package.json and vitest config, or
- extract the exact code changes for each item (examples) from the migration doc. Which would you prefer?
</web_search_result>
Script executed:
#!/bin/bash
echo "=== Checking for deprecated vitest 4.0 options in config ==="
grep -n "ignoreEmptyLines\|poolMatchGlobs\|environmentMatchGlobs\|minWorkers" packages/app/fastify-bullboard-plugin/vitest.config.ts || echo "No deprecated options found in config"
echo ""
echo "=== Checking test files for potential mock/spy issues ==="
find packages/app/fastify-bullboard-plugin/src -name "*.test.ts" -o -name "*.spec.ts" | head -5Repository: lokalise/shared-ts-libs
<shell_result>
Repository: lokalise/shared-ts-libs
Exit code: 0
stdout:
=== Checking for deprecated vitest 4.0 options in config ===
No deprecated options found in config
=== Checking test files for potential mock/spy issues ===
packages/app/fastify-bullboard-plugin/src/basicAuth.spec.ts
packages/app/fastify-bullboard-plugin/src/bullBoard.spec.ts
packages/app/fastify-bullboard-plugin/src/errorReporterPlugin.spec.ts
</shell_result>
Based on my verification, I can now provide a rewritten review comment:
Verify restoreMocks behavior and v8 coverage reporting after vitest 4.0 upgrade.
This file upgrades vitest and @vitest/coverage-v8 from 3.2.4 to 4.0.14. While the config file exists and uses no deprecated options, vitest 4.0 introduces breaking changes affecting this package:
-
restoreMocks behavior changed: The
restoreMocks: truesetting (line 8 of vitest.config.ts) now only restores spies created withvi.spyOn, no longer resetting automocks. Review test files to ensure mock behavior remains correct. -
v8 coverage remapping changed: The AST-based remapping in v8 provider may produce different coverage reports than 3.2.4. Monitor CI coverage metrics for unexpected threshold changes.
Also applies to: 64-64
🤖 Prompt for AI Agents
In packages/app/fastify-bullboard-plugin/package.json around line 45, vitest and
@vitest/coverage-v8 were upgraded to 4.0.14 which changes restoreMocks behavior
and v8 coverage remapping; update the test suite and CI accordingly by (1)
auditing tests that rely on automatic mock restoration and either change them to
use vi.spyOn where appropriate or call vi.restoreAllMocks()/vi.resetAllMocks()
in afterEach hooks (or change vitest.config.ts restoreMocks to false and use
explicit restores), and (2) run CI locally to compare coverage reports and, if
thresholds shift due to v8 remapping, adjust coverage thresholds or investigate
source-mapping differences to ensure expected coverage metrics remain correct.
Bumps the vitest group with 2 updates: [@vitest/coverage-v8](https://github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-v8) and [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest). Updates `@vitest/coverage-v8` from 3.2.4 to 4.0.3 - [Release notes](https://github.com/vitest-dev/vitest/releases) - [Commits](https://github.com/vitest-dev/vitest/commits/v4.0.3/packages/coverage-v8) Updates `vitest` from 3.2.4 to 4.0.3 - [Release notes](https://github.com/vitest-dev/vitest/releases) - [Commits](https://github.com/vitest-dev/vitest/commits/v4.0.3/packages/vitest) --- updated-dependencies: - dependency-name: "@vitest/coverage-v8" dependency-version: 4.0.3 dependency-type: direct:development update-type: version-update:semver-major dependency-group: vitest - dependency-name: vitest dependency-version: 4.0.3 dependency-type: direct:development update-type: version-update:semver-major dependency-group: vitest ... Signed-off-by: dependabot[bot] <[email protected]>
8be5db0 to
c25c813
Compare
Bumps the vitest group with 2 updates: @vitest/coverage-v8 and vitest.
Updates
@vitest/coverage-v8from 3.2.4 to 4.0.3Release notes
Sourced from
@vitest/coverage-v8's releases.... (truncated)
Commits
ca1766fchore: release v4.0.307bc56achore: release v4.0.24a28faachore: release v4.0.1da7ce17chore: release v4.0.03e4b6b7chore: release v4.0.0-beta.1935816fefix(coverage): v8 to ignore Vite's generated cjs import helpers (#8718)bc7c20dchore: release v4.0.0-beta.184783137chore: release v4.0.0-beta.176fc7890chore: release v4.0.0-beta.16d677c0bchore: release v4.0.0-beta.15Maintainer changes
This version was pushed to npm by [GitHub Actions](https://www.npmjs.com/~GitHub Actions), a new releaser for
@vitest/coverage-v8since your current version.Updates
vitestfrom 3.2.4 to 4.0.3Release notes
Sourced from vitest's releases.
... (truncated)
Commits
ca1766fchore: release v4.0.3155521afix: preserve reporter options from config when CLI reporters override them (...abc046ffix(init): use correct jsx/tsx extension (#8792)0fb74bdfix(happy-dom): support fetch globals (#8791)07bc56achore: release v4.0.22eedbcefix(spy): reset spies if bothrestoreMocksandmockResetis set in the co...26ce88dfix(pool): assign envs before running tests to keep in sync with process.env ...4a28faachore: release v4.0.13fae73efix(pool): don't teardown the communication channel too soon if something is ...8100063fix: move thegetBuiltinscheck (#8765)Maintainer changes
This version was pushed to npm by [GitHub Actions](https://www.npmjs.com/~GitHub Actions), a new releaser for vitest since your current version.
You can trigger a rebase of this PR by commenting
@dependabot rebase.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot mergewill merge this PR after your CI passes on it@dependabot squash and mergewill squash and merge this PR after your CI passes on it@dependabot cancel mergewill cancel a previously requested merge and block automerging@dependabot reopenwill reopen this PR if it is closed@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore <dependency name> major versionwill close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)@dependabot ignore <dependency name> minor versionwill close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)@dependabot ignore <dependency name>will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)@dependabot unignore <dependency name>will remove all of the ignore conditions of the specified dependency@dependabot unignore <dependency name> <ignore condition>will remove the ignore condition of the specified dependency and ignore conditionsSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.