mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 13:11:22 +00:00
chore: migrate to oxlint and oxfmt
Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
This commit is contained in:
@@ -15,16 +15,14 @@ vi.mock("../config/paths.js", () => ({
|
||||
|
||||
describe("github-copilot token", () => {
|
||||
it("derives baseUrl from token", async () => {
|
||||
const { deriveCopilotApiBaseUrlFromToken } = await import(
|
||||
"./github-copilot-token.js"
|
||||
);
|
||||
const { deriveCopilotApiBaseUrlFromToken } = await import("./github-copilot-token.js");
|
||||
|
||||
expect(
|
||||
deriveCopilotApiBaseUrlFromToken("token;proxy-ep=proxy.example.com;"),
|
||||
).toBe("https://api.example.com");
|
||||
expect(
|
||||
deriveCopilotApiBaseUrlFromToken("token;proxy-ep=https://proxy.foo.bar;"),
|
||||
).toBe("https://api.foo.bar");
|
||||
expect(deriveCopilotApiBaseUrlFromToken("token;proxy-ep=proxy.example.com;")).toBe(
|
||||
"https://api.example.com",
|
||||
);
|
||||
expect(deriveCopilotApiBaseUrlFromToken("token;proxy-ep=https://proxy.foo.bar;")).toBe(
|
||||
"https://api.foo.bar",
|
||||
);
|
||||
});
|
||||
|
||||
it("uses cache when token is still valid", async () => {
|
||||
@@ -35,9 +33,7 @@ describe("github-copilot token", () => {
|
||||
updatedAt: now,
|
||||
});
|
||||
|
||||
const { resolveCopilotApiToken } = await import(
|
||||
"./github-copilot-token.js"
|
||||
);
|
||||
const { resolveCopilotApiToken } = await import("./github-copilot-token.js");
|
||||
|
||||
const fetchImpl = vi.fn();
|
||||
const res = await resolveCopilotApiToken({
|
||||
@@ -63,9 +59,7 @@ describe("github-copilot token", () => {
|
||||
}),
|
||||
});
|
||||
|
||||
const { resolveCopilotApiToken } = await import(
|
||||
"./github-copilot-token.js"
|
||||
);
|
||||
const { resolveCopilotApiToken } = await import("./github-copilot-token.js");
|
||||
|
||||
const res = await resolveCopilotApiToken({
|
||||
githubToken: "gh",
|
||||
|
||||
Reference in New Issue
Block a user