Skip to content

Commit

Permalink
Add "only" to testIfKafka011
Browse files Browse the repository at this point in the history
  • Loading branch information
tulios committed Oct 29, 2018
1 parent d35a152 commit bb1eeaf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions testHelpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,16 @@ const addPartitions = async ({ topic, partitions }) => {
})
}

const testIfKafka011 = (description, callback) => {
const testIfKafka011 = (description, callback, testFn = test) => {
return process.env.KAFKA_VERSION === '0.11'
? test(description, callback)
? testFn(description, callback)
: test.skip(description, callback)
}

testIfKafka011.only = (description, callback) => {
return testIfKafka011(description, callback, test.only)
}

const unsupportedVersionResponse = () => Buffer.from({ type: 'Buffer', data: [0, 35, 0, 0, 0, 0] })

module.exports = {
Expand Down

0 comments on commit bb1eeaf

Please sign in to comment.