-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
test: enable vitest isolate:false on safe packages #5962
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: next
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; | ||
|
|
||
| const config: UserWorkspaceConfig = defineProject({ | ||
| test: { | ||
| // Reuse a single worker thread across this project's test files instead of | ||
| // spawning a fresh worker per file. The root vitest.config.ts cannot set | ||
| // these for glob-matched projects, so each project opts in explicitly. | ||
| pool: 'threads', | ||
| isolate: false, | ||
| }, | ||
| }); | ||
|
|
||
| export default config; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; | ||
|
|
||
| const config: UserWorkspaceConfig = defineProject({ | ||
| test: { | ||
| // Reuse a single worker thread across this project's test files instead of | ||
| // spawning a fresh worker per file. The root vitest.config.ts cannot set | ||
| // these for glob-matched projects, so each project opts in explicitly. | ||
| pool: 'threads', | ||
| isolate: false, | ||
| }, | ||
| }); | ||
|
|
||
| export default config; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; | ||
|
|
||
| const config: UserWorkspaceConfig = defineProject({ | ||
| test: { | ||
| // Reuse a single worker thread across this project's test files instead of | ||
| // spawning a fresh worker per file. The root vitest.config.ts cannot set | ||
| // these for glob-matched projects, so each project opts in explicitly. | ||
| pool: 'threads', | ||
| isolate: false, | ||
| }, | ||
| }); | ||
|
|
||
| export default config; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; | ||
|
|
||
| const config: UserWorkspaceConfig = defineProject({ | ||
| test: { | ||
| // Reuse a single worker thread across this project's test files instead of | ||
| // spawning a fresh worker per file. The root vitest.config.ts cannot set | ||
| // these for glob-matched projects, so each project opts in explicitly. | ||
| pool: 'threads', | ||
| isolate: false, | ||
| }, | ||
| }); | ||
|
|
||
| export default config; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; | ||
|
|
||
| const config: UserWorkspaceConfig = defineProject({ | ||
| test: { | ||
| // Reuse a single worker thread across this project's test files instead of | ||
| // spawning a fresh worker per file. The root vitest.config.ts cannot set | ||
| // these for glob-matched projects, so each project opts in explicitly. | ||
| pool: 'threads', | ||
| isolate: false, | ||
| }, | ||
| }); | ||
|
|
||
| export default config; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; | ||
|
|
||
| const config: UserWorkspaceConfig = defineProject({ | ||
| test: { | ||
| // Reuse a single worker thread across this project's test files instead of | ||
| // spawning a fresh worker per file. The root vitest.config.ts cannot set | ||
| // these for glob-matched projects, so each project opts in explicitly. | ||
| pool: 'threads', | ||
| isolate: false, | ||
| }, | ||
| }); | ||
|
|
||
| export default config; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; | ||
|
|
||
| const config: UserWorkspaceConfig = defineProject({ | ||
| test: { | ||
| // Reuse a single worker thread across this project's test files instead of | ||
| // spawning a fresh worker per file. The root vitest.config.ts cannot set | ||
| // these for glob-matched projects, so each project opts in explicitly. | ||
| pool: 'threads', | ||
| isolate: false, | ||
| }, | ||
| }); | ||
|
|
||
| export default config; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; | ||
|
|
||
| const config: UserWorkspaceConfig = defineProject({ | ||
| test: { | ||
| // Reuse a single worker thread across this project's test files instead of | ||
| // spawning a fresh worker per file. The root vitest.config.ts cannot set | ||
| // these for glob-matched projects, so each project opts in explicitly. | ||
| pool: 'threads', | ||
| isolate: false, | ||
| }, | ||
| }); | ||
|
|
||
| export default config; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; | ||
|
|
||
| const config: UserWorkspaceConfig = defineProject({ | ||
| test: { | ||
| // Reuse a single worker thread across this project's test files instead of | ||
| // spawning a fresh worker per file. The root vitest.config.ts cannot set | ||
| // these for glob-matched projects, so each project opts in explicitly. | ||
| pool: 'threads', | ||
| isolate: false, | ||
| }, | ||
| }); | ||
|
|
||
| export default config; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; | ||
|
|
||
| const config: UserWorkspaceConfig = defineProject({ | ||
| test: { | ||
| // Reuse a single worker thread across this project's test files instead of | ||
| // spawning a fresh worker per file. The root vitest.config.ts cannot set | ||
| // these for glob-matched projects, so each project opts in explicitly. | ||
| pool: 'threads', | ||
| isolate: false, | ||
| }, | ||
| }); | ||
|
|
||
| export default config; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; | ||
|
|
||
| const config: UserWorkspaceConfig = defineProject({ | ||
| test: { | ||
| // Reuse a single worker thread across this project's test files instead of | ||
| // spawning a fresh worker per file. The root vitest.config.ts cannot set | ||
| // these for glob-matched projects, so each project opts in explicitly. | ||
| pool: 'threads', | ||
| isolate: false, | ||
| }, | ||
| }); | ||
|
|
||
| export default config; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; | ||
|
|
||
| const config: UserWorkspaceConfig = defineProject({ | ||
| test: { | ||
| // Reuse a single worker thread across this project's test files instead of | ||
| // spawning a fresh worker per file. The root vitest.config.ts cannot set | ||
| // these for glob-matched projects, so each project opts in explicitly. | ||
| pool: 'threads', | ||
| isolate: false, | ||
| }, | ||
| }); | ||
|
|
||
| export default config; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,8 @@ import { defineConfig, type UserWorkspaceConfig } from 'vitest/config'; | |
|
|
||
| const config: UserWorkspaceConfig = defineConfig({ | ||
| test: { | ||
| pool: 'threads', | ||
| isolate: false, | ||
|
Comment on lines
+5
to
+6
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In Vitest workspaces, individual project configurations should use Please consider updating this file to use |
||
| testTimeout: 30000, | ||
| hookTimeout: 30000, | ||
| globals: true, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; | ||
|
|
||
| const config: UserWorkspaceConfig = defineProject({ | ||
| test: { | ||
| // Reuse a single worker thread across this project's test files instead of | ||
| // spawning a fresh worker per file. The root vitest.config.ts cannot set | ||
| // these for glob-matched projects, so each project opts in explicitly. | ||
| pool: 'threads', | ||
| isolate: false, | ||
| }, | ||
| }); | ||
|
|
||
| export default config; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; | ||
|
|
||
| const config: UserWorkspaceConfig = defineProject({ | ||
| test: { | ||
| // Reuse a single worker thread across this project's test files instead of | ||
| // spawning a fresh worker per file. The root vitest.config.ts cannot set | ||
| // these for glob-matched projects, so each project opts in explicitly. | ||
| pool: 'threads', | ||
| isolate: false, | ||
| }, | ||
| }); | ||
|
|
||
| export default config; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; | ||
|
|
||
| const config: UserWorkspaceConfig = defineProject({ | ||
| test: { | ||
| // Reuse a single worker thread across this project's test files instead of | ||
| // spawning a fresh worker per file. The root vitest.config.ts cannot set | ||
| // these for glob-matched projects, so each project opts in explicitly. | ||
| pool: 'threads', | ||
| isolate: false, | ||
| }, | ||
| }); | ||
|
|
||
| export default config; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; | ||
|
|
||
| const config: UserWorkspaceConfig = defineProject({ | ||
| test: { | ||
| // Reuse a single worker thread across this project's test files instead of | ||
| // spawning a fresh worker per file. The root vitest.config.ts cannot set | ||
| // these for glob-matched projects, so each project opts in explicitly. | ||
| pool: 'threads', | ||
| isolate: false, | ||
| }, | ||
| }); | ||
|
|
||
| export default config; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,10 @@ | ||
| import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; | ||
|
|
||
| const config: UserWorkspaceConfig = defineProject({}); | ||
| const config: UserWorkspaceConfig = defineProject({ | ||
| test: { | ||
| pool: 'threads', | ||
| isolate: false, | ||
| }, | ||
| }); | ||
|
|
||
| export default config; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; | ||
|
|
||
| const config: UserWorkspaceConfig = defineProject({ | ||
| test: { | ||
| // Reuse a single worker thread across this project's test files instead of | ||
| // spawning a fresh worker per file. The root vitest.config.ts cannot set | ||
| // these for glob-matched projects, so each project opts in explicitly. | ||
| pool: 'threads', | ||
| isolate: false, | ||
| }, | ||
| }); | ||
|
|
||
| export default config; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; | ||
|
|
||
| const config: UserWorkspaceConfig = defineProject({ | ||
| test: { | ||
| // Reuse a single worker thread across this project's test files instead of | ||
| // spawning a fresh worker per file. The root vitest.config.ts cannot set | ||
| // these for glob-matched projects, so each project opts in explicitly. | ||
| pool: 'threads', | ||
| isolate: false, | ||
| }, | ||
| }); | ||
|
|
||
| export default config; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; | ||
|
|
||
| const config: UserWorkspaceConfig = defineProject({ | ||
| test: { | ||
| // Reuse a single worker thread across this project's test files instead of | ||
| // spawning a fresh worker per file. The root vitest.config.ts cannot set | ||
| // these for glob-matched projects, so each project opts in explicitly. | ||
| pool: 'threads', | ||
| isolate: false, | ||
| }, | ||
| }); | ||
|
|
||
| export default config; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; | ||
|
|
||
| const config: UserWorkspaceConfig = defineProject({ | ||
| test: { | ||
| // Reuse a single worker thread across this project's test files instead of | ||
| // spawning a fresh worker per file. The root vitest.config.ts cannot set | ||
| // these for glob-matched projects, so each project opts in explicitly. | ||
| pool: 'threads', | ||
| isolate: false, | ||
| }, | ||
| }); | ||
|
|
||
| export default config; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; | ||
|
|
||
| const config: UserWorkspaceConfig = defineProject({ | ||
| test: { | ||
| // Reuse a single worker thread across this project's test files instead of | ||
| // spawning a fresh worker per file. The root vitest.config.ts cannot set | ||
| // these for glob-matched projects, so each project opts in explicitly. | ||
| pool: 'threads', | ||
| isolate: false, | ||
| }, | ||
| }); | ||
|
|
||
| export default config; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; | ||
|
|
||
| const config: UserWorkspaceConfig = defineProject({ | ||
| test: { | ||
| // Reuse a single worker thread across this project's test files instead of | ||
| // spawning a fresh worker per file. The root vitest.config.ts cannot set | ||
| // these for glob-matched projects, so each project opts in explicitly. | ||
| pool: 'threads', | ||
| isolate: false, | ||
| }, | ||
| }); | ||
|
|
||
| export default config; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { defineProject, type UserWorkspaceConfig } from 'vitest/config'; | ||
|
|
||
| const config: UserWorkspaceConfig = defineProject({ | ||
| test: { | ||
| // Reuse a single worker thread across this project's test files instead of | ||
| // spawning a fresh worker per file. The root vitest.config.ts cannot set | ||
| // these for glob-matched projects, so each project opts in explicitly. | ||
| pool: 'threads', | ||
| isolate: false, | ||
| }, | ||
| }); | ||
|
|
||
| export default config; |
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.
The explicit
UserWorkspaceConfigtype annotation is incorrect for a project configuration (which should beUserProjectConfigor inferred) and is unnecessary. We can let TypeScript automatically infer the correct type returned bydefineProjectand remove the unused import.This suggestion can be applied to all the newly added
vitest.config.tsfiles in this PR to keep them clean and consistent.