mirror of
https://github.com/ZHANGTIANYAO1/teamspeak-music-bot.git
synced 2026-10-01 20:42:50 +08:00
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
13 lines
1.0 KiB
TypeScript
13 lines
1.0 KiB
TypeScript
import { describe, it, expect } from "vitest";
|
|
import { resolveSpotifyBackendKind as pick } from "./backend-select.js";
|
|
describe("resolveSpotifyBackendKind", () => {
|
|
it("auto: go present -> go-librespot", () => expect(pick("auto", true, true)).toBe("go-librespot"));
|
|
it("auto: go absent, rust present -> librespot", () => expect(pick("auto", false, true)).toBe("librespot"));
|
|
it("auto: neither -> null", () => expect(pick("auto", false, false)).toBeNull());
|
|
it("go-librespot: present -> go-librespot", () => expect(pick("go-librespot", true, true)).toBe("go-librespot"));
|
|
it("go-librespot: absent -> null even if rust present", () => expect(pick("go-librespot", false, true)).toBeNull());
|
|
it("librespot: present -> librespot", () => expect(pick("librespot", true, true)).toBe("librespot"));
|
|
it("librespot: absent -> null even if go present", () => expect(pick("librespot", true, false)).toBeNull());
|
|
it("auto default fallthrough matches auto", () => expect(pick("auto", true, false)).toBe("go-librespot"));
|
|
});
|