Skip to content

chore(deps): update vitest to v4 (major)#1530

Merged
Shinigami92 merged 4 commits into
mainfrom
renovate/major-vitest
Dec 11, 2025
Merged

chore(deps): update vitest to v4 (major)#1530
Shinigami92 merged 4 commits into
mainfrom
renovate/major-vitest

Conversation

@renovate

@renovate renovate Bot commented Oct 27, 2025

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
@vitest/coverage-v8 (source) 3.2.4 -> 4.0.6 age confidence
@vitest/ui (source) 3.2.4 -> 4.0.6 age confidence
vitest (source) 3.2.4 -> 4.0.6 age confidence

Release Notes

vitest-dev/vitest (@​vitest/coverage-v8)

v4.0.6

Compare Source

   🐞 Bug Fixes
    View changes on GitHub

v4.0.5

Compare Source

   🐞 Bug Fixes
   🏎 Performance
    View changes on GitHub

v4.0.4

Compare Source

   🐞 Bug Fixes
   🏎 Performance
    View changes on GitHub

v4.0.3

Compare Source

   🐞 Bug Fixes
    View changes on GitHub

v4.0.2

Compare Source

   🐞 Bug Fixes
    View changes on GitHub

v4.0.1

Compare Source

   🐞 Bug Fixes
    View changes on GitHub

v4.0.0

Compare Source

   🚨 Breaking Changes
   🚀 Features
   🐞 Bug Fixes
   🏎 Performance
    View changes on GitHub

Configuration

