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

Function newWatcher

__tests__/watcher.test.ts:74–82  ·  view source on GitHub ↗
(
    syncFn: SyncFn,
    opts: WatchOptions = {},
    isFileStateCurrent?: (relativePath: string) => boolean
  )

Source from the content-addressed store, hash-verified

72 // Inert by default — unit tests drive events via __emitWatchEventForTests
73 // and never depend on real OS watch delivery.
74 const newWatcher = (
75 syncFn: SyncFn,
76 opts: WatchOptions = {},
77 isFileStateCurrent?: (relativePath: string) => boolean
78 ) => {
79 const watcher = new FileWatcher(testDir, syncFn, { inertForTests: true, ...opts }, isFileStateCurrent);
80 unitWatchers.add(watcher);
81 return watcher;
82 };
83
84 beforeEach(() => {
85 testDir = fs.mkdtempSync(path.join(os.tmpdir(), 'codegraph-watcher-'));

Callers 1

watcher.test.tsFile · 0.85

Calls 1

addMethod · 0.45

Tested by

no test coverage detected