test: tighten media tool factory assertions

This commit is contained in:
Peter Steinberger
2026-05-08 15:31:27 +01:00
parent b4a717829d
commit e402efe818
4 changed files with 6 additions and 6 deletions

View File

@@ -113,7 +113,7 @@ function stubImageGenerationProviders() {
}
function requireImageGenerateTool(tool: ReturnType<typeof createImageGenerateTool>) {
expect(tool).not.toBeNull();
expect(typeof tool?.execute).toBe("function");
if (!tool) {
throw new Error("expected image_generate tool");
}

View File

@@ -207,7 +207,7 @@ describe("createMusicGenerateTool", () => {
},
}),
});
expect(tool).not.toBeNull();
expect(typeof tool?.execute).toBe("function");
if (!tool) {
throw new Error("expected music_generate tool");
}
@@ -277,7 +277,7 @@ describe("createMusicGenerateTool", () => {
},
}),
});
expect(tool).not.toBeNull();
expect(typeof tool?.execute).toBe("function");
if (!tool) {
throw new Error("expected music_generate tool");
}

View File

@@ -49,7 +49,7 @@ function requirePdfTool(
? R
: never,
) {
expect(tool).not.toBeNull();
expect(typeof tool?.execute).toBe("function");
if (!tool) {
throw new Error("expected pdf tool");
}

View File

@@ -309,7 +309,7 @@ describe("createVideoGenerateTool", () => {
},
}),
});
expect(tool).not.toBeNull();
expect(typeof tool?.execute).toBe("function");
if (!tool) {
throw new Error("expected video_generate tool");
}
@@ -589,7 +589,7 @@ describe("createVideoGenerateTool", () => {
},
}),
});
expect(tool).not.toBeNull();
expect(typeof tool?.execute).toBe("function");
if (!tool) {
throw new Error("expected video_generate tool");
}