e5e6de2fad
- Replace bun:test with vitest across all packages - Replace bun build with esbuild - Replace bun:sqlite with better-sqlite3 - Fix OCAS Store API: store.put/get → store.cas.put/get - Fix vitest vi.mock hoisting (vi.hoisted) - Add pnpm-workspace.yaml and pnpm-lock.yaml - Update all package.json test/build scripts WIP: 8 failures remain in agent-hermes (bun engines check + sqlite migration) Refs #26
22 lines
756 B
TypeScript
22 lines
756 B
TypeScript
import { describe, expect, test } from 'vitest';
|
|
import { resolve } from "node:path";
|
|
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"));
|
|
});
|
|
});
|