MCPcopy
hub / github.com/foambubble/foam / forceCleanup

Function forceCleanup

packages/foam-vscode/src/test/vscode-mock.ts:2386–2407  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2384// ===== Force Cleanup for Test Files =====
2385
2386export async function forceCleanup(): Promise<void> {
2387 // Clean up existing Foam instance
2388 TestFoam.dispose();
2389
2390 // Clear all event listeners by resetting emitters
2391 mockState.activeTextEditor = undefined;
2392 mockState.visibleTextEditors = [];
2393
2394 // Close any open file handles by clearing the file system
2395 mockState.fileSystem = new MockFileSystem();
2396
2397 // Clear configuration
2398 mockState.configuration = new MockWorkspaceConfiguration();
2399
2400 // Force garbage collection
2401 if (global.gc) {
2402 global.gc();
2403 }
2404
2405 // Wait for any pending file system operations to complete
2406 await new Promise(resolve => setTimeout(resolve, 10));
2407}

Callers 1

Calls 1

disposeMethod · 0.65

Tested by

no test coverage detected