-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use generated integration constants (#1959)
* refactor: use generated integration constants * refactor: integration constants * refactor: integration constants based on pr comments * refactor: integration constants based on pr comments
- Loading branch information
Showing
97 changed files
with
515 additions
and
355 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
packages/analytics-js-common/__tests__/constants/integrations/constants.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { readdirSync, statSync } from 'fs'; | ||
import { join } from 'path'; | ||
|
||
const BaseIntegrationDir = join(__dirname, '../../../src/constants/integrations'); | ||
describe('Integration Constants', () => { | ||
let allConstants: Record<string, string>; | ||
|
||
beforeAll(async () => { | ||
allConstants = await import(join(BaseIntegrationDir, 'Destinations')); | ||
}); | ||
|
||
const integrations = readdirSync(BaseIntegrationDir); | ||
integrations | ||
// Skip non integration folders | ||
.filter(dir => ['CommonIntegrationsConstant'].indexOf(dir) === -1) | ||
.filter(dir => statSync(join(BaseIntegrationDir, dir)).isDirectory()) | ||
.forEach(integration => { | ||
describe(`${integration} Integration`, () => { | ||
let integrationConstants: { NAME: string; DISPLAY_NAME: string }; | ||
|
||
beforeAll(async () => { | ||
const modulePath = join(BaseIntegrationDir, integration, 'constants'); | ||
integrationConstants = await import(modulePath); | ||
}); | ||
|
||
it('should have the same NAME as defined in Destination constants', () => { | ||
const { NAME } = integrationConstants; | ||
expect(NAME).toBeDefined(); | ||
expect(NAME).toEqual(allConstants[`${NAME}_NAME`]); | ||
}); | ||
|
||
it('should have the same DISPLAY_NAME as defined in Destination constants', () => { | ||
const { NAME, DISPLAY_NAME } = integrationConstants; | ||
expect(DISPLAY_NAME).toBeDefined(); | ||
expect(DISPLAY_NAME).toEqual(allConstants[`${NAME}_DISPLAY_NAME`]); | ||
}); | ||
}); | ||
}); | ||
}); |
7 changes: 5 additions & 2 deletions
7
packages/analytics-js-common/src/constants/integrations/ActiveCampaign/constants.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 5 additions & 2 deletions
7
packages/analytics-js-common/src/constants/integrations/AdobeAnalytics/constants.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/analytics-js-common/src/constants/integrations/Adroll/constants.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/analytics-js-common/src/constants/integrations/Amplitude/constants.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/analytics-js-common/src/constants/integrations/Appcues/constants.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/analytics-js-common/src/constants/integrations/Axeptio/constants.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/analytics-js-common/src/constants/integrations/BingAds/constants.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/analytics-js-common/src/constants/integrations/Braze/constants.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/analytics-js-common/src/constants/integrations/Bugsnag/constants.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/analytics-js-common/src/constants/integrations/Chartbeat/constants.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/analytics-js-common/src/constants/integrations/Clevertap/constants.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 4 additions & 11 deletions
15
packages/analytics-js-common/src/constants/integrations/CommandBar/constants.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,14 @@ | ||
import { COMMANDBAR_NAME as NAME, COMMANDBAR_DISPLAY_NAME as DISPLAY_NAME } from '../Destinations'; | ||
|
||
const DIR_NAME = 'CommandBar'; | ||
const NAME = 'COMMANDBAR'; | ||
const DISPLAY_NAME = 'CommandBar'; | ||
|
||
const DISPLAY_NAME_TO_DIR_NAME_MAP = { [DISPLAY_NAME]: DIR_NAME }; | ||
const CNameMapping = { | ||
[NAME]: NAME, | ||
'Command Bar': NAME, | ||
'Commandbar': NAME, | ||
Commandbar: NAME, | ||
COMMAND_BAR: NAME, | ||
commandbar: NAME, | ||
}; | ||
|
||
export { | ||
NAME, | ||
CNameMapping, | ||
DISPLAY_NAME_TO_DIR_NAME_MAP, | ||
DISPLAY_NAME, | ||
DIR_NAME, | ||
}; | ||
|
||
export { NAME, CNameMapping, DISPLAY_NAME_TO_DIR_NAME_MAP, DISPLAY_NAME, DIR_NAME }; |
15 changes: 0 additions & 15 deletions
15
packages/analytics-js-common/src/constants/integrations/Comscore/constants.ts
This file was deleted.
Oops, something went wrong.
7 changes: 5 additions & 2 deletions
7
packages/analytics-js-common/src/constants/integrations/ConvertFlow/constants.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/analytics-js-common/src/constants/integrations/Criteo/constants.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/analytics-js-common/src/constants/integrations/CustomerIO/constants.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 5 additions & 2 deletions
7
packages/analytics-js-common/src/constants/integrations/DCMFloodlight/constants.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.