Skip to content

Commit

Permalink
CR changes
Browse files Browse the repository at this point in the history
  • Loading branch information
KarthikBhaskara committed Jul 11, 2018
1 parent 5a766ae commit f59e724
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
6 changes: 1 addition & 5 deletions lib/auth-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,7 @@ function AuthClient(options) {
development: Joi.boolean(),
});

try {
Joi.assert(options, schema);
} catch (err) {
throw err;
}
Joi.assert(options, schema);

this.clientId = options.clientId;
this.clientSecret = options.clientSecret;
Expand Down
10 changes: 5 additions & 5 deletions test/lib/auth-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ test('constructor', function(t) {

});

test('constructor - validation error', function(t) {
test('constructor - missing required parameter', function(t) {

t.throws(() => new AuthClient({
clientId: 'f3266b17-961d-4295-8544-054c7bd94fbb',
redirectUri: 'https://insurance.co/callback',
scope: ['read_odometer', 'read_vehicle_info'],
}), Error);
}));

});

Expand All @@ -45,7 +45,7 @@ test('constructor - invalid uuid parameter', function(t) {
clientSecret: CLIENT_SECRET,
redirectUri: 'https://insurance.co/callback',
scope: ['read_odometer', 'read_vehicle_info'],
}), Error);
}));

});

Expand All @@ -56,7 +56,7 @@ test('constructor - invalid scope parameter', function(t) {
clientSecret: CLIENT_SECRET,
redirectUri: 'https://insurance.co/callback',
scope: 'read_odometer',
}), Error);
}));

});

Expand All @@ -68,7 +68,7 @@ test('constructor - invalid development parameter', function(t) {
redirectUri: 'https://insurance.co/callback',
scope: ['read_odometer', 'read_vehicle_info'],
development: 'truthsies',
}), Error);
}));

});

Expand Down

0 comments on commit f59e724

Please sign in to comment.