Skip to content

Commit 33676fc

Browse files
committed
fix(node v4): solving issue with node v4 incompatibility,
1 parent 04f3509 commit 33676fc

2 files changed

Lines changed: 6 additions & 34 deletions

File tree

lib/index.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,19 @@
33
const Aws = require('aws-sdk');
44
const Async = require('async');
55
const Joi = require('joi');
6+
const Hoek = require('hoek');
67
const Schemas = require('./schemas');
78

89
const validateOptions = {
910
abortEarly: false
1011
};
1112

12-
exports.register = function (server, options = {}, next) {
13+
exports.register = function (server, options, next) {
1314

14-
if (!options.global) {
15-
return next(new Error('[options.global] must be present.'));
16-
}
17-
18-
if (!options.services) {
19-
return next(new Error('[options.services] must be present.'));
20-
}
15+
options = Hoek.applyToDefaults({
16+
global: {},
17+
services: []
18+
}, options);
2119

2220
Async.auto({
2321
globalConfig: (callback) => {

test/index.js

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -49,32 +49,6 @@ lab.describe('Plugin Registration', () => {
4949
});
5050
});
5151

52-
lab.it('it returns an error if no global config were passed.', (done) => {
53-
54-
register({}, (error) => {
55-
56-
Code.expect(error).to.exist();
57-
58-
return done();
59-
});
60-
});
61-
62-
lab.it('it returns an error if no services config were passed.', (done) => {
63-
64-
register({
65-
global: {
66-
accessKeyId: 'anything',
67-
secretAccessKey: 'anything',
68-
region: 'anything'
69-
}
70-
}, (error) => {
71-
72-
Code.expect(error).to.exist();
73-
74-
return done();
75-
});
76-
});
77-
7852
lab.it('it returns error if wrong formed service is passed.', (done) => {
7953

8054
register({

0 commit comments

Comments
 (0)