📅 Schedule: Branch creation - Between 12:00 AM and 03:59 AM, only on Monday ( * 0-3 * * 1 ) (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot added the c: dependencies Pull requests that adds/updates a dependency label Oct 27, 2025
@renovate
renovate Bot requested a review from Shinigami92 as a code owner October 27, 2025 01:30
@renovate renovate Bot added the c: dependencies Pull requests that adds/updates a dependency label Oct 27, 2025
@github-actions

github-actions Bot commented Oct 27, 2025

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 93.2% (🎯 90%)
⬆️ +0.64%
1426 / 1530
🔵 Statements 93.27% (🎯 90%)
⬆️ +0.71%
1443 / 1547
🔵 Functions 94.41% (🎯 90%)
⬇️ -2.25%
321 / 340
🔵 Branches 87.1% (🎯 85%)
⬇️ -4.17%
905 / 1039
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Affected Files
src/db.ts 78.43%
⬇️ -4.75%
75%
⬇️ -13.88%
76.92%
⬇️ -10.58%
78%
⬇️ -5.18%
90-92, 125-137, 173, 177-178
src/migration.ts 79.66%
⬆️ +3.59%
74.07%
⬇️ -12.69%
79.16%
⬆️ +10.41%
79.48%
⬆️ +3.41%
149-151, 174-187, 235-236, 301-336, 402, 429-431, 439, 457-459, 489
src/migrationBuilder.ts 95.49%
⬇️ -0.70%
62.5%
⬇️ -30.83%
90%
⬇️ -10.00%
95.49%
⬇️ -0.70%
833-836, 976-980
src/runner.ts 76.85%
⬇️ -3.54%
60.56%
⬇️ -7.23%
82.6%
⬇️ -17.40%
76.06%
⬇️ -4.33%
209-217, 230, 283, 328, 338-341, 355, 367-369, 393, 434-445, 450-452, 473-474, 484, 486-494
src/sqlMigration.ts 83.33%
⬇️ -2.03%
100%
🟰 ±0%
80%
🟰 ±0%
83.33%
⬇️ -2.03%
57-59
src/operations/sql.ts 100%
🟰 ±0%
50%
⬇️ -50.00%
100%
🟰 ±0%
100%
🟰 ±0%
src/operations/domains/createDomain.ts 100%
🟰 ±0%
95.45%
⬇️ -4.55%
100%
🟰 ±0%
100%
🟰 ±0%
src/operations/functions/createFunction.ts 96.29%
⬆️ +0.77%
92%
⬇️ -2.44%
100%
🟰 ±0%
96.29%
⬆️ +0.77%
71-73
src/operations/grants/shared.ts 100%
⬆️ +4.55%
75%
⬇️ -10.71%
100%
🟰 ±0%
100%
⬆️ +4.55%
src/operations/indexes/shared.ts 100%
⬆️ +12.00%
85%
⬇️ -1.95%
100%
🟰 ±0%
100%
⬆️ +12.00%
src/operations/materializedViews/shared.ts 100%
🟰 ±0%
83.33%
⬇️ -4.17%
100%
🟰 ±0%
100%
🟰 ±0%
src/operations/operators/createOperator.ts 100%
🟰 ±0%
88.88%
⬇️ -11.12%
100%
🟰 ±0%
100%
🟰 ±0%
src/operations/operators/createOperatorClass.ts 100%
🟰 ±0%
75%
⬇️ -8.33%
100%
🟰 ±0%
100%
🟰 ±0%
src/operations/operators/shared.ts 81.81%
⬇️ -3.19%
77.77%
⬆️ +2.77%
100%
🟰 ±0%
81.81%
⬇️ -3.19%
24, 38
src/operations/roles/createRole.ts 100%
🟰 ±0%
92.3%
⬆️ +17.30%
100%
🟰 ±0%
100%
🟰 ±0%
src/operations/roles/shared.ts 100%
⬆️ +1.93%
86.66%
⬆️ +9.74%
100%
🟰 ±0%
100%
⬆️ +1.93%
src/operations/sequences/alterSequence.ts 90%
⬇️ -4.73%
83.33%
⬆️ +3.33%
100%
🟰 ±0%
90%
⬇️ -4.73%
23
src/operations/sequences/shared.ts 81.48%
⬆️ +2.91%
83.33%
⬆️ +14.58%
100%
🟰 ±0%
81.48%
⬆️ +2.91%
41, 43, 49, 63, 69
src/operations/tables/addColumns.ts 100%
🟰 ±0%
85.71%
⬆️ +5.71%
100%
🟰 ±0%
100%
🟰 ±0%
src/operations/tables/alterColumn.ts 91.17%
⬆️ +1.84%
81.25%
⬆️ +4.78%
100%
🟰 ±0%
91.17%
⬆️ +1.84%
69, 76-83
src/operations/tables/createTable.ts 88%
⬇️ -1.39%
82.14%
⬆️ +4.87%
100%
🟰 ±0%
88%
⬇️ -1.39%
51-54, 92
src/operations/tables/shared.ts 86.79%
⬆️ +3.71%
76.76%
⬇️ -5.05%
76.47%
⬇️ -3.53%
86.79%
⬆️ +3.71%
155, 239, 259, 285, 289-295, 299, 440-461
src/operations/triggers/createTrigger.ts 88.23%
⬆️ +1.98%
71.79%
⬆️ +3.61%
100%
🟰 ±0%
88.23%
⬆️ +1.98%
53, 66, 70, 74-76
src/operations/views/shared.ts 100%
🟰 ±0%
50%
⬇️ -16.66%
100%
🟰 ±0%
100%
🟰 ±0%
src/utils/PgLiteral.ts 80%
⬇️ -10.47%
100%
🟰 ±0%
75%
⬇️ -5.00%
80%
⬇️ -10.47%
44
src/utils/formatParams.ts 100%
🟰 ±0%
87.5%
⬇️ -12.50%
100%
🟰 ±0%
100%
🟰 ±0%
Unchanged Files
src/index.ts 100% 100% 100% 100%
src/logger.ts 100% 100% 100% 100%
src/migrationOptions.ts 100% 100% 100% 100%
src/pgType.ts 100% 100% 100% 100%
src/operations/casts/createCast.ts 100% 100% 100% 100%
src/operations/casts/dropCast.ts 100% 100% 100% 100%
src/operations/casts/index.ts 100% 100% 100% 100%
src/operations/domains/alterDomain.ts 100% 100% 100% 100%
src/operations/domains/dropDomain.ts 100% 100% 100% 100%
src/operations/domains/index.ts 100% 100% 100% 100%
src/operations/domains/renameDomain.ts 100% 100% 100% 100%
src/operations/domains/shared.ts 100% 100% 100% 100%
src/operations/extensions/createExtension.ts 100% 100% 100% 100%
src/operations/extensions/dropExtension.ts 100% 100% 100% 100%
src/operations/extensions/index.ts 100% 100% 100% 100%
src/operations/extensions/shared.ts 100% 100% 100% 100%
src/operations/functions/dropFunction.ts 100% 100% 100% 100%
src/operations/functions/index.ts 100% 100% 100% 100%
src/operations/functions/renameFunction.ts 100% 100% 100% 100%
src/operations/functions/shared.ts 100% 100% 100% 100%
src/operations/grants/grantOnSchemas.ts 100% 100% 100% 100%
src/operations/grants/grantOnTables.ts 100% 100% 100% 100%
src/operations/grants/grantRoles.ts 100% 100% 100% 100%
src/operations/grants/index.ts 100% 100% 100% 100%
src/operations/grants/revokeOnSchemas.ts 100% 100% 100% 100%
src/operations/grants/revokeOnTables.ts 100% 100% 100% 100%
src/operations/grants/revokeRoles.ts 100% 100% 100% 100%
src/operations/indexes/createIndex.ts 100% 100% 100% 100%
src/operations/indexes/dropIndex.ts 100% 100% 100% 100%
src/operations/indexes/index.ts 100% 100% 100% 100%
src/operations/materializedViews/alterMaterializedView.ts 100% 100% 100% 100%
src/operations/materializedViews/createMaterializedView.ts 100% 100% 100% 100%
src/operations/materializedViews/dropMaterializedView.ts 100% 100% 100% 100%
src/operations/materializedViews/index.ts 100% 100% 100% 100%
src/operations/materializedViews/refreshMaterializedView.ts 100% 100% 100% 100%
src/operations/materializedViews/renameMaterializedView.ts 100% 100% 100% 100%
src/operations/materializedViews/renameMaterializedViewColumn.ts 100% 100% 100% 100%
src/operations/operators/addToOperatorFamily.ts 100% 100% 100% 100%
src/operations/operators/createOperatorFamily.ts 100% 100% 100% 100%
src/operations/operators/dropOperator.ts 100% 100% 100% 100%
src/operations/operators/dropOperatorClass.ts 100% 100% 100% 100%
src/operations/operators/dropOperatorFamily.ts 100% 100% 100% 100%
src/operations/operators/index.ts 100% 100% 100% 100%
src/operations/operators/removeFromOperatorFamily.ts 100% 100% 100% 100%
src/operations/operators/renameOperatorClass.ts 100% 100% 100% 100%
src/operations/operators/renameOperatorFamily.ts 100% 100% 100% 100%
src/operations/policies/alterPolicy.ts 100% 100% 100% 100%
src/operations/policies/createPolicy.ts 100% 100% 100% 100%
src/operations/policies/dropPolicy.ts 100% 100% 100% 100%
src/operations/policies/index.ts 100% 100% 100% 100%
src/operations/policies/renamePolicy.ts 100% 100% 100% 100%
src/operations/policies/shared.ts 100% 100% 100% 100%
src/operations/roles/alterRole.ts 100% 100% 100% 100%
src/operations/roles/dropRole.ts 100% 100% 100% 100%
src/operations/roles/index.ts 100% 100% 100% 100%
src/operations/roles/renameRole.ts 100% 100% 100% 100%
src/operations/schemas/createSchema.ts 100% 100% 100% 100%
src/operations/schemas/dropSchema.ts 100% 100% 100% 100%
src/operations/schemas/index.ts 100% 100% 100% 100%
src/operations/schemas/renameSchema.ts 100% 100% 100% 100%
src/operations/sequences/createSequence.ts 100% 100% 100% 100%
src/operations/sequences/dropSequence.ts 100% 100% 100% 100%
src/operations/sequences/index.ts 100% 100% 100% 100%
src/operations/sequences/renameSequence.ts 100% 100% 100% 100%
src/operations/tables/addConstraint.ts 100% 100% 100% 100%
src/operations/tables/alterTable.ts 100% 100% 100% 100%
src/operations/tables/dropColumns.ts 100% 100% 100% 100%
src/operations/tables/dropConstraint.ts 100% 100% 100% 100%
src/operations/tables/dropTable.ts 100% 100% 100% 100%
src/operations/tables/index.ts 100% 100% 100% 100%
src/operations/tables/renameColumn.ts 100% 100% 100% 100%
src/operations/tables/renameConstraint.ts 100% 100% 100% 100%
src/operations/tables/renameTable.ts 100% 100% 100% 100%
src/operations/triggers/dropTrigger.ts 100% 100% 100% 100%
src/operations/triggers/index.ts 100% 100% 100% 100%
src/operations/triggers/renameTrigger.ts 100% 100% 100% 100%
src/operations/triggers/shared.ts 100% 100% 100% 100%
src/operations/types/addTypeAttribute.ts 100% 100% 100% 100%
src/operations/types/addTypeValue.ts 100% 100% 100% 100%
src/operations/types/createType.ts 100% 100% 100% 100%
src/operations/types/dropType.ts 100% 100% 100% 100%
src/operations/types/dropTypeAttribute.ts 100% 100% 100% 100%
src/operations/types/index.ts 100% 100% 100% 100%
src/operations/types/renameType.ts 100% 100% 100% 100%
src/operations/types/renameTypeAttribute.ts 100% 100% 100% 100%
src/operations/types/renameTypeValue.ts 100% 100% 100% 100%
src/operations/types/setTypeAttribute.ts 100% 100% 100% 100%
src/operations/views/alterView.ts 100% 100% 100% 100%
src/operations/views/alterViewColumn.ts 100% 100% 100% 100%
src/operations/views/createView.ts 100% 100% 100% 100%
src/operations/views/dropView.ts 100% 100% 100% 100%
src/operations/views/index.ts 100% 100% 100% 100%
src/operations/views/renameView.ts 100% 100% 100% 100%
src/utils/createSchemalize.ts 100% 100% 100% 100%
src/utils/createTransformer.ts 100% 100% 100% 100%
src/utils/decamelize.ts 100% 100% 100% 100%
src/utils/escapeValue.ts 100% 100% 100% 100%
src/utils/formatLines.ts 100% 100% 100% 100%
src/utils/formatPartitionColumns.ts 100% 100% 100% 100%
src/utils/getMigrationTableSchema.ts 100% 100% 100% 100%
src/utils/getSchemas.ts 100% 100% 100% 100%
src/utils/identity.ts 100% 100% 100% 100%
src/utils/index.ts 100% 100% 100% 100%
src/utils/intersection.ts 100% 100% 100% 100%
src/utils/makeComment.ts 100% 100% 100% 100%
src/utils/quote.ts 100% 100% 100% 100%
src/utils/stringIdGenerator.ts 100% 100% 100% 100%
src/utils/toArray.ts 100% 100% 100% 100%
src/utils/types.ts 100% 100% 100% 100%
Generated in workflow #2721 for commit 70d7e0a by the Vitest Coverage Report Action

@renovate
renovate Bot force-pushed the renovate/major-vitest branch 10 times, most recently from 5808447 to cf519bc Compare October 30, 2025 16:43
@Shinigami92

Copy link
Copy Markdown
Collaborator

@brenoepics in v3->v4 migration, there seems to be a problem around mock/hoisted. Do you maybe know something about this? Do you maybe have some time to look into it? (If not that is also fine).
I could also ask for help in the vitest ecosystem, but for now I could imagine that we find out what's going wrong on our own.

@renovate
renovate Bot force-pushed the renovate/major-vitest branch from c49f5bc to 8446f73 Compare November 1, 2025 22:08
@brenoepics

brenoepics commented Nov 2, 2025

Copy link
Copy Markdown
Collaborator

@brenoepics in v3->v4 migration, there seems to be a problem around mock/hoisted. Do you maybe know something about this? Do you maybe have some time to look into it? (If not that is also fine). I could also ask for help in the vitest ecosystem, but for now I could imagine that we find out what's going wrong on our own.

This issue was caused by vi.fn().mockImplementation() not supporting arrow functions for constructors. see Vitest migration guide

Before:

const client = vi.fn().mockImplementation(() => hoisted.client);

After:

 const client = vi.fn().mockImplementation(function () {
   return hoisted.client;
 });

Switching to a regular function resolves the issue since Vitest requires a function or class for constructor mocking. This change also required me to add proper type definition for fn, not sure if that's also intentional.

Another breaking change is the removal of all (actually just type issue since we already define include and exclude) see Removed Options.

@renovate

renovate Bot commented Nov 2, 2025

Copy link
Copy Markdown
Contributor Author

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

⚠️ Warning: custom changes will be lost.

@Shinigami92

Copy link
Copy Markdown
Collaborator

@brenoepics Thanks a lot ❤️

I have two questions:

  1. Is the client actually a class and we should more tend to this syntax? .mockImplementation(class MockClient { ... })?
    -> right now a lint-fix rule could auto-convert a function to an arrow-fn
  2. all is not marked as deprecated or similar when I hover over it in my IDE 🤔 Should we contribute a JSDoc @deprecated to vitest?
    -> right now no lint or compile step could identify that

@brenoepics

Copy link
Copy Markdown
Collaborator
  1. Is the client actually a class and we should more tend to this syntax? .mockImplementation(class MockClient { ... })?
    -> right now a lint-fix rule could auto-convert a function to an arrow-fn

Hmm yeah, a class could make sense, I was thinking about that too, but I used a function because creating a client class would have required adding all the methods and types that wouldn’t even be used. It ended up getting overly complex, and using a function works in 1 LoC and fits the same style used for the other tests.

As for the lint-fix rule, I get it and actually, I’m not sure what would happen to hoisted mocks that are supposed to be functions. The lint rules would probably break them then.

  1. all is not marked as deprecated or similar when I hover over it in my IDE 🤔 Should we contribute a JSDoc @deprecated to vitest?
    -> right now no lint or compile step could identify that

Our ts-check CI failed check here, WebStorm LSP also detected it on my end, it got completely removed on v4.0.6, see here

@Shinigami92

Copy link
Copy Markdown
Collaborator
  1. that is good to know, would you like to add a dev-inline-comment, so at least the next developer knows that they should not convert it to an arrow-fn?

  2. that's insane 😄 for any reason this did not work on my machine and I cleaned node_modules and pnpm-lock file... 🤷
    anyway, thanks for the digging, this part is done and accepted from my side ✅

@Shinigami92
Shinigami92 force-pushed the renovate/major-vitest branch from 7c7382f to 70d7e0a Compare December 11, 2025 10:00
@Shinigami92
Shinigami92 added this pull request to the merge queue Dec 11, 2025
Merged via the queue into main with commit e60eb42 Dec 11, 2025
36 of 37 checks passed
@Shinigami92
Shinigami92 deleted the renovate/major-vitest branch December 11, 2025 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c: dependencies Pull requests that adds/updates a dependency

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants