permission denied tests

This commit is contained in:
Simon Martín 2018-03-28 14:02:10 +02:00
parent db6ab4a591
commit 3ad3cb7aa9

View File

@ -53,4 +53,19 @@ describe('error-handler-factory', function () {
assert.deepEqual(errorHandler, expectedError);
});
it('permission denied error', function() {
const error = new Error('permission denied');
const errorHandler = errorHandlerFactory(error);
const expectedError = new ErrorHandler(
error.message,
error.context,
error.detail,
error.hint,
403,
codeToCondition[error.code] || error.name
);
assert.deepEqual(errorHandler, expectedError);
});
});