fix: about account live coverage (#51) (thanks @pjtf93)

This commit is contained in:
Peter Steinberger
2026-06-24 18:42:16 +09:00
committed by yuta
parent 058aa0e3c3
commit 77c7d676a7
7 changed files with 97 additions and 54 deletions
+11
View File
@@ -149,6 +149,17 @@ d('live CLI (Twitter/X)', () => {
expect(whoamiStdout).toContain('credentials:');
});
it('about returns account JSON', async () => {
const aboutHandle = (process.env.BIRD_LIVE_ABOUT_HANDLE ?? handle).trim() || handle;
const about = await runBird([...baseArgs, '--cookie-timeout', cookieTimeoutArg, 'about', aboutHandle, '--json'], {
timeoutMs: 45_000,
});
expect(about.exitCode).toBe(0);
const payload = parseJson<Record<string, unknown>>(about.stdout);
expect(Array.isArray(payload)).toBe(false);
expect(Object.keys(payload).length).toBeGreaterThan(0);
});
it('read returns tweet JSON', async () => {
const read = await runBird([...baseArgs, 'read', tweetId, '--json'], {
timeoutMs: 45_000,
+1 -1
View File
@@ -119,7 +119,7 @@ describe('TwitterClient getUserAboutAccount', () => {
});
it('handles HTTP 404 error', async () => {
mockFetch.mockResolvedValueOnce({
mockFetch.mockResolvedValue({
ok: false,
status: 404,
text: async () => 'Not Found',