MCPcopy Create free account
hub / github.com/freecodexyz/free-code / resetForTesting

Function resetForTesting

src/utils/settings/changeDetector.ts:461–480  ·  view source on GitHub ↗
(overrides?: {
  stabilityThreshold?: number
  pollInterval?: number
  mdmPollInterval?: number
  deletionGrace?: number
})

Source from the content-addressed store, hash-verified

459 * pending awaitWriteFinish poll fires on the deleted dir → ENOENT (#25253).
460 */
461export function resetForTesting(overrides?: {
462 stabilityThreshold?: number
463 pollInterval?: number
464 mdmPollInterval?: number
465 deletionGrace?: number
466}): Promise<void> {
467 if (mdmPollTimer) {
468 clearInterval(mdmPollTimer)
469 mdmPollTimer = null
470 }
471 for (const timer of pendingDeletions.values()) clearTimeout(timer)
472 pendingDeletions.clear()
473 lastMdmSnapshot = null
474 initialized = false
475 disposed = false
476 testOverrides = overrides ?? null
477 const w = watcher
478 watcher = null
479 return w ? w.close() : Promise.resolve()
480}
481
482export const settingsChangeDetector = {
483 initialize,

Callers

nothing calls this directly

Calls 3

resolveMethod · 0.80
clearMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected