MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / recordRealpaths

Function recordRealpaths

__tests__/sparse-checkout.test.ts:27–36  ·  view source on GitHub ↗

Every path `realpathSync` is asked about from here on.

()

Source from the content-addressed store, hash-verified

25
26/** Every path `realpathSync` is asked about from here on. */
27function recordRealpaths(): string[] {
28 const real = fs.realpathSync;
29 const asked: string[] = [];
30 vi.spyOn(fs, 'realpathSync').mockImplementation(((p: fs.PathLike, ...rest: []) => {
31 asked.push(String(p));
32 return real(p, ...rest);
33 }) as typeof fs.realpathSync);
34 Object.assign(fs.realpathSync, { native: real.native });
35 return asked;
36}
37
38afterEach(() => {
39 vi.restoreAllMocks();

Callers 1

Calls 2

realFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected