1abc3b4cf4
- Fix import ordering (organizeImports) across multiple packages - Replace forEach with for...of loops (noForEach) - Replace non-null assertions with fallback values (noNonNullAssertion) - Add biome-ignore comments for justified noExplicitAny usages - Remove parameter properties, use explicit class properties (noParameterProperties) - Fix string concatenation to template literals (useTemplate) - Fix format issues (CSS, TypeScript) - Add tailwindDirectives CSS parser config in biome.json - Replace var with const (noVar) Result: 0 errors, 12 warnings (all cognitive complexity, acceptable)
22 lines
758 B
TypeScript
22 lines
758 B
TypeScript
import { describe, expect, test } from "bun:test";
|
|
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"));
|
|
});
|
|
});
|