UNPKG

@qntm-code/utils

Version:

A collection of useful utility functions with associated TypeScript types. All functions have been unit tested.

21 lines (20 loc) 778 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const __1 = require("../.."); describe('convertTimeUnit', () => { it('should convert days into weeks', () => { const days = 7; const weeks = 1; expect((0, __1.convertTimeUnit)(days, __1.TimeUnit.Days, __1.TimeUnit.Weeks)).toBe(weeks); }); it('should convert hours into seconds', () => { const hours = 2; const seconds = 7200; expect((0, __1.convertTimeUnit)(hours, __1.TimeUnit.Hours, __1.TimeUnit.Seconds)).toBe(seconds); }); it('should convert weeks into days', () => { const weeks = 2; const Days = 14; expect((0, __1.convertTimeUnit)(weeks, __1.TimeUnit.Weeks, __1.TimeUnit.Days)).toBe(Days); }); });