hapijs / boom

HTTP-friendly error objects
Other
2.94k stars 192 forks source link

fix: make reformat configurable in initialize #289

Closed AdriVanHoudt closed 3 years ago

AdriVanHoudt commented 3 years ago

I didn't really see how to write a test for this but let me know if you have ideas.

Fixes https://github.com/hapijs/boom/issues/288

devinivy commented 3 years ago

If you'd like to pull in an old version of boom for testing purposes, you could do something like this: https://github.com/hapijs/hapi/blob/c95985e225fa09c4b640a887ccb4be46dbe265bc/package.json#L43

kanongil commented 3 years ago

For a test, I would probably just do something like Object.defineProperty(new Boom.Boom('oops'), 'reformat', { value: true }). It should fail on the current release, and pass with this fix.

AdriVanHoudt commented 3 years ago

Added the test, thanks for the nice and easy suggestion @kanongil

devinivy commented 3 years ago

Thanks!