-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Bump Vitest to v4 (major) #20102
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
Open
renovate
wants to merge
28
commits into
master
Choose a base branch
from
renovate/major-vite-and-vitest
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+578
−729
Open
Bump Vitest to v4 (major) #20102
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
0ad2a96
Bump Vite & Vitest to ^4.0.2
renovate[bot] f273f78
Align deps
bernardobelchior 7bb6ae8
Fix breaking changes
bernardobelchior f24d82e
Dedupe
bernardobelchior edcae5a
Fix wrong type import
bernardobelchior 3afec7e
Remove @types/mocha
bernardobelchior 35002f3
Pin same versions
bernardobelchior 2a661e7
Upgrade to 4.0.3
bernardobelchior caadf9c
Fix node types
bernardobelchior 29db56f
Upgrade to 4.0.4
bernardobelchior cea08d4
Patch internal test utils
bernardobelchior 9598403
Enable isolation
bernardobelchior 973bc46
Update patch
bernardobelchior 66bf24c
Set VITEST env var
bernardobelchior 34c872d
Use commit from monorepo
bernardobelchior 871c050
Disable isolation again
bernardobelchior c549e5b
update max workers in CI
JCQuintas bbb706a
Remove patch
bernardobelchior 91428c4
Upgrade to v4.0.5
bernardobelchior c6663eb
Pin master commit
bernardobelchior bfcfa81
Reduce suite concurrency
bernardobelchior 89ed7d0
Revert "Reduce suite concurrency"
bernardobelchior 45a9e84
try ordering
JCQuintas 05dcb2d
Revert "try ordering"
bernardobelchior 1b32e47
Upgrade to v4.0.6
bernardobelchior 6975be9
Set maxWorkers on eslint-plugin-mui-x
bernardobelchior 9124bfe
Try Vitest fix
bernardobelchior 115523a
Upgrade to v4.0.7
bernardobelchior File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,16 @@ | ||
| /// <reference types="@vitest/browser/providers/playwright" /> | ||
| import { mergeConfig } from 'vitest/config'; | ||
| import { mergeConfig, defineConfig } from 'vitest/config'; | ||
| import sharedConfig from '../../vitest.shared.mts'; | ||
| import { getTestName } from '../../scripts/getTestName.mts'; | ||
|
|
||
| export default mergeConfig(sharedConfig, { | ||
| test: { | ||
| name: getTestName(import.meta.url), | ||
| browser: { | ||
| enabled: true, | ||
| instances: [ | ||
| { | ||
| browser: 'chromium', | ||
| ...(process.env.PLAYWRIGHT_SERVER_WS | ||
| ? { | ||
| connect: { | ||
| wsEndpoint: process.env.PLAYWRIGHT_SERVER_WS, | ||
| }, | ||
| } | ||
| : {}), | ||
| }, | ||
| ], | ||
| export default mergeConfig( | ||
| sharedConfig, | ||
| defineConfig({ | ||
| test: { | ||
| name: getTestName(import.meta.url), | ||
| browser: { | ||
| enabled: true, | ||
| instances: [{ browser: 'chromium' }], | ||
| }, | ||
| }, | ||
| }, | ||
| }); | ||
| }), | ||
| ); |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,16 @@ | ||
| /// <reference types="@vitest/browser/providers/playwright" /> | ||
| import { mergeConfig } from 'vitest/config'; | ||
| import { mergeConfig, defineConfig } from 'vitest/config'; | ||
| import sharedConfig from '../../vitest.shared.mts'; | ||
| import { getTestName } from '../../scripts/getTestName.mts'; | ||
|
|
||
| export default mergeConfig(sharedConfig, { | ||
| test: { | ||
| name: getTestName(import.meta.url), | ||
| browser: { | ||
| enabled: true, | ||
| instances: [ | ||
| { | ||
| browser: 'chromium', | ||
| ...(process.env.PLAYWRIGHT_SERVER_WS | ||
| ? { | ||
| connect: { | ||
| wsEndpoint: process.env.PLAYWRIGHT_SERVER_WS, | ||
| }, | ||
| } | ||
| : {}), | ||
| }, | ||
| ], | ||
| export default mergeConfig( | ||
| sharedConfig, | ||
| defineConfig({ | ||
| test: { | ||
| name: getTestName(import.meta.url), | ||
| browser: { | ||
| enabled: true, | ||
| instances: [{ browser: 'chromium' }], | ||
| }, | ||
| }, | ||
| }, | ||
| }); | ||
| }), | ||
| ); |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,16 @@ | ||
| /// <reference types="@vitest/browser/providers/playwright" /> | ||
| import { mergeConfig } from 'vitest/config'; | ||
| import { defineConfig, mergeConfig } from 'vitest/config'; | ||
| import sharedConfig from '../../vitest.shared.mts'; | ||
| import { getTestName } from '../../scripts/getTestName.mts'; | ||
|
|
||
| export default mergeConfig(sharedConfig, { | ||
| test: { | ||
| name: getTestName(import.meta.url), | ||
| browser: { | ||
| enabled: true, | ||
| instances: [ | ||
| { | ||
| browser: 'chromium', | ||
| }, | ||
| ], | ||
| export default mergeConfig( | ||
| sharedConfig, | ||
| defineConfig({ | ||
| test: { | ||
| name: getTestName(import.meta.url), | ||
| browser: { | ||
| enabled: true, | ||
| instances: [{ browser: 'chromium' }], | ||
| }, | ||
| }, | ||
| }, | ||
| }); | ||
| }), | ||
| ); |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,16 @@ | ||
| /// <reference types="@vitest/browser/providers/playwright" /> | ||
| import { mergeConfig } from 'vitest/config'; | ||
| import { mergeConfig, defineConfig } from 'vitest/config'; | ||
| import sharedConfig from '../../vitest.shared.mts'; | ||
| import { getTestName } from '../../scripts/getTestName.mts'; | ||
|
|
||
| export default mergeConfig(sharedConfig, { | ||
| test: { | ||
| name: getTestName(import.meta.url), | ||
| browser: { | ||
| enabled: true, | ||
| instances: [ | ||
| { | ||
| browser: 'chromium', | ||
| ...(process.env.PLAYWRIGHT_SERVER_WS | ||
| ? { | ||
| connect: { | ||
| wsEndpoint: process.env.PLAYWRIGHT_SERVER_WS, | ||
| }, | ||
| } | ||
| : {}), | ||
| }, | ||
| ], | ||
| export default mergeConfig( | ||
| sharedConfig, | ||
| defineConfig({ | ||
| test: { | ||
| name: getTestName(import.meta.url), | ||
| browser: { | ||
| enabled: true, | ||
| instances: [{ browser: 'chromium' }], | ||
| }, | ||
| }, | ||
| }, | ||
| }); | ||
| }), | ||
| ); |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,16 @@ | ||
| /// <reference types="@vitest/browser/providers/playwright" /> | ||
| import { mergeConfig } from 'vitest/config'; | ||
| import { mergeConfig, defineConfig } from 'vitest/config'; | ||
| import sharedConfig from '../../vitest.shared.mts'; | ||
| import { getTestName } from '../../scripts/getTestName.mts'; | ||
|
|
||
| export default mergeConfig(sharedConfig, { | ||
| test: { | ||
| name: getTestName(import.meta.url), | ||
| browser: { | ||
| enabled: true, | ||
| instances: [ | ||
| { | ||
| browser: 'chromium', | ||
| ...(process.env.PLAYWRIGHT_SERVER_WS | ||
| ? { | ||
| connect: { | ||
| wsEndpoint: process.env.PLAYWRIGHT_SERVER_WS, | ||
| }, | ||
| } | ||
| : {}), | ||
| }, | ||
| ], | ||
| export default mergeConfig( | ||
| sharedConfig, | ||
| defineConfig({ | ||
| test: { | ||
| name: getTestName(import.meta.url), | ||
| browser: { | ||
| enabled: true, | ||
| instances: [{ browser: 'chromium' }], | ||
| }, | ||
| }, | ||
| }, | ||
| }); | ||
| }), | ||
| ); |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,30 +1,35 @@ | ||
| /// <reference types="@vitest/browser/providers/playwright" /> | ||
| import { mergeConfig } from 'vitest/config'; | ||
| import { defineConfig, mergeConfig } from 'vitest/config'; | ||
| import { playwright } from '@vitest/browser-playwright'; | ||
| import sharedConfig from '../../vitest.shared.mts'; | ||
| import { getTestName } from '../../scripts/getTestName.mts'; | ||
|
|
||
| export default mergeConfig(sharedConfig, { | ||
| test: { | ||
| name: getTestName(import.meta.url), | ||
| browser: { | ||
| enabled: true, | ||
| instances: [ | ||
| { | ||
| browser: 'chromium', | ||
| ...(process.env.PLAYWRIGHT_SERVER_WS | ||
| ? { | ||
| connect: { | ||
| wsEndpoint: process.env.PLAYWRIGHT_SERVER_WS, | ||
| }, | ||
| } | ||
| : { | ||
| launch: { | ||
| // Required for tests which use scrollbars. | ||
| ignoreDefaultArgs: ['--hide-scrollbars'], | ||
| }, | ||
| }), | ||
| }, | ||
| ], | ||
| export default mergeConfig( | ||
| sharedConfig, | ||
| defineConfig({ | ||
| test: { | ||
| name: getTestName(import.meta.url), | ||
| browser: { | ||
| enabled: true, | ||
| instances: [ | ||
| { | ||
| browser: 'chromium', | ||
| provider: playwright({ | ||
| ...(process.env.PLAYWRIGHT_SERVER_WS | ||
| ? { | ||
| connectOptions: { | ||
| wsEndpoint: process.env.PLAYWRIGHT_SERVER_WS, | ||
| }, | ||
| } | ||
| : { | ||
| launchOptions: { | ||
| // Required for tests which use scrollbars. | ||
| ignoreDefaultArgs: ['--hide-scrollbars'], | ||
| }, | ||
| }), | ||
| }), | ||
| }, | ||
| ], | ||
| }, | ||
| }, | ||
| }, | ||
| }); | ||
| }), | ||
| ); | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,30 +1,35 @@ | ||
| /// <reference types="@vitest/browser/providers/playwright" /> | ||
| import { mergeConfig } from 'vitest/config'; | ||
| import { mergeConfig, defineConfig } from 'vitest/config'; | ||
| import { playwright } from '@vitest/browser-playwright'; | ||
| import sharedConfig from '../../vitest.shared.mts'; | ||
| import { getTestName } from '../../scripts/getTestName.mts'; | ||
|
|
||
| export default mergeConfig(sharedConfig, { | ||
| test: { | ||
| name: getTestName(import.meta.url), | ||
| browser: { | ||
| enabled: true, | ||
| instances: [ | ||
| { | ||
| browser: 'chromium', | ||
| ...(process.env.PLAYWRIGHT_SERVER_WS | ||
| ? { | ||
| connect: { | ||
| wsEndpoint: process.env.PLAYWRIGHT_SERVER_WS, | ||
| }, | ||
| } | ||
| : { | ||
| launch: { | ||
| // Required for tests which use scrollbars. | ||
| ignoreDefaultArgs: ['--hide-scrollbars'], | ||
| }, | ||
| }), | ||
| }, | ||
| ], | ||
| export default mergeConfig( | ||
| sharedConfig, | ||
| defineConfig({ | ||
| test: { | ||
| name: getTestName(import.meta.url), | ||
| browser: { | ||
| enabled: true, | ||
| instances: [ | ||
| { | ||
| browser: 'chromium', | ||
| provider: playwright({ | ||
| ...(process.env.PLAYWRIGHT_SERVER_WS | ||
| ? { | ||
| connectOptions: { | ||
| wsEndpoint: process.env.PLAYWRIGHT_SERVER_WS, | ||
| }, | ||
| } | ||
| : { | ||
| launchOptions: { | ||
| // Required for tests which use scrollbars. | ||
| ignoreDefaultArgs: ['--hide-scrollbars'], | ||
| }, | ||
| }), | ||
| }), | ||
| }, | ||
| ], | ||
| }, | ||
| }, | ||
| }, | ||
| }); | ||
| }), | ||
| ); |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,18 @@ | ||
| /// <reference types="@vitest/browser/providers/playwright" /> | ||
| import { fileURLToPath } from 'node:url'; | ||
| import { mergeConfig } from 'vitest/config'; | ||
| import { mergeConfig, defineConfig } from 'vitest/config'; | ||
| import sharedConfig from '../../vitest.shared.mts'; | ||
| import { getTestName } from '../../scripts/getTestName.mts'; | ||
|
|
||
| export default mergeConfig(sharedConfig, { | ||
| test: { | ||
| name: getTestName(import.meta.url), | ||
| setupFiles: [fileURLToPath(new URL('../../test/utils/setupPickers.js', import.meta.url))], | ||
| browser: { | ||
| enabled: true, | ||
| instances: [ | ||
| { | ||
| browser: 'chromium', | ||
| ...(process.env.PLAYWRIGHT_SERVER_WS | ||
| ? { | ||
| connect: { | ||
| wsEndpoint: process.env.PLAYWRIGHT_SERVER_WS, | ||
| }, | ||
| } | ||
| : {}), | ||
| }, | ||
| ], | ||
| export default mergeConfig( | ||
| sharedConfig, | ||
| defineConfig({ | ||
| test: { | ||
| name: getTestName(import.meta.url), | ||
| setupFiles: [fileURLToPath(new URL('../../test/utils/setupPickers.js', import.meta.url))], | ||
| browser: { | ||
| enabled: true, | ||
| instances: [{ browser: 'chromium' }], | ||
| }, | ||
| }, | ||
| }, | ||
| }); | ||
| }), | ||
| ); |
Oops, something went wrong.
Oops, something went wrong.
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.
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.
We should be able to move this to the shared config now I believe, which would simplify this file 😆
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.
This isn't used in all files tests, so I didn't want to move it there if we don't use it. Would the other packages benefit from this?
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.
We can probably just make the sharedConfig a func that accepts arguments, so we can simplify this file