summaryrefslogtreecommitdiff
path: root/date-fns/src/weeksToDays/test.ts
blob: 46bbab1609621e5e6f88d9487c1f0750b07791c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* eslint-env mocha */

import assert from 'assert'
import weeksToDays from '.'

describe('weeksToDays', function () {
  it('converts weeks to days', function () {
    assert(weeksToDays(1) === 7)
    assert(weeksToDays(2) === 14)
  })

  it('uses floor rounding', () => {
    assert(weeksToDays(1.5) === 10)
    assert(weeksToDays(0.1) === 0)
  })

  it('handles border values', () => {
    assert(weeksToDays(1.5) === 10)
    assert(weeksToDays(0) === 0)
  })
})