Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/kafka/tests/unit/consumer.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { setTimeout } from 'node:timers/promises';
import type { Context } from 'aws-lambda';
import { describe, expect, it } from 'vitest';
import { z } from 'zod/v4';
Expand Down Expand Up @@ -145,6 +146,7 @@ describe('Kafka consumer', () => {
for (const record of event.records) {
try {
results.push(record.value);
await setTimeout(1); // simulate some processing time
} catch (error) {
return error;
}
Expand Down Expand Up @@ -247,6 +249,7 @@ describe('Kafka consumer', () => {
for (const record of event.records) {
try {
const { value, key } = record;
await setTimeout(1); // simulate some processing time
results.push([value, key]);
} catch (error) {
return error;
Expand Down Expand Up @@ -444,6 +447,7 @@ describe('Kafka consumer', () => {
try {
const { value } = record;
results.push(value);
await setTimeout(1); // simulate some processing time
} catch (error) {
results.push(error);
}
Expand Down Expand Up @@ -480,6 +484,7 @@ describe('Kafka consumer', () => {
try {
const { value } = record;
results.push(value);
await setTimeout(1); // simulate some processing time
} catch (error) {
results.push(error);
}
Expand Down Expand Up @@ -531,6 +536,7 @@ describe('Kafka consumer', () => {
try {
const { value } = record;
results.push(value);
await setTimeout(1); // simulate some processing time
} catch (error) {
results.push(error);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/kafka/tests/unit/deserializer.avro.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('Avro Deserializer: ', () => {
expect(await deserialize(message, schema)).toEqual(expected);
});

it('throws when avro deserialiser fails', async () => {
it('throws when avro deserialiser fails', () => {
// Prepare
const message = '0g8MTGFwdG9wUrgehes/j0A=';
const schema = `{
Expand All @@ -39,7 +39,7 @@ describe('Avro Deserializer: ', () => {
);
});

it('throws when avro deserialiser has not matching schema', async () => {
it('throws when avro deserialiser has not matching schema', () => {
// Prepare
const message = '0g8MTGFwdG9wUrgehes/j0A=';
const schema = `{
Expand Down
Loading