Skip to content

Commit

Permalink
fix: add filter files for automatic checks (#607)
Browse files Browse the repository at this point in the history
  • Loading branch information
navateja-alagam authored Nov 2, 2023
1 parent a19cfe7 commit 6f84054
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/jest/src/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,24 @@ function registerRemoveChild() {
};
}

const improvedChecksFilter = [
'ui-email-stream-components/modules/emailStream/adminHealthInsights/__tests__/adminHealthInsights.test.js',
];

/**
* Register Sa11y Jest API and automatic checks depending on {@link Sa11yOpts}
* @param opts - {@link Sa11yOpts} to opt-in to automatic checks
*/
export function setup(opts: Sa11yOpts = defaultSa11yOpts): void {
registerRemoveChild();
if (process.env.SA11Y_AUTO) {
const testPath = expect.getState().testPath ?? '';
const ignoreImprovedChecks = improvedChecksFilter.some((fileName) =>
testPath.toLowerCase().includes(fileName.toLowerCase())
);
if (!ignoreImprovedChecks) {
registerRemoveChild();
}
}
registerSa11yMatcher();
// Set defaults from env vars
const autoCheckOpts = opts.autoCheckOpts;
Expand Down

0 comments on commit 6f84054

Please sign in to comment.