Skip to content

Commit 935105a

Browse files
mrjasonroyclaude
andcommitted
fix: use inline type definition to fix TypeScript compilation
TypeScript couldn't infer the return type from fileGeneratorTool.execute since it could be undefined. Instead of using ReturnType, define the FileGeneratorToolResult type inline in the test file. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent aa51172 commit 935105a

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/lib/ai/tools/file-generator/index.test.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,17 @@ vi.mock("logger", () => ({
2222

2323
// Import after mocking
2424
const { fileGeneratorTool } = await import("./index");
25-
type FileGeneratorToolResult = Awaited<
26-
ReturnType<typeof fileGeneratorTool.execute>
27-
>;
25+
26+
type FileGeneratorToolResult = {
27+
files: {
28+
url: string;
29+
filename: string;
30+
mimeType: string;
31+
size: number;
32+
}[];
33+
description?: string;
34+
guide?: string;
35+
};
2836

2937
describe("fileGeneratorTool.execute", () => {
3038
beforeEach(() => {

0 commit comments

Comments
 (0)