Skip to content

Commit 465ecc3

Browse files
authored
Merge pull request #317 from mcgG/mocha-update-fix
Unit test fix for mocha update
2 parents 5d2d56d + 88e3021 commit 465ecc3

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

spec/lib/common/child-process-spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ describe("ChildProcess", function () {
187187

188188
// Use done() because if the promise is fulfilled that is a failure
189189
// case for this test. Assert that we hit this catch block.
190-
return child.run()
190+
child.run()
191191
.catch(function(e) {
192192
expect(e).to.deep.equal(new Error('test failure'));
193193
expect(_runSpy).to.have.been.calledOnce;
@@ -253,7 +253,7 @@ describe("ChildProcess", function () {
253253
execFileStub.returns(mockSpawnedProcess)
254254
.callsArgWith(3, {code: -1}, undefined, "stderr result");
255255

256-
return child.run().then(function() {
256+
child.run().then(function() {
257257
done(new Error('Expect job to fail'));
258258
})
259259
.catch(function(e) {

spec/lib/common/connection-spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe('Connection', function () {
1717
context.amqp = function() {
1818
this.createConnection = sandbox.stub();
1919
};
20-
20+
2121
return [
2222
helper.di.simpleWrapper(context.Core, 'Services.Core' ),
2323
helper.di.simpleWrapper(context.amqp, 'amqp' )
@@ -28,7 +28,7 @@ describe('Connection', function () {
2828
Connection = helper.injector.get('Connection');
2929
amqp = helper.injector.get('amqp');
3030
});
31-
31+
3232
beforeEach(function() {
3333
this.subject = new Connection({url: ''}, {}, 'test');
3434
});
@@ -288,7 +288,7 @@ describe('Connection', function () {
288288
'disconnect':function(){done();},
289289
});
290290
});
291-
return this.subject.start().then(function () {
291+
this.subject.start().then(function () {
292292
return expect(self.subject.stop()).to.be.fulfilled;
293293
});
294294
});

spec/lib/common/json-schema-validator-spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ describe('JsonSchemaValidator', function () {
342342
nodeFs.readFileAsync.onCall(0).resolves(JSON.stringify(testSchema1));
343343
nodeFs.readFileAsync.onCall(1).resolves(JSON.stringify(testRefSchema1));
344344

345-
return validator.addSchemasByDir('/testdir', 'noMetaSchema.json')
345+
validator.addSchemasByDir('/testdir', 'noMetaSchema.json')
346346
.then(function () {
347347
done(new Error("Expect addSchemasByDir to fail"));
348348
})
@@ -359,7 +359,7 @@ describe('JsonSchemaValidator', function () {
359359
});
360360

361361
it('should throw assertion error when incorrect schemaDir passed', function (done) {
362-
return validator.addSchemasByDir(123)
362+
validator.addSchemasByDir(123)
363363
.then(function () {
364364
done(new Error("Expect addSchemasByDir to fail"));
365365
})
@@ -376,7 +376,7 @@ describe('JsonSchemaValidator', function () {
376376
});
377377

378378
it('should throw assertion error when incorrect metaSchemaName passed', function (done) {
379-
return validator.addSchemasByDir('testdir3', 456)
379+
validator.addSchemasByDir('testdir3', 456)
380380
.then(function () {
381381
done(new Error("Expect addSchemasByDir to fail"));
382382
})

spec/lib/common/subscription-spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ describe('Subscription', function () {
8888
self.subject.MAX_DISPOSE_RETRIES = 1;
8989
self.queue.unsubscribe.rejects(new Error('test error'));
9090

91-
return expect(self.subject.dispose()).to.be.rejectedWith(/test error/)
91+
expect(self.subject.dispose()).to.be.rejectedWith(/test error/)
9292
.then(function() {
9393
setTimeout(function() {
9494
try {
@@ -105,7 +105,7 @@ describe('Subscription', function () {
105105
});
106106

107107
it('should reject with an error if the queue is already unsubscribed', function () {
108-
108+
109109
this.subject.queue.state = 'closing';
110110

111111
return this.subject.dispose().should.be.rejectedWith(

spec/lib/services/hook-spec.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe('Hook', function () {
1313
var payload = {"hello": "world", "routingKey": "test"};
1414

1515
helper.before();
16-
16+
1717
before("Before hookService test", function(){
1818
helper.setupInjector([
1919
helper.require('/lib/services/hook'),
@@ -52,7 +52,7 @@ describe('Hook', function () {
5252
.post('/test')
5353
.reply(201, 'OK');
5454
findStub.withArgs({}).resolves([hooks[0]]);
55-
return hookService .publish(payload)
55+
hookService .publish(payload)
5656
.then(function(){
5757
expect(hookService ._publish).to.have.been.calledOnce;
5858
expect(hookService ._publish).to.have.been.calledWith(hooks[0], payload);
@@ -80,7 +80,7 @@ describe('Hook', function () {
8080
.reply(201, 'OK');
8181

8282
findStub.withArgs({}).resolves(hooks);
83-
return hookService .publish(payload)
83+
hookService .publish(payload)
8484
.then(function(){
8585
expect(hookService ._publish).to.have.been.calledTwice;
8686
expect(hookService ._publish).to.have.been.calledWith(hooks[0], payload);
@@ -97,7 +97,7 @@ describe('Hook', function () {
9797
expect(hookService ._publish).to.have.not.been.called;
9898
});
9999
});
100-
100+
101101
it('should post data to hook url only after passed filter', function (done) {
102102
var _hooks = _.cloneDeep(hooks);
103103
var scope = nock('https://172.1.1.0:8080')
@@ -113,11 +113,11 @@ describe('Hook', function () {
113113
.reply(201, 'OK');
114114
_hooks[0].filters = [{hello: "world|anything"}, {routingKey: "anything"}];
115115
_hooks[1].filters = [
116-
{hello: "world", routingKey: "anything"},
116+
{hello: "world", routingKey: "anything"},
117117
{routingKey: "[^(anything|test)]"}
118118
];
119119
findStub.withArgs({}).resolves(_hooks);
120-
return hookService.publish(payload)
120+
hookService.publish(payload)
121121
.then(function(){
122122
expect(hookService._publish).to.have.been.calledTwice;
123123
expect(scope.isDone()).to.equal(false);
@@ -138,7 +138,7 @@ describe('Hook', function () {
138138
_publishSpy.restore();
139139
sinon.stub(hookService , '_publish').withArgs(hooks[0], payload)
140140
.rejects(new Error('Failed to send data to all hooks'));
141-
return hookService .publish(payload)
141+
hookService .publish(payload)
142142
.then(function(){
143143
done(new Error('Test should fail'));
144144
})

0 commit comments

Comments
 (0)