test(core): Stop agents unit tests from fetching the model catalog (no-changelog) (#38592)

Co-authored-by: Claude Fable 5.1 <[email protected]>
This commit is contained in:
Charlie Kolb
2026-09-15 12:50:41 +00:00
committed by GitHub
co-authored by Claude Fable 5.1
parent 48445f5b9e
commit e3c3cb8f5a
2 changed files with 8 additions and 0 deletions
@@ -0,0 +1,7 @@
import { vi } from 'vitest';
// Agent.build() looks up model cost on models.dev. Unit tests must not reach the network.
vi.mock('../sdk/catalog', async (importOriginal) => {
const actual = await importOriginal<typeof import('../sdk/catalog')>();
return { ...actual, getModelCost: async () => undefined };
});
+1
View File
@@ -53,6 +53,7 @@ export default mergeConfig(
createVitestConfig({
// Integration tests run via vitest.integration.config.mjs (real providers, long timeouts).
exclude: [...configDefaults.exclude, '**/__tests__/integration/**'],
setupFiles: ['src/__tests__/setup.ts'],
}),
{
plugins: [rewriteSourceRequire()],