Skip to content

The IDE you know, rebuilt in Rust. IntelliJ IDEA–style keymap, tool windows and search-everywhere in a fast native app: editor, code insight, debugger, Git, terminal, database and HTTP clients for 60+ languages.

534 B
Raw Blame
import { describe, expect, it } from "vitest";
import { filePathChain } from "./filePath";

describe("filePathChain", () => {
  it("lists the file then every folder up to the root", () => {
    expect(filePathChain("/work/app/src/main.ts")).toEqual([
      "/work/app/src/main.ts",
      "/work/app/src",
      "/work/app",
      "/work",
      "/",
    ]);
  });

  it("stops at a Windows drive root", () => {
    expect(filePathChain("C:/Users/me/a.txt")).toEqual(["C:/Users/me/a.txt", "C:/Users/me", "C:/Users", "C:/"]);
  });
});