test(cli): always print tweet URL

This commit is contained in:
Peter Steinberger
2025-12-26 22:04:08 +01:00
parent 1007d051e4
commit a3d1ba29f7
3 changed files with 21 additions and 2 deletions
+10
View File
@@ -1,6 +1,7 @@
import { describe, expect, it } from 'vitest';
import {
formatStatsLine,
formatTweetUrlLine,
labelPrefix,
resolveOutputConfigFromArgv,
resolveOutputConfigFromCommander,
@@ -62,4 +63,13 @@ describe('output', () => {
expect(formatStatsLine(stats, { plain: false, emoji: false, color: false })).toBe('Likes 0 Retweets 0 Replies 2');
expect(formatStatsLine(stats, { plain: false, emoji: true, color: false })).toBe('❤️ 0 🔁 0 💬 2');
});
it('always includes tweet URL in all modes', () => {
const id = '1234567890';
const url = `https://x.com/i/status/${id}`;
expect(formatTweetUrlLine(id, { plain: true, emoji: false, color: false })).toContain(url);
expect(formatTweetUrlLine(id, { plain: false, emoji: false, color: false })).toContain(url);
expect(formatTweetUrlLine(id, { plain: false, emoji: true, color: false })).toContain(url);
});
});