Files
OmniRoute/tests/unit/executor-phind.test.ts
Paijo 89c52d4f04 fix: resolve pre-existing test failures (env sync, PII, quota, sidebar) (#3039)
Integrated into release/v3.8.8. 9 legit test alignments + 34 new test files kept; restored 5 masked assertions (sk_ key redaction, circular/SSN redaction, T24 wait-log, THEORY-004 SSE, relay handoff) to strict/meaningful checks. Thanks @oyi77!
2026-06-01 14:52:50 -03:00

46 lines
1.3 KiB
TypeScript

import { describe, it } from "node:test";
import assert from "node:assert/strict";
const mod = await import("../../open-sse/executors/phind.ts");
describe("PhindExecutor", () => {
it("can be instantiated", () => {
const executor = new mod.PhindExecutor();
assert.ok(executor);
});
it("execute returns proper shape on missing cookie (fetch fails)", async () => {
const executor = new mod.PhindExecutor();
try {
const result = await executor.execute({
model: "phind-model",
body: { messages: [{ role: "user", content: "hi" }] },
stream: false,
credentials: { apiKey: "" },
signal: null,
});
assert.ok(result.response instanceof Response);
assert.ok(typeof result.url === "string");
assert.ok(typeof result.headers === "object");
} catch {
// Network error expected in test env
}
});
it("execute builds correct URL", async () => {
const executor = new mod.PhindExecutor();
try {
const result = await executor.execute({
model: "test",
body: { messages: [{ role: "user", content: "hi" }] },
stream: false,
credentials: { apiKey: "fake" },
signal: null,
});
assert.ok(result.url.includes("phind.com/api/agent"));
} catch {
// expected
}
});
});