Skip to content

Commit

Permalink
fix: move to utility
Browse files Browse the repository at this point in the history
  • Loading branch information
aashishmalik committed Oct 11, 2023
1 parent cdaec41 commit 0f90f0d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/v0/destinations/campaign_manager/util.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@ const { convertToMicroseconds } = require('./util');

describe('convertToMicroseconds utility test', () => {
it('ISO 8601 input', () => {
expect(1609748704780000).toEqual(convertToMicroseconds('2021-01-04T08:25:04.780Z'));
expect(convertToMicroseconds('2021-01-04T08:25:04.780Z')).toEqual(1609748704780000);
});

it('unix microseconds input', () => {
expect(1668624722903333).toEqual(convertToMicroseconds('1668624722903333'));
expect(convertToMicroseconds('1668624722903333')).toEqual(1668624722903333);
});

it('non numeric time input', () => {
expect(1668624722903000).toEqual(convertToMicroseconds('2022-11-17T00:22:02.903+05:30'));
expect(convertToMicroseconds('2022-11-17T00:22:02.903+05:30')).toEqual(1668624722903000);
});

it('unix seconds input', () => {
expect(1697013935000000).toEqual(convertToMicroseconds('1697013935'));
expect(convertToMicroseconds('1697013935')).toEqual(1697013935000000);
});

it('unix miliseconds input', () => {
expect(1697013935000000).toEqual(convertToMicroseconds('1697013935000'));
expect(convertToMicroseconds('1697013935000')).toEqual(1697013935000000);
});
});

0 comments on commit 0f90f0d

Please sign in to comment.