Skip to content

Commit

Permalink
chore: improve spec coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
vishnu-narayanan committed Feb 22, 2024
1 parent 97a6876 commit 7048702
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test/helpers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,32 @@ describe('#convertSecondsToTimeUnit', () => {
})
).toEqual({ time: 1, unit: 'Minutes' });
});
it("it should return { time: 1, unit: 'h' } if 3600 seconds passed", () => {
expect(
convertSecondsToTimeUnit(3600, { minute: 'm', hour: 'h', day: 'd' })
).toEqual({ time: 1, unit: 'h' });
});
it("it should return { time: 1, unit: 'Hours' } if 3600 seconds passed", () => {
expect(
convertSecondsToTimeUnit(3600, {
minute: 'Minutes',
hour: 'Hours',
day: 'Days',
})
).toEqual({ time: 1, unit: 'Hours' });
});
it("it should return { time: 1, unit: 'd' } if 86400 seconds passed", () => {
expect(
convertSecondsToTimeUnit(86400, { minute: 'm', hour: 'h', day: 'd' })
).toEqual({ time: 1, unit: 'd' });
});
it("it should return { time: 1, unit: 'Days' } if 86400 seconds passed", () => {
expect(
convertSecondsToTimeUnit(86400, {
minute: 'Minutes',
hour: 'Hours',
day: 'Days',
})
).toEqual({ time: 1, unit: 'Days' });
});
});

0 comments on commit 7048702

Please sign in to comment.