90893b0aa8
CI / check (pull_request) Failing after 1m47s
- 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
22 lines
756 B
TypeScript
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"));
|
|
});
|
|
});
|