File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33const Aws = require ( 'aws-sdk' ) ;
44const Async = require ( 'async' ) ;
55const Joi = require ( 'joi' ) ;
6+ const Hoek = require ( 'hoek' ) ;
67const Schemas = require ( './schemas' ) ;
78
89const 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 ) => {
Original file line number Diff line number Diff 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 ( {
You can’t perform that action at this time.
0 commit comments