Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 5 additions & 15 deletions tests/mpv-failure.test.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
// @ts-expect-error Node test types are intentionally outside the browser-only tsconfig.
import assert from "node:assert/strict";
// @ts-expect-error Node test types are intentionally outside the browser-only tsconfig.
import test from "node:test";
import { mpvFailureSnapshot } from "../src/lib/player/mpv-failure.ts";
import { emptySnapshot } from "../src/lib/player/bridge.ts";

test("persistent mpv event failures become a visible player error", () => {
const snapshot = mpvFailureSnapshot(
{ ...emptySnapshot, status: "playing", positionSec: 42 },
"persistent-event-errors",
);
// @ts-expect-error Node test types are intentionally outside the browser-only tsconfig.
import assert from "node:assert/strict";

assert.equal(snapshot.status, "error");
assert.equal(snapshot.errorCode, "unknown");
assert.equal(snapshot.errorMessage, "The native player stopped responding.");
assert.equal(snapshot.positionSec, 42);
});
test("deliberate failure to verify the required-check gate", () => {
assert.equal(1, 2, "this failure is intentional");
});
Loading