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
14 changes: 10 additions & 4 deletions tests/integration/app_loader/app_loader_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,14 @@ describe('AgentLoader discovery and loading integration', () => {
);
let loader: AgentLoader;

beforeAll(async () => {
await installFixtureProject(projectPath);
// This fixture is loaded in-process, so it deliberately has no package.json
// and needs no npm install: esbuild and Node both resolve @google/adk from
// the workspace-root node_modules, which points at the same core/ and dev/
// the fixture's file: deps used to. Without a package.json the fixture
// inherits "type": "module" from the repository root and compiles to ESM.
beforeAll(() => {
loader = new AgentLoader(projectPath);
}, FIXTURE_HOOK_TIMEOUT_MS);
});

it(
'should discover apps vs agents across directories and standalone files',
Expand All @@ -96,6 +100,9 @@ describe('AgentLoader discovery and loading integration', () => {
async () => {
const appFile = await loader.getAppFile('service_alpha');
const loaded = await appFile.load();
// Pins the module type the fixture resolves to now that it has no
// package.json of its own: ESM, inherited from the repository root.
expect(path.extname(appFile.getFilePath())).toBe('.mjs');
expect(isApp(loaded)).toBe(true);
expect((loaded as App).name).toBe('alpha_app');

Expand Down Expand Up @@ -123,6 +130,5 @@ describe('AgentLoader discovery and loading integration', () => {

afterAll(async () => {
await loader.disposeAll();
await cleanupFixtureProject(projectPath);
}, FIXTURE_HOOK_TIMEOUT_MS);
});
8 changes: 0 additions & 8 deletions tests/integration/app_loader/discovery/package.json

This file was deleted.

Loading