diff --git a/lib/core/base/audit.js b/lib/core/base/audit.js index 49c28d85bb..d9472a8d1e 100644 --- a/lib/core/base/audit.js +++ b/lib/core/base/audit.js @@ -150,9 +150,6 @@ const mergeFallbackMessage = (a, b) => { class Audit { constructor(audit) { // defaults - this.brand = 'axe'; - this.application = 'axeAPI'; - this.tagExclude = ['experimental']; this.lang = 'en'; this.defaultConfig = audit; this.standards = standards; @@ -298,6 +295,9 @@ class Audit { this.commands = {}; this.rules = []; this.checks = {}; + this.brand = 'axe'; + this.application = 'axeAPI'; + this.tagExclude = ['experimental']; unpackToObject(audit.rules, this, 'addRule'); unpackToObject(audit.checks, this, 'addCheck'); this.data = {}; diff --git a/test/core/base/audit.js b/test/core/base/audit.js index 19ed2e66de..930532c136 100644 --- a/test/core/base/audit.js +++ b/test/core/base/audit.js @@ -394,6 +394,35 @@ describe('Audit', function() { audit.resetRulesAndChecks(); assert.equal(audit.lang, 'en'); }); + it('should reset brand', function() { + var audit = new Audit(); + assert.equal(audit.brand, 'axe'); + audit.setBranding({ + brand: 'test' + }); + assert.equal(audit.brand, 'test'); + audit.resetRulesAndChecks(); + assert.equal(audit.brand, 'axe'); + }); + it('should reset brand application', function() { + var audit = new Audit(); + assert.equal(audit.application, 'axeAPI'); + audit.setBranding({ + application: 'test' + }); + assert.equal(audit.application, 'test'); + audit.resetRulesAndChecks(); + assert.equal(audit.application, 'axeAPI'); + }); + it('should reset brand tagExlcude', function() { + axe._load({}); + assert.deepEqual(axe._audit.tagExclude, ['experimental']); + axe.configure({ + tagExclude: ['ninjas'] + }); + axe._audit.resetRulesAndChecks(); + assert.deepEqual(axe._audit.tagExclude, ['experimental']); + }); }); describe('Audit#addCheck', function() {