23 lines · 810 B · TypeScript
RawDownload
import { describe, expect, it } from "vite-plus/test"; import { fileBreadcrumbs } from "./filePath"; describe("fileBreadcrumbs", () => {  it("builds project, directory, and file crumbs", () => {    expect(fileBreadcrumbs("t3code", "apps/web/src/main.tsx")).toEqual([      { label: "t3code", path: "", kind: "project" },      { label: "apps", path: "apps", kind: "directory" },      { label: "web", path: "apps/web", kind: "directory" },      { label: "src", path: "apps/web/src", kind: "directory" },      { label: "main.tsx", path: "apps/web/src/main.tsx", kind: "file" },    ]);  });   it("normalizes repeated separators", () => {    expect(fileBreadcrumbs("workspace", "/src//index.ts").map((crumb) => crumb.label)).toEqual([      "workspace",      "src",      "index.ts",    ]);  });});

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t