Skip to content

Commit cef9420

Browse files
committed
Update test because there seems to be a change in error message depending on broker version
1 parent 0b5e022 commit cef9420

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/promisified/admin/create_topics.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const {
55
createAdmin,
66
sleep,
77
} = require('../testhelpers');
8-
const { KafkaJSAggregateError, KafkaJSCreateTopicError } = require('../../../lib').KafkaJS;
8+
const { KafkaJSAggregateError, KafkaJSCreateTopicError, ErrorCodes } = require('../../../lib').KafkaJS;
99

1010
describe('Admin > createTopics', () => {
1111
let topicNames, admin;
@@ -90,7 +90,7 @@ describe('Admin > createTopics', () => {
9090

9191
const replicationErr = storedErr.errors.find(e => e.topic === topicNames[0] + '-invalid');
9292
expect(replicationErr).toBeInstanceOf(KafkaJSCreateTopicError);
93-
expect(replicationErr.message).toMatch(/The target replication factor/);
93+
expect(replicationErr.code).toEqual(ErrorCodes.ERR_INVALID_REPLICATION_FACTOR);
9494

9595
const partitionsErr = storedErr.errors.find(e => e.topic === topicNames[1]+ '-invalid');
9696
expect(partitionsErr).toBeInstanceOf(KafkaJSCreateTopicError);

0 commit comments

Comments
 (0)