// Add this import at the top of test files
import { createResourceCleanup } from '../helpers/cleanup'; // or '../../helpers/cleanup' for nested paths

// Add this inside describe block
const cleanup = createResourceCleanup();

// Add this afterEach hook
afterEach(async () => {
  await cleanup.afterEach();
  jest.clearAllMocks();
});

// For tracking event emitters:
cleanup.trackEmitter(eventBus);
cleanup.events.on(emitter, 'event', handler);

// For tracking agents:
cleanup.agents.track(agent);
// or
const agent = cleanup.agents.create(AgentClass, config);
