mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-11 17:52:31 +03:00
29 lines
909 B
TypeScript
29 lines
909 B
TypeScript
import test from "node:test";
|
|
import assert from "node:assert/strict";
|
|
|
|
const { normalizeWebFetchCredentials } = await import("../../src/lib/skills/webFetchExecution.ts");
|
|
|
|
test("web-fetch skills reject unavailable credential sentinels", () => {
|
|
assert.equal(
|
|
normalizeWebFetchCredentials({ allRateLimited: true, retryAfter: "tomorrow" }),
|
|
null
|
|
);
|
|
assert.equal(normalizeWebFetchCredentials({ allExpired: true, expiredCount: 2 }), null);
|
|
});
|
|
|
|
test("web-fetch skills expose only the credential fields used by fetch executors", () => {
|
|
assert.deepEqual(
|
|
normalizeWebFetchCredentials({
|
|
apiKey: "secret",
|
|
baseUrl: "https://fetch.example.test",
|
|
providerSpecificData: { region: "test" },
|
|
accessToken: "must-not-leak-through",
|
|
}),
|
|
{
|
|
apiKey: "secret",
|
|
baseUrl: "https://fetch.example.test",
|
|
providerSpecificData: { region: "test" },
|
|
}
|
|
);
|
|
});
|