Skip to content
Open
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
64 changes: 22 additions & 42 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@ const INTEGRATION_HOOK_TIMEOUT_MS = 120000;
*/
const INTEGRATION_TEST_TIMEOUT_MS = 60000;

/**
* Module aliases shared by every test project, so that a new workspace package
* cannot be wired into one project and forgotten in the other five. Each entry
* points a package specifier at its TypeScript sources.
*
* `@google/adk-devtools` is deliberately absent: its `AdkApiServer` serves the
* web UI from a path relative to `dist/{esm,cjs}/server`, so resolving it from
* `dev/src` would break `tests/integration/adk_web/webui_test.ts`, which also
* spawns the CLI from `dev/dist`. Tests that want dev sources import them
* relatively, as `tests/integration/test_api_server.ts` does.
*/
const alias = {
'@google/adk': path.resolve(__dirname, './core/src'),
'@google/adk-integrations': path.resolve(__dirname, './integrations/src'),
};

export default defineConfig({
test: {
poolOptions: {
Expand All @@ -35,41 +51,23 @@ export default defineConfig({
test: {
name: 'unit:core',
environment: 'node',
alias: {
'@google/adk': path.resolve(__dirname, './core/src'),
'@google/adk-integrations': path.resolve(
__dirname,
'./integrations/src',
),
},
alias,
include: ['core/test/**/*_test.ts'],
},
},
{
test: {
name: 'unit:dev',
environment: 'node',
alias: {
'@google/adk': path.resolve(__dirname, './core/src'),
'@google/adk-integrations': path.resolve(
__dirname,
'./integrations/src',
),
},
alias,
include: ['dev/test/**/*_test.ts'],
},
},
{
test: {
name: 'unit:integrations',
environment: 'node',
alias: {
'@google/adk': path.resolve(__dirname, './core/src'),
'@google/adk-integrations': path.resolve(
__dirname,
'./integrations/src',
),
},
alias,
include: ['integrations/test/**/*_test.ts'],
},
},
Expand All @@ -79,41 +77,23 @@ export default defineConfig({
environment: 'node',
hookTimeout: INTEGRATION_HOOK_TIMEOUT_MS,
testTimeout: INTEGRATION_TEST_TIMEOUT_MS,
alias: {
'@google/adk': path.resolve(__dirname, './core/src'),
'@google/adk-integrations': path.resolve(
__dirname,
'./integrations/src',
),
},
alias,
include: ['tests/integration/**/*_test.ts'],
},
},
{
test: {
name: 'e2e',
environment: 'node',
alias: {
'@google/adk': path.resolve(__dirname, './core/src'),
'@google/adk-integrations': path.resolve(
__dirname,
'./integrations/src',
),
},
alias,
include: ['tests/e2e/**/*_test.ts'],
},
},
{
test: {
name: 'cross-language',
environment: 'node',
alias: {
'@google/adk': path.resolve(__dirname, './core/src'),
'@google/adk-integrations': path.resolve(
__dirname,
'./integrations/src',
),
},
alias,
include: ['tests/cross_language/**/*_test.ts'],
},
},
Expand Down
Loading