дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-08 19:02:17 +02:00
15 рядки
528 B
TypeScript
15 рядки
528 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { relativeDir } from "./project";
|
|
|
|
describe("relativeDir", () => {
|
|
it("is empty for files directly in the project root", () => {
|
|
expect(relativeDir("/p/app", "/p/app/README.md")).toBe("");
|
|
});
|
|
it("is project-relative for nested files", () => {
|
|
expect(relativeDir("/p/app", "/p/app/src/lib/a.ts")).toBe("src/lib");
|
|
});
|
|
it("keeps the absolute directory outside the project", () => {
|
|
expect(relativeDir("/p/app", "/other/x.ts")).toBe("/other");
|
|
});
|
|
});
|