Skip to content

Instantly share code, notes, and snippets.

@YonatanKra
Created December 21, 2024 04:41
Show Gist options
  • Save YonatanKra/e426959e065bfde9fe3186d9c883684b to your computer and use it in GitHub Desktop.
Save YonatanKra/e426959e065bfde9fe3186d9c883684b to your computer and use it in GitHub Desktop.
describe('run()', () => {
it('should fire the callback on every streaming event', async () => {
queueAgentFeedResponse(fullFeedResponse);
queueAgentFeedResponse(fullFeedLastResponse);
const spy = vi.fn();
await bot.run(handle, 'password', spy);
expect(spy).toHaveBeenCalledTimes(2);
});
});
async run(handle, callback: () => {}) {
       await this.streamPosts(handle, (data) => callback())
   }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment