Skip to content

Commit

Permalink
fix: deprecate na reporter (#1625)
Browse files Browse the repository at this point in the history
* fix: deprecate na reporter

* properly restore console
  • Loading branch information
straker authored Jun 10, 2019
1 parent 96a1ea8 commit 3e807f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions lib/core/reporters/na.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
axe.addReporter('na', function(results, options, callback) {
'use strict';

console.warn(
'"na" reporter will be deprecated in axe v4.0. Use the "v2" reporter instead.'
);

if (typeof options === 'function') {
callback = options;
options = {};
Expand Down
4 changes: 2 additions & 2 deletions test/core/log.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ describe('axe.log', function() {
assert.isFunction(axe.log);
});
it('should invoke console.log', function() {
var orig = window.console;
if (!window.console || window.console.log) {
window.console = { log: function() {} };
}
var orig = window.console.log;
var expected = ['hi', 'hello'];
var success = false;

Expand All @@ -21,6 +21,6 @@ describe('axe.log', function() {
axe.log.apply(axe.log, expected);
assert.isTrue(success);

window.console.log = orig;
window.console = orig;
});
});

0 comments on commit 3e807f0

Please sign in to comment.