mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 17:50:43 +00:00
test: tighten extension media assertions
This commit is contained in:
@@ -75,12 +75,9 @@ describe("transcribeOpenAiAudio", () => {
|
||||
expect(form.get("language")).toBe("en");
|
||||
expect(form.get("prompt")).toBe("hello");
|
||||
const file = form.get("file") as Blob | { type?: string; name?: string } | null;
|
||||
expect(file).not.toBeNull();
|
||||
if (file) {
|
||||
expect(file.type).toBe("audio/wav");
|
||||
if ("name" in file && typeof file.name === "string") {
|
||||
expect(file.name).toBe("voice.wav");
|
||||
}
|
||||
expect(file).toEqual(expect.objectContaining({ type: "audio/wav" }));
|
||||
if (file && "name" in file && typeof file.name === "string") {
|
||||
expect(file.name).toBe("voice.wav");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ function installQaChannelTestRegistry() {
|
||||
}
|
||||
|
||||
function expectDispatchedContext(ctx: Record<string, unknown> | null): Record<string, unknown> {
|
||||
expect(ctx).not.toBeNull();
|
||||
expect(ctx).toEqual(expect.any(Object));
|
||||
if (ctx === null) {
|
||||
throw new Error("Expected dispatched context");
|
||||
}
|
||||
|
||||
@@ -972,7 +972,7 @@ describe("qa bundled plugin dir", () => {
|
||||
expect(stagedRoot).toBe(
|
||||
path.join(repoRoot, ".artifacts", "qa-runtime", path.basename(tempRoot)),
|
||||
);
|
||||
await expect(readFile(path.join(stagedRoot!, "package.json"), "utf8")).resolves.toContain(
|
||||
await expect(readFile(path.join(stagedRoot, "package.json"), "utf8")).resolves.toContain(
|
||||
'"name": "openclaw"',
|
||||
);
|
||||
await expect(
|
||||
|
||||
@@ -78,12 +78,9 @@ describe("transcribeSenseAudioAudio", () => {
|
||||
expect(form.get("language")).toBe("en");
|
||||
expect(form.get("prompt")).toBe("hello");
|
||||
const file = form.get("file") as Blob | { type?: string; name?: string } | null;
|
||||
expect(file).not.toBeNull();
|
||||
if (file) {
|
||||
expect(file.type).toBe("audio/wav");
|
||||
if ("name" in file && typeof file.name === "string") {
|
||||
expect(file.name).toBe("voice.wav");
|
||||
}
|
||||
expect(file).toEqual(expect.objectContaining({ type: "audio/wav" }));
|
||||
if (file && "name" in file && typeof file.name === "string") {
|
||||
expect(file.name).toBe("voice.wav");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user