diff --git a/lib/validator.js b/lib/validator.js index 77ba6fcf..363ab010 100644 --- a/lib/validator.js +++ b/lib/validator.js @@ -186,16 +186,13 @@ const ashnazgHookUrls = [ ]; function validateAshHooks(hooks) { - // Note: unlike `reportError` used above, here empty object literals are - // pushed instead of nulls. This is simply to match the original structure - // of report.json. TODO: change this to null, or add error details. const errors = []; const ashHooks = hooks.filter(h => ashnazgHookUrls.includes(h.config.url) && h.config.contentType === "json" && h.config.insecureSsl === "0" && h.config.secret !== ""); if (ashHooks.length === 0) { - errors.push(['missingashnazghook', {}]); + errors.push(['missingashnazghook', null]); } if (ashHooks.length > 1) { - errors.push(['duplicateashnazghooks', {}]); + errors.push(['duplicateashnazghooks', null]); } return errors; } diff --git a/test/validator.js b/test/validator.js index d30460d0..fe546bce 100644 --- a/test/validator.js +++ b/test/validator.js @@ -411,7 +411,7 @@ describe('validateAshHooks', () => { it('no hooks', () => { const hooks = []; const errors = validateAshHooks(hooks); - assert.deepStrictEqual(errors, [['missingashnazghook', {}]]); + assert.deepStrictEqual(errors, [['missingashnazghook', null]]); }); it('one hook', () => { @@ -444,6 +444,6 @@ describe('validateAshHooks', () => { } }]; const errors = validateAshHooks(hooks); - assert.deepStrictEqual(errors, [['duplicateashnazghooks', {}]]); + assert.deepStrictEqual(errors, [['duplicateashnazghooks', null]]); }); });