Use twitter safe relay
CI / test (pull_request) Has been cancelled

This commit is contained in:
2026-06-24 03:39:34 +09:00
parent b771e827aa
commit 1f6e228272
66 changed files with 597 additions and 1720 deletions
+5 -5
View File
@@ -1,6 +1,6 @@
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { TwitterClient } from '../src/lib/twitter-client.js';
import { type TwitterClientPrivate, validCookies } from './twitter-client-fixtures.js';
import { type TwitterClientPrivate, testRelayBaseUrl } from './twitter-client-fixtures.js';
const originalFetch = global.fetch;
@@ -67,7 +67,7 @@ describe('TwitterClient likes', () => {
}),
});
const client = new TwitterClient({ cookies: validCookies });
const client = new TwitterClient({ relayBaseUrl: testRelayBaseUrl });
const clientPrivate = client as unknown as TwitterClientPrivate;
clientPrivate.getCurrentUser = async () => ({
success: true,
@@ -198,7 +198,7 @@ describe('TwitterClient likes', () => {
}),
});
const client = new TwitterClient({ cookies: validCookies });
const client = new TwitterClient({ relayBaseUrl: testRelayBaseUrl });
const clientPrivate = client as unknown as TwitterClientPrivate;
clientPrivate.getCurrentUser = async () => ({
success: true,
@@ -275,7 +275,7 @@ describe('TwitterClient likes', () => {
}),
});
const client = new TwitterClient({ cookies: validCookies });
const client = new TwitterClient({ relayBaseUrl: testRelayBaseUrl });
const clientPrivate = client as unknown as TwitterClientPrivate;
clientPrivate.getCurrentUser = async () => ({
success: true,
@@ -292,7 +292,7 @@ describe('TwitterClient likes', () => {
});
it('returns an error when current user is unavailable', async () => {
const client = new TwitterClient({ cookies: validCookies });
const client = new TwitterClient({ relayBaseUrl: testRelayBaseUrl });
const clientPrivate = client as unknown as TwitterClientPrivate;
clientPrivate.getCurrentUser = async () => ({ success: false, error: 'no user' });