test(bilibili): check recovery request context

This commit is contained in:
TIANYAO ZHANG committed 2026-11-18 18:21:08 +08:00
1 parent d0e1422af7
commit 23b36e2019
1 file changed
+1 -1
+1 -1
View File
@@ -1771,7 +1771,7 @@ describe("resumeInterruptedStream — long B站 streams dying mid-play (#161)",
it("re-resolves the URL and resumes at the current position when a B站 stream ends early", async () => {
const ctx = makeCtx({ elapsed: 1000, duration: 10_000 });
expect(await resumeInterruptedStream.call(ctx)).toBe(true);
expect(ctx.provider.getSongUrl).toHaveBeenCalledWith("BV1abc");
expect(ctx.provider.getSongUrl).toHaveBeenCalledExactlyOnceWith("BV1abc", undefined, { avoidHosts: new Set() });
expect(ctx.player.play).toHaveBeenCalledWith("https://fresh.test/a.m4s", 1000, 10_000);
expect(ctx.song.url).toBe("https://fresh.test/a.m4s");
});