Skip to content

Commit

Permalink
chore: source integration script filter condition (#3704)
Browse files Browse the repository at this point in the history
Co-authored-by: Sai Sankeerth <[email protected]>
  • Loading branch information
sanpj2292 and Sai Sankeerth authored Sep 3, 2024
1 parent 001909e commit 3f2a5a6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"type": "alias",
"previousId": "[email protected]",
"userId": "12345",
"context": {},
"receivedAt": "2024-03-03T04:48:29.000Z",
"request_ip": "192.0.2.30",
"messageId": "00000000-0000-0000-0000-000000000000"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
{
"userId": "1",
"originalTimestamp": "2020-09-28T19:53:31.900Z",
"context": {},
"traits": {
"firstName": "John",
"lastName": "doe",
Expand Down
9 changes: 5 additions & 4 deletions test/integrations/testUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,17 @@ 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[] = [];

if (opts.destination || opts.source) {
testFilePaths = testFilePaths.filter((testFile) =>
testFile.includes(`${opts.destination}/` || opts.source),
filteredTestFilePaths = testFilePaths.filter((testFile) =>
testFile.includes(`${opts.destination || opts.source}/`),
);
}
if (opts.feature) {
testFilePaths = testFilePaths.filter((testFile) => testFile.includes(opts.feature));
filteredTestFilePaths = testFilePaths.filter((testFile) => testFile.includes(opts.feature));
}
return testFilePaths;
return filteredTestFilePaths;
};

export const getTestData = (filePath): TestCaseData[] => {
Expand Down

0 comments on commit 3f2a5a6

Please sign in to comment.