test: catch bot tests up with the de-click transport ramp

Upstream a0f0b49..6f165b5 added the pause/resume fade tail but shipped no
test updates, leaving 5 assertions red (also reproducible on pristine
upstream/main, so not merge-induced).

- instance-recovery/instance harnesses: stub players borrow
  AudioPlayer.prototype.pause/resume, which now call this.setTransportRamp().
  Give the stubs that method or they throw TypeError on pause/resume.
- voice-failure: pausing deliberately emits a fade tail, so the frame count
  no longer freezes at exactly 50. Assert the de-click fade completes, then
  that the scheduler and elapsed clock are genuinely frozen — the actual
  behavior under test.

No production code changed.

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
zbn297427669andClaude Code committed 2026-11-02 15:58:44 +08:00
1 parent 17008ae52e
commit ba645e5ccb
3 files changed
+18 -2

No files matched your search

+4
View File
@@ -29,6 +29,10 @@ function makeBot() {
player.getVolume = () => 50;
player.pause = AudioPlayer.prototype.pause;
player.resume = AudioPlayer.prototype.resume;
// The real pause()/resume() drive the de-click transport ramp
// (a0f0b49..6f165b5). A stub player must expose it too, or the prototype
// methods throw "setTransportRamp is not a function".
player.setTransportRamp = vi.fn();
player.play = vi.fn((_url: string, position: number) => { player.sessionId++; player.elapsed = position; player.state = "playing"; });
player.stop = vi.fn(() => { player.sessionId++; player.state = "idle"; });
const provider = { getSongUrl: vi.fn(async (): Promise<{ url: string } | null> => ({ url: "fresh" })) };