Added a check for an error object passed into the method with "boomify" and handle it accordingly so boom will not throw an "Unable to wrap non-error object" error.
Tidied up the validate_func tests to match other test files with a separate server setup. This allowed for better debugging in my experience.
Separated out tests into specific cases.
Techncially the 'ASPLODE' test was also impacted by this bug, but the test did not catch it because the Hapi server wraps any 500 error in a generic "Internal Server Error" message, so I added a new case that throws a 404 error and is broken without the bug fix.
Code to address bug in Issue #468 https://github.com/dwyl/hapi-auth-jwt2/issues/468
Added a check for an error object passed into the method with "boomify" and handle it accordingly so boom will not throw an "Unable to wrap non-error object" error.
Tidied up the validate_func tests to match other test files with a separate server setup. This allowed for better debugging in my experience.
Separated out tests into specific cases.
Techncially the 'ASPLODE' test was also impacted by this bug, but the test did not catch it because the Hapi server wraps any 500 error in a generic "Internal Server Error" message, so I added a new case that throws a 404 error and is broken without the bug fix.