Skip to content

Commit b7c822a

Browse files
ArthurDEV44claude
andcommitted
fix(mcp-server): resolve vitest zod import and self-matching test
- Add zod to vitest server.deps.inline to fix dynamic import resolution - Fix search.test.ts grep pattern to exclude test file from results 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 24da165 commit b7c822a

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

packages/mcp-server/src/sandbox/sdk/search.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,9 @@ describe("Search SDK", () => {
203203

204204
describe("error handling", () => {
205205
it("should handle empty results gracefully", () => {
206-
const result = search.grep("xyznonexistentpattern123", "**/*.ts");
206+
// Use a pattern that won't appear in any file (including this test file)
207+
// by searching in a directory without test files
208+
const result = search.grep("xyznonexistentpattern123", "src/ast/**/*.ts");
207209
expect(result.matches).toEqual([]);
208210
expect(result.totalMatches).toBe(0);
209211
});

packages/mcp-server/vitest.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,10 @@ export default defineConfig({
1212
exclude: ["src/**/*.test.ts"],
1313
},
1414
testTimeout: 30000, // Tree-sitter initialization can be slow
15+
server: {
16+
deps: {
17+
inline: ["zod"],
18+
},
19+
},
1520
},
1621
});

0 commit comments

Comments
 (0)