0.1.1 • Published 3 years ago

@kpbode/kafkajs-helpers v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

This a tiny helper to use with kafka (e.g. for integration tests).

createTopic

Create a topic with a given kafkajs instance.

// ...

await createTopic(kafka, topic);

// ...

waitForMessage

Starts a consumer and waits for the give time for message

// ...

const message = await waitForMessage(kafka, topic, "group-id", 10000);
expect(message).to.be.undefined;
0.1.1

3 years ago

0.1.0

3 years ago