From 4066a9143c532ace5f909e04d777fef5b98c9a6a Mon Sep 17 00:00:00 2001 From: Justin Wind Date: Thu, 20 Jul 2023 15:58:51 -0700 Subject: [PATCH] minor coverage cleanup --- lib/content-negotiation.js | 1 + test/lib/enum.js | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/content-negotiation.js b/lib/content-negotiation.js index 4401374..e78fe35 100644 --- a/lib/content-negotiation.js +++ b/lib/content-negotiation.js @@ -102,6 +102,7 @@ class ContentNegotiation { if (acc === undefined && validTypesQuality[cur] !== 0.0) { return cur; } + // istanbul ignore next // eslint-disable-next-line security/detect-object-injection return validTypesQuality[acc] < validTypesQuality[cur] ? cur : acc; }, undefined); diff --git a/test/lib/enum.js b/test/lib/enum.js index 0a86ec5..bdd353f 100644 --- a/test/lib/enum.js +++ b/test/lib/enum.js @@ -9,13 +9,18 @@ const Enum = require('../../lib/enum'); describe('enum', function () { describe('ErrorResponse', function () { - it('covers default', function () { + it('covers broken', function () { const result = Enum.ErrorResponse.notPresent; const expected = { errorMessage: 'undefined error response \'notPresent\'', }; assert.deepStrictEqual(result, expected); }); + it('covers success', function () { + const { statusCode } = Enum.ErrorResponse.ReallyForbidden; + const expected = 403; + assert.deepStrictEqual(statusCode, expected); + }); }); // ErrorResponse }); -- 2.45.2