From f82d773b2a8c0372acd8cf1bfd1963058d307283 Mon Sep 17 00:00:00 2001 From: Adam Cutler Date: Sun, 30 Dec 2018 03:10:14 -0700 Subject: [PATCH] fix: Log instead of error on unknown tag (#1290) --- lib/core/base/audit.js | 4 +--- test/core/base/audit.js | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/core/base/audit.js b/lib/core/base/audit.js index 5d4dd92b4f..389d77183e 100644 --- a/lib/core/base/audit.js +++ b/lib/core/base/audit.js @@ -604,9 +604,7 @@ Audit.prototype.normalizeOptions = function(options) { }, only.values); if (unmatchedTags.length !== 0) { - throw new Error( - 'Could not find tags `' + unmatchedTags.join('`, `') + '`' - ); + axe.log('Could not find tags `' + unmatchedTags.join('`, `') + '`'); } } else { throw new Error(`Unknown runOnly type '${only.type}'`); diff --git a/test/core/base/audit.js b/test/core/base/audit.js index a531315aa2..405d85340b 100644 --- a/test/core/base/audit.js +++ b/test/core/base/audit.js @@ -1273,8 +1273,8 @@ describe('Audit', function() { }); }); - it('throws an error when option.runOnly has an unknown tag', function() { - assert.throws(function() { + it("doesn't throw an error when option.runOnly has an unknown tag", function() { + assert.doesNotThrow(function() { a.normalizeOptions({ runOnly: { type: 'tags',