Skip to content

Commit

Permalink
chore: source integration script filter initial condition - 1 (#3706)
Browse files Browse the repository at this point in the history
chore: source integration script filter initial condition

Co-authored-by: Sai Sankeerth <[email protected]>
  • Loading branch information
sanpj2292 and Sai Sankeerth authored Sep 3, 2024
1 parent 3f2a5a6 commit a2aae58
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/integrations/testUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit a2aae58

Please sign in to comment.