From caccf17ea684a68592b10f6d8d8d42780578cf67 Mon Sep 17 00:00:00 2001 From: Sai Sankeerth Date: Tue, 3 Sep 2024 15:37:35 +0530 Subject: [PATCH] chore: source integration script filter initial condition --- test/integrations/testUtils.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/integrations/testUtils.ts b/test/integrations/testUtils.ts index 13c0727f8f..7d1c2a4317 100644 --- a/test/integrations/testUtils.ts +++ b/test/integrations/testUtils.ts @@ -24,11 +24,12 @@ const generateAlphanumericId = (size = 36) => export const getTestDataFilePaths = (dirPath: string, opts: OptionValues): string[] => { const globPattern = join(dirPath, '**', 'data.ts'); let testFilePaths = globSync(globPattern); - let filteredTestFilePaths: string[] = []; + let filteredTestFilePaths: string[] = testFilePaths; - if (opts.destination || opts.source) { - filteredTestFilePaths = testFilePaths.filter((testFile) => - testFile.includes(`${opts.destination || opts.source}/`), + const destinationOrSource = opts.destination || opts.source; + if (destinationOrSource) { + filteredTestFilePaths = testFilePaths.filter( + (testFile) => destinationOrSource && testFile.includes(`${destinationOrSource}/`), ); } if (opts.feature) {