summaryrefslogtreecommitdiff
path: root/date-fns/src/quartersToMonths/test.ts
blob: 8fb7f41fdef4cbdf0cc8722f6791203fc8fd7584 (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 quartersToMonths from '.'

describe('quartersToMonths', function () {
  it('converts quarters to months', function () {
    assert(quartersToMonths(1) === 3)
    assert(quartersToMonths(2) === 6)
  })
  
  it('uses floor rounding', () => {
    assert(quartersToMonths(1.5) === 4)
    assert(quartersToMonths(0.3) === 0)
  })

  it('handles border values', () => {
    assert(quartersToMonths(0.4) === 1)
    assert(quartersToMonths(0) === 0)
  })
})