diff --git a/test/integrations/destinations/mp/common.ts b/test/integrations/destinations/mp/common.ts new file mode 100644 index 0000000000..871b447269 --- /dev/null +++ b/test/integrations/destinations/mp/common.ts @@ -0,0 +1,28 @@ +const defaultMockFns = () => { + jest.spyOn(Date, 'now').mockImplementation(() => new Date(Date.UTC(2020, 0, 25)).valueOf()); +}; + +const sampleDestination = { + Config: { + apiKey: 'dummyApiKey', + token: 'dummyApiKey', + prefixProperties: true, + useNativeSDK: false, + }, + DestinationDefinition: { + DisplayName: 'Mixpanel', + ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', + Name: 'MP', + }, + Enabled: true, + ID: '1WhcOCGgj9asZu850HvugU2C3Aq', + Name: 'MP', + Transformations: [], +}; + +const getDestination = (configValues) => { + const destination = Object.assign({}, sampleDestination, { Config: configValues }); + return destination; +}; + +export { sampleDestination, defaultMockFns, getDestination } \ No newline at end of file diff --git a/test/integrations/destinations/mp/processor/data.ts b/test/integrations/destinations/mp/processor/data.ts index ee356c1ab6..fa36d35e64 100644 --- a/test/integrations/destinations/mp/processor/data.ts +++ b/test/integrations/destinations/mp/processor/data.ts @@ -1,29 +1,4 @@ -const defaultMockFns = () => { - jest.spyOn(Date, 'now').mockImplementation(() => new Date(Date.UTC(2020, 0, 25)).valueOf()); -}; - -const sampleDestination = { - Config: { - apiKey: 'dummyApiKey', - token: 'dummyApiKey', - prefixProperties: true, - useNativeSDK: false, - }, - DestinationDefinition: { - DisplayName: 'Mixpanel', - ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', - Name: 'MP', - }, - Enabled: true, - ID: '1WhcOCGgj9asZu850HvugU2C3Aq', - Name: 'MP', - Transformations: [], -}; - -const getDestination = (configValues) => { - const destination = Object.assign({}, sampleDestination, { Config: configValues }); - return destination; -}; +import { sampleDestination, defaultMockFns, getDestination } from '../common'; export const data = [ { diff --git a/test/integrations/destinations/mp/router/data.ts b/test/integrations/destinations/mp/router/data.ts index 2ac51463cb..fe8181f083 100644 --- a/test/integrations/destinations/mp/router/data.ts +++ b/test/integrations/destinations/mp/router/data.ts @@ -1,29 +1,4 @@ -const defaultMockFns = () => { - jest.spyOn(Date, 'now').mockImplementation(() => new Date(Date.UTC(2020, 0, 25)).valueOf()); -}; - -const sampleDestination = { - Config: { - apiKey: 'dummyApiKey', - token: 'dummyApiKey', - prefixProperties: true, - useNativeSDK: false, - }, - DestinationDefinition: { - DisplayName: 'Mixpanel', - ID: '1WhbSZ6uA3H5ChVifHpfL2H6sie', - Name: 'MP', - }, - Enabled: true, - ID: '1WhcOCGgj9asZu850HvugU2C3Aq', - Name: 'MP', - Transformations: [], -}; - -const getDestination = (configValues) => { - const destination = Object.assign({}, sampleDestination, { Config: configValues }); - return destination; -}; +import { sampleDestination, getDestination } from '../common'; export const data = [ {