Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

fileTreeExpansion.test.ts

10 lines520 Bytes

1import { expect, it } from "vite-plus/test";
2​
3import { readExpandedDirectories, writeExpandedDirectories } from "./fileTreeExpansion";
4​
5it("keeps the 100 expanded folders nearest the root, so a remount does not list hundreds", () => {
6 const deep = Array.from({ length: 150 }, (_, index) => `pkg/mod/d${index}/`);
7 writeExpandedDirectories("env:/repo", [...deep, "pkg/mod/", "pkg/"]);
8 const restored = readExpandedDirectories("env:/repo");
9 expect(restored).toEqual(["pkg/", "pkg/mod/", ...deep.slice(0, 98)]);
10});