From e23bd6b235ec82957bea9554a5952a0e7130e464 Mon Sep 17 00:00:00 2001 From: Anthony GAEREMYNCK <1@anthony.sh> Date: Tue, 11 Aug 2026 15:19:02 +0200 Subject: [PATCH] test: cover 4K format selector in buildYtdlpArgs --- src/lib/__tests__/ytdlp.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib/__tests__/ytdlp.test.ts b/src/lib/__tests__/ytdlp.test.ts index a137be3..3dfdc99 100644 --- a/src/lib/__tests__/ytdlp.test.ts +++ b/src/lib/__tests__/ytdlp.test.ts @@ -40,6 +40,13 @@ describe('buildYtdlpArgs', () => { expect(args[idx + 1]).toContain('height<=?1080') }) + it('adds a height filter to -f for 4K quality', () => { + const args = buildYtdlpArgs({ ...base, quality: '2160p' }) + const idx = args.indexOf('-f') + expect(idx).toBeGreaterThan(-1) + expect(args[idx + 1]).toContain('height<=?2160') + }) + it('does not add a height filter when quality is "best"', () => { const args = buildYtdlpArgs(base) const idx = args.indexOf('-f')