Skip to content

Commit

Permalink
fix: removed file exclusion log (#675)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaig-0911 committed May 3, 2024
1 parent bb119a8 commit 03c66b2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/common/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* Convenience wrapper to prefix a standard header for console log messages.
* Logging is enabled only when environment variable `SA11Y_DEBUG` is set.
*/
const sa11yAutoFilterListDefaultPackageName = 'sa11y-jest-automated-check-file-exclusion';

import * as fs from 'fs';
export function log(...args: unknown[]): void {
Expand All @@ -19,7 +20,7 @@ export function log(...args: unknown[]): void {

export function useFilesToBeExempted(): string[] {
const packageName: string =
process.env.SA11Y_AUTO_FILTER_LIST_PACKAGE_NAME ?? 'sa11y-jest-automated-check-file-exclusion';
process.env.SA11Y_AUTO_FILTER_LIST_PACKAGE_NAME ?? sa11yAutoFilterListDefaultPackageName;
let getFilesToBeExempted: () => string[];
if (packageName !== '') {
try {
Expand All @@ -28,7 +29,7 @@ export function useFilesToBeExempted(): string[] {
const filesToBeExempted = getFilesToBeExempted();
return filesToBeExempted;
} catch (error) {
console.log('Package not found : ', packageName);
if (packageName !== sa11yAutoFilterListDefaultPackageName) console.log('Package not found : ', packageName);
}
}
return [];
Expand Down

0 comments on commit 03c66b2

Please sign in to comment.