Skip to content

Commit

Permalink
feat(react): export logToConsole fn (#812)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-siek committed Sep 12, 2023
1 parent 764ad64 commit 480fb12
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/react/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,8 @@ export default function reactAxe(
return checkAndReport(document.body, timeout);
}

reactAxe.logToConsole = logToConsole;

if (typeof module === 'object') {
exports = module.exports = reactAxe;
}
6 changes: 5 additions & 1 deletion packages/react/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { mount } from 'enzyme';
import sinon from 'sinon';
import { assert } from 'chai';
import axe from 'axe-core';
import reactAxe from '../dist/index.js';
import reactAxe, { logToConsole } from '../dist/index.js';
import cache from '../dist/cache.js';

class App extends React.Component {
Expand Down Expand Up @@ -541,4 +541,8 @@ describe(`@axe-core/react using react@${React.version}`, () => {
}
});
});

it('check to make sure logToConsole is exported', () => {
assert.isFunction(logToConsole);
});
});

0 comments on commit 480fb12

Please sign in to comment.