Skip to content

Commit 3f2a5a6

Browse files
SankeerthSai Sankeerth
Sankeerth
and
Sai Sankeerth
authored
chore: source integration script filter condition (#3704)
Co-authored-by: Sai Sankeerth <[email protected]>
1 parent 001909e commit 3f2a5a6

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

go/webhook/testcases/testdata/testcases/pipedream/alias_type____type_and_user_id_is_given.json

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"type": "alias",
2424
"previousId": "[email protected]",
2525
"userId": "12345",
26+
"context": {},
2627
"receivedAt": "2024-03-03T04:48:29.000Z",
2728
"request_ip": "192.0.2.30",
2829
"messageId": "00000000-0000-0000-0000-000000000000"

go/webhook/testcases/testdata/testcases/pipedream/identify_type____type_and_user_id_is_given.json

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
{
4040
"userId": "1",
4141
"originalTimestamp": "2020-09-28T19:53:31.900Z",
42+
"context": {},
4243
"traits": {
4344
"firstName": "John",
4445
"lastName": "doe",

test/integrations/testUtils.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,17 @@ const generateAlphanumericId = (size = 36) =>
2424
export const getTestDataFilePaths = (dirPath: string, opts: OptionValues): string[] => {
2525
const globPattern = join(dirPath, '**', 'data.ts');
2626
let testFilePaths = globSync(globPattern);
27+
let filteredTestFilePaths: string[] = [];
2728

2829
if (opts.destination || opts.source) {
29-
testFilePaths = testFilePaths.filter((testFile) =>
30-
testFile.includes(`${opts.destination}/` || opts.source),
30+
filteredTestFilePaths = testFilePaths.filter((testFile) =>
31+
testFile.includes(`${opts.destination || opts.source}/`),
3132
);
3233
}
3334
if (opts.feature) {
34-
testFilePaths = testFilePaths.filter((testFile) => testFile.includes(opts.feature));
35+
filteredTestFilePaths = testFilePaths.filter((testFile) => testFile.includes(opts.feature));
3536
}
36-
return testFilePaths;
37+
return filteredTestFilePaths;
3738
};
3839

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

0 commit comments

Comments
 (0)