From 03c66b2df14c3d80601e50e911a3eb40e8b5cbcd Mon Sep 17 00:00:00 2001 From: jaig-0911 <63843872+jaig-0911@users.noreply.github.com> Date: Fri, 3 May 2024 14:22:34 +0530 Subject: [PATCH] fix: removed file exclusion log (#675) --- packages/common/src/helpers.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/common/src/helpers.ts b/packages/common/src/helpers.ts index 23deb934..162c9cfd 100644 --- a/packages/common/src/helpers.ts +++ b/packages/common/src/helpers.ts @@ -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 { @@ -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 { @@ -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 [];