MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / mount

Function mount

graph-ui/src/architecture/useRepositoryGuide.test.tsx:11–24  ·  view source on GitHub ↗
(paths: string[], readSource?: SourceReader)

Source from the content-addressed store, hash-verified

9const cleanups: (() => Promise<void>)[] = [];
10afterEach(async () => { for (const cleanup of cleanups.splice(0)) await cleanup(); });
11async function mount(paths: string[], readSource?: SourceReader) {
12 const container = document.createElement('div'); document.body.append(container);
13 const root = createRoot(container);
14 let result: ReturnType<typeof useRepositoryGuide>;
15 function Harness({ paths, reader }: { paths: string[]; reader?: SourceReader }) {
16 result = useRepositoryGuide(paths, reader); return null;
17 }
18 const render = async (nextPaths = paths, reader = readSource) => {
19 await act(async () => root.render(<Harness paths={nextPaths} reader={reader} />));
20 };
21 cleanups.push(async () => { await act(async () => root.unmount()); container.remove(); });
22 await render();
23 return { render, result: () => result! };
24}
25
26it('finishes an empty inspection without leaving a permanent loading state', async () => {
27 const read = vi.fn(async () => ({ source: '' }));

Callers 1

Calls 3

removeMethod · 0.80
renderFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected