Skip to content

Commit

Permalink
Proper skips and more stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
jlandersen committed May 27, 2018
1 parent c7e7434 commit caeafc5
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test/test.kafkaClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ describe('Kafka Client', function () {

beforeEach(function (done) {
if (process.env.KAFKA_VERSION === '0.9') {
this.skip();
return this.skip();
}

client = new Client({
Expand Down Expand Up @@ -893,7 +893,7 @@ describe('Kafka Client', function () {

beforeEach(function (done) {
if (process.env.KAFKA_VERSION === '0.9') {
this.skip();
return this.skip();
}

sandbox = sinon.sandbox.create();
Expand Down Expand Up @@ -997,11 +997,13 @@ describe('Kafka Client', function () {
let client, sandbox;

beforeEach(function (done) {
this.skip();
if (process.env.KAFKA_VERSION === '0.9') {
return this.skip();
}

sandbox = sinon.sandbox.create();
client = new Client({
kafkaHost: '23.101.71.248:9092'
kafkaHost: 'localhost:9092'
});
client.once('ready', done);
});
Expand All @@ -1014,6 +1016,7 @@ describe('Kafka Client', function () {
it('should wrap callback', function () {
const fakeBroker = new BrokerWrapper(new FakeSocket());
sandbox.stub(client, 'getController').yields(null, fakeBroker);
sandbox.stub(client, 'queueCallback');
const wrapControllerSpy = sandbox.spy(client, 'wrapControllerCheckIfNeeded');
const callbackSpy = sandbox.spy();

Expand All @@ -1039,7 +1042,7 @@ describe('Kafka Client', function () {
it('should call encoder and queue callback', function () {
const fakeBroker = new BrokerWrapper(new FakeSocket());
sandbox.stub(client, 'getController').yields(null, fakeBroker);
const queueCallbackSpy = sandbox.spy(client, 'queueCallback');
const queueCallbackSpy = sandbox.stub(client, 'queueCallback');
const encoder = sandbox.spy();
const decoder = _.noop;
const args = [];
Expand Down

0 comments on commit caeafc5

Please sign in to comment.