Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(react): export logToConsole fn #812

Merged
merged 3 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
});
});