openpencil/packages/mcp/tests/root.test.ts
2026-08-31 15:01:41 +03:00

15 lines
396 B
TypeScript

import { describe, expect, test } from 'bun:test'
import { homedir } from 'node:os'
import { resolveMCPRoot } from '../src/root'
describe('resolveMCPRoot', () => {
test('honors an explicit root', () => {
expect(resolveMCPRoot(' /designs ')).toBe('/designs')
})
test('uses the home directory on Windows', () => {
expect(resolveMCPRoot(undefined, 'win32')).toBe(homedir())
})
})