mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-08-20 14:03:34 +00:00
fix(tests): revert to main's DO token test (posthog filter was redundant after #3425)
Agent: pr-maintainer Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
6927c1eb2b
commit
720dde6481
1 changed files with 3 additions and 7 deletions
|
|
@ -88,16 +88,12 @@ describe("doApi 401 OAuth recovery", () => {
|
|||
|
||||
it("attempts OAuth recovery on 401 before throwing", async () => {
|
||||
state.token = "expired-token";
|
||||
let doCallCount = 0;
|
||||
let callCount = 0;
|
||||
globalThis.fetch = mock((url: string | URL | Request) => {
|
||||
callCount++;
|
||||
const urlStr = String(url);
|
||||
// Ignore telemetry (PostHog) fire-and-forget calls triggered by logWarn
|
||||
if (urlStr.includes("posthog") || urlStr.includes("i.posthog")) {
|
||||
return Promise.resolve(new Response("ok"));
|
||||
}
|
||||
doCallCount++;
|
||||
// First call: the actual API call returning 401
|
||||
if (doCallCount === 1) {
|
||||
if (callCount === 1) {
|
||||
return Promise.resolve(
|
||||
new Response("Unauthorized", {
|
||||
status: 401,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue