mirror of
https://github.com/modelcontextprotocol/servers.git
synced 2026-04-18 00:03:23 +02:00
fix(filesystem): use vi.fn() instead of jest.fn() in test
The project uses Vitest, not Jest. Replace jest.fn() with vi.fn() to fix the ReferenceError in the relative path resolution test. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -211,7 +211,7 @@ describe('Lib Functions', () => {
|
|||||||
|
|
||||||
// Mock process.cwd to return a directory outside allowed directories
|
// Mock process.cwd to return a directory outside allowed directories
|
||||||
const disallowedCwd = process.platform === 'win32' ? 'C:\\Windows\\System32' : '/root';
|
const disallowedCwd = process.platform === 'win32' ? 'C:\\Windows\\System32' : '/root';
|
||||||
(process as any).cwd = jest.fn(() => disallowedCwd);
|
(process as any).cwd = vi.fn(() => disallowedCwd);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const result = await validatePath(relativePath);
|
const result = await validatePath(relativePath);
|
||||||
|
|||||||
Reference in New Issue
Block a user