Skip to content

Commit

Permalink
chore: make a common file for common modules
Browse files Browse the repository at this point in the history
  • Loading branch information
ujjwal-ab committed Oct 3, 2023
1 parent c1722d3 commit fd57123
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 52 deletions.
28 changes: 28 additions & 0 deletions test/integrations/destinations/mp/common.ts
Original file line number Diff line number Diff line change
@@ -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 }
27 changes: 1 addition & 26 deletions test/integrations/destinations/mp/processor/data.ts
Original file line number Diff line number Diff line change
@@ -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 = [
{
Expand Down
27 changes: 1 addition & 26 deletions test/integrations/destinations/mp/router/data.ts
Original file line number Diff line number Diff line change
@@ -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 = [
{
Expand Down

0 comments on commit fd57123

Please sign in to comment.