Skip to content

Commit

Permalink
Fix SearchForm creates timestamp for weeks ago test (jaegertracing#569)
Browse files Browse the repository at this point in the history
Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>
  • Loading branch information
rubenvp8510 authored May 12, 2020
1 parent e01d90f commit 8e348fd
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,14 @@ describe('lookback utils', () => {
});
});

// DST/not-DST means this test will fail for 14 out of 52 weeks of the year!
xit('creates timestamp for weeks ago', () => {
it('creates timestamp for weeks ago', () => {
[1, 2, 4, 7].forEach(lookbackNum => {
expect(nowInMicroseconds - lookbackToTimestamp(`${lookbackNum}w`, now)).toBe(
lookbackNum * 7 * 24 * hourInMicroseconds
);
const actual = nowInMicroseconds - lookbackToTimestamp(`${lookbackNum}w`, now);
try {
expect(actual).toBe(lookbackNum * 7 * 24 * hourInMicroseconds);
} catch (_e) {
expect(Math.abs(actual - lookbackNum * 7 * 24 * hourInMicroseconds)).toBe(hourInMicroseconds);
}
});
});
});
Expand Down

0 comments on commit 8e348fd

Please sign in to comment.