Closed benib closed 6 years ago
All the tests now use async/await
as they should as server.inject
is an async function.
I had to change the behaviour in test number 10 "returns 500 when strategy returns a regular object to validateFunc".
This test was named confusingly to test for status 500 but in fact tested for status 200 and the thrown object to be in the body.
I changed this to test against status 500 as hapi responds with this if an error object is returned from the handler function.
Not sure if this change makes sense or if there should be a case where the validation function could throw resulting in status 200 in the end.
When it's planned to land?
@AdriVanHoudt just let me know if I can help here in any way...
Someone has to release a new version 🙌
Sorry being the bottleneck! Reviewing now!
Ok, I've created PR of changes I'd like to make on top these here: https://github.com/benib/hapi-auth-bearer-token/pull/1 so it's easier to see the proposed changes.
@benib @AdriVanHoudt can you review? If you're happy with those @benib can you merge it that PR, I'll merge this one and we can get this version out tomorrow.
@johnbrett the PR https://github.com/benib/hapi-auth-bearer-token/pull/1 is merged. So from my point of view this is all good. Thanks a lot for the collaboration to you and @AdriVanHoudt ❤️
Thank you for the PR 🎉
This makes the plugin work with hapi 17. It is a breaking change, tests are updated to work with the new version.
Let me know if you want me to change something.