Skip to content

Commit

Permalink
Warn about a11y tree exclusion
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Nov 18, 2019
1 parent 35d2eb5 commit d5478f8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/utils/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ import * as testingLibrary from '@testing-library/react/pure';
import consoleError from './consoleError';
import './initMatchers';

consoleError();

enzyme.configure({ adapter: new Adapter() });

// checking if an element is hidden is quite expensive
// this is only done in CI as a fail safe. It can still explicitly be checked
// in the test files which helps documenting what is part of the DOM but hidden
// from assistive technology
testingLibrary.configure({ defaultHidden: !process.env.CI });
const defaultHidden = !process.env.CI;
// adds verbosity for something that might be confusing
console.warn(`${defaultHidden ? 'including' : 'excluding'} inaccessible elements by default`);
testingLibrary.configure({ defaultHidden });

consoleError();

0 comments on commit d5478f8

Please sign in to comment.