Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions packages/cookies/vitest.config.ts
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,
},
});
Comment on lines +1 to +11
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The explicit UserWorkspaceConfig type annotation is incorrect for a project configuration (which should be UserProjectConfig or inferred) and is unnecessary. We can let TypeScript automatically infer the correct type returned by defineProject and remove the unused import.

This suggestion can be applied to all the newly added vitest.config.ts files in this PR to keep them clean and consistent.

Suggested change
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,
},
});
import { defineProject } from 'vitest/config';
const config = 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;
2 changes: 2 additions & 0 deletions packages/core/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { defineProject } from 'vitest/config';

export default defineProject({
test: {
pool: 'threads',
isolate: false,
testTimeout: 10000,
hookTimeout: 20000,
exclude: ['test/fixtures/**', 'test/benchmark/**', '**/node_modules/**', '**/dist/**'],
Expand Down
13 changes: 13 additions & 0 deletions packages/errors/vitest.config.ts
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;
13 changes: 13 additions & 0 deletions packages/extend2/vitest.config.ts
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;
13 changes: 13 additions & 0 deletions packages/koa-static-cache/vitest.config.ts
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;
13 changes: 13 additions & 0 deletions packages/koa/vitest.config.ts
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;
13 changes: 13 additions & 0 deletions packages/loader-fs/vitest.config.ts
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;
13 changes: 13 additions & 0 deletions packages/path-matching/vitest.config.ts
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;
13 changes: 13 additions & 0 deletions packages/router/vitest.config.ts
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;
13 changes: 13 additions & 0 deletions packages/supertest/vitest.config.ts
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;
13 changes: 13 additions & 0 deletions packages/tsconfig/vitest.config.ts
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;
2 changes: 2 additions & 0 deletions packages/utils/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { defineProject } from 'vitest/config';

export default defineProject({
test: {
pool: 'threads',
isolate: false,
testTimeout: 15000,
include: ['test/**/*.test.ts'],
exclude: ['**/test/fixtures/**', '**/node_modules/**', '**/dist/**'],
Expand Down
13 changes: 13 additions & 0 deletions plugins/i18n/vitest.config.ts
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;
13 changes: 13 additions & 0 deletions plugins/jsonp/vitest.config.ts
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;
2 changes: 2 additions & 0 deletions plugins/logrotator/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { defineProject } from 'vitest/config';

export default defineProject({
test: {
pool: 'threads',
isolate: false,
testTimeout: 20000,
hookTimeout: 20000,
},
Expand Down
2 changes: 2 additions & 0 deletions plugins/onerror/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { defineProject } from 'vitest/config';

export default defineProject({
test: {
pool: 'threads',
isolate: false,
testTimeout: 20000,
hookTimeout: 20000,
},
Expand Down
2 changes: 2 additions & 0 deletions plugins/redis/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

In Vitest workspaces, individual project configurations should use defineProject instead of defineConfig to ensure correct configuration merging and behavior within the workspace. Additionally, the explicit UserWorkspaceConfig type annotation can be removed to let TypeScript automatically infer the correct UserProjectConfig type returned by defineProject.

Please consider updating this file to use defineProject and remove the explicit type annotation, similar to the other project configurations.

testTimeout: 30000,
hookTimeout: 30000,
globals: true,
Expand Down
13 changes: 13 additions & 0 deletions plugins/session/vitest.config.ts
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;
13 changes: 13 additions & 0 deletions plugins/static/vitest.config.ts
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;
13 changes: 13 additions & 0 deletions plugins/tracer/vitest.config.ts
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;
13 changes: 13 additions & 0 deletions plugins/typebox-validate/vitest.config.ts
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;
2 changes: 2 additions & 0 deletions plugins/view/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { defineProject } from 'vitest/config';

export default defineProject({
test: {
pool: 'threads',
isolate: false,
testTimeout: 20000,
hookTimeout: 20000,
},
Expand Down
2 changes: 2 additions & 0 deletions plugins/watcher/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { defineProject } from 'vitest/config';

export default defineProject({
test: {
pool: 'threads',
isolate: false,
testTimeout: 20000,
hookTimeout: 20000,
},
Expand Down
7 changes: 6 additions & 1 deletion tegg/core/agent-runtime/vitest.config.ts
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;
13 changes: 13 additions & 0 deletions tegg/core/ajv-decorator/vitest.config.ts
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;
13 changes: 13 additions & 0 deletions tegg/core/aop-decorator/vitest.config.ts
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;
13 changes: 13 additions & 0 deletions tegg/core/aop-runtime/vitest.config.ts
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;
13 changes: 13 additions & 0 deletions tegg/core/background-task/vitest.config.ts
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;
13 changes: 13 additions & 0 deletions tegg/core/common-util/vitest.config.ts
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;
13 changes: 13 additions & 0 deletions tegg/core/controller-decorator/vitest.config.ts
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;
13 changes: 13 additions & 0 deletions tegg/core/core-decorator/vitest.config.ts
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;
Loading
Loading