diff --git a/lib/core/base/audit.js b/lib/core/base/audit.js index 1c6432eaf1..86df69b490 100644 --- a/lib/core/base/audit.js +++ b/lib/core/base/audit.js @@ -165,7 +165,7 @@ Audit.prototype.run = function (context, options, resolve, reject) { result: axe.constants.CANTTELL, description: 'An error occured while running this rule', message: err.message, - help: err.stack || err.message, + stack: err.stack, error: err }); res(errResult); diff --git a/test/core/base/audit.js b/test/core/base/audit.js index af6a18c948..f5d8df59ee 100644 --- a/test/core/base/audit.js +++ b/test/core/base/audit.js @@ -496,6 +496,7 @@ describe('Audit', function () { }); it('catches errors and passes them as a cantTell result', function (done) { + var err = new Error('Launch the super sheep!'); a.addRule({ id: 'throw1', selector: '*', @@ -506,7 +507,7 @@ describe('Audit', function () { a.addCheck({ id: 'throw1-check1', evaluate: function () { - throw new Error('Launch the super sheep!'); + throw err; } }); @@ -518,7 +519,9 @@ describe('Audit', function () { }, function (results) { assert.lengthOf(results,1); assert.equal(results[0].result, 'cantTell'); - assert.equal(results[0].error.message, 'Launch the super sheep!'); + assert.equal(results[0].message, err.message); + assert.equal(results[0].stack, err.stack); + assert.equal(results[0].error, err); done(); }, isNotCalled); });