Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RAC-5743: unit test doesn't exit after upgrading mocha to 4.0.1 #318

Merged
merged 1 commit into from
Nov 10, 2017
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
2 changes: 1 addition & 1 deletion lib/common/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function connectionFactory (assert, amqp, Promise, util, _) {
delete self.connection;
resolve();
});

self.connection.setImplOptions({reconnect: false});
self.connection.disconnect();
} else {
reject(new Error('Connection Not Started.'));
Expand Down
1 change: 1 addition & 0 deletions lib/services/statsd.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ function statsdServiceFactory(
if(this.started) {
this.increment('process.stopped');
this.started = false;
this.close();
}
return Promise.resolve();
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"istanbul": "^0.3.5",
"jsdoc": "^3.3.0-alpha13",
"jshint": "^2.5.11",
"mocha": "^2.1.0",
"mocha": "^4.0.1",
"nock": "~9.0.22",
"sinon": "1.16.1",
"sinon-as-promised": "^2.0.3",
Expand Down
3 changes: 2 additions & 1 deletion spec/lib/common/connection-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,8 @@ describe('Connection', function () {
});
this.subject.start().then(function () {
return expect(self.subject.stop()).to.be.fulfilled;
});
})
.then(done());
});

it('should reject if not connected', function () {
Expand Down
7 changes: 3 additions & 4 deletions spec/lib/protocol/dhcp-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,10 @@ describe("DHCP protocol functions", function () {
testSubscription = new Subscription({},{});
testMessage = new Message({},{},{});
sinon.stub(testMessage);
sinon.stub(messenger);
});

beforeEach(function() {
messenger.subscribe.reset();
messenger.request.reset();
this.sandbox.stub(messenger, 'request');
});

helper.after();
Expand Down Expand Up @@ -291,4 +289,5 @@ describe("DHCP protocol functions", function () {
}).should.be.rejectedWith(sampleError);
});
});
});
});

5 changes: 4 additions & 1 deletion spec/lib/protocol/scheduler-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ describe("Schedular protocol functions", function () {
testSubscription = new Subscription({},{});
testMessage = new Message({},{},{});
sinon.stub(testMessage);
sinon.stub(messenger);
});

beforeEach(function() {
this.sandbox.stub(messenger, 'request');
});

helper.after();
Expand Down
8 changes: 7 additions & 1 deletion spec/lib/protocol/task-graph-runner-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ describe("TaskGraph Runner protocol functions", function () {
testSubscription = new Subscription({},{});
testMessage = new Message({},{},{});
sinon.stub(testMessage);
sinon.stub(messenger);
});

beforeEach(function() {
this.sandbox.stub(messenger, 'request');
this.sandbox.stub(messenger, 'publish');
this.sandbox.stub(messenger, 'subscribe');
});

helper.after();
Expand Down Expand Up @@ -88,6 +93,7 @@ describe("TaskGraph Runner protocol functions", function () {

it("should subscribe and receive cancelTaskGraph failures", function() {
var graphId = uuid.v4();
messenger.subscribe.restore();
messenger.request.rejects(sampleError);
return taskgraphrunner.subscribeCancelTaskGraph(function(_graphId) {
expect(_graphId).to.deep.equal(graphId);
Expand Down
5 changes: 4 additions & 1 deletion spec/lib/protocol/task-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@ describe("Task protocol functions", function() {
testSubscription = new Subscription({},{});
testMessage = new Message({},{},{});
sinon.stub(testMessage);
sinon.stub(messenger);
sinon.stub(testSubscription);
sinon.stub(events);
});

beforeEach(function() {
this.sandbox.stub(messenger, 'request');
this.sandbox.stub(messenger, 'publish');
});
helper.after();

describe("Run", function() {
Expand Down
5 changes: 0 additions & 5 deletions spec/lib/protocol/waterline-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,18 @@ describe('Protocol.Waterline', function() {
var Subscription = helper.injector.get('Subscription');
testSubscription = new Subscription({},{});
sinon.stub(testSubscription);
sinon.stub(messenger);
});

helper.after();

it('should publish a created event', function() {
messenger.publish.resolves();
return waterlineProtocol.publishRecord(collection, 'created', { id: 1 });
});

it('should publish an updated event', function() {
messenger.publish.resolves();
return waterlineProtocol.publishRecord(collection, 'updated', { id: 1 });
});

it('should publish a destroyed event', function() {
messenger.publish.resolves();
return waterlineProtocol.publishRecord(collection, 'destroyed', { id: 1 });
});
});
Expand Down