kafkajs

v2.2.4
A modern Apache Kafka client for node.js
kafka sasl scram

jest

export KAFKA_VERSION=${KAFKA_VERSION:='2.4'} && NODE_ENV=test echo "KAFKA_VERSION: ${KAFKA_VERSION}" && KAFKAJS_DEBUG_PROTOCOL_BUFFERS=1 jest

test:local

yarn jest --detectOpenHandles

test:debug

NODE_ENV=test KAFKAJS_DEBUG_PROTOCOL_BUFFERS=1 node --inspect-brk $(yarn bin 2>/dev/null)/jest --detectOpenHandles --runInBand --watch

test:local:watch

yarn test:local --watch

test

yarn lint && JEST_JUNIT_OUTPUT_NAME=test-report.xml ./scripts/testWithKafka.sh 'yarn jest --ci --maxWorkers=4 --no-watchman --forceExit'

lint

find . -path ./node_modules -prune -o -path ./coverage -prune -o -path ./website -prune -o -name '*.js' -print0 | xargs -0 eslint

format

find . -path ./node_modules -prune -o -path ./coverage -prune -o -path ./website -prune -o -name '*.js' -print0 | xargs -0 prettier --write

precommit

lint-staged

test:group:broker

yarn jest --forceExit --testPathPattern 'src/broker/.*'

test:group:admin

yarn jest --forceExit --testPathPattern 'src/admin/.*'

test:group:producer

yarn jest --forceExit --testPathPattern 'src/producer/.*'

test:group:consumer

yarn jest --forceExit --testPathPattern 'src/consumer/.*.spec.js'

test:group:others

yarn jest --forceExit --testPathPattern 'src/(?!(broker|admin|producer|consumer)/).*'

test:group:oauthbearer

OAUTHBEARER_ENABLED=1 yarn jest --forceExit src/producer/index.spec.js src/broker/__tests__/connect.spec.js src/consumer/__tests__/connection.spec.js src/broker/__tests__/disconnect.spec.js src/admin/__tests__/connection.spec.js src/broker/__tests__/reauthenticate.spec.js

test:group:broker:ci

JEST_JUNIT_OUTPUT_NAME=test-report.xml ./scripts/testWithKafka.sh "yarn test:group:broker --ci --maxWorkers=4 --no-watchman"

test:group:admin:ci

JEST_JUNIT_OUTPUT_NAME=test-report.xml ./scripts/testWithKafka.sh "yarn test:group:admin --ci --maxWorkers=4 --no-watchman"

test:group:producer:ci

JEST_JUNIT_OUTPUT_NAME=test-report.xml ./scripts/testWithKafka.sh "yarn test:group:producer --ci --maxWorkers=4 --no-watchman"

test:group:consumer:ci

JEST_JUNIT_OUTPUT_NAME=test-report.xml ./scripts/testWithKafka.sh "yarn test:group:consumer --ci --maxWorkers=4 --no-watchman"

test:group:others:ci

JEST_JUNIT_OUTPUT_NAME=test-report.xml ./scripts/testWithKafka.sh "yarn test:group:others --ci --maxWorkers=4 --no-watchman"

test:group:oauthbearer:ci

JEST_JUNIT_OUTPUT_NAME=test-report.xml COMPOSE_FILE='docker-compose.2_4_oauthbearer.yml' ./scripts/testWithKafka.sh "yarn test:group:oauthbearer --ci --maxWorkers=4 --no-watchman"

test:types

tsc -p types/
npm i kafkajs

Metadata

  • MIT
  • >=14.0.0
  • Tulio Ornelas
  • released 2/27/2023

Downloads

Maintainers