From f46ecea789c28db66a139ccf1ce38a19f6b443fd Mon Sep 17 00:00:00 2001 From: Nicolas Morel Date: Sun, 2 Aug 2026 13:41:20 +0200 Subject: [PATCH] chore: add regression tests based on #307 --- test/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/index.js b/test/index.js index 1c760ce..171c0e0 100755 --- a/test/index.js +++ b/test/index.js @@ -227,6 +227,14 @@ describe('Boom', () => { expect(err.data).toBeNull(); }); + it('wraps a DOMException without touching its getters', () => { + const error = new DOMException('kaboom', 'AbortError'); + const err = Boom.boomify(error, { statusCode: 400 }); + + expect(err.cause).toBe(error); + expect(err.output.payload.message).toBe('kaboom'); + }); + it('sets new message when none exists', () => { const error = new Error(); const wrapped = Boom.boomify(error, { statusCode: 400, message: 'something bad' });