Skip to content

Your personal intelligence agent. Watches the world from multiple data sources and pings you when something changes.

test(llm): split OpenRouter unit and integration tests

dan0612915695a1
diff --git a/test/llm-openrouter-integration.test.mjs b/test/llm-openrouter-integration.test.mjs
new file mode 100644
index 0000000..7d8af58
--- /dev/null
+++ b/test/llm-openrouter-integration.test.mjs
@@ -0,0 +1,17 @@
+import test from 'node:test';
+import assert from 'node:assert/strict';
+import { createLLMProvider } from '../lib/llm/index.mjs';
+
+test('OpenRouterProvider Integration Test', { skip: !process.env.LLM_API_KEY || process.env.LLM_PROVIDER !== 'openrouter' }, async (t) => {
+ await t.test('Performs live API call', async () => {
+ const provider = createLLMProvider({
+ provider: 'openrouter',
+ apiKey: process.env.LLM_API_KEY,
+ model: process.env.LLM_MODEL || 'openrouter/auto'
+ });
+
+ const result = await provider.complete('Reply with exactly "Hello".', 'Hi');
+ assert.ok(result.text.length > 0, 'Should return text');
+ assert.ok(result.usage.inputTokens > 0, 'Should return input token usage');
+ });
+});
diff --git a/test/llm-openrouter.test.mjs b/test/llm-openrouter.test.mjs
index b776ae3..bc13ac6 100644
--- a/test/llm-openrouter.test.mjs
+++ b/test/llm-openrouter.test.mjs
@@ -88,17 +88,3 @@ test('OpenRouterProvider Unit Tests', async (t) => {
}
});
});
-
-test('OpenRouterProvider Integration Test', { skip: !process.env.LLM_API_KEY || process.env.LLM_PROVIDER !== 'openrouter' }, async (t) => {
- await t.test('Performs live API call', async () => {
- const provider = createLLMProvider({
- provider: 'openrouter',
- apiKey: process.env.LLM_API_KEY,
- model: process.env.LLM_MODEL || 'openrouter/auto'
- });
-
- const result = await provider.complete('Reply with exactly "Hello".', 'Hi');
- assert.ok(result.text.length > 0, 'Should return text');
- assert.ok(result.usage.inputTokens > 0, 'Should return input token usage');
- });
-});