From 38acabfa6089ab8ac469c12b5f55022fb96935e5 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 23 Aug 2021 16:46:06 -0300 Subject: added web vendors --- date-fns/src/hoursToMilliseconds/test.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 date-fns/src/hoursToMilliseconds/test.ts (limited to 'date-fns/src/hoursToMilliseconds/test.ts') diff --git a/date-fns/src/hoursToMilliseconds/test.ts b/date-fns/src/hoursToMilliseconds/test.ts new file mode 100644 index 0000000..fdc426c --- /dev/null +++ b/date-fns/src/hoursToMilliseconds/test.ts @@ -0,0 +1,20 @@ +/* eslint-env mocha */ + +import assert from 'assert' +import hoursToMilliseconds from '.' + +describe('hoursToMilliseconds', function () { + it('converts hours to milliseconds', function () { + assert(hoursToMilliseconds(1) === 3600000) + assert(hoursToMilliseconds(2) === 7200000) + }) + + it('uses floor rounding', () => { + assert(hoursToMilliseconds(0.123456) === 444441) + }) + + it('handles border values', () => { + assert(hoursToMilliseconds(1.5) === 5400000) + assert(hoursToMilliseconds(0) === 0) + }) +}) -- cgit v1.2.3