production runtime and mock removal

This commit is contained in:
inman committed 2026-08-17 23:44:14 +08:00
1 parent 2ef3da7af5
commit 6480e503eb
55 files changed
+581 -540

No files matched your search

+1 -9
View File
@@ -4,8 +4,7 @@ import {
bailianStatus,
buildBailianImagePayload,
buildBailianVideoPayload,
deriveBailianNativeBaseUrl,
shouldMockBailian
deriveBailianNativeBaseUrl
} from "@/lib/bailian/client";
afterEach(() => {
@@ -13,7 +12,6 @@ afterEach(() => {
delete process.env.BAILIAN_VIDEO_MODEL;
delete process.env.BAILIAN_API_KEY;
delete process.env.DASHSCOPE_API_KEY;
delete process.env.BAILIAN_MOCK;
});
describe("Bailian client", () => {
@@ -22,12 +20,6 @@ describe("Bailian client", () => {
.toBe("https://workspace.cn-beijing.maas.aliyuncs.com");
});
it("does not silently mock when the API key is missing", () => {
expect(shouldMockBailian()).toBe(false);
process.env.BAILIAN_MOCK = "true";
expect(shouldMockBailian()).toBe(true);
});
it("builds Wan 2.7 text-to-image and reference-image payloads", () => {
const text = buildBailianImagePayload("image.generate", { prompt: "海边酒店", width: 2048, height: 2048 });
expect(text).toMatchObject({ model: "wan2.7-image-pro", parameters: { size: "2048*2048", thinking_mode: true, watermark: false } });