From 76e6b9727eae31b5465ce7dbc090a75524b6a823 Mon Sep 17 00:00:00 2001 From: jlightner Date: Fri, 3 Apr 2026 02:35:37 +0000 Subject: [PATCH] fix: update download test expectations for format fallback chains MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tests expected old single-format strings, updated to match the new fallback chain format: preferred → next best → any. --- src/__tests__/download.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/__tests__/download.test.ts b/src/__tests__/download.test.ts index a961bd9..3f83acb 100644 --- a/src/__tests__/download.test.ts +++ b/src/__tests__/download.test.ts @@ -344,7 +344,7 @@ describe('DownloadService', () => { const args = execYtDlpMock.mock.calls[0][0] as string[]; expect(args).toContain('-f'); const fIdx = args.indexOf('-f'); - expect(args[fIdx + 1]).toBe('bestvideo[height<=1080]+bestaudio/best[height<=1080]'); + expect(args[fIdx + 1]).toBe('bestvideo[height<=1080]+bestaudio/bestvideo[height<=1080]*+bestaudio/best[height<=1080]/bestvideo+bestaudio/best'); expect(args).toContain('--merge-output-format'); const moIdx = args.indexOf('--merge-output-format'); expect(args[moIdx + 1]).toBe('mkv'); @@ -431,7 +431,7 @@ describe('DownloadService', () => { const args = execYtDlpMock.mock.calls[0][0] as string[]; expect(args).toContain('-f'); const fIdx = args.indexOf('-f'); - expect(args[fIdx + 1]).toBe('best'); + expect(args[fIdx + 1]).toBe('bestvideo+bestaudio/best'); }); it('falls back to -f "bestaudio" for audio when no format profile', async () => { @@ -652,7 +652,7 @@ describe('DownloadService', () => { const args = execYtDlpMock.mock.calls[0][0] as string[]; const fIdx = args.indexOf('-f'); expect(fIdx).toBeGreaterThanOrEqual(0); - expect(args[fIdx + 1]).toBe('bestvideo+bestaudio/best'); + expect(args[fIdx + 1]).toBe('bestvideo+bestaudio/bestvideo*+bestaudio/best'); // Should default to mp4 merge format when containerFormat is null expect(args).toContain('--merge-output-format'); const moIdx = args.indexOf('--merge-output-format'); @@ -695,7 +695,7 @@ describe('DownloadService', () => { const args = execYtDlpMock.mock.calls[0][0] as string[]; const fIdx = args.indexOf('-f'); - expect(args[fIdx + 1]).toBe('bestvideo+bestaudio/best'); + expect(args[fIdx + 1]).toBe('bestvideo+bestaudio/bestvideo*+bestaudio/best'); const moIdx = args.indexOf('--merge-output-format'); expect(args[moIdx + 1]).toBe('mkv'); });