Files
united-workforce/packages/agent-builtin/__tests__/path.test.ts
T
xiaoju 90893b0aa8
CI / check (pull_request) Failing after 1m47s
chore: integrate proman scaffold
- Add proman.yaml with 8 packages in dependency order
- Add @shazhou/proman as devDependency
- Replace root scripts: build/test/check/format → proman commands
- Keep typecheck script for standalone tsc --build

Fixes #27
2026-06-04 03:10:14 +00:00

22 lines
756 B
TypeScript

import { resolve } from "node:path";
import { describe, expect, test } from "vitest";
import { resolvePath } from "../src/tools/path.js";
describe("resolvePath", () => {
test("resolves relative paths against cwd", () => {
const root = "/workspace/project";
const resolved = resolvePath(root, "src/foo.ts");
expect(resolved).toBe(resolve(root, "src/foo.ts"));
});
test("resolves absolute paths as-is", () => {
const resolved = resolvePath("/workspace", "/etc/hosts");
expect(resolved).toBe("/etc/hosts");
});
test("resolves parent traversal normally", () => {
const resolved = resolvePath("/workspace/project", "../other/file.ts");
expect(resolved).toBe(resolve("/workspace/project", "../other/file.ts"));
});
});