mirror of
https://github.com/n8n-io/n8n.git
synced 2026-10-12 02:19:43 +00:00
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:
co-authored by
Claude Fable 5.1
parent
48445f5b9e
commit
e3c3cb8f5a
@@ -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 };
|
||||
});
|
||||
@@ -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()],
|
||||
|
||||
Reference in New Issue
Block a user